// test agenda is empty
assertEquals(0,
agenda.getFocus().size());
// True filter, activations should always add
final AgendaFilter filterTrue = new
AgendaFilter() {
public boolean accept(Match item) {
return true;
}
};
rule.setNoLoop(false);
node.assertLeftTuple(tuple,
context,
ksession);
agenda.unstageActivations();
// check there is an item to fire
assertEquals(1,
agenda.getFocus().size());
agenda.fireNextItem(filterTrue, 0, -1);
// 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(Match item) {
return false;
}