use of org.drools.compiler.Cheesery in project drools by kiegroup.
the class FromTest method testMultipleFroms.
@Test
public void testMultipleFroms() throws Exception {
final KieBase kbase = SerializationHelper.serializeObject(loadKnowledgeBase("test_multipleFroms.drl"));
final KieSession ksession = createKnowledgeSession(kbase);
final List results = new ArrayList();
ksession.setGlobal("results", results);
final Cheesery cheesery = new Cheesery();
cheesery.addCheese(new Cheese("stilton", 15));
cheesery.addCheese(new Cheese("brie", 10));
ksession.setGlobal("cheesery", cheesery);
ksession.fireAllRules();
assertEquals(2, results.size());
assertEquals(2, ((List) results.get(0)).size());
assertEquals(2, ((List) results.get(1)).size());
}
Aggregations