// test agenda is empty
assertEquals( 0,
agenda.getFocus().size() );
// True filter, activations should always add
final AgendaFilter filterTrue = new AgendaFilter() {
public boolean accept(Activation item) {
return true;
}
};
rule.setNoLoop( false );
node.assertLeftTuple( tuple,
context,
workingMemory );
agenda.unstageActivations();
// check there is an item to fire
assertEquals( 1,
agenda.getFocus().size() );
agenda.fireNextItem( filterTrue );
// check focus is empty
assertEquals( 0,
agenda.getFocus().size() );
// make sure it also fired
assertEquals( new Boolean( true ),
results.get( "fired" ) );
assertEquals( false,
filtered[0].booleanValue() );
// clear the agenda and the result map
agenda.clearAndCancel();
results.clear();
// False filter, activations should always be denied
final AgendaFilter filterFalse = new AgendaFilter() {
public boolean accept(Activation item) {
return false;
}
};