|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnz.ac.waikato.modeljunit.examples.ecinema.ECinema
public class ECinema
A model of a simple eCinema. That is, a web-based system for selecting and buying movie tickets. For simplicity, Movie objects and Ticket objects are just modelled as strings. Note that missing usernames and passwords are modelled as empty strings ("").
Nested Class Summary | |
---|---|
static class |
ECinema.State
Each of these states models a separate web page. |
Field Summary | |
---|---|
java.util.Map<java.lang.String,User> |
allUsers
This maps each username to the User object. |
User |
currentUser
|
java.lang.String |
message
This is the most recent message that has been output. |
Showtime[] |
showtimes
|
ECinema.State |
state
|
Constructor Summary | |
---|---|
ECinema()
|
Method Summary | |
---|---|
void |
back()
|
boolean |
backGuard()
|
void |
buyTicket(Showtime shtime)
Buy one ticket for current user, from the given shtime. |
boolean |
buyTicketGrd(Showtime shtime)
|
void |
buyTicketShow1()
|
boolean |
buyTicketShow1Guard()
|
void |
buyTicketShow2()
|
boolean |
buyTicketShow2Guard()
|
void |
close()
|
boolean |
closeGuard()
|
protected java.util.Set<java.lang.String> |
currUsersTickets(Showtime shtime)
the current user's tickets for the given show time. |
void |
deleteAllTickets(Showtime shtime)
|
boolean |
deleteAllTicketsGrd(Showtime shtime)
|
void |
deleteAllTicketsShow1()
|
boolean |
deleteAllTicketsShow1Guard()
|
void |
deleteAllTicketsShow2()
|
boolean |
deleteAllTicketsShow2Guard()
|
void |
deleteTicket(Showtime shtime)
|
boolean |
deleteTicketGrd(Showtime shtime)
|
void |
deleteTicketShow1()
|
boolean |
deleteTicketShow1Guard()
|
void |
deleteTicketShow2()
|
boolean |
deleteTicketShow2Guard()
|
void |
displayTickets()
|
boolean |
displayTicketsGuard()
|
java.lang.Object |
getState()
Return the current state of the FSM model. |
void |
gotoRegister()
|
boolean |
gotoRegisterGuard()
|
void |
login(java.lang.String userName,
java.lang.String userPassword)
|
void |
loginAmandineEmpty()
|
boolean |
loginAmandineEmptyGuard()
|
void |
loginAmandineOk()
|
boolean |
loginAmandineOkGuard()
|
void |
loginEmpty()
|
boolean |
loginEmptyGuard()
|
void |
loginEricBad()
|
boolean |
loginEricBadGuard()
|
void |
loginEricOk()
|
boolean |
loginEricOkGuard()
|
boolean |
loginGrd()
|
void |
logout()
|
boolean |
logoutGuard()
|
static void |
main(java.lang.String[] args)
|
void |
reg(java.lang.String userName,
java.lang.String userPassword)
|
boolean |
regGuard(java.lang.String userName)
|
void |
registerAmandine()
|
boolean |
registerAmandineGuard()
|
void |
registerEmpty()
|
boolean |
registerEmptyGuard()
|
void |
registerEric()
|
boolean |
registerEricGuard()
|
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 |
---|
public ECinema.State state
public java.lang.String message
public User currentUser
public java.util.Map<java.lang.String,User> allUsers
public Showtime[] showtimes
Constructor Detail |
---|
public ECinema()
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 boolean loginEmptyGuard()
public boolean loginEricOkGuard()
public boolean loginEricBadGuard()
public boolean loginAmandineOkGuard()
public boolean loginAmandineEmptyGuard()
public void loginEmpty()
public void loginEricOk()
public void loginEricBad()
public void loginAmandineOk()
public void loginAmandineEmpty()
public boolean loginGrd()
public void login(java.lang.String userName, java.lang.String userPassword)
public boolean logoutGuard()
public void logout()
public boolean buyTicketShow1Guard()
public boolean buyTicketShow2Guard()
public void buyTicketShow1()
public void buyTicketShow2()
public boolean buyTicketGrd(Showtime shtime)
public void buyTicket(Showtime shtime)
public boolean deleteTicketShow1Guard()
public boolean deleteTicketShow2Guard()
public void deleteTicketShow1()
public void deleteTicketShow2()
public boolean deleteTicketGrd(Showtime shtime)
public void deleteTicket(Showtime shtime)
public boolean deleteAllTicketsShow1Guard()
public boolean deleteAllTicketsShow2Guard()
public void deleteAllTicketsShow1()
public void deleteAllTicketsShow2()
public boolean deleteAllTicketsGrd(Showtime shtime)
public void deleteAllTickets(Showtime shtime)
public boolean gotoRegisterGuard()
public void gotoRegister()
public boolean registerAmandineGuard()
public boolean registerEricGuard()
public boolean registerEmptyGuard()
public void registerAmandine()
public void registerEric()
public void registerEmpty()
public boolean regGuard(java.lang.String userName)
public void reg(java.lang.String userName, java.lang.String userPassword)
public boolean displayTicketsGuard()
public void displayTickets()
public boolean backGuard()
public void back()
public boolean closeGuard()
public void close()
protected java.util.Set<java.lang.String> currUsersTickets(Showtime shtime)
public static void main(java.lang.String[] args) throws java.io.FileNotFoundException
java.io.FileNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |