Search in sources :

Example 1 with XmlFlatBoxedPrimitiveElement

use of io.atlasmap.xml.test.v2.XmlFlatBoxedPrimitiveElement in project atlasmap by atlasmap.

the class XmlXmlFlatMappingTest method testProcessXmlXmlBoxedFlatMappingPrimitiveAttributeToElementNS.

@Test
public void testProcessXmlXmlBoxedFlatMappingPrimitiveAttributeToElementNS() throws Exception {
    AtlasContext context = atlasContextFactory.createContext(new File("src/test/resources/xmlToXml/atlasmapping-boxedflatprimitive-attributeToElement-ns.xml"));
    AtlasSession session = context.createSession();
    String sourceXml = AtlasTestUtil.loadFileAsString("src/test/resources/xmlToXml/atlas-xml-boxedflatprimitive-attribute-ns.xml");
    session.setDefaultSourceDocument(sourceXml);
    context.process(session);
    assertFalse(printAudit(session), session.hasErrors());
    Object object = session.getDefaultTargetDocument();
    assertNotNull(object);
    assertTrue(object instanceof String);
    JAXBElement<XmlFlatBoxedPrimitiveElement> xmlFPE = AtlasXmlTestHelper.unmarshal((String) object, XmlFlatBoxedPrimitiveElement.class);
    AtlasTestUtil.validateXmlFlatPrimitiveBoxedPrimitiveElementFields(xmlFPE.getValue());
}
Also used : AtlasContext(io.atlasmap.api.AtlasContext) XmlFlatBoxedPrimitiveElement(io.atlasmap.xml.test.v2.XmlFlatBoxedPrimitiveElement) File(java.io.File) AtlasSession(io.atlasmap.api.AtlasSession) Test(org.junit.Test) AtlasMappingBaseTest(io.atlasmap.reference.AtlasMappingBaseTest)

Aggregations

AtlasContext (io.atlasmap.api.AtlasContext)1 AtlasSession (io.atlasmap.api.AtlasSession)1 AtlasMappingBaseTest (io.atlasmap.reference.AtlasMappingBaseTest)1 XmlFlatBoxedPrimitiveElement (io.atlasmap.xml.test.v2.XmlFlatBoxedPrimitiveElement)1 File (java.io.File)1 Test (org.junit.Test)1