Reader source = new InputStreamReader(DebugViewsTest.class.getResourceAsStream("/debug.drl"));
PackageBuilder builder = new PackageBuilder();
builder.addPackageFromDrl(source);
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage(builder.getPackage());
ReteooStatefulSession session = (ReteooStatefulSession) ruleBase.newStatefulSession();
List list = new ArrayList();
session.setGlobal("list", list);
session.insert("String1");
String focusName = session.getAgenda().getFocusName();
assertEquals("MAIN", focusName);
AgendaGroup[] agendaGroups = session.getAgenda().getAgendaGroups();
assertEquals(1, agendaGroups.length);
assertEquals("MAIN", agendaGroups[0].getName());
assertEquals(1, agendaGroups[0].getActivations().length);
Match activation = agendaGroups[0].getActivations()[0];
assertEquals("ActivationCreator", activation.getRule().getName());
Entry[] parameters = session.getActivationParameters(
((org.drools.core.spi.Activation) activation).getActivationNumber());
assertEquals(1, parameters.length);
assertEquals("o", parameters[0].getKey());
assertEquals("String1", parameters[0].getValue());
}