java.util.ArrayList

Here are the examples of the java api class java.util.ArrayList taken from open source projects.

1. ResourceAttributes#initializeLists()

Project: oodt
Source File: ResourceAttributes.java
View license
/**
	 * Initialize all the various {@link java.util.List} fields.
	 */
protected void initializeLists() {
    formats = new ArrayList<String>();
    creators = new ArrayList<String>();
    subjects = new ArrayList<String>();
    publishers = new ArrayList<String>();
    contributors = new ArrayList<String>();
    dates = new ArrayList<String>();
    types = new ArrayList<String>();
    sources = new ArrayList<String>();
    languages = new ArrayList<String>();
    relations = new ArrayList<String>();
    coverages = new ArrayList<String>();
    rights = new ArrayList<String>();
    contexts = new ArrayList<String>();
    locations = new ArrayList<String>();
}

2. CopyTest#testReferences()

Project: kryo
Source File: CopyTest.java
View license
public void testReferences() {
    ArrayList test = new ArrayList();
    test.add("one");
    test.add("two");
    test.add("three");
    ArrayList test2 = new ArrayList();
    test2.add(1);
    test2.add(2f);
    test2.add(3d);
    test2.add((byte) 4);
    test2.add((short) 5);
    test.add(test2);
    test.add(test2);
    test.add(test2);
    ArrayList copy = kryo.copy(test);
    assertTrue(test != copy);
    assertEquals(test, copy);
    assertTrue(test.get(3) != copy.get(4));
    assertTrue(copy.get(3) == copy.get(4));
    assertTrue(copy.get(3) == copy.get(5));
}

3. SharedActivatableServiceDescriptor#toString()

View license
public String toString() {
    // Would like to call super(), but need different formatting
    ArrayList fields = new ArrayList(12);
    fields.add(getExportCodebase());
    fields.add(getPolicy());
    fields.add(getImportCodebase());
    fields.add(getImplClassName());
    fields.add(((getServerConfigArgs() == null) ? null : Arrays.asList(getServerConfigArgs())));
    fields.add(getLifeCycle());
    fields.add(getServicePreparer());
    fields.add(getInnerProxyPreparer());
    fields.add(sharedGroupLog);
    fields.add(Boolean.valueOf(restart));
    fields.add(host);
    fields.add(new Integer(port));
    return fields.toString();
}

4. CopyTest#testNested()

Project: kryo
Source File: CopyTest.java
View license
public void testNested() {
    ArrayList test = new ArrayList();
    test.add("one");
    test.add("two");
    test.add("three");
    ArrayList test2 = new ArrayList();
    test2.add(1);
    test2.add(2f);
    test2.add(3d);
    test2.add((byte) 4);
    test2.add((short) 5);
    test.add(test2);
    ArrayList copy = kryo.copy(test);
    assertTrue(test != copy);
    assertTrue(test.get(3) != copy.get(3));
    assertEquals(test, copy);
}

5. CopyTest#testShallow()

Project: kryo
Source File: CopyTest.java
View license
public void testShallow() {
    ArrayList test = new ArrayList();
    test.add("one");
    test.add("two");
    test.add("three");
    ArrayList test2 = new ArrayList();
    test2.add(1);
    test2.add(2f);
    test2.add(3d);
    test2.add((byte) 4);
    test2.add((short) 5);
    test.add(test2);
    ArrayList copy = kryo.copyShallow(test);
    assertTrue(test != copy);
    assertTrue(test.get(3) == copy.get(3));
    assertEquals(test, copy);
}

6. EXIFGPSTagSet#initTags()

Project: bioformats
Source File: EXIFGPSTagSet.java
View license
private static List initTags() {
    ArrayList tags = new ArrayList(31);
    tags.add(new GPSVersionID());
    tags.add(new GPSLatitudeRef());
    tags.add(new GPSLatitude());
    tags.add(new GPSLongitudeRef());
    tags.add(new GPSLongitude());
    tags.add(new GPSAltitudeRef());
    tags.add(new GPSAltitude());
    tags.add(new GPSTimeStamp());
    tags.add(new GPSSatellites());
    tags.add(new GPSStatus());
    tags.add(new GPSMeasureMode());
    tags.add(new GPSDOP());
    tags.add(new GPSSpeedRef());
    tags.add(new GPSSpeed());
    tags.add(new GPSTrackRef());
    tags.add(new GPSTrack());
    tags.add(new GPSImgDirectionRef());
    tags.add(new GPSImgDirection());
    tags.add(new GPSMapDatum());
    tags.add(new GPSDestLatitudeRef());
    tags.add(new GPSDestLatitude());
    tags.add(new GPSDestLongitudeRef());
    tags.add(new GPSDestLongitude());
    tags.add(new GPSDestBearingRef());
    tags.add(new GPSDestBearing());
    tags.add(new GPSDestDistanceRef());
    tags.add(new GPSDestDistance());
    tags.add(new GPSProcessingMethod());
    tags.add(new GPSAreaInformation());
    tags.add(new GPSDateStamp());
    tags.add(new GPSDifferential());
    return tags;
}

7. Workbook#createWorkbook()

Project: bioformats
Source File: Workbook.java
View license
/**
     * Creates an empty workbook object with three blank sheets and all the empty
     * fields.  Use this to create a workbook from scratch.
     */
public static Workbook createWorkbook() {
    if (log.check(POILogger.DEBUG))
        log.log(DEBUG, "creating new workbook from scratch");
    Workbook retval = new Workbook();
    ArrayList records = new ArrayList(30);
    ArrayList formats = new ArrayList(8);
    records.add(retval.createBOF());
    records.add(retval.createInterfaceHdr());
    records.add(retval.createMMS());
    records.add(retval.createInterfaceEnd());
    records.add(retval.createWriteAccess());
    records.add(retval.createCodepage());
    records.add(retval.createDSF());
    records.add(retval.createTabId());
    retval.records.setTabpos(records.size() - 1);
    records.add(retval.createFnGroupCount());
    records.add(retval.createWindowProtect());
    records.add(retval.createProtect());
    retval.records.setProtpos(records.size() - 1);
    records.add(retval.createPassword());
    records.add(retval.createProtectionRev4());
    records.add(retval.createPasswordRev4());
    retval.windowOne = (WindowOneRecord) retval.createWindowOne();
    records.add(retval.windowOne);
    records.add(retval.createBackup());
    retval.records.setBackuppos(records.size() - 1);
    records.add(retval.createHideObj());
    records.add(retval.createDateWindow1904());
    records.add(retval.createPrecision());
    records.add(retval.createRefreshAll());
    records.add(retval.createBookBool());
    records.add(retval.createFont());
    records.add(retval.createFont());
    records.add(retval.createFont());
    records.add(retval.createFont());
    // last font record postion
    retval.records.setFontpos(records.size() - 1);
    retval.numfonts = 4;
    // set up format records
    for (int i = 0; i <= 7; i++) {
        Record rec;
        rec = retval.createFormat(i);
        retval.maxformatid = retval.maxformatid >= ((FormatRecord) rec).getIndexCode() ? retval.maxformatid : ((FormatRecord) rec).getIndexCode();
        formats.add(rec);
        records.add(rec);
    }
    retval.formats = formats;
    for (int k = 0; k < 21; k++) {
        records.add(retval.createExtendedFormat(k));
        retval.numxfs++;
    }
    retval.records.setXfpos(records.size() - 1);
    for (int k = 0; k < 6; k++) {
        records.add(retval.createStyle(k));
    }
    records.add(retval.createUseSelFS());
    for (int k = 0; k < 1; k++) {
        // now just do 1
        BoundSheetRecord bsr = (BoundSheetRecord) retval.createBoundSheet(k);
        records.add(bsr);
        retval.boundsheets.add(bsr);
        retval.records.setBspos(records.size() - 1);
    }
    //        retval.records.supbookpos = retval.records.bspos + 1;
    //        retval.records.namepos = retval.records.supbookpos + 2;
    records.add(retval.createCountry());
    retval.sst = (SSTRecord) retval.createSST();
    records.add(retval.sst);
    records.add(retval.createExtendedSST());
    records.add(retval.createEOF());
    retval.records.setRecords(records);
    if (log.check(POILogger.DEBUG))
        log.log(DEBUG, "exit create new workbook from scratch");
    return retval;
}

8. SharedActivationGroupDescriptor#toString()

View license
public String toString() {
    ArrayList fields = new ArrayList(8);
    fields.add(policy);
    fields.add(classpath);
    fields.add(log);
    fields.add(serverCommand);
    fields.add(Arrays.asList(serverOptions));
    fields.add(serverProperties);
    fields.add(host);
    fields.add(new Integer(port));
    return fields.toString();
}

9. NonActivatableServiceDescriptor#toString()

View license
/** Prints out a field summary */
public String toString() {
    ArrayList fields = new ArrayList(7);
    fields.add(codebase);
    fields.add(policy);
    fields.add(classpath);
    fields.add(implClassName);
    fields.add(((serverConfigArgs == null) ? null : Arrays.asList(serverConfigArgs)));
    fields.add(lifeCycle);
    fields.add(servicePreparer);
    return fields.toString();
}

10. Sheet#createSheet()

Project: bioformats
Source File: Sheet.java
View license
/**
     * Creates a sheet with all the usual records minus values and the "index"
     * record (not required).  Sets the location pointer to where the first value
     * records should go.  Use this to create a sheet from "scratch".
     *
     * @return Sheet object with all values set to defaults
     */
public static Sheet createSheet() {
    if (log.check(POILogger.DEBUG))
        log.log(POILogger.DEBUG, "Sheet createsheet from scratch called");
    Sheet retval = new Sheet();
    ArrayList records = new ArrayList(30);
    records.add(retval.createBOF());
    // records.add(retval.createIndex());
    records.add(retval.createCalcMode());
    records.add(retval.createCalcCount());
    records.add(retval.createRefMode());
    records.add(retval.createIteration());
    records.add(retval.createDelta());
    records.add(retval.createSaveRecalc());
    records.add(retval.createPrintHeaders());
    retval.printGridlines = (PrintGridlinesRecord) retval.createPrintGridlines();
    records.add(retval.printGridlines);
    retval.gridset = (GridsetRecord) retval.createGridset();
    records.add(retval.gridset);
    records.add(retval.createGuts());
    retval.defaultrowheight = (DefaultRowHeightRecord) retval.createDefaultRowHeight();
    records.add(retval.defaultrowheight);
    records.add(retval.createWSBool());
    retval.rowBreaks = new PageBreakRecord(PageBreakRecord.HORIZONTAL_SID);
    records.add(retval.rowBreaks);
    retval.colBreaks = new PageBreakRecord(PageBreakRecord.VERTICAL_SID);
    records.add(retval.colBreaks);
    retval.header = (HeaderRecord) retval.createHeader();
    records.add(retval.header);
    retval.footer = (FooterRecord) retval.createFooter();
    records.add(retval.footer);
    records.add(retval.createHCenter());
    records.add(retval.createVCenter());
    retval.printSetup = (PrintSetupRecord) retval.createPrintSetup();
    records.add(retval.printSetup);
    retval.defaultcolwidth = (DefaultColWidthRecord) retval.createDefaultColWidth();
    records.add(retval.defaultcolwidth);
    ColumnInfoRecordsAggregate columns = new ColumnInfoRecordsAggregate();
    records.add(columns);
    retval.columns = columns;
    retval.dims = (DimensionsRecord) retval.createDimensions();
    records.add(retval.dims);
    retval.dimsloc = records.size() - 1;
    records.add(retval.windowTwo = retval.createWindowTwo());
    retval.setLoc(records.size() - 1);
    retval.selection = (SelectionRecord) retval.createSelection();
    records.add(retval.selection);
    retval.protect = (ProtectRecord) retval.createProtect();
    records.add(retval.protect);
    records.add(retval.createEOF());
    retval.records = records;
    if (log.check(POILogger.DEBUG))
        log.log(POILogger.DEBUG, "Sheet createsheet from scratch exit");
    return retval;
}

11. SortTest#testSort()

Project: ant-ivy
Source File: SortTest.java
View license
public void testSort() throws Exception {
    Ivy ivy = new Ivy();
    ivy.configureDefault();
    toSort = new ArrayList(Arrays.asList(new Object[] { md[0], md[2], md[1], md[3] }));
    assertSorted(md, ivy.sortModuleDescriptors(toSort));
    toSort = new ArrayList(Arrays.asList(new Object[] { md[0], md[1], md[2], md[3] }));
    assertSorted(md, ivy.sortModuleDescriptors(toSort));
    toSort = new ArrayList(Arrays.asList(new Object[] { md[1], md[0], md[2], md[3] }));
    assertSorted(md, ivy.sortModuleDescriptors(toSort));
    toSort = new ArrayList(Arrays.asList(new Object[] { md[1], md[2], md[0], md[3] }));
    assertSorted(md, ivy.sortModuleDescriptors(toSort));
    toSort = new ArrayList(Arrays.asList(new Object[] { md[2], md[1], md[0], md[3] }));
    assertSorted(md, ivy.sortModuleDescriptors(toSort));
    toSort = new ArrayList(Arrays.asList(new Object[] { md[2], md[0], md[1], md[3] }));
    assertSorted(md, ivy.sortModuleDescriptors(toSort));
    toSort = new ArrayList(Arrays.asList(new Object[] { md[1], md[3], md[2], md[0] }));
    assertSorted(md, ivy.sortModuleDescriptors(toSort));
}

12. RPCCallTest#testmultiArrays()

Project: axis2-java
Source File: RPCCallTest.java
View license
public void testmultiArrays() throws AxisFault {
    RPCServiceClient sender = getRPCClient("EchoXMLService", "multiArrays");
    ArrayList args = new ArrayList();
    String[] values = new String[] { "abc", "cde", "efg" };
    args.add(values);
    String[] values2 = new String[] { "abc", "cde", "efg" };
    args.add(values2);
    String[] values3 = new String[] { "abc", "cde", "efg" };
    args.add(values3);
    args.add("10");
    ArrayList ret = new ArrayList();
    ret.add(Integer.class);
    Object[] objs = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org", "multiArrays", "req"), args.toArray(), (Class[]) ret.toArray(new Class[ret.size()]));
    assertNotNull(objs);
    assertEquals(19, Integer.parseInt(objs[0].toString()));
}

13. FilteringIteratorTest#testRemove()

Project: consulo
Source File: FilteringIteratorTest.java
View license
public void testRemove() {
    ArrayList collection = new ArrayList();
    collection.add(new Integer(1));
    collection.add("x");
    collection.add(new Integer(2));
    collection.add("2");
    collection.add("x");
    Object[] expected = new Object[] { new Integer(1), new Integer(2), "2" };
    checkRemove(expected, collection);
    collection.add(0, "x");
    checkRemove(expected, collection);
}

14. FilteringIteratorTest#testRemove()

View license
public void testRemove() {
    ArrayList collection = new ArrayList();
    collection.add(new Integer(1));
    collection.add("x");
    collection.add(new Integer(2));
    collection.add("2");
    collection.add("x");
    Object[] expected = new Object[] { new Integer(1), new Integer(2), "2" };
    checkRemove(expected, collection);
    collection.add(0, "x");
    checkRemove(expected, collection);
}

15. DavaDecompileFolderLauncher#setCmd()

View license
/**
	 * Method getCmd.
	 * @return String
	 */
private void setCmd() {
    ArrayList commands = new ArrayList();
    commands.add("--" + LaunchCommands.SOOT_CLASSPATH);
    commands.add(getProcessPath() + getSootClasspath().getSeparator() + getClasspathAppend());
    commands.add("--" + LaunchCommands.OUTPUT_DIR);
    commands.add(getOutputLocation());
    getSootCommandList().addSingleOpt("--" + LaunchCommands.KEEP_LINE_NUMBER);
    getSootCommandList().addSingleOpt("--" + LaunchCommands.XML_ATTRIBUTES);
    commands.add("--" + LaunchCommands.PROCESS_PATH);
    commands.add(getProcessPath());
    getSootCommandList().addSingleOpt("--" + LaunchCommands.DAVA);
    getSootCommandList().addSingleOpt(commands);
}

16. DavaDecompileProjectLauncher#setCmd()

View license
private void setCmd() {
    ArrayList commands = new ArrayList();
    commands.add("--" + LaunchCommands.SOOT_CLASSPATH);
    commands.add(getProcess_path() + getSootClasspath().getSeparator() + getClasspathAppend());
    commands.add("--" + LaunchCommands.OUTPUT_DIR);
    commands.add(getOutputLocation());
    getSootCommandList().addSingleOpt("--" + LaunchCommands.KEEP_LINE_NUMBER);
    getSootCommandList().addSingleOpt("--" + LaunchCommands.XML_ATTRIBUTES);
    commands.add("--" + LaunchCommands.PROCESS_PATH);
    commands.add(getProcess_path());
    getSootCommandList().addSingleOpt("--" + LaunchCommands.DAVA);
    getSootCommandList().addSingleOpt(commands);
}

17. SootJimpleProjectLauncher#setCmd()

View license
private void setCmd() {
    ArrayList commands = new ArrayList();
    commands.add("--" + LaunchCommands.SOOT_CLASSPATH);
    commands.add(getProcess_path() + getSootClasspath().getSeparator() + getClasspathAppend());
    commands.add("--" + LaunchCommands.OUTPUT_DIR);
    commands.add(getOutputLocation());
    getSootCommandList().addSingleOpt("--" + LaunchCommands.KEEP_LINE_NUMBER);
    getSootCommandList().addSingleOpt("--" + LaunchCommands.XML_ATTRIBUTES);
    commands.add("--" + LaunchCommands.PROCESS_PATH);
    commands.add(getProcess_path());
    getSootCommandList().addDoubleOpt("--" + LaunchCommands.OUTPUT, LaunchCommands.JIMPLE_OUT);
    getSootCommandList().addSingleOpt(commands);
}

18. PartDiversionTransporter#getSyncPacket()

View license
@Override
public ArrayList getSyncPacket(TransporterStack stack, boolean kill) {
    ArrayList data = super.getSyncPacket(stack, kill);
    data.add(modes[0]);
    data.add(modes[1]);
    data.add(modes[2]);
    data.add(modes[3]);
    data.add(modes[4]);
    data.add(modes[5]);
    return data;
}

19. JettisonMappedXmlDriverTest#testWriteHierarchy()

View license
public void testWriteHierarchy() {
    Category category = new Category("fruit", "111");
    ArrayList products = new ArrayList();
    Product banana = new Product("Banana", "123", 23.01);
    ArrayList bananaTags = new ArrayList();
    bananaTags.add("yellow");
    bananaTags.add("fresh");
    bananaTags.add("tasty");
    banana.setTags(bananaTags);
    products.add(banana);
    Product mango = new Product("Mango", "124", 34.01);
    products.add(mango);
    category.setProducts(products);
    String result = xstream.toXML(category);
    assertEquals(HIERARCHY, result);
}

20. JettisonMappedXmlDriverTest#testListWithComplexNestedObjects()

View license
public void testListWithComplexNestedObjects() {
    ArrayList list1 = new ArrayList();
    list1.add(new Product("Banana", "123", 23.00));
    list1.add(new Product("Apple", "47", 11.00));
    list1.add(new Product("Orange", "100", 42.00));
    ArrayList tags = new ArrayList();
    ((Product) list1.get(1)).setTags(tags);
    tags.add(new Product("Braeburn", "47.1", 10.00));
    String json = xstream.toXML(list1);
    assertEquals((JVM.is15() ? "{'list':[{'product':[{'name':'Banana','id':123,'price':23},{'name':'Apple','id':47,'price':11,'tags':[{'product':{'name':'Braeburn','id':47.1,'price':10}}]},{'name':'Orange','id':100,'price':42}]}]}" : "{'list':{'product':[{'name':'Banana','id':123,'price':23},{'name':'Apple','id':47,'price':11,'tags':{'product':[{'name':'Braeburn','id':47.1,'price':10}]}},{'name':'Orange','id':100,'price':42}]}}").replace('\'', '"'), json);
    ArrayList list2 = (ArrayList) xstream.fromXML(json);
    assertEquals(json, xstream.toXML(list2));
}

21. ReferenceTest#testReadingNestedObjectsFirst()

Project: kryo
Source File: ReferenceTest.java
View license
public void testReadingNestedObjectsFirst() {
    ArrayList list = new ArrayList();
    list.add("1");
    list.add("1");
    list.add("2");
    list.add("1");
    list.add("1");
    List subList = list.subList(0, 5);
    kryo.setRegistrationRequired(false);
    kryo.register(ArrayList.class);
    Class<List> subListClass = (Class<List>) subList.getClass();
    if (subListClass.getName().equals("java.util.ArrayList$SubList")) {
        // This is JDK > = 1.7
        kryo.register(subList.getClass(), new ArraySubListSerializer());
    } else {
        kryo.register(subList.getClass(), new SubListSerializer());
    }
    roundTrip(26, 26, subList);
}

22. SaveKeyringParcel#reset()

View license
public void reset() {
    mNewUnlock = null;
    mAddUserIds = new ArrayList<>();
    mAddUserAttribute = new ArrayList<>();
    mAddSubKeys = new ArrayList<>();
    mChangePrimaryUserId = null;
    mChangeSubKeys = new ArrayList<>();
    mRevokeUserIds = new ArrayList<>();
    mRevokeSubKeys = new ArrayList<>();
    mSecurityTokenPin = null;
    mSecurityTokenAdminPin = null;
    mUpload = false;
    mUploadAtomic = false;
    mKeyserver = null;
}

23. FeatureDictionaryTest#makeDenseFeatureVector()

View license
public FeatureVector makeDenseFeatureVector(String id, double v1, double v2) {
    ArrayList list = new ArrayList<Double>();
    list.add(v1);
    list.add(v2);
    HashMap denseFeatures = new HashMap<String, List<Double>>();
    denseFeatures.put("a", list);
    ArrayList list2 = new ArrayList<Double>();
    list2.add(v2);
    list2.add(v1);
    denseFeatures.put("b", list2);
    Set<String> list3 = new HashSet<>();
    list3.add(id);
    Map<String, Set<String>> stringFeatures = new HashMap<>();
    stringFeatures.put("id", list3);
    FeatureVector featureVector = new FeatureVector();
    featureVector.setDenseFeatures(denseFeatures);
    featureVector.setStringFeatures(stringFeatures);
    return featureVector;
}

24. ClientExam2#main()

Project: hprose-java
Source File: ClientExam2.java
View license
public static void main(String[] args) throws Throwable {
    HproseHttpClient client = new HproseHttpClient();
    client.useService("http://localhost:8084/examserver/Methods");
    System.out.println(client.invoke("ex1_sum", new Object[] { new int[] { 1, 2, 3, 4, 5 } }));
    System.out.println(client.invoke("ex1_sum", new Object[] { new short[] { 6, 7, 8, 9, 10 } }));
    System.out.println(client.invoke("ex1_sum", new Object[] { new long[] { 11, 12, 13, 14, 15 } }));
    System.out.println(client.invoke("ex1_sum", new Object[] { new double[] { 16, 17, 18, 19, 20 } }));
    System.out.println(client.invoke("ex1_sum", new Object[] { new String[] { "21", "22", "23", "24", "25" } }));
    ArrayList intList = new ArrayList();
    intList.add(26);
    intList.add(27);
    intList.add(28);
    intList.add(29);
    intList.add(30);
    System.out.println(client.invoke("ex2_sum", new Object[] { intList }, double.class));
}

25. ClientExam6#main()

Project: hprose-java
Source File: ClientExam6.java
View license
public static void main(String[] args) throws IOException {
    HproseHttpClient client = new HproseHttpClient();
    client.useService("http://localhost:8084/examserver/Methods");
    IExam1 exam = client.useService(IExam1.class, "ex1");
    System.out.println(exam.sum(new int[] { 1, 2, 3, 4, 5 }));
    System.out.println(exam.sum(new short[] { 6, 7, 8, 9, 10 }));
    System.out.println(exam.sum(new long[] { 11, 12, 13, 14, 15 }));
    System.out.println(exam.sum(new double[] { 16, 17, 18, 19, 20 }));
    System.out.println(exam.sum(new String[] { "21", "22", "23", "24", "25" }));
    ArrayList intList = new ArrayList();
    intList.add(26);
    intList.add(27);
    intList.add(28);
    intList.add(29);
    intList.add(30);
    System.out.println(exam.sum(intList));
}

26. StreamUtil#makeJavaCommand()

Project: hadoop-20
Source File: StreamUtil.java
View license
public static String makeJavaCommand(Class main, String[] argv) {
    ArrayList vargs = new ArrayList();
    File javaHomeBin = new File(System.getProperty("java.home"), "bin");
    File jvm = new File(javaHomeBin, "java");
    vargs.add(jvm.toString());
    // copy parent classpath
    vargs.add("-classpath");
    vargs.add("\"" + System.getProperty("java.class.path") + "\"");
    // add heap-size limit
    vargs.add("-Xmx" + Runtime.getRuntime().maxMemory());
    // Add main class and its arguments
    vargs.add(main.getName());
    for (int i = 0; i < argv.length; i++) {
        vargs.add(argv[i]);
    }
    return collate(vargs, " ");
}

27. StreamUtil#makeJavaCommand()

Project: hadoop-common
Source File: StreamUtil.java
View license
public static String makeJavaCommand(Class main, String[] argv) {
    ArrayList vargs = new ArrayList();
    File javaHomeBin = new File(System.getProperty("java.home"), "bin");
    File jvm = new File(javaHomeBin, "java");
    vargs.add(jvm.toString());
    // copy parent classpath
    vargs.add("-classpath");
    vargs.add("\"" + System.getProperty("java.class.path") + "\"");
    // add heap-size limit
    vargs.add("-Xmx" + Runtime.getRuntime().maxMemory());
    // Add main class and its arguments
    vargs.add(main.getName());
    for (int i = 0; i < argv.length; i++) {
        vargs.add(argv[i]);
    }
    return collate(vargs, " ");
}

28. StreamUtil#makeJavaCommand()

Project: hadoop-mapreduce
Source File: StreamUtil.java
View license
public static String makeJavaCommand(Class main, String[] argv) {
    ArrayList vargs = new ArrayList();
    File javaHomeBin = new File(System.getProperty("java.home"), "bin");
    File jvm = new File(javaHomeBin, "java");
    vargs.add(jvm.toString());
    // copy parent classpath
    vargs.add("-classpath");
    vargs.add("\"" + System.getProperty("java.class.path") + "\"");
    // add heap-size limit
    vargs.add("-Xmx" + Runtime.getRuntime().maxMemory());
    // Add main class and its arguments
    vargs.add(main.getName());
    for (int i = 0; i < argv.length; i++) {
        vargs.add(argv[i]);
    }
    return collate(vargs, " ");
}

29. JettisonMappedXmlDriverTest#testListWithSimpleObjects()

View license
public void testListWithSimpleObjects() {
    ArrayList list1 = new ArrayList();
    list1.add("one");
    list1.add("two");
    list1.add("three");
    String json = xstream.toXML(list1);
    assertEquals((JVM.is15() ? "{'list':[{'string':['one','two','three']}]}" : "{'list':{'string':['one','two','three']}}").replace('\'', '"'), json);
    ArrayList list2 = (ArrayList) xstream.fromXML(json);
    assertEquals(json, xstream.toXML(list2));
}

30. YamlWriterTest#testRootList()

Project: yamlbeans
Source File: YamlWriterTest.java
View license
public void testRootList() throws Exception {
    ArrayList list = new ArrayList();
    list.add(new PhoneNumber("206-555-1234"));
    list.add(new PhoneNumber("206-555-4321"));
    list.add(new PhoneNumber("206-555-6789"));
    list.add(new PhoneNumber("206-555-9876"));
    List roundTrip = roundTrip(list, ArrayList.class, new YamlConfig());
    assertEquals("206-555-1234", ((PhoneNumber) roundTrip.get(0)).number);
    assertEquals("206-555-4321", ((PhoneNumber) roundTrip.get(1)).number);
    assertEquals("206-555-6789", ((PhoneNumber) roundTrip.get(2)).number);
    assertEquals("206-555-9876", ((PhoneNumber) roundTrip.get(3)).number);
    Contact contact = new Contact();
    contact.name = "Bill";
    contact.phoneNumbers = list;
    roundTrip = roundTrip(contact, Contact.class, new YamlConfig()).phoneNumbers;
    assertEquals("206-555-1234", ((PhoneNumber) roundTrip.get(0)).number);
    assertEquals("206-555-4321", ((PhoneNumber) roundTrip.get(1)).number);
    assertEquals("206-555-6789", ((PhoneNumber) roundTrip.get(2)).number);
    assertEquals("206-555-9876", ((PhoneNumber) roundTrip.get(3)).number);
}

31. ErrataHandlerTest#testAdvisoryReleaseAtMax()

Project: spacewalk
Source File: ErrataHandlerTest.java
View license
public void testAdvisoryReleaseAtMax() throws Exception {
    Channel channel = ChannelFactoryTest.createBaseChannel(admin);
    channel.setOrg(admin.getOrg());
    Map errataInfo = new HashMap();
    String advisoryName = TestUtils.randomString();
    populateErrataInfo(errataInfo);
    errataInfo.put("advisory_name", advisoryName);
    errataInfo.put("advisory_release", new Integer(9999));
    ArrayList packages = new ArrayList();
    ArrayList bugs = new ArrayList();
    ArrayList keywords = new ArrayList();
    ArrayList channels = new ArrayList();
    channels.add(channel.getLabel());
    Errata errata = handler.create(admin, errataInfo, bugs, keywords, packages, true, channels);
    assertEquals(ErrataManager.MAX_ADVISORY_RELEASE, errata.getAdvisoryRel().longValue());
}

32. StreamUtil#makeJavaCommand()

Project: hadoop-20
Source File: StreamUtil.java
View license
public static String makeJavaCommand(Class main, String[] argv) {
    ArrayList vargs = new ArrayList();
    File javaHomeBin = new File(System.getProperty("java.home"), "bin");
    File jvm = new File(javaHomeBin, "java");
    vargs.add(jvm.toString());
    // copy parent classpath
    vargs.add("-classpath");
    vargs.add("\"" + System.getProperty("java.class.path") + "\"");
    // Add main class and its arguments
    vargs.add(main.getName());
    for (int i = 0; i < argv.length; i++) {
        vargs.add(argv[i]);
    }
    return collate(vargs, " ");
}

33. SerializerTest#TestListArray()

Project: Gaea
Source File: SerializerTest.java
View license
@Test
public void TestListArray() throws Exception {
    Serializer serializer = new Serializer();
    ArrayList a1 = new ArrayList();
    a1.add(1);
    ArrayList a2 = new ArrayList();
    a2.add(2);
    Object data = new ArrayList[] { a1, a2 };
    byte[] buffer = serializer.Serialize(data);
    assertNotNull(buffer);
    Object obj = serializer.Derialize(buffer, data.getClass());
    Object expect = data;
    Object a = Array.newInstance(List.class, 3);
    assertEquals(expect, obj);
    ArrayList[] abc = (ArrayList[]) obj;
}

34. AnnotationSimpleQueryTest#importData()

View license
private void importData() throws JcrMappingException {
    ObjectContentManager ocm = getObjectContentManager();
    Page page = new Page();
    page.setPath("/test");
    page.setTitle("Page Title");
    ArrayList paragraphs = new ArrayList();
    paragraphs.add(new Paragraph("Para 1"));
    paragraphs.add(new Paragraph("Para 2"));
    paragraphs.add(new Paragraph("Para 3"));
    paragraphs.add(new Paragraph("Another Para "));
    page.setParagraphs(paragraphs);
    ocm.insert(page);
    ocm.save();
}

35. ArrayListTest#test_ArrayList_addAll_scenario1()

Project: j2objc
Source File: ArrayListTest.java
View license
public void test_ArrayList_addAll_scenario1() {
    ArrayList arrayListA = new ArrayList();
    arrayListA.add(1);
    ArrayList arrayListB = new ArrayList();
    arrayListB.add(1);
    arrayListA.addAll(1, arrayListB);
    int size = arrayListA.size();
    assertEquals(2, size);
    for (int index = 0; index < size; index++) {
        assertEquals(1, arrayListA.get(index));
    }
}

36. CollectionsTest#test_copy_check_index()

Project: j2objc
Source File: CollectionsTest.java
View license
/**
	 * @tests java.util.Collections#copy(java.util.List, java.util.List)
	 */
public void test_copy_check_index() {
    ArrayList a1 = new ArrayList();
    a1.add("one");
    a1.add("two");
    ArrayList a2 = new ArrayList();
    a2.add("aa");
    try {
        Collections.copy(a2, a1);
        fail("Expected IndexOutOfBoundsException");
    } catch (IndexOutOfBoundsException e) {
    }
    assertEquals("aa", a2.get(0));
}

37. SootGrimpFromJavaFileLauncher#setCmd()

View license
private void setCmd() {
    ArrayList commands = new ArrayList();
    commands.add("--" + LaunchCommands.SOOT_CLASSPATH);
    commands.add(getClasspathAppend());
    commands.add("--" + LaunchCommands.OUTPUT_DIR);
    commands.add(getOutputLocation());
    getSootCommandList().addSingleOpt("--" + LaunchCommands.KEEP_LINE_NUMBER);
    getSootCommandList().addSingleOpt("--" + LaunchCommands.XML_ATTRIBUTES);
    getSootCommandList().addDoubleOpt("--" + LaunchCommands.OUTPUT, LaunchCommands.GRIMP_OUT);
    if (isExtraCmd()) {
        getSootCommandList().addSingleOpt("--" + getExtraCmd());
    }
    if (isSrcPrec()) {
        getSootCommandList().addDoubleOpt("--" + LaunchCommands.SRC_PREC, getSrcPrec());
    }
    Iterator it = getToProcessList().iterator();
    while (it.hasNext()) {
        commands.add((String) it.next());
    }
    getSootCommandList().addSingleOpt(commands);
}

38. SootJimpleFileLauncher#setCmd()

Project: JAADAS
Source File: SootJimpleFileLauncher.java
View license
private void setCmd() {
    ArrayList commands = new ArrayList();
    commands.add("--" + LaunchCommands.SOOT_CLASSPATH);
    commands.add(getClasspathAppend());
    commands.add("--" + LaunchCommands.OUTPUT_DIR);
    commands.add(getOutputLocation());
    getSootCommandList().addSingleOpt("--" + LaunchCommands.KEEP_LINE_NUMBER);
    getSootCommandList().addSingleOpt("--" + LaunchCommands.XML_ATTRIBUTES);
    getSootCommandList().addDoubleOpt("--" + LaunchCommands.OUTPUT, LaunchCommands.JIMPLE_OUT);
    if (isExtraCmd()) {
        getSootCommandList().addSingleOpt("--" + getExtraCmd());
    }
    if (isSrcPrec()) {
        getSootCommandList().addDoubleOpt("--" + LaunchCommands.SRC_PREC, getSrcPrec());
    }
    Iterator it = getToProcessList().iterator();
    while (it.hasNext()) {
        commands.add((String) it.next());
    }
    getSootCommandList().addSingleOpt(commands);
}

39. SootJimpleFromJavaFileLauncher#setCmd()

View license
private void setCmd() {
    ArrayList commands = new ArrayList();
    commands.add("--" + LaunchCommands.SOOT_CLASSPATH);
    commands.add(getClasspathAppend());
    commands.add("--" + LaunchCommands.OUTPUT_DIR);
    commands.add(getOutputLocation());
    getSootCommandList().addSingleOpt("--" + LaunchCommands.KEEP_LINE_NUMBER);
    getSootCommandList().addSingleOpt("--" + LaunchCommands.XML_ATTRIBUTES);
    getSootCommandList().addDoubleOpt("--" + LaunchCommands.OUTPUT, LaunchCommands.JIMPLE_OUT);
    if (isExtraCmd()) {
        getSootCommandList().addSingleOpt("--" + getExtraCmd());
    }
    if (isSrcPrec()) {
        getSootCommandList().addDoubleOpt("--" + LaunchCommands.SRC_PREC, getSrcPrec());
    }
    Iterator it = getToProcessList().iterator();
    while (it.hasNext()) {
        commands.add((String) it.next());
    }
    getSootCommandList().addSingleOpt(commands);
}

40. SootJimpleJavaProjectLauncher#setCmd()

View license
private void setCmd() {
    ArrayList commands = new ArrayList();
    commands.add("--" + LaunchCommands.SOOT_CLASSPATH);
    Iterator it = getJavaProcessPath().iterator();
    String cp = (String) it.next();
    while (it.hasNext()) {
        cp = cp + getSootClasspath().getSeparator() + (String) it.next();
    }
    cp = cp + getSootClasspath().getSeparator() + getClasspathAppend();
    commands.add(cp);
    commands.add("--" + LaunchCommands.OUTPUT_DIR);
    commands.add(getOutputLocation());
    getSootCommandList().addSingleOpt("--" + LaunchCommands.KEEP_LINE_NUMBER);
    getSootCommandList().addSingleOpt("--" + LaunchCommands.XML_ATTRIBUTES);
    Iterator it2 = getJavaProcessPath().iterator();
    while (it2.hasNext()) {
        commands.add("--" + LaunchCommands.PROCESS_PATH);
        commands.add((String) it2.next());
    }
    getSootCommandList().addDoubleOpt("--" + LaunchCommands.OUTPUT, LaunchCommands.JIMPLE_OUT);
    getSootCommandList().addDoubleOpt("--" + LaunchCommands.SRC_PREC, "java");
    getSootCommandList().addSingleOpt(commands);
}

41. ADBXMLStreamReaderTest#testNullableAttribute()

View license
/** Test a completely null element */
public void testNullableAttribute() throws Exception {
    /*
        This is what I expect :

        */
    String exptectedXML = "<Person xmlns=\"\"><Name xmlns=\"\">FooOne</Name><DependentOne xmlns=\"\" " + "xsi:nil=\"true\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"/>" + "</Person>";
    ArrayList propertyList = new ArrayList();
    propertyList.add("Name");
    propertyList.add("FooOne");
    propertyList.add(new QName("DependentOne"));
    propertyList.add(null);
    QName projectQName = new QName("Person");
    XMLStreamReader pullParser = new ADBXMLStreamReaderImpl(projectQName, propertyList.toArray(), null);
    Document actualDom = newDocument(getStringXML(pullParser));
    Document expectedDocument = newDocument(exptectedXML);
    assertXMLEqual(actualDom, expectedDocument);
}

42. TestDeser#testSparseArray1()

Project: axis1-java
Source File: TestDeser.java
View license
public void testSparseArray1() throws Exception {
    ArrayList list = new ArrayList(4);
    list.add(null);
    list.add(null);
    list.add("abc");
    list.add("def");
    boolean expectedExceptionThrown = false;
    try {
        deserialize(HEAD + "<result xsi:type=\"soapenc:Array\" " + "soapenc:itemType=\"xsd:string\" soapenc:arraySize=\"4\" " + " soapenc:offset=\"[2]\">" + "<item xsi:type=\"xsd:string\">abc</item>" + "<item xsi:type=\"xsd:string\">def</item>" + "</result>" + TAIL, list, true);
    } catch (Exception af) {
        String expected = Messages.getMessage("noSparseArray");
        if (af.toString().indexOf(expected) != -1)
            expectedExceptionThrown = true;
    }
    assertTrue(expectedExceptionThrown);
}

43. TestDeser#testSparseArray2()

Project: axis1-java
Source File: TestDeser.java
View license
public void testSparseArray2() throws Exception {
    ArrayList list = new ArrayList(4);
    list.add("abc");
    list.add(null);
    list.add("def");
    list.add(null);
    boolean expectedExceptionThrown = false;
    try {
        deserialize(HEAD + "<result xsi:type=\"soapenc:Array\" " + "soapenc:itemType=\"xsd:string\" soapenc:arraySize=\"4\">" + "<item soapenc:position=\"[0]\" xsi:type=\"xsd:string\">abc</item>" + "<item soapenc:position=\"[2]\" xsi:type=\"xsd:string\">def</item>" + "</result>" + TAIL, list, true);
    } catch (Exception af) {
        String expected = Messages.getMessage("noSparseArray");
        if (af.toString().indexOf(expected) != -1)
            expectedExceptionThrown = true;
    }
    assertTrue(expectedExceptionThrown);
}

44. TestDeser#testSparseArray1()

Project: axis1-java
Source File: TestDeser.java
View license
public void testSparseArray1() throws Exception {
    ArrayList list = new ArrayList(4);
    list.add(null);
    list.add(null);
    list.add("abc");
    list.add("def");
    deserialize("<result xsi:type=\"soapenc:Array\" " + "soapenc:arrayType=\"xsd:string[4]\" " + "soapenc:offset=\"[2]\"> " + "<item xsi:type=\"xsd:string\">abc</item>" + "<item xsi:type=\"xsd:string\">def</item>" + "</result>", list, true);
}

45. ModelComparator#compareModels()

Project: ddlutils
Source File: ModelComparator.java
View license
/**
     * Compares the given source and target models and creates change objects to get from
     * the source to the target one. These changes will be applied to the given
     * intermediate model (the other two won't be changed), so that it will be equal to
     * the target model after this model has finished.
     * 
     * @param sourceModel       The source model
     * @param intermediateModel The intermediate model to apply the changes to
     * @param targetModel       The target model
     * @return The changes
     */
protected List compareModels(Database sourceModel, Database intermediateModel, Database targetModel) {
    ArrayList changes = new ArrayList();
    changes.addAll(checkForRemovedForeignKeys(sourceModel, intermediateModel, targetModel));
    changes.addAll(checkForRemovedTables(sourceModel, intermediateModel, targetModel));
    for (int tableIdx = 0; tableIdx < intermediateModel.getTableCount(); tableIdx++) {
        Table intermediateTable = intermediateModel.getTable(tableIdx);
        Table sourceTable = sourceModel.findTable(intermediateTable.getName(), _caseSensitive);
        Table targetTable = targetModel.findTable(intermediateTable.getName(), _caseSensitive);
        List tableChanges = compareTables(sourceModel, sourceTable, intermediateModel, intermediateTable, targetModel, targetTable);
        changes.addAll(tableChanges);
    }
    changes.addAll(checkForAddedTables(sourceModel, intermediateModel, targetModel));
    changes.addAll(checkForAddedForeignKeys(sourceModel, intermediateModel, targetModel));
    return changes;
}

46. PipelineSqlMapDaoIntegrationTest#shouldGetLatestRevisionFromOrderedLists()

View license
@Test
public void shouldGetLatestRevisionFromOrderedLists() {
    PipelineSqlMapDao pipelineSqlMapDao = new PipelineSqlMapDao(null, null, null, null, null, null, null, systemEnvironment, goConfigDao, database);
    ArrayList list1 = new ArrayList();
    ArrayList list2 = new ArrayList();
    assertThat(pipelineSqlMapDao.getLatestRevisionFromOrderedLists(list1, list2), is((String) null));
    Modification modification1 = new Modification(MOD_USER, MOD_COMMENT, EMAIL_ADDRESS, YESTERDAY_CHECKIN, ModificationsMother.nextRevision());
    list1.add(modification1);
    assertThat(pipelineSqlMapDao.getLatestRevisionFromOrderedLists(list1, list2), is(ModificationsMother.currentRevision()));
    Modification modification2 = new Modification(MOD_USER_COMMITTER, MOD_COMMENT_2, EMAIL_ADDRESS, TODAY_CHECKIN, ModificationsMother.nextRevision());
    list2.add(modification2);
    assertThat(pipelineSqlMapDao.getLatestRevisionFromOrderedLists(list1, list2), is(ModificationsMother.currentRevision()));
}

47. TestDeser2001#testArrayWithNilString()

Project: axis1-java
Source File: TestDeser2001.java
View license
public void testArrayWithNilString() throws Exception {
    ArrayList list = new ArrayList(4);
    list.add("abc");
    list.add(null);
    list.add("def");
    deserialize("<result xsi:type=\"soapenc:Array\" " + "soapenc:arrayType=\"xsd:string[3]\"> " + "<item xsi:type=\"xsd:string\">abc</item>" + "<item xsi:nil=\"true\"/>" + "<item xsi:type=\"xsd:string\">def</item>" + "</result>", list, true);
}

48. TestDeser2001#testArrayWithNilInt()

Project: axis1-java
Source File: TestDeser2001.java
View license
public void testArrayWithNilInt() throws Exception {
    ArrayList list = new ArrayList(4);
    list.add(new Integer(1));
    list.add(null);
    list.add(new Integer(3));
    deserialize("<result xsi:type=\"soapenc:Array\" " + "soapenc:arrayType=\"xsd:int[3]\"> " + "<item xsi:type=\"xsd:int\">1</item>" + "<item xsi:nil=\"true\"/>" + "<item xsi:type=\"xsd:int\">3</item>" + "</result>", list, true);
}

49. TestDeser2000#testArrayWithNullString()

Project: axis1-java
Source File: TestDeser2000.java
View license
public void testArrayWithNullString() throws Exception {
    ArrayList list = new ArrayList(4);
    list.add("abc");
    list.add(null);
    list.add("def");
    deserialize("<result xsi:type=\"soapenc:Array\" " + "soapenc:arrayType=\"xsd:string[3]\"> " + "<item xsi:type=\"xsd:string\">abc</item>" + "<item xsi:null=\"true\"/>" + "<item xsi:type=\"xsd:string\">def</item>" + "</result>", list, true);
}

50. TestDeser2000#testArrayWithNullInt()

Project: axis1-java
Source File: TestDeser2000.java
View license
public void testArrayWithNullInt() throws Exception {
    ArrayList list = new ArrayList(4);
    list.add(new Integer(1));
    list.add(null);
    list.add(new Integer(3));
    deserialize("<result xsi:type=\"soapenc:Array\" " + "soapenc:arrayType=\"xsd:int[3]\"> " + "<item xsi:type=\"xsd:int\">1</item>" + "<item xsi:null=\"true\"/>" + "<item xsi:type=\"xsd:int\">3</item>" + "</result>", list, true);
}

51. TestDeser1999#testArrayWithNullString()

Project: axis1-java
Source File: TestDeser1999.java
View license
public void testArrayWithNullString() throws Exception {
    ArrayList list = new ArrayList(4);
    list.add("abc");
    list.add(null);
    list.add("def");
    deserialize("<result xsi:type=\"soapenc:Array\" " + "soapenc:arrayType=\"xsd:string[3]\"> " + "<item xsi:type=\"xsd:string\">abc</item>" + "<item xsi:null=\"true\"/>" + "<item xsi:type=\"xsd:string\">def</item>" + "</result>", list, true);
}

52. TestDeser1999#testArrayWithNullInt()

Project: axis1-java
Source File: TestDeser1999.java
View license
public void testArrayWithNullInt() throws Exception {
    ArrayList list = new ArrayList(4);
    list.add(new Integer(1));
    list.add(null);
    list.add(new Integer(3));
    deserialize("<result xsi:type=\"soapenc:Array\" " + "soapenc:arrayType=\"xsd:int[3]\"> " + "<item xsi:type=\"xsd:int\">1</item>" + "<item xsi:null=\"true\"/>" + "<item xsi:type=\"xsd:int\">3</item>" + "</result>", list, true);
}

53. TestDeser#testHugeSparseArray()

Project: axis1-java
Source File: TestDeser.java
View license
public void testHugeSparseArray() throws Exception {
    ArrayList list = new ArrayList(4);
    list.add("abc");
    list.add(null);
    list.add("def");
    deserialize("<result xsi:type=\"soapenc:Array\" " + "soapenc:arrayType=\"xsd:string[50000000]\"> " + "<item soapenc:position=\"[0]\" xsi:type=\"xsd:string\">abc</item>" + "<item soapenc:position=\"[2]\" xsi:type=\"xsd:string\">def</item>" + "</result>", list, true);
}

54. TestDeser#testSparseArray2()

Project: axis1-java
Source File: TestDeser.java
View license
public void testSparseArray2() throws Exception {
    ArrayList list = new ArrayList(4);
    list.add("abc");
    list.add(null);
    list.add("def");
    deserialize("<result xsi:type=\"soapenc:Array\" " + "soapenc:arrayType=\"xsd:string[4]\"> " + "<item soapenc:position=\"[0]\" xsi:type=\"xsd:string\">abc</item>" + "<item soapenc:position=\"[2]\" xsi:type=\"xsd:string\">def</item>" + "</result>", list, true);
}

55. CodeGenerationUtility#findPlainBase64Types()

View license
/**
     * @param sts
     * @return array list
     */
private static List findPlainBase64Types(SchemaTypeSystem sts) {
    ArrayList allSeenTypes = new ArrayList();
    allSeenTypes.addAll(Arrays.asList(sts.documentTypes()));
    allSeenTypes.addAll(Arrays.asList(sts.globalTypes()));
    ArrayList base64Types = new ArrayList();
    for (Iterator iterator = allSeenTypes.iterator(); iterator.hasNext(); ) {
        SchemaType stype = (SchemaType) iterator.next();
        findPlainBase64Types(stype, base64Types, new ArrayList());
    }
    return base64Types;
}

56. DataStruturesTest#testRecordLocationImplComparison()

View license
public synchronized void testRecordLocationImplComparison() throws IOException {
    Location l1 = new Location(0, 1);
    Location l2 = new Location(0, 2);
    Location l3 = new Location(0, 3);
    assertTrue(l1.compareTo(l2) < 0);
    // Sort them using a list.  Put them in the wrong order.
    ArrayList l = new ArrayList();
    l.add(l2);
    l.add(l3);
    l.add(l1);
    Collections.sort(l);
    // Did they get sorted to the correct order?
    assertSame(l.get(0), l1);
    assertSame(l.get(1), l2);
    assertSame(l.get(2), l3);
}

57. RPCServiceClass#mulReturn()

Project: axis2-java
Source File: RPCServiceClass.java
View license
/**
     * This methods return mutiple object , so it creat an Object array and retuen that so , if a
     * method want to return mutiple value , this way can be used
     *
     * @param obj
     * @return Object []
     */
public Object[] mulReturn(OMElement obj) {
    ArrayList objs = new ArrayList();
    objs.add(new Integer(100));
    MyBean bean = new MyBean();
    bean.setAge(100);
    bean.setName("Deepal");
    bean.setValue(false);
    AddressBean ab = new AddressBean();
    ab.setNumber(1010);
    ab.setTown("Colombo3");
    bean.setAddress(ab);
    objs.add(bean);
    return objs.toArray();
}

58. RPCCallTest#testStringArray()

Project: axis2-java
Source File: RPCCallTest.java
View license
//    public void testmultireturn() throws AxisFault {
//        configureSystem("multireturn");
//
//        Options options = new Options();
//        options.setTo(targetEPR);
//        options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
//
//        ConfigurationContext configContext =
//                ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
//        RPCServiceClient sender = new RPCServiceClient(configContext, null);
//        sender.setOptions(options);
//
//        ArrayList args = new ArrayList();
//        args.add("1");
//
//        ArrayList ret = new ArrayList();
//        ret.add(Integer.class);
//        ret.add(String.class);
//
//        Object [] response = sender.invokeBlocking(operationName, args.toArray(), ret.toArray());
//        assertEquals(((Integer) response[0]).intValue(), 10);
//        assertEquals(response[1], "foo");
//    }
public void testStringArray() throws AxisFault {
    RPCServiceClient sender = getRPCClient("EchoXMLService", "handleStringArray");
    ArrayList args = new ArrayList();
    String[] values = new String[] { "abc", "cde", "efg" };
    args.add(values);
    ArrayList ret = new ArrayList();
    ret.add(Boolean.class);
    Object[] objs = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org", "handleStringArray", "req"), args.toArray(), (Class[]) ret.toArray(new Class[ret.size()]));
    assertNotNull(objs);
    assertEquals(Boolean.TRUE, Boolean.valueOf(objs[0].toString()));
}

59. RPCCallTest#testechoInt2()

Project: axis2-java
Source File: RPCCallTest.java
View license
public void testechoInt2() throws AxisFault {
    RPCServiceClient sender = getRPCClient("EchoXMLService", "echoInt");
    ArrayList args = new ArrayList();
    args.add("100");
    ArrayList ret = new ArrayList();
    ret.add(Integer.class);
    Object[] response = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org", "echoInt", "req"), args.toArray(), (Class[]) ret.toArray(new Class[ret.size()]));
    assertEquals(((Integer) response[0]).intValue(), 100);
}

60. RPCCallTest#testechoBean2()

Project: axis2-java
Source File: RPCCallTest.java
View license
////////////////////////////////////////////////// Invoking by Passing Return types //////////
public void testechoBean2() throws AxisFault {
    RPCServiceClient sender = getRPCClient("EchoXMLService", "echoBean");
    MyBean bean = new MyBean();
    bean.setAge(100);
    bean.setName("Deepal");
    bean.setValue(false);
    AddressBean ab = new AddressBean();
    ab.setNumber(1010);
    ab.setTown("Colombo3");
    bean.setAddress(ab);
    ArrayList args = new ArrayList();
    args.add(bean);
    ArrayList ret = new ArrayList();
    ret.add(MyBean.class);
    Object[] response = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org", "echoBean", "req"), args.toArray(), (Class[]) ret.toArray(new Class[ret.size()]));
    MyBean resBean = (MyBean) response[0];
    assertNotNull(resBean);
    assertEquals(resBean.getAge(), 100);
}

61. CmsHistorySettingsDialog#getModes()

View license
/**
     * Returns a list with the possible modes for the history to keep.<p>
     *
     * @return a list with the possible modes for the history to keep
     */
private List getModes() {
    ArrayList ret = new ArrayList();
    ret.add(new CmsSelectWidgetOption(String.valueOf(CmsHistorySettings.MODE_DELETED_HISTORY_DISABLED), m_historySettings.getMode() == CmsHistorySettings.MODE_DELETED_HISTORY_DISABLED, key(Messages.GUI_HISTORY_SETTINGS_MODE_DISABLED_0)));
    ret.add(new CmsSelectWidgetOption(String.valueOf(CmsHistorySettings.MODE_DELETED_HISTORY_KEEP_NO_VERSIONS), m_historySettings.getMode() == CmsHistorySettings.MODE_DELETED_HISTORY_KEEP_NO_VERSIONS, key(Messages.GUI_HISTORY_SETTINGS_MODE_KEEP_NO_VERSIONS_0)));
    ret.add(new CmsSelectWidgetOption(String.valueOf(CmsHistorySettings.MODE_DELETED_HISTORY_KEEP_WITH_VERSIONS), m_historySettings.getMode() == CmsHistorySettings.MODE_DELETED_HISTORY_KEEP_WITH_VERSIONS, key(Messages.GUI_HISTORY_SETTINGS_MODE_KEEP_WITH_VERSIONS_0)));
    return ret;
}

62. CmsHistoryClearDialog#getClearDeletedModes()

View license
/**
     * Returns a list with the possible modes for the clean deleted action.<p>
     *
     * @return a list with the possible modes for the clean deleted action
     */
private List getClearDeletedModes() {
    ArrayList ret = new ArrayList();
    ret.add(new CmsSelectWidgetOption(MODE_CLEANDELETED_KEEP_RESTORE_VERSION, getClearDeletedMode().equals(MODE_CLEANDELETED_KEEP_RESTORE_VERSION), key(Messages.GUI_HISTORY_CLEAR_DELETED_KEEPRESTORE_0)));
    ret.add(new CmsSelectWidgetOption(MODE_CLEANDELETED_DELETE_ALL, getClearDeletedMode().equals(MODE_CLEANDELETED_DELETE_ALL), key(Messages.GUI_HISTORY_CLEAR_DELETED_DELETEALL_0)));
    ret.add(new CmsSelectWidgetOption(MODE_CLEANDELETED_DELETE_NONE, getClearDeletedMode().equals(MODE_CLEANDELETED_DELETE_NONE), key(Messages.GUI_HISTORY_CLEAR_DELETED_DELETENONE_0)));
    return ret;
}

63. TypeDecl#emitBoxingOperation()

Project: JAADAS
Source File: TypeDecl.java
View license
/**
   * @ast method 
   * @aspect AutoBoxingCodegen
   * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/Jimple1.5Backend/AutoBoxingCodegen.jrag:57
   */
protected soot.Value emitBoxingOperation(Body b, soot.Value v, ASTNode location) {
    // Box the value on the stack into this Reference type
    ArrayList parameters = new ArrayList();
    parameters.add(unboxed().getSootType());
    SootMethodRef ref = Scene.v().makeMethodRef(getSootClassDecl(), "valueOf", parameters, getSootType(), true);
    ArrayList args = new ArrayList();
    args.add(asLocal(b, v));
    return b.newStaticInvokeExpr(ref, args, location);
}

64. HintCaseView#init()

Project: hintcase
Source File: HintCaseView.java
View license
private void init(HintCase hintCase) {
    setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    this.hintCase = hintCase;
    closeOnTouch = true;
    showExtraContentHolderAnimators = new ArrayList<>();
    hideExtraContentHolderAnimators = new ArrayList<>();
    hintBlock = NO_BLOCK_INFO;
    hintBlockView = NO_BLOCK_INFO_VIEW;
    extraBlocks = new ArrayList<>();
    extraBlockViews = new ArrayList<>();
    backgroundColor = DEFAULT_BACKGROUND_COLOR;
    offsetInPx = HintCase.NO_OFFSET_IN_PX;
    hintBlockPosition = DEFAULT_HINT_BLOCK_POSITION;
    basePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    navigationBarSizeIfExistAtTheBottom = DimenUtils.getNavigationBarSizeIfExistAtTheBottom(getContext());
    navigationBarSizeIfExistOnTheRight = DimenUtils.getNavigationBarSizeIfExistOnTheRight(getContext());
}

65. JSSessionModel#pushClass()

Project: flex-falcon
Source File: JSSessionModel.java
View license
public void pushClass(IClassDefinition currentClass) {
    Context context = new Context();
    context.bindableVars = bindableVars;
    context.interfacePropertyMap = interfacePropertyMap;
    context.propertyMap = propertyMap;
    context.staticPropertyMap = staticPropertyMap;
    context.classDefinition = this.currentClass;
    context.vars = vars;
    context.methods = methods;
    stack.push(context);
    this.currentClass = currentClass;
    bindableVars = new ArrayList<String>();
    staticPropertyMap = new LinkedHashMap<String, PropertyNodes>();
    interfacePropertyMap = new ArrayList<String>();
    propertyMap = new LinkedHashMap<String, PropertyNodes>();
    vars = new ArrayList<IVariableNode>();
    methods = new ArrayList<IFunctionNode>();
}

66. BasicFSTTest#testSimpleCollections()

View license
@Test
public void testSimpleCollections() throws Exception {
    HashMap obj = new HashMap();
    ArrayList li = new ArrayList();
    li.add("zero");
    li.add(null);
    li.add("second");
    obj.put("x", li);
    obj.put("y", li);
    obj.put("yy", null);
    obj.put(null, "asd");
    obj.put(3, "99999");
    out.writeObject(obj);
    final byte[] copyOfWrittenBuffer = out.getCopyOfWrittenBuffer();
    in.resetForReuseUseArray(copyOfWrittenBuffer);
    out.flush();
    HashMap res = (HashMap) in.readObject();
    assertTrue(res.get("x") == res.get("y"));
    assertTrue(DeepEquals.deepEquals(obj, res));
}

67. CmsVfsConfiguration#initMembers()

View license
/**
     * @see org.opencms.configuration.A_CmsXmlConfiguration#initMembers()
     */
@Override
protected void initMembers() {
    setXmlFileName(DEFAULT_XML_FILE_NAME);
    m_fileTranslations = new ArrayList<String>();
    m_folderTranslations = new ArrayList<String>();
    m_xsdTranslations = new ArrayList<String>();
    m_defaultFiles = new ArrayList<String>();
    if (CmsLog.INIT.isInfoEnabled()) {
        CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_VFS_CONFIG_INIT_0));
    }
}

68. ObjectGraphIteratorTest#setUp()

View license
@Override
public void setUp() {
    list1 = new ArrayList<String>();
    list1.add("One");
    list1.add("Two");
    list1.add("Three");
    list2 = new ArrayList<String>();
    list2.add("Four");
    list3 = new ArrayList<String>();
    list3.add("Five");
    list3.add("Six");
    iteratorList = new ArrayList<Iterator<String>>();
    iteratorList.add(list1.iterator());
    iteratorList.add(list2.iterator());
    iteratorList.add(list3.iterator());
}

69. SieveCoreferenceSystem#initScorers()

Project: CoreNLP
Source File: SieveCoreferenceSystem.java
View license
public void initScorers() {
    linksCountInPass = new ArrayList<>();
    scorePairwise = new ArrayList<>();
    scoreBcubed = new ArrayList<>();
    scoreMUC = new ArrayList<>();
    for (String sieveClassName : sieveClassNames) {
        scorePairwise.add(new ScorerPairwise());
        scoreBcubed.add(new ScorerBCubed(BCubedType.Bconll));
        scoreMUC.add(new ScorerMUC());
        linksCountInPass.add(new Pair<>(0, 0));
    }
}

70. Bug2562DeserializedUnkeyedListTest#writeRoot()

View license
private void writeRoot(final LogicalDatastoreType store) {
    final ReadWriteTransaction readWriteTransaction = getDataBroker().newReadWriteTransaction();
    final Barroot barRoot = new BarrootBuilder().setType(2).setValue(2).setKey(new BarrootKey(2)).build();
    final ArrayList barRootList = new ArrayList();
    barRootList.add(barRoot);
    final Fooroot fooRoot = new FoorootBuilder().setBarroot(barRootList).build();
    final ArrayList fooRootList = new ArrayList();
    fooRootList.add(fooRoot);
    final Root root = new RootBuilder().setFooroot(fooRootList).build();
    readWriteTransaction.put(store, ROOT_PATH, root);
    assertCommit(readWriteTransaction.submit());
}

71. TestAlgorithms#setUp()

Project: commons-functor
Source File: TestAlgorithms.java
View license
// Lifecycle
// ------------------------------------------------------------------------
@Before
public void setUp() throws Exception {
    list = new ArrayList<Integer>();
    evens = new ArrayList<Integer>();
    doubled = new ArrayList<Integer>();
    listWithDuplicates = new ArrayList<Integer>();
    sum = 0;
    for (int i = 0; i < 10; i++) {
        list.add(Integer.valueOf(i));
        doubled.add(Integer.valueOf(i * 2));
        listWithDuplicates.add(Integer.valueOf(i));
        listWithDuplicates.add(Integer.valueOf(i));
        sum += i;
        if (i % 2 == 0) {
            evens.add(Integer.valueOf(i));
        }
    }
}

72. GraphTest#setup()

Project: parceler
Source File: GraphTest.java
View license
@Before
public void setup() {
    as = new ArrayList<A>();
    bs = new ArrayList<B>();
    cs = new ArrayList<C>();
    ds = new ArrayList<D>();
    as.add(null);
    bs.add(null);
    cs.add(null);
    ds.add(null);
}

73. QuestionPoolBean#getCheckedQuestion()

Project: sakai
Source File: QuestionPoolBean.java
View license
public void getCheckedQuestion() {
    String itemId = ContextUtil.lookupParam("itemid");
    ItemService delegate = new ItemService();
    ItemFacade itemfacade = delegate.getItem(new Long(itemId), AgentFacade.getAgentString());
    ArrayList itemIds = new ArrayList();
    itemIds.add(itemId);
    setCurrentItemIds(itemIds);
    ArrayList itemFacades = new ArrayList();
    itemFacades.add(itemfacade);
    setCurrentItems(itemFacades);
    setActionType("item");
}

74. MapModule#initSides()

Project: SquidLib
Source File: MapModule.java
View license
private void initSides() {
    leftDoors = new ArrayList<>(8);
    rightDoors = new ArrayList<>(8);
    topDoors = new ArrayList<>(8);
    bottomDoors = new ArrayList<>(8);
    for (Coord dr : validDoors) {
        if (dr.x * max.y < dr.y * max.x && dr.y * max.x < (max.x - dr.x) * max.y)
            leftDoors.add(dr);
        else if (dr.x * max.y > dr.y * max.x && dr.y * max.x > (max.x - dr.x) * max.y)
            rightDoors.add(dr);
        else if (dr.x * max.y > dr.y * max.x && dr.y * max.x < (max.x - dr.x) * max.y)
            topDoors.add(dr);
        else if (dr.x * max.y < dr.y * max.x && dr.y * max.x > (max.x - dr.x) * max.y)
            bottomDoors.add(dr);
    }
}

75. MockConnection#clear()

Project: spacewalk
Source File: MockConnection.java
View license
public static void clear() {
    profiles = new ArrayList<Map>();
    distros = new ArrayList<Map>();
    systems = new ArrayList<Map>();
    images = new ArrayList<Map>();
    systemMap = new HashMap<String, Map>();
    profileMap = new HashMap<String, Map>();
    distroMap = new HashMap<String, Map>();
    imageMap = new HashMap<String, Map>();
}

76. PartLogisticalTransporter#getSyncPacket()

View license
public ArrayList getSyncPacket(TransporterStack stack, boolean kill) {
    ArrayList data = new ArrayList();
    data.add(1);
    data.add(kill);
    data.add(getTransmitter().transit.indexOf(stack));
    if (!kill) {
        stack.write(getTransmitter(), data);
    }
    return data;
}

77. TreeTableDataView#getTableColunms()

Project: tapestry3
Source File: TreeTableDataView.java
View license
public ITableColumn[] getTableColunms() {
    ArrayList arrColumnsList = new ArrayList();
    arrColumnsList.add(new TreeTableColumn("Name", false, null));
    ArrayList arrTableColunms = getTableColunmsFromBinding();
    if (arrTableColunms != null)
        arrColumnsList.addAll(arrTableColunms);
    ITableColumn[] arrColumns = new ITableColumn[arrColumnsList.size()];
    arrColumnsList.toArray(arrColumns);
    return arrColumns;
}

78. CollectionActivity#initData()

View license
private void initData() {
    Collection_data_real = new ArrayList<Integer>(Arrays.asList(R.mipmap.a01, R.mipmap.a02, R.mipmap.a03, R.mipmap.a04, R.mipmap.a05, R.mipmap.a06, R.mipmap.a07, R.mipmap.a08, R.mipmap.a09, R.mipmap.a10, R.mipmap.a11, R.mipmap.a12));
    Collection_data_cartoon = new ArrayList<Integer>(Arrays.asList(R.mipmap.bg01, R.mipmap.bg02, R.mipmap.bg03, R.mipmap.bg04, R.mipmap.bg05));
    Collection_data_real_mini = new ArrayList<Integer>(Arrays.asList(R.mipmap.a01_mini, R.mipmap.a02_mini, R.mipmap.a03_mini, R.mipmap.a04_mini, R.mipmap.a05_mini, R.mipmap.a06_mini, R.mipmap.a07_mini, R.mipmap.a08_mini, R.mipmap.a09_mini, R.mipmap.a10_mini, R.mipmap.a11_mini, R.mipmap.a12_mini));
    Collection_data_cartoon_mini = new ArrayList<Integer>(Arrays.asList(R.mipmap.bg01_mini, R.mipmap.bg02_mini, R.mipmap.bg03_mini, R.mipmap.bg04_mini, R.mipmap.bg05_mini));
}

79. Collections9#doGet()

Project: JAADAS
Source File: Collections9.java
View license
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
    String s1 = req.getParameter(FIELD_NAME);
    LinkedList c1 = new LinkedList();
    c1.addLast(s1);
    ArrayList c2 = new ArrayList();
    c2.add("abc");
    c2.retainAll(c1);
    String s2 = (String) c2.get(0);
    PrintWriter writer = resp.getWriter();
    writer.println(s2);
/* OK */
}

80. ResideMenu#initValue()

View license
private void initValue(Activity activity) {
    this.activity = activity;
    leftMenuItems = new ArrayList<ResideMenuItem>();
    rightMenuItems = new ArrayList<ResideMenuItem>();
    ignoredViews = new ArrayList<View>();
    viewDecor = (ViewGroup) activity.getWindow().getDecorView();
    viewActivity = new TouchDisableView(this.activity);
    View mContent = viewDecor.getChildAt(0);
    viewDecor.removeViewAt(0);
    viewActivity.setContent(mContent);
    addView(viewActivity);
    ViewGroup parent = (ViewGroup) scrollViewLeftMenu.getParent();
    parent.removeView(scrollViewLeftMenu);
    parent.removeView(scrollViewRightMenu);
}

81. ResideMenu#initValue()

View license
private void initValue(Activity activity) {
    this.activity = activity;
    leftMenuItems = new ArrayList<ResideMenuItem>();
    rightMenuItems = new ArrayList<ResideMenuItem>();
    ignoredViews = new ArrayList<View>();
    viewDecor = (ViewGroup) activity.getWindow().getDecorView();
    viewActivity = new TouchDisableView(this.activity);
    View mContent = viewDecor.getChildAt(0);
    viewDecor.removeViewAt(0);
    viewActivity.setContent(mContent);
    addView(viewActivity);
    ViewGroup parent = (ViewGroup) scrollViewLeftMenu.getParent();
    parent.removeView(scrollViewLeftMenu);
    parent.removeView(scrollViewRightMenu);
}

82. MovieLibraryUpdate#clear()

Project: Mizuu
Source File: MovieLibraryUpdate.java
View license
private void clear() {
    // Lists
    mFileSources = new ArrayList<FileSource>();
    mMovieFileSources = new ArrayList<MovieFileSource<?>>();
    mMovieQueue = new ArrayList<MovieStructure>();
    // Booleans
    mClearLibrary = false;
    mClearUnavailable = false;
    mSyncLibraries = true;
    mStopUpdate = false;
    // Other variables
    mEditor = null;
    mSettings = null;
    mTotalFiles = 0;
    mNotificationManager = null;
    mBuilder = null;
}

83. TvShowsLibraryUpdate#clear()

Project: Mizuu
Source File: TvShowsLibraryUpdate.java
View license
private void clear() {
    // Lists
    mFileSources = new ArrayList<FileSource>();
    mTvShowFileSources = new ArrayList<TvShowFileSource<?>>();
    mFiles = new ArrayList<ShowStructure>();
    mUniqueShowIds = new HashSet<String>();
    // Booleans
    mClearLibrary = false;
    mClearUnavailable = false;
    mSyncLibraries = true;
    mStopUpdate = false;
    // Other variables
    mEditor = null;
    mSettings = null;
    mTotalFiles = 0;
    mShowCount = 0;
    mNotificationManager = null;
    mBuilder = null;
}

84. FlowObjectiveManagerTest#initializeTest()

Project: onos
Source File: FlowObjectiveManagerTest.java
View license
@Before
public void initializeTest() {
    manager = new FlowObjectiveManager();
    manager.flowObjectiveStore = new TestFlowObjectiveStore();
    manager.mastershipService = new MastershipServiceAdapter();
    manager.deviceService = new TestDeviceService();
    manager.defaultDriverService = new TestDriversLoader();
    manager.driverService = new TestDriverService();
    filteringObjectives = new ArrayList<>();
    forwardingObjectives = new ArrayList<>();
    nextObjectives = new ArrayList<>();
    manager.activate();
}

85. AtomixTestBase#clearTests()

Project: onos
Source File: AtomixTestBase.java
View license
public static void clearTests() throws Exception {
    registry = new LocalServerRegistry();
    members = new ArrayList<>();
    CompletableFuture<Void> closeClients = CompletableFuture.allOf(atomixClients.stream().map(AtomixClient::close).toArray(CompletableFuture[]::new));
    closeClients.thenCompose( v -> CompletableFuture.allOf(copycatServers.stream().map(CopycatServer::shutdown).toArray(CompletableFuture[]::new))).join();
    atomixClients = new ArrayList<>();
    copycatServers = new ArrayList<>();
}

86. ControllerTest#testUpdateConfig1()

Project: onos
Source File: ControllerTest.java
View license
/**
     * Tests updateConfig() method.
     */
@Test
public void testUpdateConfig1() throws Exception {
    ospfProcess = new OspfProcessImpl();
    ospfArea = new OspfAreaImpl();
    ospfInterface = new OspfInterfaceImpl();
    ospfInterfaces = new ArrayList();
    ospfInterface.setIpAddress(Ip4Address.valueOf("10.10.10.5"));
    ospfInterfaces.add(ospfInterface);
    ospfArea.setAreaId(Ip4Address.valueOf("2.2.2.2"));
    ospfArea.setInterfacesLst(ospfInterfaces);
    ospfProcess.setProcessId("10.10.10.10");
    ospfAreas = new ArrayList();
    ospfAreas.add(ospfArea);
    ospfProcess.setAreas(ospfAreas);
    ospfProcesses = new ArrayList();
    ospfProcesses.add(ospfProcess);
    controller.updateConfig(ospfProcesses);
    assertThat(controller, is(notNullValue()));
}

87. CmsSystemConfiguration#initMembers()

View license
/**
     * @see org.opencms.configuration.A_CmsXmlConfiguration#initMembers()
     */
@Override
protected void initMembers() {
    setXmlFileName(DEFAULT_XML_FILE_NAME);
    m_historyEnabled = true;
    m_historyVersions = 10;
    // use m_historyVersions instead
    m_historyVersionsAfterDeletion = -1;
    m_resourceInitHandlers = new ArrayList<I_CmsResourceInit>();
    m_requestHandlers = new ArrayList<I_CmsRequestHandler>();
    m_configuredJobs = new ArrayList<CmsScheduledJobInfo>();
    m_runtimeProperties = new HashMap<String, String>();
    m_eventManager = new CmsEventManager();
    if (CmsLog.INIT.isInfoEnabled()) {
        CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_SYSTEM_CONFIG_INIT_0));
    }
}

88. TestISODateTimeFormat_Fields#testForFields_calBased_D()

View license
//-----------------------------------------------------------------------
public void testForFields_calBased_D() {
    DateTimeFieldType[] fields = new DateTimeFieldType[] { DateTimeFieldType.dayOfMonth() };
    int[] values = new int[] { 25 };
    List types = new ArrayList(Arrays.asList(fields));
    DateTimeFormatter f = ISODateTimeFormat.forFields(types, true, true);
    assertEquals("---25", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, true, false);
    assertEquals("---25", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, false, true);
    assertEquals("---25", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, false, false);
    assertEquals("---25", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
}

89. TestISODateTimeFormat_Fields#testForFields_weekBased_Y()

View license
//-----------------------------------------------------------------------
public void testForFields_weekBased_Y() {
    DateTimeFieldType[] fields = new DateTimeFieldType[] { DateTimeFieldType.weekyear() };
    int[] values = new int[] { 2005 };
    List types = new ArrayList(Arrays.asList(fields));
    DateTimeFormatter f = ISODateTimeFormat.forFields(types, true, true);
    assertEquals("2005", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, true, false);
    assertEquals("2005", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, false, true);
    assertEquals("2005", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, false, false);
    assertEquals("2005", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
}

90. TestISODateTimeFormat_Fields#testForFields_weekBased_W()

View license
//-----------------------------------------------------------------------
public void testForFields_weekBased_W() {
    DateTimeFieldType[] fields = new DateTimeFieldType[] { DateTimeFieldType.weekOfWeekyear() };
    int[] values = new int[] { 8 };
    List types = new ArrayList(Arrays.asList(fields));
    DateTimeFormatter f = ISODateTimeFormat.forFields(types, true, true);
    assertEquals("-W08", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, true, false);
    assertEquals("-W08", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, false, true);
    assertEquals("-W08", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, false, false);
    assertEquals("-W08", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
}

91. TestISODateTimeFormat_Fields#testForFields_weekBased_D()

View license
//-----------------------------------------------------------------------
public void testForFields_weekBased_D() {
    DateTimeFieldType[] fields = new DateTimeFieldType[] { DateTimeFieldType.dayOfWeek() };
    int[] values = new int[] { 5 };
    List types = new ArrayList(Arrays.asList(fields));
    DateTimeFormatter f = ISODateTimeFormat.forFields(types, true, true);
    assertEquals("-W-5", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, true, false);
    assertEquals("-W-5", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, false, true);
    assertEquals("-W-5", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, false, false);
    assertEquals("-W-5", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
}

92. TestISODateTimeFormat_Fields#testForFields_ordinalBased_Y()

View license
//-----------------------------------------------------------------------
public void testForFields_ordinalBased_Y() {
    DateTimeFieldType[] fields = new DateTimeFieldType[] { DateTimeFieldType.year() };
    int[] values = new int[] { 2005 };
    List types = new ArrayList(Arrays.asList(fields));
    DateTimeFormatter f = ISODateTimeFormat.forFields(types, true, true);
    assertEquals("2005", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, true, false);
    assertEquals("2005", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, false, true);
    assertEquals("2005", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, false, false);
    assertEquals("2005", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
}

93. TestISODateTimeFormat_Fields#testForFields_ordinalBased_D()

View license
//-----------------------------------------------------------------------
public void testForFields_ordinalBased_D() {
    DateTimeFieldType[] fields = new DateTimeFieldType[] { DateTimeFieldType.dayOfYear() };
    int[] values = new int[] { 177 };
    List types = new ArrayList(Arrays.asList(fields));
    DateTimeFormatter f = ISODateTimeFormat.forFields(types, true, true);
    assertEquals("-177", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, true, false);
    assertEquals("-177", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, false, true);
    assertEquals("-177", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, false, false);
    assertEquals("-177", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
}

94. TestISODateTimeFormat_Fields#testForFields_time_H()

View license
//-----------------------------------------------------------------------
public void testForFields_time_H() {
    DateTimeFieldType[] fields = new DateTimeFieldType[] { DateTimeFieldType.hourOfDay() };
    int[] values = new int[] { 10 };
    List types = new ArrayList(Arrays.asList(fields));
    DateTimeFormatter f = ISODateTimeFormat.forFields(types, true, true);
    assertEquals("10", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, true, false);
    assertEquals("10", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, false, true);
    assertEquals("10", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, false, false);
    assertEquals("10", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
}

95. TestISODateTimeFormat_Fields#testForFields_time_M()

View license
//-----------------------------------------------------------------------
public void testForFields_time_M() {
    DateTimeFieldType[] fields = new DateTimeFieldType[] { DateTimeFieldType.minuteOfHour() };
    int[] values = new int[] { 20 };
    List types = new ArrayList(Arrays.asList(fields));
    DateTimeFormatter f = ISODateTimeFormat.forFields(types, true, true);
    assertEquals("-20", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, true, false);
    assertEquals("-20", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, false, true);
    assertEquals("-20", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
    types = new ArrayList(Arrays.asList(fields));
    f = ISODateTimeFormat.forFields(types, false, false);
    assertEquals("-20", f.print(new Partial(fields, values)));
    assertEquals(0, types.size());
}

96. HandlerFailureTest#setUp()

Project: axis2-java
Source File: HandlerFailureTest.java
View license
public void setUp() throws Exception {
    super.setUp();
    AxisService as = deployClassAsService(Echo.SERVICE_NAME, Echo.class);
    AxisOperation operation = as.getOperation(new QName(Echo.ECHO_OM_ELEMENT_OP_NAME));
    ArrayList phasec = new ArrayList();
    phasec.add(new Phase(PhaseMetadata.PHASE_POLICY_DETERMINATION));
    operation.setRemainingPhasesInFlow(phasec);
    ArrayList phase = operation.getRemainingPhasesInFlow();
    for (int i = 0; i < phase.size(); i++) {
        Phase phase1 = (Phase) phase.get(i);
        if (PhaseMetadata.PHASE_POLICY_DETERMINATION.equals(phase1.getPhaseName())) {
            phase1.addHandler(culprit);
        }
    }
}

97. SOAPHeaderTest#testAddUpgradeHeaderElement()

Project: axis2-java
Source File: SOAPHeaderTest.java
View license
@Validated
@Test
public void testAddUpgradeHeaderElement() throws Exception {
    javax.xml.soap.SOAPMessage soapMessage = javax.xml.soap.MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL).createMessage();
    javax.xml.soap.SOAPEnvelope soapEnv = soapMessage.getSOAPPart().getEnvelope();
    javax.xml.soap.SOAPHeader header = soapEnv.getHeader();
    // create a list of supported URIs.
    ArrayList supported = new ArrayList();
    supported.add(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE);
    supported.add(SOAPConstants.URI_NS_SOAP_ENVELOPE);
    SOAPElement soapElement = header.addUpgradeHeaderElement(supported.iterator());
    assertNotNull(soapElement);
    Name name = soapElement.getElementName();
    String uri = name.getURI();
    String localName = name.getLocalName();
    //Validate the URI which must be SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE);
    assertTrue(uri.equals(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE));
    assertTrue(localName.equals("Upgrade"));
}

98. RPCCallTest#testEditBean()

Project: axis2-java
Source File: RPCCallTest.java
View license
public void testEditBean() throws AxisFault {
    RPCServiceClient sender = getRPCClient("EchoXMLService", "editBean");
    MyBean bean = new MyBean();
    bean.setAge(100);
    bean.setName("Deepal");
    bean.setValue(false);
    AddressBean ab = new AddressBean();
    ab.setNumber(1010);
    ab.setTown("Colombo3");
    bean.setAddress(ab);
    ArrayList args = new ArrayList();
    args.add(bean);
    args.add("159");
    OMElement response = sender.invokeBlocking(new QName("http://rpc.axis2.apache.org", "editBean", "req"), args.toArray());
    MyBean resBean = (MyBean) BeanUtil.deserialize(MyBean.class, response.getFirstElement(), new DefaultObjectSupplier(), null);
    assertNotNull(resBean);
    assertEquals(resBean.getAge(), 159);
}

99. LibraryServiceClient#lendBook()

View license
public void lendBook(String isbn, String userName, RPCServiceClient rpcClient) throws Exception {
    rpcClient.getOptions().setAction("urn:lendBook");
    ArrayList args = new ArrayList();
    args.add(isbn);
    args.add(userName);
    Object obj[] = rpcClient.invokeBlocking(new QName("http://servicelifecycle.sample", "lendBook"), args.toArray(), new Class[] { Book.class });
    Book book = (Book) obj[0];
    System.out.println("Title : " + book.getTitle());
    System.out.println("Isbn : " + book.getIsbn());
    System.out.println("Author : " + book.getAuthor());
}

100. ADBXMLStreamReaderTest#testQualifiedElement()

View license
/** test the qualified elements A qulified element has been associated with a namespace */
public void testQualifiedElement() throws Exception {
    String expectedXML = "<ns1:testElementText xmlns:ns1=\"http://testElementText.org\">" + "<ns2:QualifiedElement xmlns:ns2=\"http://testQElementText.org\">" + "This is some Text for the element</ns2:QualifiedElement></ns1:testElementText>";
    ArrayList properties = new ArrayList();
    properties.add(new QName("http://testQElementText.org", "QualifiedElement", "ns2"));
    properties.add("This is some Text for the element");
    XMLStreamReader pullParser = new ADBXMLStreamReaderImpl(new QName("http://testElementText.org", "testElementText", "ns1"), properties.toArray(), null);
    String actualXML = getStringXML(pullParser);
    assertXMLEqual(newDocument(expectedXML), newDocument(actualXML));
}