use of io.atlasmap.java.v2.JavaClass in project atlasmap by atlasmap.
the class ClassValidationUtil method validateFlatPrimitiveInterfaceTwoDimArray.
public static void validateFlatPrimitiveInterfaceTwoDimArray(ClassInspectionService classInspectionService, Class<?> clazz) {
JavaClass flatClass = classInspectionService.inspectClass(clazz);
validateFlatClass(flatClass);
assertEquals(CollectionType.ARRAY, flatClass.getCollectionType());
assertEquals(new Integer(2), flatClass.getArrayDimensions());
assertTrue(flatClass.isInterface());
assertEquals("io.atlasmap.java.test.FlatPrimitiveInterface", flatClass.getClassName());
validateFlatPrimitiveFields(flatClass);
}
use of io.atlasmap.java.v2.JavaClass in project atlasmap by atlasmap.
the class ClassValidationUtil method validateFlatPrimitiveInterface.
public static void validateFlatPrimitiveInterface(ClassInspectionService classInspectionService, Class<?> clazz) {
JavaClass flatClass = classInspectionService.inspectClass(clazz);
validateFlatClass(flatClass);
assertEquals("io.atlasmap.java.test.FlatPrimitiveInterface", flatClass.getClassName());
validateFlatPrimitiveFields(flatClass);
}
use of io.atlasmap.java.v2.JavaClass in project atlasmap by atlasmap.
the class ClassValidationUtil method validateFlatPrimitiveInterfaceThreeDimArray.
public static void validateFlatPrimitiveInterfaceThreeDimArray(ClassInspectionService classInspectionService, Class<?> clazz) {
JavaClass flatClass = classInspectionService.inspectClass(clazz);
validateFlatClass(flatClass);
assertEquals(CollectionType.ARRAY, flatClass.getCollectionType());
assertEquals(new Integer(3), flatClass.getArrayDimensions());
assertTrue(flatClass.isInterface());
assertEquals("io.atlasmap.java.test.FlatPrimitiveInterface", flatClass.getClassName());
validateFlatPrimitiveFields(flatClass);
}
use of io.atlasmap.java.v2.JavaClass in project atlasmap by atlasmap.
the class ClassValidationUtil method validateFlatPrimitiveClassArray.
public static void validateFlatPrimitiveClassArray(ClassInspectionService classInspectionService, Class<?> clazz, String className) {
JavaClass flatClass = classInspectionService.inspectClass(clazz);
validateFlatClass(flatClass);
assertEquals(CollectionType.ARRAY, flatClass.getCollectionType());
assertEquals(new Integer(1), flatClass.getArrayDimensions());
assertEquals(null, flatClass.getArraySize());
assertFalse(flatClass.isInterface());
assertEquals(className, flatClass.getClassName());
validateFlatPrimitiveFields(flatClass);
}
use of io.atlasmap.java.v2.JavaClass in project atlasmap by atlasmap.
the class ClassValidationUtil method validateSimpleTestAddress.
public static void validateSimpleTestAddress(JavaClass c) {
assertNotNull(c);
assertFalse(c.isAnnonymous());
assertFalse(c.isAnnotation());
// assertTrue(c.getCollectionType() == null || c.getCollectionT());
assertFalse(c.isEnumeration());
assertFalse(c.isInterface());
assertFalse(c.isLocalClass());
assertFalse(c.isMemberClass());
assertFalse(c.isPrimitive());
assertFalse(c.isSynthetic());
assertNotNull(c.getUri());
assertEquals(String.format(AtlasJavaModelFactory.URI_FORMAT, c.getClassName()), c.getUri());
assertEquals("io.atlasmap.java.test.BaseAddress", c.getClassName());
assertEquals("io.atlasmap.java.test", c.getPackageName());
assertNotNull(c.getJavaEnumFields());
assertNotNull(c.getJavaEnumFields().getJavaEnumField());
assertEquals(new Integer(0), new Integer(c.getJavaEnumFields().getJavaEnumField().size()));
assertNotNull(c.getJavaFields());
assertNotNull(c.getJavaFields().getJavaField());
assertEquals(new Integer(6), new Integer(c.getJavaFields().getJavaField().size()));
for (JavaField f : c.getJavaFields().getJavaField()) {
switch(f.getName()) {
case "serialVersionUID":
validateSerialVersionUID(f);
break;
case "addressLine1":
break;
case "addressLine2":
break;
case "city":
break;
case "state":
break;
case "zipCode":
break;
default:
fail("Unexpected field detected: " + f.getName());
}
}
}
Aggregations