use of io.atlasmap.v2.AtlasMapping 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.v2.AtlasMapping 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.v2.AtlasMapping 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.AtlasMapping 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.AtlasMapping 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