use of io.atlasmap.java.test.TargetOrder in project atlasmap by atlasmap.
the class XmlJavaComplexTest method testProcessXmlJavaComplexOrderAutodetectAttributeNS.
@Test
public void testProcessXmlJavaComplexOrderAutodetectAttributeNS() throws Exception {
AtlasContext context = atlasContextFactory.createContext(new File("src/test/resources/xmlToJava/atlasmapping-complex-order-autodetect-attribute-ns.xml").toURI());
AtlasSession session = context.createSession();
String sourceXml = AtlasTestUtil.loadFileAsString("src/test/resources/xmlToJava/atlas-xml-complex-order-autodetect-attribute-ns.xml");
session.setDefaultSourceDocument(sourceXml);
context.process(session);
Object object = session.getDefaultTargetDocument();
assertNotNull(object);
assertTrue(object instanceof TargetOrder);
AtlasTestUtil.validateOrder((TargetOrder) object);
}
use of io.atlasmap.java.test.TargetOrder in project atlasmap by atlasmap.
the class XmlJavaComplexTest method testProcessXmlJavaComplexOrderAutodetectElement.
@Test
public void testProcessXmlJavaComplexOrderAutodetectElement() throws Exception {
AtlasContext context = atlasContextFactory.createContext(new File("src/test/resources/xmlToJava/atlasmapping-complex-order-autodetect-element.xml").toURI());
AtlasSession session = context.createSession();
String sourceXml = AtlasTestUtil.loadFileAsString("src/test/resources/xmlToJava/atlas-xml-complex-order-autodetect-element.xml");
session.setDefaultSourceDocument(sourceXml);
context.process(session);
Object object = session.getDefaultTargetDocument();
assertNotNull(object);
assertTrue(object instanceof TargetOrder);
AtlasTestUtil.validateOrder((TargetOrder) object);
}
use of io.atlasmap.java.test.TargetOrder in project atlasmap by atlasmap.
the class XmlJavaComplexTest method testProcessXmlJavaComplexOrderAutodetectElementNS.
@Test
public void testProcessXmlJavaComplexOrderAutodetectElementNS() throws Exception {
AtlasContext context = atlasContextFactory.createContext(new File("src/test/resources/xmlToJava/atlasmapping-complex-order-autodetect-element-ns.xml").toURI());
AtlasSession session = context.createSession();
String sourceXml = AtlasTestUtil.loadFileAsString("src/test/resources/xmlToJava/atlas-xml-complex-order-autodetect-element-ns.xml");
session.setDefaultSourceDocument(sourceXml);
context.process(session);
Object object = session.getDefaultTargetDocument();
assertNotNull(object);
assertTrue(object instanceof TargetOrder);
AtlasTestUtil.validateOrder((TargetOrder) object);
}
use of io.atlasmap.java.test.TargetOrder in project atlasmap by atlasmap.
the class JavaConstructServiceComplexTest method testConstructTargetParentOrder.
@Test
public void testConstructTargetParentOrder() throws Exception {
JavaClass javaClass = generateParentOrder("Target");
Object targetObject = constructService.constructClass(javaClass, null);
assertNotNull(targetObject);
assertTrue(targetObject instanceof TargetParentOrder);
TargetParentOrder parentOrder = (TargetParentOrder) targetObject;
assertNotNull(parentOrder.getOrder());
TargetOrder order = (TargetOrder) parentOrder.getOrder();
assertNotNull(order.getAddress());
assertTrue(order.getAddress() instanceof TargetAddress);
TargetAddress address = (TargetAddress) order.getAddress();
assertNull(address.getAddressLine1());
assertNull(address.getAddressLine2());
assertNull(address.getCity());
assertNull(address.getState());
assertNull(address.getZipCode());
assertNotNull(order.getContact());
assertTrue(order.getContact() instanceof TargetContact);
TargetContact contact = (TargetContact) order.getContact();
assertNull(contact.getFirstName());
assertNull(contact.getLastName());
assertNull(contact.getPhoneNumber());
assertNull(contact.getZipCode());
}
use of io.atlasmap.java.test.TargetOrder in project atlasmap by atlasmap.
the class JavaConstructServiceComplexTest method testConstructTargetOrder.
@Test
public void testConstructTargetOrder() throws Exception {
Object targetObject = constructService.constructClass(generateOrder("Target"), null);
assertNotNull(targetObject);
assertTrue(targetObject instanceof TargetOrder);
TargetOrder order = (TargetOrder) targetObject;
assertNotNull(order.getAddress());
assertTrue(order.getAddress() instanceof TargetAddress);
TargetAddress address = (TargetAddress) order.getAddress();
assertNull(address.getAddressLine1());
assertNull(address.getAddressLine2());
assertNull(address.getCity());
assertNull(address.getState());
assertNull(address.getZipCode());
assertNotNull(order.getContact());
assertTrue(order.getContact() instanceof TargetContact);
TargetContact contact = (TargetContact) order.getContact();
assertNull(contact.getFirstName());
assertNull(contact.getLastName());
assertNull(contact.getPhoneNumber());
assertNull(contact.getZipCode());
}
Aggregations