use of org.kie.api.internal.utils.KieService in project drools by kiegroup.
the class IncrementalCompilationTest method testIncrementalTypeDeclarationOnInterface.
@Test
public void testIncrementalTypeDeclarationOnInterface() {
// DROOLS-861
final String drl1 = "import " + KieService.class.getCanonicalName() + "\n" + "rule A when\n" + " KieService( )\n" + "then\n" + "end";
final String drl2 = "import " + KieService.class.getCanonicalName() + "\n" + "declare Service @role( event ) end\n" + "rule A when\n" + " KieService( )\n" + "then\n" + "end";
final KieServices ks = KieServices.Factory.get();
final ReleaseId releaseId1 = ks.newReleaseId("org.kie", "test-upgrade", "1.0.0");
KieUtil.getKieModuleFromDrls(releaseId1, kieBaseTestConfiguration, drl1);
final KieContainer kc = ks.newKieContainer(releaseId1);
kc.newKieSession();
final ReleaseId releaseId2 = ks.newReleaseId("org.kie", "test-upgrade", "1.1.0");
KieUtil.getKieModuleFromDrls(releaseId2, kieBaseTestConfiguration, drl2);
kc.updateToVersion(releaseId2);
}
Aggregations