Search in sources :

Example 66 with StatefulKnowledgeSessionImpl

use of org.drools.kiesession.session.StatefulKnowledgeSessionImpl in project drools by kiegroup.

the class SegmentMemoryPrototypeTest method testSessionCache.

@Test
public void testSessionCache() {
    KieBase kbase = KieBaseUtil.getKieBaseFromKieModuleFromDrl("test", kieBaseTestConfiguration, DRL);
    StatefulKnowledgeSessionImpl ksession = (StatefulKnowledgeSessionImpl) kbase.newKieSession();
    try {
        checkKieSession(ksession);
    } finally {
        try {
            ksession.reset();
            checkKieSession(ksession);
        } finally {
            ksession.dispose();
        }
    }
}
Also used : KieBase(org.kie.api.KieBase) StatefulKnowledgeSessionImpl(org.drools.kiesession.session.StatefulKnowledgeSessionImpl) Test(org.junit.Test)

Aggregations

StatefulKnowledgeSessionImpl (org.drools.kiesession.session.StatefulKnowledgeSessionImpl)66 Test (org.junit.Test)57 InternalKnowledgeBase (org.drools.kiesession.rulebase.InternalKnowledgeBase)34 ArrayList (java.util.ArrayList)15 ObjectTypeNode (org.drools.core.reteoo.ObjectTypeNode)15 KieBase (org.kie.api.KieBase)15 ClassObjectType (org.drools.core.base.ClassObjectType)14 DefaultFactHandle (org.drools.core.common.DefaultFactHandle)14 BetaMemory (org.drools.core.reteoo.BetaMemory)14 List (java.util.List)13 InternalFactHandle (org.drools.core.common.InternalFactHandle)13 KieSession (org.kie.api.runtime.KieSession)12 FactHandle (org.kie.api.runtime.rule.FactHandle)11 MockObjectSink (org.drools.core.reteoo.MockObjectSink)10 BuildContext (org.drools.core.reteoo.builder.BuildContext)10 LeftTupleImpl (org.drools.core.reteoo.LeftTupleImpl)8 HashMap (java.util.HashMap)7 KnowledgeBuilderImpl (org.drools.compiler.builder.impl.KnowledgeBuilderImpl)7 PathMemory (org.drools.core.reteoo.PathMemory)7 Rete (org.drools.core.reteoo.Rete)7