use of org.drools.compiler.Attribute in project drools by kiegroup.
the class NullTest method testNullFieldOnCompositeSink.
@Test
public void testNullFieldOnCompositeSink() throws Exception {
final KieBase kbase = loadKnowledgeBase("test_NullFieldOnCompositeSink.drl");
KieSession ksession = createKnowledgeSession(kbase);
final List list = new ArrayList();
ksession.setGlobal("list", list);
ksession.insert(new Attribute());
ksession.insert(new Message());
ksession = SerializationHelper.getSerialisedStatefulKnowledgeSession(ksession, true);
ksession.fireAllRules();
assertEquals(1, ((List) ksession.getGlobal("list")).size());
assertEquals("X", ((List) ksession.getGlobal("list")).get(0));
}