Package org.kie.internal.runtime

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


         p.setName( "hungry" );
         ksession.insert( p );

         ksession.fireAllRules();

         ksession.dispose();
     }

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


         ksession.setGlobal( "list", list );

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

         ksession.dispose();
     }

     @Test
     public void testBindingToNullFieldWithEquality() {
         // JBRULES-3396
View Full Code Here

         ksession.setGlobal( "list", list );

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

         ksession.dispose();
     }

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

         ksession.fireAllRules();
         assertTrue( list.contains( 31 + 123 ) );
         assertTrue( list.contains( true ) );

         ksession.dispose();
     }

     @Test
     public void testDeclaredTypeAsFieldForAnotherDeclaredType() {
         // JBRULES-3468
View Full Code Here

         KnowledgeBase kbase = loadKnowledgeBaseFromString( str );
         StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();

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

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

         List list = new ArrayList();

         ksession.setGlobal( "list", list );
         ksession.fireAllRules();

         ksession.dispose();

         assertFalse( list.get( 0 ).hashCode() == 34 );
         assertFalse( list.get( 1 ).hashCode() == 34 );
         assertFalse( list.get( 0 ).hashCode() == list.get( 1 ).hashCode() );
         assertNotSame( list.get( 0 ), list.get( 1 ) );
View Full Code Here

         ksession.insert( new Person( "mark", 37 ) );
         ksession.insert( new Person( "mario", 38 ) );

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

     @Test
     public void testJittingMethodWithCharSequenceArg() {
         String str = "package com.sample\n" +
View Full Code Here

         ksession.insert( new Person( "mark", 37 ) );
         ksession.insert( new Person( "mario", 38 ) );

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

     @Test
     public void testMapAccessorWithPrimitiveKey() {
         String str = "package com.sample\n" +
View Full Code Here

         KnowledgeBase kbase = loadKnowledgeBaseFromString( str );
         StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();

         ksession.insert( new MapContainerBean() );
         assertEquals( 4, ksession.fireAllRules() );
         ksession.dispose();
     }

     public static class MapContainerBean {
         private final Map<Integer, String> map = new HashMap<Integer, String>();
View Full Code Here

         Map<String, String> testMap = new HashMap<String, String>();
         testMap.put( "keyOne", "valone" );
         testMap.put( "valTwo", "valTwo" );
         ksession.insert( testMap );
         assertEquals( 1, ksession.fireAllRules() );
         ksession.dispose();
     }

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