Search in sources :

Example 1 with XmlFlatPrimitiveAttribute

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

the class XmlXmlFlatMappingTest method testProcessXmlXmlFlatPrimitiveElementToAtributeNoMappedBoxedFieldsNS.

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

Example 2 with XmlFlatPrimitiveAttribute

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

the class XmlXmlFlatMappingTest method testProcessXmlXmlFlatPrimitiveElementToAttributeNS.

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

Aggregations

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