Package java.util

Examples of java.util.ArrayList$ArrayListSpliterator


    if (refill)
  selectAndFillCard();
}

protected void doSave() {
    ArrayList defaultValues = new ArrayList();
    int type = typeFromWidgets();
    int arity = arityFromWidgets();

    // Create list of new default values.
    switch (arity) {
    case Parameter.ARITY_ONE:
  switch (type) {
  case Parameter.TYPE_BOOLEAN:
      defaultValues.add(Boolean.valueOf(boolYesRButton.isSelected()));
  case Parameter.TYPE_DATE:
      break;
  default:
      defaultValues.add(singleField.getText());
      break;
  }
  break;
    case Parameter.ARITY_RANGE:
  defaultValues.add(rangeFromField.getText());
  defaultValues.add(rangeToField.getText());
  break;
    case Parameter.ARITY_LIST_SINGLE:
    case Parameter.ARITY_LIST_MULTIPLE:
  DefaultListModel model = (DefaultListModel)list.getModel();
  for (Enumeration e = model.elements(); e.hasMoreElements(); )
      defaultValues.add(e.nextElement());
  break;
    }

    ParamEditCommand cmd =
  new ParamEditCommand(param, nameField.getText(),
View Full Code Here


     */
    @Test
    public void testSingleSourceBatchCommandReferentialIntegrityRollback() throws Exception {
        AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testSingleSourceBatchCommandReferentialIntegrityRollback") {
            public void testCase() throws Exception {
                ArrayList list = new ArrayList();
                for (int i = 200; i < 210; i++) {
                    list.add("insert into pm1.g1 (e1, e2) values("+i+",'"+i+"')");
                }
               
                // try to rollback, since we are in single batch it must rollback
                list.add("insert into pm1.g2 (e1, e2) values(9999,'9999')");
                executeBatch((String[])list.toArray(new String[list.size()]));
            }
           
            public boolean exceptionExpected() {
                return true;
            }           
View Full Code Here

        MappingDocument doc = new MappingDocument(false);
       
        MappingElement root = doc.addChildElement(new MappingElement("root")); //$NON-NLS-1$
       
        List stagingTables = new ArrayList(1);
        stagingTables.add("tm1.stagingTable2"); //$NON-NLS-1$
        root.setStagingTables(stagingTables);

       
        // Create virtual documents
        // DOC 1
View Full Code Here

     * result = commit
     */
    @Test
    public void testMultipleSourceBulkRowInsertRollback() throws Exception {
        AbstractQueryTransactionTest userTxn = new AbstractQueryTransactionTest("testMultipleSourceBulkRowInsertRollback") {
            ArrayList list = new ArrayList();
            public void testCase() throws Exception {
                for (int i = 100; i < 120; i++) {
                    list.add("insert into vm.g1 (pm1e1, pm1e2, pm2e1, pm2e2) values("+i+",'"+i+"',"+i+",'"+i+"')");
                }
                list.add("select pm1.g1.e1, pm1.g1.e2 into pm2.g2 from pm1.g1 where pm1.g1.e1 >= 100");
               
                // force the rollback by trying to insert an invalid row.
                list.add("insert into pm1.g2 (e1, e2) values(9999,'9999')");
               
                executeBatch((String[])list.toArray(new String[list.size()]));
            }
           
            public boolean exceptionExpected() {
                return true;
            }           
View Full Code Here

    }

    
    // Helper to create a list of elements - used in creating sample data
    private static List createElements(List elementIDs) {
        List elements = new ArrayList();
        for(int i=0; i<elementIDs.size(); i++) {
            FakeMetadataObject elementID = (FakeMetadataObject) elementIDs.get(i);           
            ElementSymbol element = new ElementSymbol(elementID.getName());
            elements.add(element);
        }       
       
        return elements;
    }   
View Full Code Here

        es1.setType(DataTypeManager.DefaultDataClasses.INTEGER);

        ElementSymbol es2 = new ElementSymbol("e2"); //$NON-NLS-1$
        es2.setType(DataTypeManager.DefaultDataClasses.STRING);
       
        List elements = new ArrayList();
        elements.add(es1);
        elements.add(es2);
       
        List[] data = new List[0];
       
        List projectElements = new ArrayList();
        projectElements.add(es1);
        projectElements.add(es2);
       
        helpTestProject(elements, data, projectElements, data, null);
       
    }
View Full Code Here

        es1.setType(DataTypeManager.DefaultDataClasses.INTEGER);

        ElementSymbol es2 = new ElementSymbol("e2"); //$NON-NLS-1$
        es2.setType(DataTypeManager.DefaultDataClasses.STRING);
       
        List elements = new ArrayList();
        elements.add(es1);
        elements.add(es2);
       
        List projectElements = new ArrayList();
        projectElements.add(es1);
        projectElements.add(es2);
       
        List[] data = new List[20];
        for(int i=0; i<20; i++) {
            data[i] = new ArrayList();
            data[i].add(new Integer((i*51) % 11));
           
            String str = "" + (i*3); //$NON-NLS-1$
            str = str.substring(0,1);
            data[i].add(str);             
View Full Code Here

        es1.setType(DataTypeManager.DefaultDataClasses.INTEGER);

        ElementSymbol es2 = new ElementSymbol("e2"); //$NON-NLS-1$
        es2.setType(DataTypeManager.DefaultDataClasses.STRING);
       
        List elements = new ArrayList();
        elements.add(es1);
        elements.add(es2);
       
        List projectElements = new ArrayList();
        projectElements.add(es2);
        projectElements.add(es1);
       
        List[] data = new List[20];
        List[] expected = new List[20];
        for(int i=0; i<20; i++) {
            data[i] = new ArrayList();
            expected[i] = new ArrayList();

            data[i].add(new Integer((i*51) % 11));
                       
            String str = "" + (i*3); //$NON-NLS-1$
            str = str.substring(0,1);
View Full Code Here

    }

    public void testProjectExpression() throws Exception {
        ElementSymbol es1 = new ElementSymbol("e1"); //$NON-NLS-1$
        es1.setType(DataTypeManager.DefaultDataClasses.STRING);      
        List elements = new ArrayList();
        elements.add(es1);
       
        Function func = new Function("concat", new Expression[] { es1, new Constant("abc")}); //$NON-NLS-1$ //$NON-NLS-2$
        FunctionDescriptor fd = FakeMetadataFactory.SFM.getSystemFunctionLibrary().findFunction("concat", new Class[] { DataTypeManager.DefaultDataClasses.STRING, DataTypeManager.DefaultDataClasses.STRING }); //$NON-NLS-1$
        func.setFunctionDescriptor(fd);
        func.setType(DataTypeManager.DefaultDataClasses.STRING);
        ExpressionSymbol expr = new ExpressionSymbol("expr", func); //$NON-NLS-1$
        List projectElements = new ArrayList();
        projectElements.add(expr);
       
        List[] data = new List[] {
            Arrays.asList(new Object[] { "1" })//$NON-NLS-1$
            Arrays.asList(new Object[] { "2" }) }; //$NON-NLS-1$
        List[] expected = new List[] {
View Full Code Here

    }

    public void testProjectExpressionFunctionFails() throws Exception {
        ElementSymbol es1 = new ElementSymbol("e1"); //$NON-NLS-1$
        es1.setType(DataTypeManager.DefaultDataClasses.STRING);      
        List elements = new ArrayList();
        elements.add(es1);
       
        Function func = new Function("convert", new Expression[] { es1, new Constant("integer")}); //$NON-NLS-1$ //$NON-NLS-2$
        FunctionDescriptor fd = FakeMetadataFactory.SFM.getSystemFunctionLibrary().findFunction("convert", new Class[] { DataTypeManager.DefaultDataClasses.STRING, DataTypeManager.DefaultDataClasses.STRING }); //$NON-NLS-1$
        func.setFunctionDescriptor(fd);
        func.setType(DataTypeManager.DefaultDataClasses.INTEGER);
        ExpressionSymbol expr = new ExpressionSymbol("expr", func); //$NON-NLS-1$
        List projectElements = new ArrayList();
        projectElements.add(expr);
       
        List[] data = new List[] {
            Arrays.asList(new Object[] { "1" })//$NON-NLS-1$
            Arrays.asList(new Object[] { "2x" }) }; //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of java.util.ArrayList$ArrayListSpliterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.