Search in sources :

Example 1 with Service

use of org.kie.api.Service in project drools by kiegroup.

the class IncrementalCompilationTest method testIncrementalTypeDeclarationOnInterface.

@Test
public void testIncrementalTypeDeclarationOnInterface() {
    // DROOLS-861
    String drl1 = "import " + Service.class.getCanonicalName() + "\n" + "rule A when\n" + "    Service( )\n" + "then\n" + "end";
    String drl2 = "import " + Service.class.getCanonicalName() + "\n" + "declare Service @role( event ) end\n" + "rule A when\n" + "    Service( )\n" + "then\n" + "end";
    KieServices ks = KieServices.Factory.get();
    ReleaseId releaseId1 = ks.newReleaseId("org.kie", "test-upgrade", "1.0.0");
    KieModule km = createAndDeployJar(ks, releaseId1, drl1);
    KieContainer kc = ks.newKieContainer(releaseId1);
    KieSession ksession = kc.newKieSession();
    ReleaseId releaseId2 = ks.newReleaseId("org.kie", "test-upgrade", "1.1.0");
    createAndDeployJar(ks, releaseId2, drl2);
    kc.updateToVersion(releaseId2);
}
Also used : CompletionService(java.util.concurrent.CompletionService) ExecutorCompletionService(java.util.concurrent.ExecutorCompletionService) ExecutorService(java.util.concurrent.ExecutorService) Service(org.kie.api.Service) KieServices(org.kie.api.KieServices) StatelessKieSession(org.kie.api.runtime.StatelessKieSession) KieSession(org.kie.api.runtime.KieSession) ReleaseId(org.kie.api.builder.ReleaseId) InternalKieModule(org.drools.compiler.kie.builder.impl.InternalKieModule) KieModule(org.kie.api.builder.KieModule) KieContainer(org.kie.api.runtime.KieContainer) Test(org.junit.Test)

Aggregations

CompletionService (java.util.concurrent.CompletionService)1 ExecutorCompletionService (java.util.concurrent.ExecutorCompletionService)1 ExecutorService (java.util.concurrent.ExecutorService)1 InternalKieModule (org.drools.compiler.kie.builder.impl.InternalKieModule)1 Test (org.junit.Test)1 KieServices (org.kie.api.KieServices)1 Service (org.kie.api.Service)1 KieModule (org.kie.api.builder.KieModule)1 ReleaseId (org.kie.api.builder.ReleaseId)1 KieContainer (org.kie.api.runtime.KieContainer)1 KieSession (org.kie.api.runtime.KieSession)1 StatelessKieSession (org.kie.api.runtime.StatelessKieSession)1