use of io.atlasmap.java.test.TargetFlatPrimitiveClass in project atlasmap by atlasmap.
the class JavaJavaAutoConversionTest method executeMapping.
protected Object executeMapping(String fileName) throws Exception {
AtlasContext context = atlasContextFactory.createContext(new File(fileName).toURI());
AtlasSession session = context.createSession();
BaseFlatPrimitiveClass sourceObject = AtlasTestUtil.generateFlatPrimitiveClass(SourceFlatPrimitiveClass.class);
session.setDefaultSourceDocument(sourceObject);
context.process(session);
assertFalse(printAudit(session), session.hasErrors());
Object object = session.getDefaultTargetDocument();
assertNotNull(object);
assertTrue(object instanceof TargetFlatPrimitiveClass);
return object;
}
use of io.atlasmap.java.test.TargetFlatPrimitiveClass in project atlasmap by atlasmap.
the class JavaJavaFieldActionsTest method createSource.
@Override
public Object createSource(String sourceFirstName) {
TargetFlatPrimitiveClass c = new TargetFlatPrimitiveClass();
c.setBoxedStringField(sourceFirstName);
return c;
}
use of io.atlasmap.java.test.TargetFlatPrimitiveClass in project atlasmap by atlasmap.
the class JavaJsonAutoConversionTest method executeMapping2.
protected Object executeMapping2(String fileName) throws Exception {
AtlasContext context = atlasContextFactory.createContext(new File(fileName).toURI());
AtlasSession session = context.createSession();
BaseFlatPrimitiveClass sourceObject = AtlasTestUtil.generateFlatPrimitiveClass(SourceFlatPrimitiveClass.class);
session.setDefaultSourceDocument(sourceObject);
context.process(session);
assertFalse(printAudit(session), session.hasErrors());
Object object = session.getDefaultTargetDocument();
assertNotNull(object);
assertTrue(object instanceof TargetFlatPrimitiveClass);
return object;
}
use of io.atlasmap.java.test.TargetFlatPrimitiveClass in project atlasmap by atlasmap.
the class JavaJavaFlatMappingTest method testProcessJavaJavaFlatFieldMapping.
@Test
public void testProcessJavaJavaFlatFieldMapping() throws Exception {
AtlasContext context = atlasContextFactory.createContext(new File("src/test/resources/javaToJava/atlasmapping-flatprimitive.xml").toURI());
AtlasSession session = context.createSession();
BaseFlatPrimitiveClass sourceClass = generateFlatPrimitiveClass(SourceFlatPrimitiveClass.class);
session.setDefaultSourceDocument(sourceClass);
context.process(session);
Object object = session.getDefaultTargetDocument();
assertNotNull(object);
assertTrue(object instanceof TargetFlatPrimitiveClass);
validateFlatPrimitiveClassPrimitiveFields((TargetFlatPrimitiveClass) object);
}
use of io.atlasmap.java.test.TargetFlatPrimitiveClass in project atlasmap by atlasmap.
the class JavaJavaFlatMappingTest method testProcessJavaJavaFlatFieldMappingBoxedPrimitives.
@Test
public void testProcessJavaJavaFlatFieldMappingBoxedPrimitives() throws Exception {
AtlasContext context = atlasContextFactory.createContext(new File("src/test/resources/javaToJava/atlasmapping-flatprimitive-boxed.xml").toURI());
AtlasSession session = context.createSession();
BaseFlatPrimitiveClass sourceClass = generateFlatPrimitiveClassBoxedPrimitiveFieldsBoxedValues(SourceFlatPrimitiveClass.class);
session.setDefaultSourceDocument(sourceClass);
context.process(session);
Object object = session.getDefaultTargetDocument();
assertNotNull(object);
assertTrue(object instanceof TargetFlatPrimitiveClass);
validateFlatPrimitiveClassBoxedPrimitiveFields((TargetFlatPrimitiveClass) object);
}
Aggregations