// asserting the sensor object
final RandomNumber rn = new RandomNumber();
rn.setValue( 10 );
ksession.insert( rn );
final Guess guess = new Guess();
guess.setValue( new Integer( 5 ) );
final org.kie.api.runtime.rule.FactHandle handle = ksession.insert( guess );
ksession.fireAllRules();
// HIGHER
assertEquals( 1,
list.size() );
assertEquals( "HIGHER",
list.get( 0 ) );
guess.setValue( new Integer( 15 ) );
ksession.update( handle,
guess );
ksession.fireAllRules();
// LOWER
assertEquals( 2,
list.size() );
assertEquals( "LOWER",
list.get( 1 ) );
guess.setValue( new Integer( 10 ) );
ksession.update( handle,
guess );
ksession.fireAllRules();