use of io.atlasmap.java.test.BaseOrderList in project atlasmap by atlasmap.
the class AtlasTestUtil method generateOrderListClass.
public static BaseOrderList generateOrderListClass(Class<? extends BaseOrderList> orderListClazz, Class<? extends BaseOrder> orderClazz, Class<? extends BaseAddress> addressClazz, Class<? extends BaseContact> contactClazz) throws Exception {
Class<?> targetClazz = AtlasTestUtil.class.getClassLoader().loadClass(orderListClazz.getName());
BaseOrderList orderList = (BaseOrderList) targetClazz.newInstance();
orderList.setNumberOrders(5);
orderList.setOrderBatchNumber(4123562);
for (int i = 0; i < 5; i++) {
BaseOrder baseOrder = generateOrderClass(orderClazz, addressClazz, contactClazz);
baseOrder.setOrderId(i);
if (orderList.getOrders() == null) {
orderList.setOrders(new ArrayList<BaseOrder>());
}
orderList.getOrders().add(baseOrder);
}
return orderList;
}
use of io.atlasmap.java.test.BaseOrderList in project atlasmap by atlasmap.
the class JavaJavaComplexListTest method testProcessJavaJavaComplexAutoDetectFullTest.
@Test
@Ignore("https://github.com/atlasmap/atlasmap-runtime/issues/229 - Allow default implementation for abstract target field")
public void testProcessJavaJavaComplexAutoDetectFullTest() throws Exception {
AtlasContext context = atlasContextFactory.createContext(new File("src/test/resources/javaToJava/atlasmapping-complex-list-autodetect-full.xml"));
AtlasSession session = context.createSession();
BaseOrderList sourceOrderList = AtlasTestUtil.generateOrderListClass(SourceOrderList.class, SourceOrder.class, SourceAddress.class, SourceContact.class);
session.setDefaultSourceDocument(sourceOrderList);
context.process(session);
Object object = session.getDefaultTargetDocument();
assertNotNull(object);
assertTrue(object instanceof TargetOrderList);
AtlasTestUtil.validateOrderList((TargetOrderList) object);
}
use of io.atlasmap.java.test.BaseOrderList in project atlasmap by atlasmap.
the class AtlasTestUtil method generateOrderListClass.
public static BaseOrderList generateOrderListClass(Class<? extends BaseOrderList> orderListClazz, Class<? extends BaseOrder> orderClazz, Class<? extends BaseAddress> addressClazz, Class<? extends BaseContact> contactClazz) throws Exception {
Class<?> targetClazz = AtlasTestUtil.class.getClassLoader().loadClass(orderListClazz.getName());
BaseOrderList orderList = (BaseOrderList) targetClazz.newInstance();
orderList.setNumberOrders(5);
orderList.setOrderBatchNumber(4123562);
for (int i = 0; i < 5; i++) {
BaseOrder baseOrder = generateOrderClass(orderClazz, addressClazz, contactClazz);
baseOrder.setOrderId(i);
if (orderList.getOrders() == null) {
orderList.setOrders(new ArrayList<BaseOrder>());
}
orderList.getOrders().add(baseOrder);
}
return orderList;
}
use of io.atlasmap.java.test.BaseOrderList in project atlasmap by atlasmap.
the class JavaJavaComplexListTest method testProcessJavaJavaComplexAutoDetectBaseTest.
@Test
@Ignore("https://github.com/atlasmap/atlasmap-runtime/issues/229 - Allow default implementation for abstract target field")
public void testProcessJavaJavaComplexAutoDetectBaseTest() throws Exception {
AtlasContext context = atlasContextFactory.createContext(new File("src/test/resources/javaToJava/atlasmapping-complex-list-autodetect-base.xml"));
AtlasSession session = context.createSession();
BaseOrderList sourceOrderList = AtlasTestUtil.generateOrderListClass(SourceOrderList.class, SourceOrder.class, SourceAddress.class, SourceContact.class);
session.setDefaultSourceDocument(sourceOrderList);
context.process(session);
Object object = session.getDefaultTargetDocument();
assertNotNull(object);
assertTrue(object instanceof TargetOrderList);
AtlasTestUtil.validateOrderList((TargetOrderList) object);
}
use of io.atlasmap.java.test.BaseOrderList in project atlasmap by atlasmap.
the class JavaJavaComplexListTest method testProcessJavaJavaComplexAutoDetectBaseNoAbstractTest.
@Test
public void testProcessJavaJavaComplexAutoDetectBaseNoAbstractTest() throws Exception {
AtlasContext context = atlasContextFactory.createContext(new File("src/test/resources/javaToJava/atlasmapping-complex-list-autodetect-base-no-abstract.xml"));
AtlasSession session = context.createSession();
BaseOrderList sourceOrderList = AtlasTestUtil.generateOrderListClass(SourceOrderList.class, SourceOrder.class, SourceAddress.class, SourceContact.class);
session.setDefaultSourceDocument(sourceOrderList);
context.process(session);
Object object = session.getDefaultTargetDocument();
assertNotNull(object);
assertTrue(object instanceof NoAbstractTargetOrderList);
AtlasTestUtil.validateOrderList((NoAbstractTargetOrderList) object);
}
Aggregations