Package org.kie.internal.runtime

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


         List res = new ArrayList();
         ksession.setGlobal( "list", res );

         ksession.fireAllRules();
         ksession.dispose();
         assertTrue( res.contains( 10 ) );
     }

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


         StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();

         ksession.insert( new PrimitiveBean( 0.9, 1.1 ) );
         ksession.insert( new PrimitiveBean( 0.9, null ) );
         assertEquals( 1, ksession.fireAllRules() );
         ksession.dispose();
     }

     public static class PrimitiveBean {
         public final double primitive;
         public final Double typed;
View Full Code Here

         ksession.insert( new Person( "mario", 38 ) );
         ksession.insert( new Person( "1mike", 44 ) );
         ksession.insert( new Person( "52matt", 44 ) );

         ksession.fireAllRules();
         ksession.dispose();

         assertEquals( 3, res.size() );
         assertTrue( res.contains( "mark" ) );
         assertTrue( res.contains( "mario" ) );
         assertTrue( res.contains( 44 ) );
View Full Code Here

         ksession.insert( new Person() );
         ksession.insert( new Cheese( "gorgonzola" ) );
         ((InternalAgenda) ksession.getAgenda()).activateRuleFlowGroup( "group1" );
         assertEquals( 1, ksession.fireAllRules() );
         ksession.dispose();
     }

     @Test
     public void testInstanceof() throws Exception {
         // JBRULES-3591
View Full Code Here

         Person mark = new Person( "mark" );
         mark.setAddress( new LongAddress( "uk" ) );
         ksession.insert( mark );

         assertEquals( 1, ksession.fireAllRules() );
         ksession.dispose();
     }

     @Test
     public void testFromNodeWithMultipleBetas() throws Exception {
         String str = "import org.drools.compiler.*;\n" +
View Full Code Here

         p.addAddress( new Address( "y", "y", "y" ) );
         ksession.insert( p );

         ksession.insert( new Cheese( "x" ) );
         ksession.fireAllRules();
         ksession.dispose();
     }

     @Test
     public void testMvelFunctionWithDeclaredTypeArg() {
         // JBRULES-3562
View Full Code Here

         StringBuilder sb = new StringBuilder();
         ksession.setGlobal( "value", sb );
         ksession.fireAllRules();

         assertEquals( "mario", sb.toString() );
         ksession.dispose();
     }

     @Test
     public void testMvelFunctionWithDeclaredTypeArgForGuvnor() throws Exception {
         // JBRULES-3562
View Full Code Here

         p.addAddress( new Address( "y", "y", "y" ) );
         ksession.insert( p );

         ksession.insert( new Cheese( "x" ) );
         assertEquals( 1, ksession.fireAllRules() );
         ksession.dispose();
     }

     @Test
     public void testGenericsOption() throws Exception {
         // JBRULES-3579
View Full Code Here

         p.setAddress( new Address( "x", "x", "x" ) );
         ksession.insert( p );

         ksession.insert( new Cheese( "x" ) );
         assertEquals( 1, ksession.fireAllRules() );
         ksession.dispose();
     }

     @Test
     public void testRHSClone() {
         // JBRULES-3539
View Full Code Here

         ksession.fireAllRules();

         assertEquals(1, list.size());
         assertSame(p, list.get(0));
         ksession.dispose();
     }

     @Test
     public void testConstantLeft() {
         // JBRULES-3627
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.