80358036803780388039804080418042804380448045
ksession.insert( new Cheese( "stilton", 8 ) ); ksession.insert( new Cheese( "brie", 28 ) ); int fired = ksession.fireAllRules(); assertEquals( 2, fired ); } @Test
81198120812181228123812481258126812781288129
// make sure the 'exists' is obeyed when fact is cycled causing add/remove node memory ksession.update( fa1, a1 ); ksession.update( fa2, a2 ); ksession.fireAllRules(); assertEquals( 0, list.size() ); ksession.dispose();
81748175817681778178817981808181818281838184
// make sure the 'exists' is obeyed when fact is cycled causing add/remove node memory ksession.update( fa1, a1 ); ksession.update( fa2, a2 ); ksession.fireAllRules(); assertEquals( 2, list.size() ); ksession.dispose();
82208221822282238224822582268227822882298230
"2" ); FactHandle fa1 = (FactHandle) ksession.insert( a1 ); FactHandle fa2 = (FactHandle) ksession.insert( a2 ); FactHandle fa3 = (FactHandle) ksession.insert( a3 ); ksession.fireAllRules(); // a1 is blocked by a2 assertEquals( 0, list.size() );
82418242824382448245824682478248824982508251
a3 ); a3.setField2( "1" ); // Do ksession.update( fa3, a3 ); ksession.fireAllRules(); assertEquals( 0, list.size() ); // this should still now blocked by a2, but bug from previous update hanging onto blocked ksession.dispose(); }
83118312831383148315831683178318831983208321
a3 ); a3.setField2( "1" ); // Do ksession.update( fa3, a3 ); ksession.fireAllRules(); assertEquals( 1, list.size() ); // a2 should still be blocked by a1, but bug from previous update hanging onto blocked ksession.dispose(); }
83558356835783588359836083618362836383648365
"target", 10 ); ksession.insert( asg ); int rules = ksession.fireAllRules(); ksession.dispose(); assertEquals( 2, rules ); }
83988399840084018402840384048405840684078408
"target", Object.class ); ksession.insert( asg ); int rules = ksession.fireAllRules(); ksession.dispose(); assertEquals( 2, rules ); }
84258426842784288429843084318432843384348435
Person p = new Person( "-..x..xrwx" ); ksession.insert( p ); int rules = ksession.fireAllRules(); ksession.dispose(); assertEquals( 0, rules ); }
84528453845484558456845784588459846084618462
Person p = new Person( "d..x..xrwx" ); ksession.insert( p ); int rules = ksession.fireAllRules(); ksession.dispose(); assertEquals( 1, rules ); }