235236237238239240241242243244245
} assertTrue( errors.isEmpty() ); assertTrue( success ); assertTrue( ! list.isEmpty() && ( (Number) list.get( list.size() - 1 ) ).intValue() > 200 ); ksession.dispose(); } @Test( timeout = 10000 ) public void testClassLoaderRace() throws InterruptedException {
458459460461462463464465466467468
} System.out.println( "Final size " + ksession.getObjects().size() ); //assertEquals( 2000, ksession.getObjects().size() ); ksession.dispose(); } public static class Runner extends Thread { private final StatefulKnowledgeSession ksession;
544545546547548549550551552553554
throw new RuntimeException(e); } } assertTrue(success); ksession.dispose(); } // FIXME // // public void testRuleBaseConcurrentCompilation() {
876877878879880881882883884885886
assertEquals( 1, results.size() ); assertEquals( do2, results.iterator().next().get( "$do" ) ); ksession.dispose(); } @Test public void testQueryWithIncompatibleArgs() { String drl = "global java.util.List list; " +
13701371137213731374137513761377137813791380
trueTraits ); ks.setGlobal( "untrueTraits", untrueTraits ); ks.fireAllRules(); ks.dispose(); assertTrue( trueTraits.contains( 1 ) ); assertFalse( trueTraits.contains( 2 ) ); assertTrue( untrueTraits.contains( 2 ) ); assertFalse( untrueTraits.contains( 1 ) );
13951396139713981399140014011402140314041405
trueTraits ); session.setGlobal( "untrueTraits", untrueTraits ); session.fireAllRules(); session.dispose(); assertTrue( trueTraits.contains( 1 ) ); assertFalse( trueTraits.contains( 2 ) ); assertTrue( untrueTraits.contains( 2 ) ); assertFalse( untrueTraits.contains( 1 ) );
18601861186218631864186518661867186818691870
InternalFactHandle h = ((InternalFactHandle) personHandle); ObjectTypeConfigurationRegistry reg = ((InternalWorkingMemoryEntryPoint) h.getEntryPoint()).getObjectTypeConfigurationRegistry(); ObjectTypeConf conf = reg.getObjectTypeConf( ((InternalWorkingMemoryEntryPoint) h.getEntryPoint()).getEntryPoint(), ((InternalFactHandle) personHandle).getObject() ); assertTrue( conf.isTMSEnabled() ); ksession.dispose(); }
305306307308309310311312313314315
ksession1.setGlobal( "list", list ); ksession1.insert("hello"); ksession1.fireAllRules(); ksession1.dispose(); // dispose before firing Assert.assertEquals(0, list.size()); Thread.sleep(5000);
338339340341342343344345346347348
ksession2.setGlobal( "list", list ); ksession2.fireAllRules(); ksession2.dispose(); Assert.assertEquals(0, list.size()); } private StatefulKnowledgeSession createSession(KnowledgeBase kbase) {
4344454647484950
ksession.fireAllRules(); assertEquals(1, list.size()); assertEquals(1L, (long)list.get(0)); ksession.dispose(); } }