agenda.evaluateEagerList();
// should be one MatchCreatedEvent
assertEquals(1,
agendaList.size());
MatchCreatedEvent createdEvent = (MatchCreatedEvent) agendaList.get( 0 );
assertSame( cheddarHandle,
createdEvent.getMatch().getFactHandles().toArray()[0] );
// clear the agenda to check CLEAR events occur
ksession.getAgenda().clear();
MatchCancelledEvent cancelledEvent = (MatchCancelledEvent) agendaList.get( 1 );
assertEquals( MatchCancelledCause.CLEAR,
cancelledEvent.getCause() );
agendaList.clear();
// update results in an MatchCreatedEvent
cheddar.setPrice( 14 );
ksession.update(cheddarHandle,
cheddar);
agenda.evaluateEagerList();
assertEquals( 1,
agendaList.size() );
createdEvent = (MatchCreatedEvent) agendaList.get( 0 );
assertSame( cheddarHandle,
createdEvent.getMatch().getFactHandles().toArray()[0] );
agendaList.clear();
// update should not result in cancelation+activation events
cheddar.setPrice( 14 );
ksession.update( cheddarHandle,