nz.ac.waikato.modeljunit
Class AbstractListener

java.lang.Object
  extended by nz.ac.waikato.modeljunit.AbstractListener
All Implemented Interfaces:
ModelListener
Direct Known Subclasses:
AbstractCoverage, CoverageHistory, GraphListener, StopOnFailureListener, VerboseListener, VisualisationListener

public abstract class AbstractListener
extends java.lang.Object
implements ModelListener

An implementation of ModelListener that ignores all events. Subclasses must define the getName method, at least.


Field Summary
protected  Model model_
           
 
Constructor Summary
AbstractListener()
           
 
Method Summary
 void doneGuard(java.lang.Object state, int action, boolean enabled, int value)
          The Model calls this after each guard evaluation.
 void doneReset(java.lang.String reason, boolean testing)
          The Model calls this after each reset(boolean) action.
 void doneTransition(int action, Transition tr)
          The Model calls this after taking each transition.
 void failure(TestFailureException ex)
          The Model calls this when an action has found an error.
 Model getModel()
          Returns the model that this listener is listening to.
 void setModel(Model model)
          Tell the listener which model it is listening to.
 void startAction(java.lang.Object state, int action, java.lang.String name)
          This is called just before an action is about to be executed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nz.ac.waikato.modeljunit.ModelListener
getName
 

Field Detail

model_

protected Model model_
Constructor Detail

AbstractListener

public AbstractListener()
Method Detail

getModel

public Model getModel()
Returns the model that this listener is listening to.

Specified by:
getModel in interface ModelListener

setModel

public void setModel(Model model)
Description copied from interface: ModelListener
Tell the listener which model it is listening to.

Specified by:
setModel in interface ModelListener

doneReset

public void doneReset(java.lang.String reason,
                      boolean testing)
Description copied from interface: ModelListener
The Model calls this after each reset(boolean) action.

Specified by:
doneReset in interface ModelListener
Parameters:
reason - An adjective that describe why the reset was done.
testing - The parameter that was passed to the FsmModel reset call.

doneGuard

public void doneGuard(java.lang.Object state,
                      int action,
                      boolean enabled,
                      int value)
Description copied from interface: ModelListener
The Model calls this after each guard evaluation. Note that this will be called even after an implicit guard (which always returns true) has been evaluated. The enabled boolean says whether the guard of action is enabled or not, while value gives the actual value returned by the guard method (0 for false, 1 for true, or other positive integer values for Markov chain guards).

Specified by:
doneGuard in interface ModelListener

startAction

public void startAction(java.lang.Object state,
                        int action,
                        java.lang.String name)
Description copied from interface: ModelListener
This is called just before an action is about to be executed. (The guard of that action is known to be true at this point).

Specified by:
startAction in interface ModelListener
Parameters:
state - The current state of the model.
action - The number of the action.
name - The name of the action.

doneTransition

public void doneTransition(int action,
                           Transition tr)
Description copied from interface: ModelListener
The Model calls this after taking each transition.

Specified by:
doneTransition in interface ModelListener
Parameters:
action - The number of the action just taken.
tr - The transition just taken.

failure

public void failure(TestFailureException ex)
Description copied from interface: ModelListener
The Model calls this when an action has found an error. The failure exception contains lots of information about the test failure. If a listener throws this exception, then the test generation process will stop with this exception. (after all listeners have been notified of the failure).

Specified by:
failure in interface ModelListener


Copyright © 2009 ModelJUnit Project. All Rights Reserved.