|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnz.ac.waikato.modeljunit.examples.SimpleSet
public class SimpleSet
A model of a set with two elements: s1 and s2.
Field Summary | |
---|---|
protected boolean |
s1
|
protected boolean |
s2
|
Constructor Summary | |
---|---|
SimpleSet()
|
Method Summary | |
---|---|
void |
addS1()
|
void |
addS2()
|
java.lang.Object |
getState()
Return the current state of the FSM model. |
static void |
main(java.lang.String[] args)
An example of generating tests from this model. |
void |
removeS1()
|
void |
removeS2()
|
void |
reset(boolean testing)
Reset the model to its initial state. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean s1
protected boolean s2
Constructor Detail |
---|
public SimpleSet()
Method Detail |
---|
public java.lang.Object getState()
FsmModel
Advanced Feature: This method can be used to define
equivalence classes over the states, if you want to reduce
the number of states to keep the FSM small.
For example, if you have a integer state variable I that can
have a huge number of possible values, you could define your
getState() method to return new Integer(I % 10)
.
This would reduce the FSM to just 10 states, where FSM state 0
represents all the states where I=0 or I=10 or I=20 etc., and
FSM state 1 represents all the states where I=1 or I=11 or I=21 etc.
getState
in interface FsmModel
public void reset(boolean testing)
FsmModel
reset
in interface FsmModel
testing
- true means the SUT should be reset too.public void addS1()
public void addS2()
public void removeS1()
public void removeS2()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |