StatefulKnowledgeSession ksessionA = null;
{
KieBaseConfiguration config = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
config.setOption(EventProcessingOption.STREAM);
KnowledgeBase knowledgeBaseA = KnowledgeBaseFactory.newKnowledgeBase(config);
KieSessionConfiguration ksconf = KnowledgeBaseFactory.newKnowledgeSessionConfiguration();
ksconf.setOption(ClockTypeOption.get("pseudo"));
ksconf.setOption(TimerJobFactoryOption.get("trackable"));
ksessionA = knowledgeBaseA.newStatefulKnowledgeSession(ksconf, null);
}
StatefulKnowledgeSession ksessionB = null;
{
KieBaseConfiguration config = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
config.setOption(EventProcessingOption.STREAM);
KnowledgeBase knowledgeBase = KnowledgeBaseFactory.newKnowledgeBase(config);
KieSessionConfiguration ksconf = KnowledgeBaseFactory.newKnowledgeSessionConfiguration();
ksconf.setOption(ClockTypeOption.get("pseudo"));
ksconf.setOption( TimerJobFactoryOption.get("trackable") );
ksessionB = knowledgeBase.newStatefulKnowledgeSession(ksconf, null);
}
Assert.assertTrue(CompareViaReflectionUtil.class.getSimpleName() + " is broken!", compareInstances(ksessionA, ksessionB));
}