Search in sources :

Example 21 with BaseFlatPrimitiveClass

use of io.atlasmap.java.test.BaseFlatPrimitiveClass in project atlasmap by atlasmap.

the class JsonJavaFlatMappingTest method generateFlatPrimitiveClassPrimitiveFieldsBoxedValues.

protected BaseFlatPrimitiveClass generateFlatPrimitiveClassPrimitiveFieldsBoxedValues(Class<? extends BaseFlatPrimitiveClass> clazz) throws Exception {
    Class<?> targetClazz = this.getClass().getClassLoader().loadClass(clazz.getName());
    BaseFlatPrimitiveClass newObject = (BaseFlatPrimitiveClass) targetClazz.newInstance();
    newObject.setBooleanField(Boolean.valueOf(Boolean.FALSE));
    newObject.setByteField(new Byte((byte) 99));
    newObject.setCharField(new Character('a'));
    newObject.setDoubleField(new Double(50000000d));
    newObject.setFloatField(new Float(40000000f));
    newObject.setIntField(new Integer(2));
    newObject.setLongField(new Long(30000L));
    newObject.setShortField(new Short((short) 1));
    return newObject;
}
Also used : BaseFlatPrimitiveClass(io.atlasmap.java.test.BaseFlatPrimitiveClass)

Example 22 with BaseFlatPrimitiveClass

use of io.atlasmap.java.test.BaseFlatPrimitiveClass in project atlasmap by atlasmap.

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

Aggregations

BaseFlatPrimitiveClass (io.atlasmap.java.test.BaseFlatPrimitiveClass)22 AtlasContext (io.atlasmap.api.AtlasContext)7 AtlasSession (io.atlasmap.api.AtlasSession)7 File (java.io.File)7 TargetFlatPrimitiveClass (io.atlasmap.java.test.TargetFlatPrimitiveClass)6 AtlasMappingBaseTest (io.atlasmap.reference.AtlasMappingBaseTest)4 Test (org.junit.Test)4 AtlasJsonTestUnrootedMapper (io.atlasmap.json.test.AtlasJsonTestUnrootedMapper)2 TargetFlatPrimitive (io.atlasmap.json.test.TargetFlatPrimitive)2 Validation (io.atlasmap.v2.Validation)1 Validations (io.atlasmap.v2.Validations)1