}
@Test
public void testAgendaGroupAndRuleFlowGroup() throws Exception {
CommandBasedStatefulKnowledgeSession ksession = createSession(-1, "agenda-groups.drl", "ruleflow-groups.drl");
org.drools.core.spi.AgendaGroup[] groups = ((AgendaImpl)stripSession(ksession).getAgenda()).getAgenda().getAgendaGroups();
// only main is available
assertEquals(1, groups.length);
assertEquals("MAIN", groups[0].getName());
int id = ksession.getId();
List<String> list = new ArrayList<String>();
list.add("Test");
ksession.insert(list);
ksession.execute(new ActivateAgendaGroupCommand("agenda-group"));
ksession.execute(new ActivateRuleFlowCommand("ruleflow-group"));
ksession.dispose();
ksession = createSession(id, "agenda-groups.drl", "ruleflow-groups.drl");
groups = ((AgendaImpl)stripSession(ksession).getAgenda()).getAgenda().getAgendaGroups();
// main and agenda group is now on the agenda
assertEquals(3, groups.length);