use of org.drools.compiler.kie.builder.impl.KieFileSystemImpl in project drools by kiegroup.
the class KieBuilderTest method testInvalidPomXmlGAV.
@Test
public void testInvalidPomXmlGAV() throws ClassNotFoundException, InterruptedException, IOException {
String namespace = "org.kie.test";
KieModuleModel kProj = createKieProject(namespace);
ReleaseId releaseId = new ReleaseIdImpl("", "", "");
KieFileSystem kfs = KieServices.Factory.get().newKieFileSystem();
generatePomXML(kfs, releaseId);
generateMessageClass(kfs, namespace);
generateRule(kfs, namespace);
MemoryFileSystem mfs = ((KieFileSystemImpl) kfs).asMemoryFileSystem();
KieBuilder kieBuilder = createKieBuilder(kfs);
kieBuilder.buildAll();
assertTrue(kieBuilder.getResults().hasMessages(Level.ERROR));
}
use of org.drools.compiler.kie.builder.impl.KieFileSystemImpl in project drools by kiegroup.
the class KieBuilderTest method testEmptyProjectXml.
@Test
public void testEmptyProjectXml() throws ClassNotFoundException, InterruptedException, IOException {
String namespace = "org.kie.test";
KieServices ks = KieServices.Factory.get();
KieModuleModel kProj = ks.newKieModuleModel();
ReleaseId releaseId = KieServices.Factory.get().newReleaseId(namespace, "memory", "1.0-SNAPSHOT");
KieFileSystem kfs = KieServices.Factory.get().newKieFileSystem();
generateKProjectXML(kfs, namespace, kProj);
generatePomXML(kfs, releaseId);
generateMessageClass(kfs, namespace);
generateRule(kfs, namespace);
MemoryFileSystem mfs = ((KieFileSystemImpl) kfs).asMemoryFileSystem();
createAndTestKieContainer(releaseId, createKieBuilder(kfs), null);
}
use of org.drools.compiler.kie.builder.impl.KieFileSystemImpl in project drools by kiegroup.
the class KieBuilderTest method testOnDisc.
@Test
public void testOnDisc() throws ClassNotFoundException, InterruptedException, IOException {
String namespace = "org.kie.test";
KieModuleModel kProj = createKieProject(namespace);
ReleaseId releaseId = KieServices.Factory.get().newReleaseId(namespace, "memory", "1.0-SNAPSHOT");
KieFileSystem kfs = KieServices.Factory.get().newKieFileSystem();
generateAll(kfs, namespace, releaseId, kProj);
MemoryFileSystem mfs = ((KieFileSystemImpl) kfs).asMemoryFileSystem();
File file = fileManager.getRootDirectory();
mfs.writeAsFs(file);
createAndTestKieContainer(releaseId, createKieBuilder(kfs), namespace);
}
Aggregations