|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnz.ac.waikato.modeljunit.examples.gsm.SimCard
public class SimCard
This is an EFSM model of the SIM card within a mobile phone. It models just a small part of the functionality to do with accessing files and directories within the SIM card, and the PINs and PUKs used to make this secure. See Chapter 11 of the book "Practical Model-Based Testing: A Tools Approach" for more discussion of this system and a version of the model in B. This ModelJUnit version of the model was translated from a UML/OCL model developed at LEIRIOS Technologies, which in turn was adapted from an earlier and larger version of the B model published in the above book.
Nested Class Summary | |
---|---|
static class |
SimCard.B_Status
|
static class |
SimCard.E_Status
|
static class |
SimCard.F_Name
|
static class |
SimCard.File_Type
|
static class |
SimCard.Permission
|
static class |
SimCard.Status_Word
|
Field Summary | |
---|---|
protected int |
counter_PIN_try
|
protected int |
counter_PUK_try
|
protected File |
DF
|
protected File |
EF
|
protected java.util.Map<SimCard.F_Name,File> |
files
|
static int |
Max_Pin_Try
|
static int |
Max_Puk_Try
|
protected boolean |
perm_session
|
protected int |
PIN
|
protected static int |
PUK
|
protected java.lang.String |
read_data
|
protected SimCard.Status_Word |
result
|
protected SimCard.B_Status |
status_block
|
protected SimCard.E_Status |
status_en
|
protected SimCard.B_Status |
status_PIN_block
|
protected SimCardAdaptor |
sut
If this is non-null, each action calls the corresponding adaptor action, which tests the GSM11 implementation. |
Constructor Summary | |
---|---|
SimCard(SimCardAdaptor sut0)
If sut0 is null, then the model runs without
testing any SUT. |
Method Summary | |
---|---|
void |
Change_PIN(int old_Pin,
int new_Pin)
|
void |
changePinNew()
|
void |
changePinSame()
|
void |
Disabled_PIN(int Pin)
|
void |
disablePINGood()
|
void |
Enabled_PIN(int Pin)
|
void |
enablePIN11()
|
java.lang.Object |
getState()
Return the current state of the FSM model. |
static void |
main(java.lang.String[] args)
|
void |
Read_Binary()
|
void |
reset(boolean testing)
Reset the model to its initial state. |
void |
Select_file(SimCard.F_Name file_name)
|
void |
selectDF_Gsm()
|
void |
selectDF_Roaming()
|
void |
selectEF_FR()
|
void |
selectEF_IMSI()
|
void |
selectEF_LP()
|
void |
selectMF()
|
void |
Unblock_PIN(int Puk,
int new_Pin)
|
void |
unblockPINBad()
|
void |
unblockPINGood12()
|
void |
Verify_PIN(int Pin)
|
void |
verifyPIN11()
|
void |
verifyPIN12()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int PIN
protected static final int PUK
protected SimCard.E_Status status_en
protected SimCard.B_Status status_PIN_block
protected SimCard.B_Status status_block
protected int counter_PIN_try
protected int counter_PUK_try
protected boolean perm_session
public static final int Max_Pin_Try
public static final int Max_Puk_Try
protected java.lang.String read_data
protected SimCard.Status_Word result
protected File DF
protected File EF
protected java.util.Map<SimCard.F_Name,File> files
protected SimCardAdaptor sut
Constructor Detail |
---|
public SimCard(SimCardAdaptor sut0)
sut0
is null, then the model runs without
testing any SUT.
sut0
- Can be null.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 verifyPIN11()
public void verifyPIN12()
public void Verify_PIN(int Pin)
public void unblockPINGood12()
public void unblockPINBad()
public void Unblock_PIN(int Puk, int new_Pin)
public void enablePIN11()
public void Enabled_PIN(int Pin)
public void disablePINGood()
public void Disabled_PIN(int Pin)
public void changePinSame()
public void changePinNew()
public void Change_PIN(int old_Pin, int new_Pin)
public void selectMF()
public void selectDF_Gsm()
public void selectDF_Roaming()
public void selectEF_IMSI()
public void selectEF_LP()
public void selectEF_FR()
public void Select_file(SimCard.F_Name file_name)
public void Read_Binary()
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 |