Search in sources :

Example 1 with TargetOrderList

use of io.atlasmap.java.test.TargetOrderList in project atlasmap by atlasmap.

the class JavaConstructServiceComplexListTest method testConstructTargetOrderList.

@Test
public void testConstructTargetOrderList() throws Exception {
    Object targetObject = constructService.constructClass(generateOrderList("Target"), null);
    assertNotNull(targetObject);
    assertTrue(targetObject instanceof TargetOrderList);
    TargetOrderList orderList = (TargetOrderList) targetObject;
    assertNotNull(orderList.getOrders());
    assertTrue(orderList.getOrders().isEmpty());
    assertNull(orderList.getNumberOrders());
    assertNull(orderList.getOrderBatchNumber());
}
Also used : TargetOrderList(io.atlasmap.java.test.TargetOrderList) Test(org.junit.Test)

Example 2 with TargetOrderList

use of io.atlasmap.java.test.TargetOrderList in project atlasmap by atlasmap.

the class JavaConstructServiceComplexListTest method testConstructTargetOrderListFiltered.

@Test
public void testConstructTargetOrderListFiltered() throws Exception {
    Object targetObject = constructService.constructClass(generateOrderList("Target"), new ArrayList<String>());
    assertNotNull(targetObject);
    assertTrue(targetObject instanceof TargetOrderList);
    TargetOrderList orderList = (TargetOrderList) targetObject;
    assertNotNull(orderList.getOrders());
    assertTrue(orderList.getOrders().isEmpty());
    assertNull(orderList.getNumberOrders());
}
Also used : TargetOrderList(io.atlasmap.java.test.TargetOrderList) Test(org.junit.Test)

Example 3 with TargetOrderList

use of io.atlasmap.java.test.TargetOrderList 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);
}
Also used : AtlasContext(io.atlasmap.api.AtlasContext) NoAbstractTargetOrderList(io.atlasmap.reference.NoAbstractTargetOrderList) TargetOrderList(io.atlasmap.java.test.TargetOrderList) File(java.io.File) AtlasSession(io.atlasmap.api.AtlasSession) BaseOrderList(io.atlasmap.java.test.BaseOrderList) Ignore(org.junit.Ignore) AtlasMappingBaseTest(io.atlasmap.reference.AtlasMappingBaseTest) Test(org.junit.Test)

Example 4 with TargetOrderList

use of io.atlasmap.java.test.TargetOrderList 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);
}
Also used : AtlasContext(io.atlasmap.api.AtlasContext) NoAbstractTargetOrderList(io.atlasmap.reference.NoAbstractTargetOrderList) TargetOrderList(io.atlasmap.java.test.TargetOrderList) File(java.io.File) AtlasSession(io.atlasmap.api.AtlasSession) BaseOrderList(io.atlasmap.java.test.BaseOrderList) Ignore(org.junit.Ignore) AtlasMappingBaseTest(io.atlasmap.reference.AtlasMappingBaseTest) Test(org.junit.Test)

Aggregations

TargetOrderList (io.atlasmap.java.test.TargetOrderList)4 Test (org.junit.Test)4 AtlasContext (io.atlasmap.api.AtlasContext)2 AtlasSession (io.atlasmap.api.AtlasSession)2 BaseOrderList (io.atlasmap.java.test.BaseOrderList)2 AtlasMappingBaseTest (io.atlasmap.reference.AtlasMappingBaseTest)2 NoAbstractTargetOrderList (io.atlasmap.reference.NoAbstractTargetOrderList)2 File (java.io.File)2 Ignore (org.junit.Ignore)2