org.drools.testframework
Class TestingEventListener
java.lang.Object
org.drools.testframework.TestingEventListener
- All Implemented Interfaces:
- EventListener, AgendaEventListener
public class TestingEventListener
- extends Object
- implements AgendaEventListener
This tracks what is happening in the engine with rule activations and firings.
It also allows you to choose what to include/exclude from firing.
If a rule is not allowed to fire, it will still be counted as an activation.
If it is allowed to fire, then it will only be counted after the activation is fired.
Method Summary |
void |
activationCancelled(ActivationCancelledEvent event,
WorkingMemory workingMemory)
|
void |
activationCreated(ActivationCreatedEvent event,
WorkingMemory workingMemory)
|
void |
afterActivationFired(AfterActivationFiredEvent event,
WorkingMemory workingMemory)
|
void |
afterRuleFlowGroupActivated(RuleFlowGroupActivatedEvent event,
WorkingMemory workingMemory)
|
void |
afterRuleFlowGroupDeactivated(RuleFlowGroupDeactivatedEvent event,
WorkingMemory workingMemory)
|
void |
agendaGroupPopped(AgendaGroupPoppedEvent event,
WorkingMemory workingMemory)
|
void |
agendaGroupPushed(AgendaGroupPushedEvent event,
WorkingMemory workingMemory)
|
void |
beforeActivationFired(BeforeActivationFiredEvent event,
WorkingMemory workingMemory)
|
void |
beforeRuleFlowGroupActivated(RuleFlowGroupActivatedEvent event,
WorkingMemory workingMemory)
|
void |
beforeRuleFlowGroupDeactivated(RuleFlowGroupDeactivatedEvent event,
WorkingMemory workingMemory)
|
AgendaFilter |
getAgendaFilter(HashSet<String> ruleNames,
boolean inclusive)
|
Map<String,Integer> |
getFiringCounts()
|
String[] |
getRulesFiredSummary()
Return a list of the rules fired, for display purposes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TestingEventListener
public TestingEventListener()
getAgendaFilter
public AgendaFilter getAgendaFilter(HashSet<String> ruleNames,
boolean inclusive)
activationCancelled
public void activationCancelled(ActivationCancelledEvent event,
WorkingMemory workingMemory)
- Specified by:
activationCancelled
in interface AgendaEventListener
activationCreated
public void activationCreated(ActivationCreatedEvent event,
WorkingMemory workingMemory)
- Specified by:
activationCreated
in interface AgendaEventListener
afterActivationFired
public void afterActivationFired(AfterActivationFiredEvent event,
WorkingMemory workingMemory)
- Specified by:
afterActivationFired
in interface AgendaEventListener
agendaGroupPopped
public void agendaGroupPopped(AgendaGroupPoppedEvent event,
WorkingMemory workingMemory)
- Specified by:
agendaGroupPopped
in interface AgendaEventListener
agendaGroupPushed
public void agendaGroupPushed(AgendaGroupPushedEvent event,
WorkingMemory workingMemory)
- Specified by:
agendaGroupPushed
in interface AgendaEventListener
beforeActivationFired
public void beforeActivationFired(BeforeActivationFiredEvent event,
WorkingMemory workingMemory)
- Specified by:
beforeActivationFired
in interface AgendaEventListener
getFiringCounts
public Map<String,Integer> getFiringCounts()
- Returns:
- A map of the number of times a given rule "fired".
(of course in reality the side effect of its firing may have been nilled out).
getRulesFiredSummary
public String[] getRulesFiredSummary()
- Return a list of the rules fired, for display purposes.
afterRuleFlowGroupActivated
public void afterRuleFlowGroupActivated(RuleFlowGroupActivatedEvent event,
WorkingMemory workingMemory)
- Specified by:
afterRuleFlowGroupActivated
in interface AgendaEventListener
afterRuleFlowGroupDeactivated
public void afterRuleFlowGroupDeactivated(RuleFlowGroupDeactivatedEvent event,
WorkingMemory workingMemory)
- Specified by:
afterRuleFlowGroupDeactivated
in interface AgendaEventListener
beforeRuleFlowGroupActivated
public void beforeRuleFlowGroupActivated(RuleFlowGroupActivatedEvent event,
WorkingMemory workingMemory)
- Specified by:
beforeRuleFlowGroupActivated
in interface AgendaEventListener
beforeRuleFlowGroupDeactivated
public void beforeRuleFlowGroupDeactivated(RuleFlowGroupDeactivatedEvent event,
WorkingMemory workingMemory)
- Specified by:
beforeRuleFlowGroupDeactivated
in interface AgendaEventListener
Copyright © 2001-2013 JBoss Inc.. All Rights Reserved.