Package org.kie.internal.runtime

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


         p.setBooleanWrapper( Boolean.FALSE );

         ksession.insert( p );

         int rules = ksession.fireAllRules();
         ksession.dispose();

         assertEquals( 1,
                       rules );
     }
View Full Code Here


         int rulesFired = knowledgeSession.fireAllRules();

         assertEquals( 1,
                       rulesFired );

         knowledgeSession.dispose();
     }

     @Test
     public void testGUVNOR578_2() throws Exception {
         MapBackedClassLoader loader = new MapBackedClassLoader( this.getClass().getClassLoader() );
View Full Code Here

             FactHandle fooFactHandle = ksession.getFactHandle( tehFoo );
             tehFoo.setBar( barList[magicBars[i]] );
             ksession.update( fooFactHandle, tehFoo );
             ksession.fireAllRules();
         }
         ksession.dispose();
     }

     @Test
     public void testJBRULES3326() throws Exception {
         StringBuilder rule = new StringBuilder();
View Full Code Here

         StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );

         ksession.insert( new Message( "test" ) );
         int rules = ksession.fireAllRules();
         assertEquals( 1, rules );
         ksession.dispose();
     }

     @Test
     public void testDispose() throws Exception {
         StringBuilder rule = new StringBuilder();
View Full Code Here

         ksession.insert( new Message( "test" ) );
         int rules = ksession.fireAllRules();
         assertEquals( 1, rules );

         ksession.dispose();

         try {
             // the following should raise an IllegalStateException as the session was already disposed
             ksession.fireAllRules();
             fail( "An IllegallStateException should have been raised as the session was disposed before the method call." );
View Full Code Here

         StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );

         ksession.insert( new Triangle() );
         int rules = ksession.fireAllRules();
         assertEquals( 1, rules );
         ksession.dispose();
     }

     @Test
     public void testNestedAccessors2() throws Exception {
         String rule = "package org.drools.compiler\n" +
View Full Code Here

         List<org.kie.api.event.rule.AfterMatchFiredEvent> values = captor.getAllValues();
         assertThat( (Cheesery) values.get( 0 ).getMatch().getObjects().get( 0 ), is( c1 ) );
         assertThat( (Cheesery) values.get( 1 ).getMatch().getObjects().get( 0 ), is( c2 ) );

         ksession.dispose();
     }

     @Test
     public void testMVELConstraintsWithFloatingPointNumbersInScientificNotation() {
View Full Code Here

         fact.setS( "asdf" );
         fact.setI( 10 );
         ksession.insert( fact );
         ksession.fireAllRules();

         ksession.dispose();
     }

     public static class TestUtility {
         public static Boolean utilMethod(String s1,
                                          String s2) {
View Full Code Here

         assertTrue( list.contains( "x1_0"));
         assertTrue( list.contains( "x1_1"));
         assertTrue( list.contains( "x2_0"));
         assertTrue( list.contains( "x2_1"));

         ksession.dispose();
     }

     @Test(timeout = 5000)
     public void testEfficientBetaNodeNetworkUpdate() {
         // [JBRULES-3372]
View Full Code Here

         ksession.setGlobal( "list", list );

         ksession.fireAllRules();
         assertTrue( list.contains( "OK" ) );

         ksession.dispose();
     }

     @Test
     public void testPatternOnClass() throws Exception {
         String rule = "import org.drools.core.reteoo.InitialFactImpl\n" +
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.