Search in sources :

Example 21 with TargetFlatPrimitiveClass

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;
}
Also used : TargetFlatPrimitiveClass(io.atlasmap.java.test.TargetFlatPrimitiveClass) AtlasContext(io.atlasmap.api.AtlasContext) BaseFlatPrimitiveClass(io.atlasmap.java.test.BaseFlatPrimitiveClass) File(java.io.File) AtlasSession(io.atlasmap.api.AtlasSession)

Example 22 with TargetFlatPrimitiveClass

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;
}
Also used : TargetFlatPrimitiveClass(io.atlasmap.java.test.TargetFlatPrimitiveClass)

Example 23 with TargetFlatPrimitiveClass

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;
}
Also used : TargetFlatPrimitiveClass(io.atlasmap.java.test.TargetFlatPrimitiveClass) AtlasContext(io.atlasmap.api.AtlasContext) BaseFlatPrimitiveClass(io.atlasmap.java.test.BaseFlatPrimitiveClass) File(java.io.File) AtlasSession(io.atlasmap.api.AtlasSession)

Example 24 with TargetFlatPrimitiveClass

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);
}
Also used : TargetFlatPrimitiveClass(io.atlasmap.java.test.TargetFlatPrimitiveClass) AtlasContext(io.atlasmap.api.AtlasContext) BaseFlatPrimitiveClass(io.atlasmap.java.test.BaseFlatPrimitiveClass) File(java.io.File) AtlasSession(io.atlasmap.api.AtlasSession) AtlasMappingBaseTest(io.atlasmap.reference.AtlasMappingBaseTest) Test(org.junit.Test)

Example 25 with TargetFlatPrimitiveClass

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);
}
Also used : TargetFlatPrimitiveClass(io.atlasmap.java.test.TargetFlatPrimitiveClass) AtlasContext(io.atlasmap.api.AtlasContext) BaseFlatPrimitiveClass(io.atlasmap.java.test.BaseFlatPrimitiveClass) File(java.io.File) AtlasSession(io.atlasmap.api.AtlasSession) AtlasMappingBaseTest(io.atlasmap.reference.AtlasMappingBaseTest) Test(org.junit.Test)

Aggregations

TargetFlatPrimitiveClass (io.atlasmap.java.test.TargetFlatPrimitiveClass)30 AtlasContext (io.atlasmap.api.AtlasContext)24 AtlasSession (io.atlasmap.api.AtlasSession)24 File (java.io.File)22 Test (org.junit.Test)22 AtlasMappingBaseTest (io.atlasmap.reference.AtlasMappingBaseTest)18 BaseFlatPrimitiveClass (io.atlasmap.java.test.BaseFlatPrimitiveClass)6 SourceFlatPrimitiveClass (io.atlasmap.java.test.SourceFlatPrimitiveClass)3 AtlasException (io.atlasmap.api.AtlasException)2 TargetAddress (io.atlasmap.java.test.TargetAddress)2 TargetOrder (io.atlasmap.java.test.TargetOrder)2 TargetOrderArray (io.atlasmap.java.test.TargetOrderArray)2 TargetTestClass (io.atlasmap.java.test.TargetTestClass)2 TestListOrders (io.atlasmap.java.test.TestListOrders)2 BaseOrder (io.atlasmap.java.test.BaseOrder)1 StateEnumClassLong (io.atlasmap.java.test.StateEnumClassLong)1 TargetContact (io.atlasmap.java.test.TargetContact)1 AtlasJsonTestUnrootedMapper (io.atlasmap.json.test.AtlasJsonTestUnrootedMapper)1 TargetFlatPrimitive (io.atlasmap.json.test.TargetFlatPrimitive)1 Validation (io.atlasmap.v2.Validation)1