buildVersion(ks, "Hi Universe", "1.2");
ReleaseId latestReleaseId = ks.newReleaseId("org.kie", "hello-world", "LATEST");
KieSession ksession = ks.newKieContainer(latestReleaseId).newKieSession("KSession1");
ksession.insert(new Message("Hello World"));
assertEquals( 0, ksession.fireAllRules() );
ksession = ks.newKieContainer(latestReleaseId).newKieSession("KSession1");
ksession.insert(new Message("Hi Universe"));
assertEquals( 1, ksession.fireAllRules() );
ReleaseId releaseId1 = ks.newReleaseId("org.kie", "hello-world", "1.0");
ksession = ks.newKieContainer(releaseId1).newKieSession("KSession1");
ksession.insert(new Message("Hello World"));
assertEquals( 1, ksession.fireAllRules() );
ksession = ks.newKieContainer(releaseId1).newKieSession("KSession1");
ksession.insert(new Message("Hi Universe"));
assertEquals( 0, ksession.fireAllRules() );
ReleaseId releaseId2 = ks.newReleaseId("org.kie", "hello-world", "[1.0,1.2)");
ksession = ks.newKieContainer(releaseId2).newKieSession("KSession1");
ksession.insert(new Message("Aloha Earth"));
assertEquals( 1, ksession.fireAllRules() );
ksession = ks.newKieContainer(releaseId2).newKieSession("KSession1");
ksession.insert(new Message("Hi Universe"));
assertEquals( 0, ksession.fireAllRules() );
}