KnowledgeAgentImpl kagent3 = (KnowledgeAgentImpl) context.getBean( "kagent3" );
assertTrue( kagent3.isNewInstance() );
assertTrue( kagent3.isUseKBaseClassLoaderForCompiling() );
StatelessKnowledgeSessionImpl ksession1 = (StatelessKnowledgeSessionImpl) context.getBean( "ksession1" );
assertSame( kbase1.getRuleBase(),
ksession1.getRuleBase() );
assertSame( kagent1,
ksession1.getKnowledgeAgent() );
StatefulKnowledgeSessionImpl ksession2 = (StatefulKnowledgeSessionImpl) context.getBean( "ksession2" );
assertSame( kbase1.getRuleBase(),
ksession2.getRuleBase() );
StatelessKnowledgeSessionImpl ksession3 = (StatelessKnowledgeSessionImpl) context.getBean( "ksession3" );
assertSame( kagent2,
ksession3.getKnowledgeAgent() );
assertSame( kbase2.getRuleBase(),
ksession3.getRuleBase() );
}