|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnz.ac.waikato.modeljunit.examples.QuiDonc
public class QuiDonc
A simple EFSM model of the Qui-Donc service. Qui-Donc is a service of France Telecom that allows you to ring up, enter a telephone number and find which subscriber owns that telephone number and what is their address.
Nested Class Summary | |
---|---|
static class |
QuiDonc.State
|
Field Summary | |
---|---|
java.lang.String |
_STAR
|
java.lang.String |
ADDR
|
java.lang.String |
BYE
|
java.lang.String |
ENTER
|
java.lang.String |
ERROR
|
java.lang.String |
FIRE
|
java.lang.String |
INFO
|
java.lang.String |
NAME
|
java.lang.String |
NOTALLOW
|
java.lang.String |
SORRY
|
java.lang.String |
SPELL
|
java.lang.String |
WELCOME
|
Constructor Summary | |
---|---|
QuiDonc()
|
|
QuiDonc(java.io.PrintWriter out0)
|
Method Summary | |
---|---|
void |
bad()
|
boolean |
badGuard()
|
static void |
checkGuard(QuiDonc quidonc,
boolean guard)
Convenience method for the interactive interface. |
void |
dial()
|
boolean |
dialGuard()
|
java.lang.String |
getState()
Return the current state of the FSM model. |
void |
key1()
|
boolean |
key1Guard()
|
void |
key2()
|
boolean |
key2Guard()
|
static void |
main(java.lang.String[] args)
An interactive interface to QuiDonce, for illustration purposes. |
void |
num1()
|
void |
num18()
|
boolean |
num18Guard()
|
boolean |
num1Guard()
|
void |
num2()
|
boolean |
num2Guard()
|
void |
reset(boolean testing)
Reset the model to its initial state. |
void |
star()
|
boolean |
starGuard()
|
void |
wait_()
We call this wait_, to avoid a clash with Java's Object.wait(). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.lang.String _STAR
public java.lang.String WELCOME
public java.lang.String NOTALLOW
public java.lang.String ENTER
public java.lang.String ERROR
public java.lang.String FIRE
public java.lang.String SORRY
public java.lang.String INFO
public java.lang.String NAME
public java.lang.String SPELL
public java.lang.String ADDR
public java.lang.String BYE
Constructor Detail |
---|
public QuiDonc()
public QuiDonc(java.io.PrintWriter out0)
Method Detail |
---|
public java.lang.String 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 boolean dialGuard()
public void dial()
public void wait_()
public boolean starGuard()
public void star()
public boolean badGuard()
public void bad()
public boolean num18Guard()
public void num18()
public boolean num1Guard()
public void num1()
public boolean num2Guard()
public void num2()
public boolean key1Guard()
public void key1()
public boolean key2Guard()
public void key2()
public static void checkGuard(QuiDonc quidonc, boolean guard)
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |