}
public void test2() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( "org/drools/container/spring/beans.xml" );
ExecutionNode node = (ExecutionNode) context.getBean("node1");
List<String> list = new ArrayList<String>();
StatelessKnowledgeSession kstateless = (StatelessKnowledgeSession) node.get(DirectoryLookupFactoryService.class).lookup("stateless1");
assertNotNull("can't obtain session named: stateless1" , kstateless);
kstateless.setGlobal("list", list);
kstateless.execute(new Person("Darth", "Cheddar", 50));
assertEquals(2, list.size());
list = new ArrayList<String>();
StatefulKnowledgeSession kstateful = (StatefulKnowledgeSession) node.get(DirectoryLookupFactoryService.class).lookup("ksession2");
kstateful.setGlobal("list", list);
kstateful.insert(new Person("Darth", "Cheddar", 50));
kstateful.fireAllRules();
assertEquals(2, list.size());
}