Package org.dozer.vo

Examples of org.dozer.vo.Child


   * Test Case Submitted by Peter Monks 1/2007
   */
  @Test
  public void testInterfaceInheritanceViaXmlBeans_PojoToXmlBean() {
    mapper = getMapper(new String[] { "xmlBeansMapping.xml" });
    Child pojo = (Child) newInstance(Child.class);

    pojo.setId(BigInteger.valueOf(42));
    pojo.setName("Ernie");
    pojo.setFu("Fu");
    pojo.setBar("Bar");

    ChildType xmlBean = mapper.map(pojo, ChildType.class);

    assertNotNull("dest obj should not be null", xmlBean);
    assertNotNull("fu value should not be null", xmlBean.getFu());
    assertEquals("invalid fu value", pojo.getFu(), xmlBean.getFu());
    assertNotNull("bar field should not be null", xmlBean.getBar());
    assertEquals("invalid bar value", pojo.getBar(), xmlBean.getBar());
    assertNotNull("name value should not be null", xmlBean.getName());
    assertEquals("invalid name value", pojo.getName(), xmlBean.getName());
    assertNotNull("id field should not be null", xmlBean.getId());
    assertEquals("invalid id value", pojo.getId(), xmlBean.getId());
  }
View Full Code Here


    xmlBean.setId(BigInteger.valueOf(7236));
    xmlBean.setName("Bert");
    xmlBean.setFu("Uf");
    xmlBean.setBar("Rab");

    Child pojo = mapper.map(xmlBean, Child.class);

    assertNotNull("dest obj should not be null", pojo);
    assertNotNull("fu should not be null", pojo.getFu());
    assertEquals("invalid fu value", xmlBean.getFu(), pojo.getFu());
    assertNotNull("bar should not be null", pojo.getBar());
    assertEquals("invalid bar value", xmlBean.getBar(), pojo.getBar());
    assertNotNull("id should not be null", pojo.getId());
    assertEquals("invalid id value", xmlBean.getId(), pojo.getId());
    assertNotNull("name should not be null", pojo.getName());
    assertEquals("invalid name value", xmlBean.getName(), pojo.getName());
  }
View Full Code Here

  @Test
  public void testXmlBeansWithNullFields() throws Exception {
    mapper = getMapper(new String[] { "xmlBeansMapping.xml" });
    ChildType xmlBean = ChildType.Factory.newInstance();

    Child pojo = mapper.map(xmlBean, Child.class);

    assertNotNull("dest obj should not be null", pojo);
    assertNull("fu should be null", pojo.getFu());
    assertNull("bar should be null", pojo.getBar());
    assertNull("id should be null", pojo.getId());
    assertNull("name should be null", pojo.getName());
    assertNull("testBoolean should be null", pojo.getTestBoolean());
    assertNull("testInt should be null", pojo.getTestInt());
  }
View Full Code Here

  @Test
  public void testXmlBeansWithNullFields() throws Exception {
    mapper = getMapper(new String[] { "xmlBeansMapping.xml" });
    ChildType xmlBean = ChildType.Factory.newInstance();

    Child pojo = mapper.map(xmlBean, Child.class);

    assertNotNull("dest obj should not be null", pojo);
    assertNull("fu should be null", pojo.getFu());
    assertNull("bar should be null", pojo.getBar());
    assertNull("id should be null", pojo.getId());
    assertNull("name should be null", pojo.getName());
    assertNull("testBoolean should be null", pojo.getTestBoolean());
    assertNull("testInt should be null", pojo.getTestInt());
  }
View Full Code Here

   * Test Case Submitted by Peter Monks 1/2007
   */
  @Test
  public void testInterfaceInheritanceViaXmlBeans_PojoToXmlBean() {
    mapper = getMapper(new String[] { "xmlBeansMapping.xml" });
    Child pojo = (Child) newInstance(Child.class);

    pojo.setId(BigInteger.valueOf(42));
    pojo.setName("Ernie");
    pojo.setFu("Fu");
    pojo.setBar("Bar");

    ChildType xmlBean = mapper.map(pojo, ChildType.class);

    assertNotNull("dest obj should not be null", xmlBean);
    assertNotNull("fu value should not be null", xmlBean.getFu());
    assertEquals("invalid fu value", pojo.getFu(), xmlBean.getFu());
    assertNotNull("bar field should not be null", xmlBean.getBar());
    assertEquals("invalid bar value", pojo.getBar(), xmlBean.getBar());
    assertNotNull("name value should not be null", xmlBean.getName());
    assertEquals("invalid name value", pojo.getName(), xmlBean.getName());
    assertNotNull("id field should not be null", xmlBean.getId());
    assertEquals("invalid id value", pojo.getId(), xmlBean.getId());
  }
View Full Code Here

    xmlBean.setId(BigInteger.valueOf(7236));
    xmlBean.setName("Bert");
    xmlBean.setFu("Uf");
    xmlBean.setBar("Rab");

    Child pojo = mapper.map(xmlBean, Child.class);

    assertNotNull("dest obj should not be null", pojo);
    assertNotNull("fu should not be null", pojo.getFu());
    assertEquals("invalid fu value", xmlBean.getFu(), pojo.getFu());
    assertNotNull("bar should not be null", pojo.getBar());
    assertEquals("invalid bar value", xmlBean.getBar(), pojo.getBar());
    assertNotNull("id should not be null", pojo.getId());
    assertEquals("invalid id value", xmlBean.getId(), pojo.getId());
    assertNotNull("name should not be null", pojo.getName());
    assertEquals("invalid name value", xmlBean.getName(), pojo.getName());
  }
View Full Code Here

TOP

Related Classes of org.dozer.vo.Child

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.