Search in sources :

Example 6 with Actions

use of io.atlasmap.v2.Actions in project atlasmap by atlasmap.

the class BaseMarshallerTest method generateConstantMapping.

protected AtlasMapping generateConstantMapping() {
    AtlasMapping mapping = generateAtlasMapping();
    ConstantField inputField = new ConstantField();
    Actions actions = new Actions();
    actions.getActions().add(new Trim());
    populateFieldComplexObject(inputField, actions, CollectionType.ARRAY, FieldStatus.SUPPORTED, FieldType.INTEGER);
    populateFieldSimpleObject(inputField, 3, "docid", "/path", false, "bar");
    Mapping fm = (Mapping) mapping.getMappings().getMapping().get(0);
    fm.getInputField().add(inputField);
    fm.getOutputField().add(inputField);
    populateMapping(fm, MappingType.MAP, "MapPropertyFieldAlias", ",", ",");
    populateMappingString(fm, "description", "id", "lookupTableName", "strategy", "strategyClassName");
    return mapping;
}
Also used : AtlasMapping(io.atlasmap.v2.AtlasMapping) ConstantField(io.atlasmap.v2.ConstantField) Actions(io.atlasmap.v2.Actions) Trim(io.atlasmap.v2.Trim) Mapping(io.atlasmap.v2.Mapping) AtlasMapping(io.atlasmap.v2.AtlasMapping)

Example 7 with Actions

use of io.atlasmap.v2.Actions in project atlasmap by atlasmap.

the class BaseMarshallerTest method generateSeparateAtlasMapping.

protected AtlasMapping generateSeparateAtlasMapping() {
    Actions actions = generateActions();
    StringList annotations = generateAnnotations();
    ModifierList modifierList = generateModifierList();
    StringList parameterizedTypes = generateParameterizedTypes();
    JavaField inputJavaField = generateJavaField(actions, annotations, modifierList, parameterizedTypes);
    JavaField outputJavaFieldA = generateJavaField(actions, annotations, modifierList, parameterizedTypes);
    JavaField outputJavaFieldB = generateJavaField(actions, annotations, modifierList, parameterizedTypes);
    Mapping fm = (Mapping) AtlasModelFactory.createMapping(MappingType.SEPARATE);
    fm.getInputField().add(inputJavaField);
    fm.getOutputField().add(outputJavaFieldA);
    fm.getOutputField().add(outputJavaFieldB);
    populateMapping(fm, MappingType.SEPARATE, "MapPropertyFieldAlias", ",", ",");
    populateMappingString(fm, "description", "id", "lookupTableName", "strategy", "strategyClassName");
    AtlasMapping mapping = generateAtlasMapping();
    mapping.getMappings().getMapping().clear();
    mapping.getMappings().getMapping().add(fm);
    return mapping;
}
Also used : AtlasMapping(io.atlasmap.v2.AtlasMapping) Actions(io.atlasmap.v2.Actions) StringList(io.atlasmap.v2.StringList) Mapping(io.atlasmap.v2.Mapping) AtlasMapping(io.atlasmap.v2.AtlasMapping)

Example 8 with Actions

use of io.atlasmap.v2.Actions in project atlasmap by atlasmap.

the class BaseMarshallerTest method generateCombineMapping.

protected AtlasMapping generateCombineMapping() {
    Actions actions = generateActions();
    StringList annotations = generateAnnotations();
    ModifierList modifierList = generateModifierList();
    StringList parameterizedTypes = generateParameterizedTypes();
    JavaField inputJavaField = generateJavaField(actions, annotations, modifierList, parameterizedTypes);
    JavaField inputJavaFieldB = generateJavaField(actions, annotations, modifierList, parameterizedTypes);
    JavaField outputJavaFieldA = generateJavaField(actions, annotations, modifierList, parameterizedTypes);
    Mapping fm = (Mapping) AtlasModelFactory.createMapping(MappingType.COMBINE);
    fm.getInputField().add(inputJavaField);
    fm.getInputField().add(inputJavaFieldB);
    fm.getOutputField().add(outputJavaFieldA);
    populateMapping(fm, MappingType.COMBINE, "MapPropertyFieldAlias", ",", ",");
    populateMappingString(fm, "description", "id", "lookupTableName", "strategy", "strategyClassName");
    AtlasMapping mapping = generateAtlasMapping();
    mapping.getMappings().getMapping().clear();
    mapping.getMappings().getMapping().add(fm);
    generateProperties(mapping);
    return mapping;
}
Also used : AtlasMapping(io.atlasmap.v2.AtlasMapping) Actions(io.atlasmap.v2.Actions) StringList(io.atlasmap.v2.StringList) Mapping(io.atlasmap.v2.Mapping) AtlasMapping(io.atlasmap.v2.AtlasMapping)

Example 9 with Actions

use of io.atlasmap.v2.Actions in project atlasmap by atlasmap.

the class BaseMarshallerTest method generateAtlasMapping.

protected AtlasMapping generateAtlasMapping() {
    AtlasMapping atlasMapping = AtlasModelFactory.createAtlasMapping();
    atlasMapping.setName("junit");
    generateDataSource(atlasMapping);
    generateLookupTables(atlasMapping);
    Actions actions = generateActions();
    StringList annotations = generateAnnotations();
    ModifierList modifierList = generateModifierList();
    StringList parameterizedTypes = generateParameterizedTypes();
    JavaField inputField = generateJavaField(actions, annotations, modifierList, parameterizedTypes);
    JavaField outputField = generateJavaField(actions, annotations, modifierList, parameterizedTypes);
    Mapping fm = AtlasModelFactory.createMapping(MappingType.MAP);
    fm.getInputField().add(inputField);
    fm.getOutputField().add(outputField);
    populateMapping(fm, MappingType.MAP, "MapPropertyFieldAlias", ",", ",");
    populateMappingString(fm, "description", "id", "lookupTableName", "strategy", "strategyClassName");
    atlasMapping.getMappings().getMapping().add(fm);
    generateProperties(atlasMapping);
    return atlasMapping;
}
Also used : AtlasMapping(io.atlasmap.v2.AtlasMapping) Actions(io.atlasmap.v2.Actions) StringList(io.atlasmap.v2.StringList) Mapping(io.atlasmap.v2.Mapping) AtlasMapping(io.atlasmap.v2.AtlasMapping)

Example 10 with Actions

use of io.atlasmap.v2.Actions in project atlasmap by atlasmap.

the class BaseMarshallerTest method generatePropertyReferenceMapping.

protected AtlasMapping generatePropertyReferenceMapping() {
    AtlasMapping mapping = generateAtlasMapping();
    PropertyField inputField = new PropertyField();
    inputField.setName("foo");
    Actions actions = new Actions();
    actions.getActions().add(new Trim());
    populateFieldComplexObject(inputField, actions, CollectionType.ARRAY, FieldStatus.SUPPORTED, FieldType.INTEGER);
    populateFieldSimpleObject(inputField, 3, "docid", "/path", false, "bar");
    Mapping fm = (Mapping) mapping.getMappings().getMapping().get(0);
    fm.getInputField().add(inputField);
    fm.getOutputField().add(inputField);
    populateMapping(fm, MappingType.MAP, "MapPropertyFieldAlias", ",", ",");
    populateMappingString(fm, "description", "id", "lookupTableName", "strategy", "strategyClassName");
    generateProperties(mapping);
    return mapping;
}
Also used : AtlasMapping(io.atlasmap.v2.AtlasMapping) PropertyField(io.atlasmap.v2.PropertyField) Actions(io.atlasmap.v2.Actions) Trim(io.atlasmap.v2.Trim) Mapping(io.atlasmap.v2.Mapping) AtlasMapping(io.atlasmap.v2.AtlasMapping)

Aggregations

Actions (io.atlasmap.v2.Actions)15 AtlasMapping (io.atlasmap.v2.AtlasMapping)10 Mapping (io.atlasmap.v2.Mapping)9 Test (org.junit.Test)8 Trim (io.atlasmap.v2.Trim)7 SimpleField (io.atlasmap.v2.SimpleField)5 ActionDetail (io.atlasmap.v2.ActionDetail)4 Capitalize (io.atlasmap.v2.Capitalize)4 Lowercase (io.atlasmap.v2.Lowercase)4 SeparateByDash (io.atlasmap.v2.SeparateByDash)4 SeparateByUnderscore (io.atlasmap.v2.SeparateByUnderscore)4 StringList (io.atlasmap.v2.StringList)4 TrimLeft (io.atlasmap.v2.TrimLeft)4 TrimRight (io.atlasmap.v2.TrimRight)4 Uppercase (io.atlasmap.v2.Uppercase)4 Camelize (io.atlasmap.v2.Camelize)3 Field (io.atlasmap.v2.Field)3 Length (io.atlasmap.v2.Length)3 Mappings (io.atlasmap.v2.Mappings)3 File (java.io.File)3