nz.ac.waikato.modeljunit.coverage
Class ActionCoverage

java.lang.Object
  extended by nz.ac.waikato.modeljunit.AbstractListener
      extended by nz.ac.waikato.modeljunit.coverage.AbstractCoverage
          extended by nz.ac.waikato.modeljunit.coverage.ActionCoverage
All Implemented Interfaces:
CoverageMetric, ModelListener

public class ActionCoverage
extends AbstractCoverage

Measures the number of distinct Actions that have been tested.


Field Summary
 
Fields inherited from class nz.ac.waikato.modeljunit.coverage.AbstractCoverage
coverage_, currCoverage_, maxCoverage_
 
Fields inherited from class nz.ac.waikato.modeljunit.AbstractListener
model_
 
Constructor Summary
ActionCoverage()
           
 
Method Summary
 void doneTransition(int action, Transition tr)
          The Model calls this after taking each transition.
 java.lang.String getDescription()
          A medium-length description of this coverage metric.
 int getMaximum()
          The maximum number of items that can be covered.
 java.lang.String getName()
          Get the short name that this listener is known by.
 void setGraph(InspectableGraph model, java.util.Map<java.lang.Object,Vertex> state2vertex)
          A default implementation that does nothing.
 
Methods inherited from class nz.ac.waikato.modeljunit.coverage.AbstractCoverage
addItem, clear, doneReset, getCoverage, getDetails, getPercentage, incrementItem, toString, transition
 
Methods inherited from class nz.ac.waikato.modeljunit.AbstractListener
doneGuard, failure, getModel, setModel, startAction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface nz.ac.waikato.modeljunit.ModelListener
doneGuard, failure, getModel, setModel, startAction
 

Constructor Detail

ActionCoverage

public ActionCoverage()
Method Detail

getName

public java.lang.String getName()
Description copied from interface: ModelListener
Get the short name that this listener is known by. This name is used to add a listener to a model or a Tester object and to lookup a listener. The name should be a short descriptive noun phrase, all in lowercase, should usually be less than 30 characters, and may contain spaces.


getDescription

public java.lang.String getDescription()
Description copied from interface: CoverageMetric
A medium-length description of this coverage metric. This should be a sentence or paragraph suitable for displaying as pop-up documentation, to explain the metric. For example, a state coverage metric might return "The number of different FSM states visited.".


getMaximum

public int getMaximum()
Description copied from class: AbstractCoverage
The maximum number of items that can be covered. For some coverage metrics, this may return -1 until the FSM graph is completely built.

Specified by:
getMaximum in interface CoverageMetric
Overrides:
getMaximum in class AbstractCoverage

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
Overrides:
doneTransition in class AbstractListener
Parameters:
action - The number of the action just taken.
tr - The transition just taken.

setGraph

public void setGraph(InspectableGraph model,
                     java.util.Map<java.lang.Object,Vertex> state2vertex)
Description copied from class: AbstractCoverage
A default implementation that does nothing.

Specified by:
setGraph in interface CoverageMetric
Overrides:
setGraph in class AbstractCoverage


Copyright © 2009 ModelJUnit Project. All Rights Reserved.