Examples of TestObjectPrime


Examples of org.dozer.vo.TestObjectPrime

    // in the destination field being an empty String and not null.
    String input = "";
    TestObject src = newInstance(TestObject.class);
    src.setOne(input);

    TestObjectPrime dest = mapper.map(src, TestObjectPrime.class);
    assertNotNull("dest field should not be null", dest.getOnePrime());
    assertEquals("invalid dest field value", input, dest.getOnePrime());
  }
View Full Code Here

Examples of org.dozer.vo.TestObjectPrime

  public void testGlobalRelationshipType() throws Exception {
    mapper = getMapper(new String[] { "relationship-type-global-configuration.xml" });
    TestObject src = new TestObject();
    src.setHintList(new ArrayList<String>(Arrays.asList(new String[] { "a" })));

    TestObjectPrime dest = new TestObjectPrime();
    dest.setHintList(new ArrayList<String>(Arrays.asList(new String[] { "a", "b" })));

    mapper.map(src, dest);

    assertEquals("wrong # of elements in dest list for non-cumulative mapping", 2, dest.getHintList().size());
  }
View Full Code Here

Examples of org.dozer.vo.TestObjectPrime

  public void testClassMapRelationshipType() throws Exception {
    mapper = getMapper(new String[] { "relationshipTypeMapping.xml" });
    TestObject src = new TestObject();
    src.setHintList(new ArrayList<String>(Arrays.asList(new String[] { "a" })));

    TestObjectPrime dest = new TestObjectPrime();
    dest.setHintList(new ArrayList<String>(Arrays.asList(new String[] { "a", "b" })));

    mapper.map(src, dest);

    assertEquals("wrong # of elements in dest list for non-cumulative mapping", 2, dest.getHintList().size());
  }
View Full Code Here

Examples of org.dozer.vo.TestObjectPrime

    } catch (Throwable t) {
    }

    TestDataFactory testDataFactory = new TestDataFactory(NoProxyDataObjectInstantiator.INSTANCE);
    TestObject to = testDataFactory.getInputGeneralMappingTestObject();
    TestObjectPrime prime = mapper.map(to, TestObjectPrime.class);
    TestObject source = mapper.map(prime, TestObject.class);
    mapper.map(source, TestObjectPrime.class);

    int numIters = 4000;
    for (int i = 0; i < numIters; i++) {
View Full Code Here

Examples of org.dozer.vo.TestObjectPrime

  @Test
  public void testCreatBeanFromFactory() throws Exception {
    String factoryName = "org.dozer.functional_tests.support.SampleCustomBeanFactory";
    TestObject bean = (TestObject) DestBeanCreator.create(
        new BeanCreationDirective(new TestObjectPrime(), TestObjectPrime.class, TestObject.class, null, factoryName, null, null));

    assertNotNull(bean);
    assertEquals(factoryName, bean.getCreatedByFactoryName());
  }
View Full Code Here

Examples of org.dozer.vo.TestObjectPrime

    } catch (Throwable t) {
    }

    TestDataFactory testDataFactory = new TestDataFactory(NoProxyDataObjectInstantiator.INSTANCE);
    TestObject to = testDataFactory.getInputGeneralMappingTestObject();
    TestObjectPrime prime = mapper.map(to, TestObjectPrime.class);
    TestObject source = mapper.map(prime, TestObject.class);
    mapper.map(source, TestObjectPrime.class);

    int numIters = 4000;
    for (int i = 0; i < numIters; i++) {
View Full Code Here

Examples of org.dozer.vo.TestObjectPrime

    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);
    assertEquals("label", top.fieldAccessibleComplexType.getLabelPrime());
    assertEquals(2, top.fieldAccessiblePrimInt);
    assertEquals("one", top.fieldAccessibleArrayToList.get(0));
    assertEquals("two", top.fieldAccessibleArrayToList.get(1));
View Full Code Here

Examples of org.dozer.vo.TestObjectPrime

  public void testOverloadGetSetMethods() throws Exception {
    Mapper mapper = getMapper("fieldAttributeMapping.xml");
    TestObject to = newInstance(TestObject.class);
    Date date = new Date();
    to.setOverloadGetField(new Date());
    TestObjectPrime top = mapper.map(to, TestObjectPrime.class);
    assertEquals(date, top.getOverloadSetField());

    // Map Back
    TestObject toDest = (TestObject) mapper.map(top, TestObject.class);
    assertEquals(date, toDest.getOverloadGetField());
  }
View Full Code Here

Examples of org.dozer.vo.TestObjectPrime

    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());

    // Map Back
    TestObject toDest = mapper.map(top, TestObject.class);
    assertEquals("testCreateMethod", toDest.getCreateMethodType().getTestCreateMethod());
  }
View Full Code Here

Examples of org.dozer.vo.TestObjectPrime

  public void testIntegerToString() throws Exception {
    Mapper mapper = getMapper("fieldAttributeMapping.xml");
    TestObject to = newInstance(TestObject.class);
    Integer[] array = new Integer[] { new Integer(1), new Integer(2) };
    to.setArrayForLists(array);
    TestObjectPrime top = mapper.map(to, TestObjectPrime.class);
    assertEquals("1", top.getListForArray().get(0));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.