use of io.atlasmap.java.test.BaseFlatPrimitiveClass in project atlasmap by atlasmap.
the class MultidocFlatMappingTest method generateFlatPrimitiveClass.
private BaseFlatPrimitiveClass generateFlatPrimitiveClass(Class<? extends BaseFlatPrimitiveClass> clazz) throws Exception {
Class<?> targetClazz = this.getClass().getClassLoader().loadClass(clazz.getName());
BaseFlatPrimitiveClass newObject = (BaseFlatPrimitiveClass) targetClazz.newInstance();
newObject.setBooleanField(false);
newObject.setByteField((byte) 99);
newObject.setCharField('a');
newObject.setDoubleField(50000000d);
newObject.setFloatField(40000000f);
newObject.setIntField(2);
newObject.setLongField(30000L);
newObject.setShortField((short) 1);
return newObject;
}
use of io.atlasmap.java.test.BaseFlatPrimitiveClass in project atlasmap by atlasmap.
the class XmlJavaFlatMappingTest method generateFlatPrimitiveClass.
protected BaseFlatPrimitiveClass generateFlatPrimitiveClass(Class<? extends BaseFlatPrimitiveClass> clazz) throws Exception {
Class<?> targetClazz = this.getClass().getClassLoader().loadClass(clazz.getName());
BaseFlatPrimitiveClass newObject = (BaseFlatPrimitiveClass) targetClazz.newInstance();
newObject.setBooleanField(false);
newObject.setByteField((byte) 99);
newObject.setCharField('a');
newObject.setDoubleField(50000000d);
newObject.setFloatField(40000000f);
newObject.setIntField(2);
newObject.setLongField(30000L);
newObject.setShortField((short) 1);
return newObject;
}
use of io.atlasmap.java.test.BaseFlatPrimitiveClass in project atlasmap by atlasmap.
the class AtlasTestUtil method generateFlatPrimitiveClass.
public static BaseFlatPrimitiveClass generateFlatPrimitiveClass(Class<? extends BaseFlatPrimitiveClass> clazz) throws Exception {
Class<?> targetClazz = AtlasTestUtil.class.getClassLoader().loadClass(clazz.getName());
BaseFlatPrimitiveClass newObject = (BaseFlatPrimitiveClass) targetClazz.newInstance();
newObject.setIntField(2);
newObject.setShortField((short) 3);
newObject.setLongField(4L);
newObject.setDoubleField(5d);
newObject.setFloatField(6f);
newObject.setBooleanField(true);
newObject.setCharField('8');
newObject.setByteField((byte) 57);
return newObject;
}
use of io.atlasmap.java.test.BaseFlatPrimitiveClass 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.BaseFlatPrimitiveClass 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;
}
Aggregations