final List list = new ArrayList();
session.setGlobal( "results",
list );
Cheese cheese = new Cheese( "stilton",
10 );
Cheesery cheesery = new Cheesery();
cheesery.addCheese( cheese );
Person bob = new Person( "bob",
"stilton" );
Cheese cheese2 = new Cheese();
bob.setCheese( cheese2 );
org.kie.api.runtime.rule.FactHandle p = session.insert( bob );
org.kie.api.runtime.rule.FactHandle c = session.insert( cheesery );
session.fireAllRules();
assertEquals( "should not have fired",
0,
list.size() );
cheese2.setType( "stilton" );
session.update( p,
bob );
session.fireAllRules();
assertEquals( 1,