Package org.dozer.vo

Examples of org.dozer.vo.InsideTestObject


    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");
View Full Code Here


  }

  @Test
  public void testDeepInterfaceWithHint() throws Exception {
    Mapper mapper = getMapper(new String[] { "fieldAttributeMapping.xml" });
    InsideTestObject ito = newInstance(InsideTestObject.class);
    House house = newInstance(House.class);
    MetalThingyIF thingy = newInstance(Car.class);
    thingy.setName("name");
    house.setThingy(thingy);
    ito.setHouse(house);
    InsideTestObjectPrime itop = mapper.map(ito, InsideTestObjectPrime.class);
    assertEquals("name", itop.getDeepInterfaceString());

    mapper.map(itop, InsideTestObject.class);
    assertEquals("name", ito.getHouse().getThingy().getName());
  }
View Full Code Here

  public void testFieldAccessible() throws Exception {
    Mapper mapper = getMapper(new String[] { "fieldAttributeMapping.xml" });
    TestObject to = newInstance(TestObject.class);
    to.setFieldAccessible("fieldAccessible");
    to.setFieldAccessiblePrimInt(2);
    InsideTestObject ito = newInstance(InsideTestObject.class);
    ito.setLabel("label");
    to.setFieldAccessibleComplexType(ito);
    String[] stringArray = new String[] { "one", "two" };
    to.setFieldAccessibleArrayToList(stringArray);
    TestObjectPrime top = mapper.map(to, TestObjectPrime.class);
    assertEquals("fieldAccessible", top.fieldAccessible);
View Full Code Here

  @Test
  public void testFieldCreateMethod() throws Exception {
    Mapper mapper = getMapper(new String[] { "fieldAttributeMapping.xml" });
    TestObject to = newInstance(TestObject.class);
    InsideTestObject ito = newInstance(InsideTestObject.class);
    // we did not set any values. this will be set in the 'createMethod'
    to.setCreateMethodType(ito);
    TestObjectPrime top = mapper.map(to, TestObjectPrime.class);
    assertEquals("myField", top.getCreateMethodType().getMyField());
View Full Code Here

  }

  @Test
  public void testDeepInterfaceWithHint() throws Exception {
    Mapper mapper = getMapper(new String[] { "fieldAttributeMapping.xml" });
    InsideTestObject ito = newInstance(InsideTestObject.class);
    House house = newInstance(House.class);
    MetalThingyIF thingy = newInstance(Car.class);
    thingy.setName("name");
    house.setThingy(thingy);
    ito.setHouse(house);
    InsideTestObjectPrime itop = mapper.map(ito, InsideTestObjectPrime.class);
    assertEquals("name", itop.getDeepInterfaceString());

    mapper.map(itop, InsideTestObject.class);
    assertEquals("name", ito.getHouse().getThingy().getName());
  }
View Full Code Here

  public void testFieldAccessible() throws Exception {
    Mapper mapper = getMapper("fieldAttributeMapping.xml");
    TestObject to = newInstance(TestObject.class);
    to.setFieldAccessible("fieldAccessible");
    to.setFieldAccessiblePrimInt(2);
    InsideTestObject ito = newInstance(InsideTestObject.class);
    ito.setLabel("label");
    to.setFieldAccessibleComplexType(ito);
    String[] stringArray = new String[] { "one", "two" };
    to.setFieldAccessibleArrayToList(stringArray);
    TestObjectPrime top = mapper.map(to, TestObjectPrime.class);
    assertEquals("fieldAccessible", top.fieldAccessible);
View Full Code Here

  @Test
  public void testFieldCreateMethod() throws Exception {
    Mapper mapper = getMapper("fieldAttributeMapping.xml");
    TestObject to = newInstance(TestObject.class);
    InsideTestObject ito = newInstance(InsideTestObject.class);
    // we did not set any values. this will be set in the 'createMethod'
    to.setCreateMethodType(ito);
    TestObjectPrime top = mapper.map(to, TestObjectPrime.class);
    assertEquals("myField", top.getCreateMethodType().getMyField());
View Full Code Here

    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");
View Full Code Here

TOP

Related Classes of org.dozer.vo.InsideTestObject

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.