use of org.drools.core.event.DefaultRuleRuntimeEventListener in project drools by kiegroup.
the class SessionsPoolTest method testListenersReset.
@Test
public void testListenersReset() {
final KieContainerSessionsPool pool = getKieContainer().newKieSessionsPool(1);
KieSession ksession = pool.newKieSession();
try {
ksession.addEventListener(new DefaultAgendaEventListener());
ksession.addEventListener(new DefaultRuleRuntimeEventListener());
((RuleEventManager) ksession).addEventListener(new RuleEventListener() {
});
} finally {
ksession.dispose();
}
ksession = pool.newKieSession();
try {
Assertions.assertThat(ksession.getAgendaEventListeners()).hasSize(0);
Assertions.assertThat(ksession.getRuleRuntimeEventListeners()).hasSize(0);
Assertions.assertThat(((EventSupport) ksession).getRuleEventSupport().getEventListeners()).hasSize(0);
} finally {
ksession.dispose();
}
}
use of org.drools.core.event.DefaultRuleRuntimeEventListener in project drools by kiegroup.
the class FactHandleTest method createCollectEventListener.
private DefaultRuleRuntimeEventListener createCollectEventListener(List<Long> factHandleIDs) {
return new DefaultRuleRuntimeEventListener() {
public void objectInserted(ObjectInsertedEvent event) {
InternalFactHandle ifh = (InternalFactHandle) event.getFactHandle();
factHandleIDs.add(ifh.getId());
}
};
}
Aggregations