fileManager.write(pomFile, pom);
return pomFile;
}
private InternalKieModule createKieJar(KieServices ks, ReleaseId releaseId, String... rules) throws IOException {
KieFileSystem kfs = ks.newKieFileSystem();
for (String rule : rules) {
String file = "org/test/" + rule + ".drl";
kfs.write("src/main/resources/KBase1/" + file, createDRL(rule));
}
KieModuleModel kproj = ks.newKieModuleModel();
KieBaseModel kieBaseModel1 = kproj.newKieBaseModel("KBase1")
.setEqualsBehavior( EqualityBehaviorOption.EQUALITY )
.setEventProcessingMode( EventProcessingOption.STREAM );
KieSessionModel ksession1 = kieBaseModel1.newKieSessionModel("KSession1")
.setType(KieSessionType.STATEFUL)
.setClockType( ClockTypeOption.get("realtime") );
kfs.writeKModuleXML(kproj.toXML());
kfs.writePomXML( getPom(releaseId) );
KieBuilder kieBuilder = ks.newKieBuilder(kfs);
assertTrue(kieBuilder.buildAll().getResults().getMessages().isEmpty());
return ( InternalKieModule ) kieBuilder.getKieModule();
}