use of org.kie.workbench.common.services.datamodeller.driver.impl.JavaRoasterModelDriver in project kie-wb-common by kiegroup.
the class JavaRoasterModelDriverTest method loadJavaTypeInfoWithFailuresTest.
@Test
public void loadJavaTypeInfoWithFailuresTest() throws ModelDriverException {
Path errorFile1 = rootPath.resolve(ERROR_FILE1);
Path errorFile2 = rootPath.resolve(ERROR_FILE2);
JavaRoasterModelDriver javaRoasterModelDriver = new JavaRoasterModelDriver();
String source = ioService.readAllString(errorFile1);
TypeInfoResult result = javaRoasterModelDriver.loadJavaTypeInfo(source);
assertTrue(result.hasErrors());
source = ioService.readAllString(errorFile2);
result = javaRoasterModelDriver.loadJavaTypeInfo(source);
assertTrue(result.hasErrors());
}
use of org.kie.workbench.common.services.datamodeller.driver.impl.JavaRoasterModelDriver in project kie-wb-common by kiegroup.
the class JavaRoasterModelDriverTest method loadDataObjectTest.
@Test
public void loadDataObjectTest() throws ModelDriverException {
Path path = rootPath.resolve("package1").resolve("Pojo1.java");
String source = ioService.readAllString(path);
JavaRoasterModelDriver javaRoasterModelDriver = new JavaRoasterModelDriver(ioService, rootPath, getClass().getClassLoader(), mock(FilterHolder.class));
ModelDriverResult result = javaRoasterModelDriver.loadDataObject(source, path);
assertFalse(result.hasErrors());
DataModelerAssert.assertEqualsDataObject(createPojo1(), result.getDataModel().getDataObject("org.kie.workbench.common.services.datamodeller.driver.package1.Pojo1"));
}
Aggregations