ReteooRuleBase rbase = ( ReteooRuleBase ) RuleBaseFactory.newRuleBase(conf);
StatefulSession wm = rbase.newStatefulSession();
InternalAgenda agenda = ( InternalAgenda ) wm.getAgenda();
AgendaItem item1 = new RuleTerminalNodeLeftTuple();
AgendaItem item2 = new RuleTerminalNodeLeftTuple();
AgendaItem item3 = new RuleTerminalNodeLeftTuple();
agenda.createAgendaItem((LeftTuple)item1, 0, null, null, null, null);
agenda.createAgendaItem((LeftTuple)item2, 0, null, null, null, null);
agenda.createAgendaItem((LeftTuple)item3, 0, null, null, null, null);
DefaultKnowledgeHelper kcontext = new DefaultKnowledgeHelper( wm );
kcontext.setActivation( item1 );
// set blockers
kcontext.blockMatch( item2 );
kcontext.blockMatch( item3 );
assertNull( item1.getBlockers() );
assertEquals( 2, item1.getBlocked().size() );
assertEquals( 1, item2.getBlockers().size() );
assertEquals( 1, item3.getBlockers().size() );
kcontext.reset();
kcontext.setActivation( item2 );
kcontext.blockMatch( item3 );
assertEquals( 2, item1.getBlocked().size() );
assertEquals( 1, item2.getBlocked().size() );
assertEquals( 1, item2.getBlockers().size() );
assertEquals( 2, item3.getBlockers().size() );
// now check correctly unblocks when parent activation is retracted
//agenda.createAgendaItem( tuple, salience, context, rtn )-
}