Package org.kie.internal.runtime

Examples of org.kie.internal.runtime.StatefulKnowledgeSession.dispose()


        }
        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 {
View Full Code Here


        }

        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;
View Full Code Here

                throw new RuntimeException(e);
            }
        }

        assertTrue(success);
        ksession.dispose();
    }

    // FIXME
//
//    public void testRuleBaseConcurrentCompilation() {
View Full Code Here

        assertEquals( 1,
                      results.size() );
        assertEquals( do2,
                      results.iterator().next().get( "$do" ) );

        ksession.dispose();
    }

    @Test
    public void testQueryWithIncompatibleArgs() {
        String drl = "global java.util.List list; " +
View Full Code Here

                      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 ) );
View Full Code Here

                           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 ) );
View Full Code Here

        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();
    }



View Full Code Here

        ksession1.setGlobal( "list", list );

        ksession1.insert("hello");
        ksession1.fireAllRules();

        ksession1.dispose(); // dispose before firing

        Assert.assertEquals(0, list.size());

        Thread.sleep(5000);
View Full Code Here

        ksession2.setGlobal( "list", list );

        ksession2.fireAllRules();

        ksession2.dispose();

        Assert.assertEquals(0, list.size());
    }

    private StatefulKnowledgeSession createSession(KnowledgeBase kbase) {
View Full Code Here

        ksession.fireAllRules();

        assertEquals(1, list.size());
        assertEquals(1L, (long)list.get(0));

        ksession.dispose();
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.