public void testComplex0Mapping() { final GenerateMapperComplex0 mapper = new GenerateMapperComplex0(); mapper.source = new SourceObject(); final InnerSourceClass1 src1 = new InnerSourceClass1(); mapper.source.setSrc1(src1); InnerSourceClass2[] tgArray = new InnerSourceClass2[] {new InnerSourceClass2()}; src1.setTgArray(tgArray); tgArray[0].setSource("value"); mapper.target = new TargetObject(); mapper.map(); final InnerTargetClass1 target3 = mapper.target.getTarget3(); assertNotNull(target3); final String[] stringArray = target3.getStringArray(); assertNotNull(stringArray); assertEquals("value", stringArray[2]); }
public void testComplex2Mapping() { final GenerateMapperComplex2 mapper = new GenerateMapperComplex2(); mapper.source = new SourceObject(); final InnerSourceClass1 src1 = new InnerSourceClass1(); mapper.source.setSrc1(src1); InnerSourceClass2[] tgArray = new InnerSourceClass2[] {new InnerSourceClass2()}; src1.setTgArray(tgArray); tgArray[0].setSource("value"); mapper.target = new TargetObject(); mapper.map(); final InnerTargetClass1 target3 = mapper.target.getTarget3(); assertNotNull(target3); final ArrayList stringList = target3.getStringList(); assertNotNull(stringList); final String tg1 = (String) stringList.get(2); assertEquals("value", tg1); }