use of io.atlasmap.v2.Mappings in project atlasmap by atlasmap.
the class JsonJavaFlatMappingTest method generateJsonJavaFlatMapping.
protected AtlasMapping generateJsonJavaFlatMapping() {
AtlasMapping atlasMapping = AtlasModelFactory.createAtlasMapping();
atlasMapping.setName("JsonJavaFlatMapping");
atlasMapping.getDataSource().add(generateDataSource("atlas:json", DataSourceType.SOURCE));
atlasMapping.getDataSource().add(generateDataSource("atlas:java?className=io.atlasmap.java.test.TargetFlatPrimitiveClass", DataSourceType.TARGET));
List<BaseMapping> mappings = atlasMapping.getMappings().getMapping();
// Add fieldMappings
for (String fieldName : FLAT_FIELDS) {
Mapping mfm = AtlasModelFactory.createMapping(MappingType.MAP);
mfm.getInputField().add(generateJsonField("/" + fieldName));
mfm.getOutputField().add(generateJavaField("/" + fieldName));
mappings.add(mfm);
}
return atlasMapping;
}
use of io.atlasmap.v2.Mappings in project atlasmap by atlasmap.
the class JsonJsonFlatMappingTest method generateJsonJsonFlatMapping.
protected AtlasMapping generateJsonJsonFlatMapping() {
AtlasMapping atlasMapping = AtlasModelFactory.createAtlasMapping();
atlasMapping.setName("JsonJsonFlatMapping");
atlasMapping.getDataSource().add(generateDataSource("atlas:json", DataSourceType.SOURCE));
atlasMapping.getDataSource().add(generateDataSource("atlas:json", DataSourceType.TARGET));
List<BaseMapping> mappings = atlasMapping.getMappings().getMapping();
// Add fieldMappings
for (String fieldName : FLAT_FIELDS) {
Mapping mfm = AtlasModelFactory.createMapping(MappingType.MAP);
mfm.getInputField().add(generateJsonField(fieldName));
mfm.getOutputField().add(generateJavaField(fieldName));
mappings.add(mfm);
}
return atlasMapping;
}
use of io.atlasmap.v2.Mappings 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"));
}
use of io.atlasmap.v2.Mappings in project atlasmap by atlasmap.
the class XmlJsonFlatMappingTest method testCreateXmlJsonFlatFieldMapping.
@Test
public void testCreateXmlJsonFlatFieldMapping() throws Exception {
AtlasMapping atlasMapping = generateXmlJsonFlatMapping();
AtlasMappingService atlasMappingService = new AtlasMappingService(Arrays.asList("io.atlasmap.v2", "io.atlasmap.json.v2", "io.atlasmap.xml.v2"));
File path = new File("target/reference-mappings/xmlToJson");
path.mkdirs();
atlasMappingService.saveMappingAsFile(atlasMapping, new File(path, "atlasmapping-flatprimitive.xml"));
}
use of io.atlasmap.v2.Mappings in project atlasmap by atlasmap.
the class XmlJsonFlatMappingTest method generateXmlJsonFlatMapping.
protected AtlasMapping generateXmlJsonFlatMapping() {
AtlasMapping atlasMapping = AtlasModelFactory.createAtlasMapping();
atlasMapping.setName("XmlJsonFlatMapping");
atlasMapping.getDataSource().add(generateDataSource("atlas:xml?complexType=XmlFlatPrimitiveAttribute", DataSourceType.SOURCE));
atlasMapping.getDataSource().add(generateDataSource("atlas:json", DataSourceType.TARGET));
List<BaseMapping> mappings = atlasMapping.getMappings().getMapping();
// Add fieldMappings
for (String fieldName : FLAT_FIELDS) {
Mapping mfm = AtlasModelFactory.createMapping(MappingType.MAP);
mfm.getInputField().add(generateXmlField("/XmlFPA/", fieldName));
mfm.getOutputField().add(generateJsonField(fieldName));
mappings.add(mfm);
}
return atlasMapping;
}
Aggregations