use of io.atlasmap.core.AtlasMappingService in project atlasmap by atlasmap.
the class AtlasMapXmlToJson method testConvertXmlToJson.
@Test
public void testConvertXmlToJson() throws Exception {
String sourceXmlPath = "src/test/resources/atlasmapping.xml";
String destJsonPath = "src/test/resources/atlasmapping.json";
AtlasMappingService atlasMappingService = DefaultAtlasContextFactory.getInstance().getMappingService();
AtlasMapping mappingFromXml = atlasMappingService.loadMapping(sourceXmlPath, AtlasMappingFormat.XML);
atlasMappingService.saveMappingAsFile(mappingFromXml, new File(destJsonPath), AtlasMappingFormat.JSON);
AtlasMapping mappingFromJson = atlasMappingService.loadMapping(destJsonPath, AtlasMappingFormat.JSON);
assertEquals(mappingFromXml.getName(), mappingFromJson.getName());
assertEquals(mappingFromXml.getDataSource().size(), mappingFromJson.getDataSource().size());
assertEquals(mappingFromXml.getMappings().getMapping().size(), mappingFromJson.getMappings().getMapping().size());
}
use of io.atlasmap.core.AtlasMappingService in project atlasmap by atlasmap.
the class JavaJavaFlatMappingTest method testCreateJavaJavaFlatFieldMapping.
@Test
public void testCreateJavaJavaFlatFieldMapping() throws Exception {
AtlasMapping atlasMapping = generateJavaJavaFlatMapping();
AtlasMappingService atlasMappingService = new AtlasMappingService(Arrays.asList("io.atlasmap.v2", "io.atlasmap.java.v2"));
File path = new File("target/reference-mappings/javaToJava");
path.mkdirs();
atlasMappingService.saveMappingAsFile(atlasMapping, new File(path, "atlasmapping-flatprimitive.xml"));
}
use of io.atlasmap.core.AtlasMappingService in project atlasmap by atlasmap.
the class JavaJsonFlatMappingTest method testCreateJavaJsonFlatFieldMappings.
@Test
public void testCreateJavaJsonFlatFieldMappings() throws Exception {
AtlasMapping atlasMapping = generateJsonJavaFlatMapping();
AtlasMappingService atlasMappingService = new AtlasMappingService(Arrays.asList("io.atlasmap.v2", "io.atlasmap.java.v2", "io.atlasmap.json.v2"));
File path = new File("target/reference-mappings/javaToJson");
path.mkdirs();
atlasMappingService.saveMappingAsFile(atlasMapping, new File(path, "atlasmapping-flatprimitive.xml"));
}
use of io.atlasmap.core.AtlasMappingService in project atlasmap by atlasmap.
the class JsonJavaFlatMappingTest method testCreateJsonJavaFlatFieldMappings.
@Test
public void testCreateJsonJavaFlatFieldMappings() throws Exception {
AtlasMapping atlasMapping = generateJsonJavaFlatMapping();
AtlasMappingService atlasMappingService = new AtlasMappingService(Arrays.asList("io.atlasmap.v2", "io.atlasmap.java.v2", "io.atlasmap.json.v2"));
File path = new File("target/reference-mappings/jsonToJava");
path.mkdirs();
atlasMappingService.saveMappingAsFile(atlasMapping, new File(path, "atlasmapping-flatprimitive.xml"));
}
use of io.atlasmap.core.AtlasMappingService in project atlasmap by atlasmap.
the class XmlJavaFlatMappingTest method testCreateXmlJavaFlatFieldMapping.
@Test
public void testCreateXmlJavaFlatFieldMapping() throws Exception {
AtlasMapping atlasMapping = generateXmlJavaFlatMapping();
AtlasMappingService atlasMappingService = new AtlasMappingService(Arrays.asList("io.atlasmap.v2", "io.atlasmap.java.v2", "io.atlasmap.xml.v2"));
File path = new File("target/reference-mappings/xmlToJava");
path.mkdirs();
atlasMappingService.saveMappingAsFile(atlasMapping, new File(path, "atlasmapping-flatprimitive.xml"));
}
Aggregations