use of io.atlasmap.java.v2.JavaClass in project atlasmap by atlasmap.
the class JavaServiceTest method testGetClass.
@Test
public void testGetClass() throws Exception {
Response res = javaService.getClass(JavaService.class.getName());
Object entity = res.getEntity();
assertEquals(byte[].class, entity.getClass());
JavaClass javaClass = Json.mapper().readValue((byte[]) entity, JavaClass.class);
assertEquals(JavaService.class.getName(), javaClass.getClassName());
}
use of io.atlasmap.java.v2.JavaClass in project atlasmap by atlasmap.
the class JavaConstructServiceTest method generatePrimitive.
protected JavaClass generatePrimitive(String className) {
JavaClass j = new JavaClass();
j.setClassName(className);
return j;
}
use of io.atlasmap.java.v2.JavaClass in project atlasmap by atlasmap.
the class JavaConstructServiceTest method generateJavaClassInvalidNullClassName.
protected JavaClass generateJavaClassInvalidNullClassName() {
JavaClass j = new JavaClass();
j.setClassName(null);
return j;
}
use of io.atlasmap.java.v2.JavaClass in project atlasmap by atlasmap.
the class JavaConstructServiceTest method generateJavaClassCollection.
protected JavaClass generateJavaClassCollection(String className, CollectionType collectionType, Integer arrayDimensions, Integer arraySize) {
JavaClass j = new JavaClass();
j.setClassName(className);
j.setCollectionType(collectionType);
if (CollectionType.ARRAY.equals(collectionType)) {
j.setArrayDimensions(arrayDimensions);
j.setArraySize(arraySize);
}
return j;
}
use of io.atlasmap.java.v2.JavaClass in project atlasmap by atlasmap.
the class JavaConstructServiceTest method testConstructClassCollectionMap.
@Test
public void testConstructClassCollectionMap() throws Exception {
JavaClass javaClass = generateJavaClassCollection("java.lang.String", CollectionType.MAP, null, null);
javaClass.setCollectionClassName("java.util.HashMap");
Object stringMap = constructService.constructClass(javaClass, null);
assertNotNull(stringMap);
assertTrue(stringMap instanceof HashMap<?, ?>);
assertTrue(((HashMap<?, ?>) stringMap).isEmpty());
}
Aggregations