use of org.kie.workbench.common.services.datamodeller.core.JavaTypeInfo in project kie-wb-common by kiegroup.
the class JavaRoasterModelDriverTest method loadJavaTypeInfoTest.
@Test
public void loadJavaTypeInfoTest() throws ModelDriverException {
Path path = rootPath.resolve("package1").resolve("Pojo1.java");
String source = ioService.readAllString(path);
JavaRoasterModelDriver javaRoasterModelDriver = new JavaRoasterModelDriver();
TypeInfoResult typeInfoResult = javaRoasterModelDriver.loadJavaTypeInfo(source);
assertFalse(typeInfoResult.hasErrors());
JavaTypeInfo typeInfo = typeInfoResult.getTypeInfo();
DataObject pojo1 = createPojo1();
assertEquals(pojo1.getName(), typeInfo.getName());
assertEquals(pojo1.getPackageName(), typeInfo.getPackageName());
assertTrue(pojo1.isClass());
assertFalse(pojo1.isAbstract());
assertFalse(typeInfo.isAnnotation());
assertFalse(typeInfo.isEnum());
assertFalse(typeInfo.isInterface());
assertTrue(typeInfo.isPublic());
assertFalse(typeInfo.isPackagePrivate());
assertFalse(typeInfo.isProtected());
assertFalse(typeInfo.isPrivate());
}
Aggregations