Package org.dozer.vo

Examples of org.dozer.vo.TestObject


    Orange orange2 = newInstance(Orange.class);
    orange2.setName("orange2");
    Map<String, Orange> map = newInstance(HashMap.class);
    map.put(orange1.getName(), orange1);
    map.put(orange2.getName(), orange2);
    TestObject to = newInstance(TestObject.class);
    to.setCollectionToList(map.values());
    TestObjectPrime top = mapper.map(to, TestObjectPrime.class);
    assertTrue(top.getListToCollection().contains(orange1));
    assertTrue(top.getListToCollection().contains(orange2));
  }
View Full Code Here


    custom.setEqualNamedList(newInstance(ArrayList.class));
    return custom;
  }

  public TestObject getInputTestListFieldArrayListTestObject() {
    TestObject custom = newInstance(TestObject.class);
    Integer[] array = { new Integer(1) };
    custom.setArrayForLists(array);
    return custom;
  }
View Full Code Here

    custom.setArrayForLists(array);
    return custom;
  }

  public TestObject getInputTestListUsingDestHintTestObject() {
    TestObject custom = newInstance(TestObject.class);
    List<TheFirstSubClass> list = newInstance(ArrayList.class);
    list.add(newInstance(TheFirstSubClass.class));
    custom.setHintList(list);
    return custom;
  }
View Full Code Here

    custom.setHintList(list);
    return custom;
  }

  public TestObject getInputGeneralMappingTestObject() {
    TestObject custom = newInstance(TestObject.class);
    custom.setOne("one");
    custom.setTwo(new Integer(2));

    int[] pa = { 0, 1, 2, 3, 4 };
    custom.setPrimArray(pa);

    InsideTestObject ito = newInstance(InsideTestObject.class);
    ito.setLabel("label");
    ito.setWrapper(new Integer(1));
    ito.setToWrapper(1);

    custom.setThree(ito);

    // testing if it will map two custom objects that are different types but same names //
    InsideTestObject ito2 = newInstance(InsideTestObject.class);
    ito2.setLabel("label");
    custom.setInsideTestObject(ito2);

    List<String> list1 = newInstance(ArrayList.class);
    list1.add("1value");
    list1.add("2value");
    List<String> list2 = newInstance(ArrayList.class);
    list2.add("1value");
    list2.add("2value");
    custom.setEqualNamedList(list1);
    custom.setUnequalNamedList(list2);

    custom.setThePrimitive(3);
    custom.setTheMappedPrimitive(4);

    int[] intArray = { 1, 1 };
    Integer[] integerArray = { new Integer(1), new Integer(1) };
    custom.setAnArray(intArray);
    custom.setArrayForLists(integerArray);
    custom.setBigDecimalToInt(new BigDecimal(1));
    custom.setIntToBigDecimal(1);
    Date date = new Date();
    custom.setDate(date);
    GregorianCalendar calendar = new GregorianCalendar();
    calendar.setTime(date);
    custom.setCalendar(calendar);
    Van van = newInstance(Van.class);
    van.setName("van");
    van.setTestValue("testValue");
    custom.setVan(van);
    custom.setExcludeMe("takemeout");

    // testing interfaces
    MetalThingyIF car = newInstance(Car.class);
    car.setName("metalthingy");
    custom.setCarMetalThingy(car);

    List<TheFirstSubClass> hintList = newInstance(ArrayList.class);
    TheFirstSubClass fsc = newInstance(TheFirstSubClass.class);
    TheFirstSubClass fsc2 = newInstance(TheFirstSubClass.class);
    fsc.setS("s");
    fsc2.setS("s");
    hintList.add(fsc);
    hintList.add(fsc2);

    custom.setHintList(hintList);

    custom.setBlankDate("");
    custom.setBlankStringToLong("");
    NoExtendBaseObject nebo = newInstance(NoExtendBaseObject.class);
    custom.setCopyByReference(nebo);
    NoExtendBaseObject nebo2 = newInstance(NoExtendBaseObject.class);
    custom.setCopyByReferenceDeep(nebo2);
    NoExtendBaseObjectGlobalCopyByReference globalNebo = newInstance(NoExtendBaseObjectGlobalCopyByReference.class);
    custom.setGlobalCopyByReference(globalNebo);

    String[] stringArray = new String[] { null, "one", "two" };
    custom.setStringArrayWithNullValue(stringArray);
    return custom;
  }
View Full Code Here

  @Test
  public void testCustomConverterHashMapMapping() throws Exception {
    mapper = getMapper(new String[] { "dozerBeanMapping.xml" });
    TestCustomConverterHashMapObject testCustomConverterHashMapObject = newInstance(TestCustomConverterHashMapObject.class);
    TestObject to = newInstance(TestObject.class);
    to.setOne("one");
    testCustomConverterHashMapObject.setTestObject(to);
    TestObjectPrime top = newInstance(TestObjectPrime.class);
    top.setOnePrime("onePrime");
    testCustomConverterHashMapObject.setTestObjectPrime(top);
    TestCustomConverterHashMapPrimeObject dest = mapper.map(testCustomConverterHashMapObject,
View Full Code Here

TOP

Related Classes of org.dozer.vo.TestObject

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.