@Test public void testNoKeepReference() throws Exception { SessionConfiguration conf = new SessionConfiguration(); conf.setKeepReference(false); final WorkingMemory wm5 = this.ruleBase.newStatefulSession(conf, null); final WorkingMemory wm6 = this.ruleBase.newStatefulSession(conf, null); assertLength(4, this.ruleBase.getStatefulSessions()); assertNotContains(wm5, this.ruleBase.getStatefulSessions()); assertNotContains(wm6, this.ruleBase.getStatefulSessions()); }
@Test public void testDispose() throws Exception { /* * Now lets test the dispose method on the WorkingMemory itself. dispose * doesn't need GC */ this.wm3.dispose(); /* Check only wm3 was removed */ assertLength(3, this.ruleBase.getStatefulSessions()); assertNotContains(this.wm3, this.ruleBase.getStatefulSessions()); }