Search in sources :

Example 1 with KieService

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);
}
Also used : KieService(org.kie.api.internal.utils.KieService) KieServices(org.kie.api.KieServices) ReleaseId(org.kie.api.builder.ReleaseId) KieContainer(org.kie.api.runtime.KieContainer) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 KieServices (org.kie.api.KieServices)1 ReleaseId (org.kie.api.builder.ReleaseId)1 KieService (org.kie.api.internal.utils.KieService)1 KieContainer (org.kie.api.runtime.KieContainer)1