Package org.dozer.vo.recursive

Examples of org.dozer.vo.recursive.ClassAA


public class RecursiveTest extends AbstractFunctionalTest {

  private ClassAA createTestClassAA() {

    // Create sample assureSocialDTO
    ClassAA classA = newInstance(ClassAA.class);

    classA.setNom("gbs");
    classA.setPrenom("prn");

    ClassB classB = newInstance(ClassB.class);
    classA.addSubs(classB);
    classB.setRue("rue");
    classB.setVille("ville");
    return classA;
  }
View Full Code Here


   *
   */
  @Test
  public void testConvertWithSubClass() {
    mapper = getMapper("recursivemappings.xml", "recursivemappings2.xml");
    ClassAA testAA = createTestClassAA();
    // the == is on purpose, we test that the referenced parent of the first item of the subs is the parent instance
    // itself
    ClassB testClassB = testAA.getSubs().iterator().next();
    assertTrue(testClassB.getParent() == testAA);
    ClassAAPrime testAAPrime = mapper.map(testAA, ClassAAPrime.class, null);
    // testing the new dozer3.0 bi-directionnal reference through a set
    assertEquals(testAA.getSubs().size(), testAAPrime.getSubs().size());
    // the equality is true at the data level
    ClassBPrime testClassBPrime = testAAPrime.getSubs().iterator().next();
    assertTrue(testClassBPrime.getParent().equals(testAAPrime));
    // we want the referenced parent of the first item of the subs to be the parent instance itself
    ClassBPrime testClassBPrime2 = testAAPrime.getSubs().iterator().next();
View Full Code Here

public class RecursiveTest extends AbstractFunctionalTest {

  private ClassAA createTestClassAA() {

    // Create sample assureSocialDTO
    ClassAA classA = newInstance(ClassAA.class);

    classA.setNom("gbs");
    classA.setPrenom("prn");

    ClassB classB = newInstance(ClassB.class);
    classA.addSubs(classB);
    classB.setRue("rue");
    classB.setVille("ville");
    return classA;
  }
View Full Code Here

   *
   */
  @Test
  public void testConvertWithSubClass() {
    mapper = getMapper("recursivemappings.xml", "recursivemappings2.xml");
    ClassAA testAA = createTestClassAA();
    // the == is on purpose, we test that the referenced parent of the first item of the subs is the parent instance
    // itself
    ClassB testClassB = testAA.getSubs().iterator().next();
    assertTrue(testClassB.getParent() == testAA);
    ClassAAPrime testAAPrime = mapper.map(testAA, ClassAAPrime.class, null);
    // testing the new dozer3.0 bi-directionnal reference through a set
    assertEquals(testAA.getSubs().size(), testAAPrime.getSubs().size());
    // the equality is true at the data level
    ClassBPrime testClassBPrime = testAAPrime.getSubs().iterator().next();
    assertTrue(testClassBPrime.getParent().equals(testAAPrime));
    // we want the referenced parent of the first item of the subs to be the parent instance itself
    ClassBPrime testClassBPrime2 = testAAPrime.getSubs().iterator().next();
View Full Code Here

TOP

Related Classes of org.dozer.vo.recursive.ClassAA

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.