6.1 Package sim.access:
3GPP51.013Release 17Test specification for Subscriber Identity Module (SIM) Application Programming Interface (API) for Java CardTS
6.1.1 Interface SIMView
NOTE: The Test applet shall be run on a class that implements this interface.
6.1.1.1 Constants
Test Area Reference: API_1_SVW_CONST
6.1.1.1.1 Conformance Requirements
This clause does not describe the conformance requirements for a method, but rather for the constants of the interface.
6.1.1.1.1.1 Normal execution
CRRN1: The constants shall have the same name and value that is defined in 3GPP TS 43.019 [7].
6.1.1.1.2 Test Suite Files
None.
6.1.1.1.3 Test Procedure
The constants in Java are resolved at compilation time, therefore a runtime test is not useful. No test of constants will be performed.
6.1.1.2 Method select(short fid, byte[] fci, short fciOffset, short fciLength)
Test Area Reference: API_1_SVW_SLCTS_BSS
6.1.1.2.1 Conformance Requirements
The method with the following header shall be compliant to its definition in the API.
public short select(short fid,
byte[] fci,
short fciOffset,
short fciLength)
throws java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException,
SIMViewException
6.1.1.2.1.1 Normal execution
– CRRN1: If the desired file is selected, the length of the FCI (File Control Information) which has been written to the array fci is returned.
– CRRN2: If the length fciLength is greater than or equal to the length of the FCI structure, the whole FCI structure is copied into the array fci and the length of the FCI which has been written to the array fci is returned.
– CRRN3: If the length fciLength is less than the length of the FCI structure, the first part of the FCI structure is copied into the array fci and the length of the FCI which has been written to the array fci is returned.
– CRRN4: After selecting a DF/MF no EF is selected.
– CRRN5: After selecting a linear fixed EF no record is selected.
– CRRN6: After selecting a cyclic EF the first record which is the last updated record is selected.
– CRRN7: The current files (file context) of any other applets shall not be changed. See TS 43.019 [7] – clause5.2. This will be tested during the testing of the framework.
– CRRN8: The information returned by fci shall be formatted as described in TS 51.011 [3], clause9.2.1.
– CRRN9: The file with a File-ID that matches fid shall be found according to the following selection rules:
1) An immediate child EF or DF of the current MF/DF can be selected,
2) A sibling DF of the current DF can be selected,
3) The current MF/DF it self can be selected,
4) The parent MF/DF of the current DF can be selected,
5) The MF can always be selected.
6.1.1.2.1.2 Parameter errors
– CRRP1: If the array fci is null, an instance of NullPointerException shall be thrown.
– CRRP2: If fciOffset is less than 0, an instance of ArrayIndexOutOfBoundsException shall be thrown.
– CRRP3: If fciLength is less than 0, an instance of ArrayIndexOutOfBoundsException shall be thrown.
– CRRP4: If fciOffset plus fciLength is greater than the length of the array fci.length, or fciOffset equals fci.length, an instance of ArrayIndexOutOfBoundsException shall be thrown.
6.1.1.2.1.3 Context errors
– CRRC1: If the file with a File-ID which matches fid could not be found according to the selection rules listed in CRRN9, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.FILE_NOT_FOUND.
– CRRC2: If the method call causes a memory problem (e.g. memory access error), an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.MEMORY_PROBLEM.
– CRRC3: If the method call causes an error to occur that is not expected and thus not handled, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.INTERNAL_ERROR.
6.1.1.2.2 Test Suite Files
Additional requirements for the GSM personalization: None
Test Script: API_1_SVW_SLCTS_BSS_1.scr
Test Applet: API_1_SVW_SLCTS_BSS_1.java
Load Script: API_1_SVW_SLCTS_BSS_1.ldr
Cleanup Script: API_1_SVW_SLCTS_BSS_1.clr
Parameter File: API_1_SVW_SLCTS_BSS_1.par
6.1.1.2.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
---|---|---|---|
0 |
SIM Initialization |
Responses ignored. |
|
1 |
Select EFICCID in MF (Transparent EF) fid = SIMView.FID_EF_ICCID byte[] fci = new byte[34] fciOffset = 0 fciLength = 20 select() |
No exception shall be thrown. Shall return a value not greater than 20. <Description of fci: XX XX XX XX 2F E2 04 > |
|
2 |
Select EFICCID in MF (Transparent EF) fid = SIMView.FID_EF_ICCID fciOffset = 0 fciLength = 13 select() |
No exception shall be thrown. Shall return 13. fci shall contain the first 13 bytes of the FCI structure. |
|
3 |
Select DFGSM in MF fid = SIMView.FID_DF_GSM fciOffset = 0 fciLength = 7 select() |
No exception shall be thrown. Shall return 7. fci shall contain the first 7 bytes of the FCI. <Description of fci: XX XX XX XX 7F 20 02 > |
|
3 |
Select DFGSM in MF fid = SIMView.FID_DF_GSM fciOffset = 0 fciLength = 7 select() |
No exception shall be thrown. Shall return 7. fci shall contain the entire FCI structure. <Description of fci: XX XX XX XX 7F 20 02 > |
|
4 |
Select EFACM in DFGSM (CyclicEF) fid = SIMView.FID_EF_ACM fciOffset = 0 fciLength = 20 select() |
No exception shall be thrown. Shall return a value between 15 and 20. (Cyclic EF) fci shall contain the first 15 or more bytes of the FCI structure. fci[14] shall have the value 3 (length of record). |
|
5 |
Select MF fid = SIMView.FID_MF fciOffset = 0 fciLength = 34 select() |
No exception shall be thrown. Shall return a value between 22 and 34. fci shall contain the entire FCI structure. |
|
6 |
Select DFTELECOM in MF fid = SIMView.FID_DF_TELECOM fci[0] = fci[1] = ’05’ fciOffset = 2 fciLength = 20 select() |
No exception shall be thrown. Shall return 20. fci shall contain the first 20 bytes of the FCI structure starting at index 2. The first two bytes shall (still) have the value ’05’. |
|
7 |
Select EFFDN in DFTELECOM (Linear FixedEF) fid = SIMView.FID_EF_FDN fciOffset = 0 fciLength = 15 select() |
No exception shall be thrown. Shall return 15. fci shall contain the first 15 bytes of the FCI structure. fci[14] shall have the value 28 (length of record). |
|
8 |
fci is null fid = SIMView.FID_EF_FDN byte[] nullBuffer = null fciOffset = 0 fciLength = 15 select() |
Shall throw java.lang.NullPointerException. |
|
9 |
fciOffset < 0 fid = SIMView.FID_EF_FDN fciOffset = -1 fciLength = 15 select() |
Shall throw java.lang.ArrayIndexOutOfBoundsException. |
|
10 |
fciLength < 0 fid = SIMView.FID_EF_FDN fciOffset = 0 fciLength = -1 select() |
Shall throw java.lang.ArrayIndexOutOfBoundsException. |
|
11 |
fciOffset + fciLength > fci.length fid = SIMView.FID_EF_FDN fciOffset = 20 fciLength = 15 select() |
Shall throw java.lang.ArrayIndexOutOfBoundsException. |
|
12 |
fciOffset fci.length fid = SIMView.FID_EF_FDN fciOffset = 34 fciLength = 1 select() |
Shall throw java.lang.ArrayIndexOutOfBoundsException |
|
13 |
Selection possibilities 1 – fid = SIMView.FID_MF fciOffset = 0 fciLength = 15 select() 2 – fid = SIMView.FID_DF_TELECOM select() 3 – fid = SIMView.FID_DF_GRAPHICS select() 4 – fid = SIMView.FID_DF_TELECOM select() 5 – fid = SIMView.FID_DF_GRAPHICS select() 6 – fid = SIMView.FID_MF select() 7 – fid = SIMView.FID_DF_GSM select() 8 – fid = SIMView.FID_DF_TELECOM select() 9 – fid = SIMView.FID_DF_TELECOM select() – |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – No exception shall be thrown. 4 – No exception shall be thrown. 5 – No exception shall be thrown. 6 – No exception shall be thrown. 7 – No exception shall be thrown. 8 – No exception shall be thrown. 9 – No exception shall be thrown. |
|
14 |
EF not selected after MF/DF selection 1 – fid = SIMView.FID_MF select() fid = SIMView.FID_EF_ICCID select() 2 – fid = SIMView.FID_MF select() readBinary() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code NO_EF_SELECTED. |
|
15 |
No selection of non-reachable file 1 – fid = SIMView.FID_MF select() 2 – fid = SIMView.FID_EF_ACM select() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code FILE_NOT_FOUND. |
|
16 |
No record is selected after selecting linear fixed EF 1 – fid = SIMView.FID_MF select() 2 – fid = FID_DF_SIMTEST select() 3 – fid = FID_EF_LARU select() 4 – recNumber = 0 mode = REC_ACC_MODE_ABSOLUTE_CURRENT readRecord() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – No exception shall be thrown. 4 – Shall throw sim.access.SIMViewException with reason code RECORD_NUMBER_NOT_AVAILABLE. |
|
17 |
Record pointer in selected cyclic EF 1 – fid = SIMView.FID_MF select() 2 – fid = FID_DF_SIMTEST select() 3 – fid = FID_EF_CARU select() 4 – byte[] data1 = { 1,2,3 } mode = REC_ACC_MODE_PREVIOUS updateRecord(data1) 5 – fid = FID_EF_CARU select() readRecord(data2) compare data1 to data2 |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – No exception shall be thrown. 4 – No exception shall be thrown. 5 – The contents of data1 and data2 shall be identical. |
6.1.1.2.4 Test Coverage
CRR Number |
Test Case Number |
---|---|
N1 |
1-7 |
N2 |
3, 5 |
N3 |
1, 2, 4, 6, 7 |
N4 |
14 |
N5 |
16 |
N6 |
17 |
N8 |
1, 3 |
N9 |
1-7, 13 |
P1 |
8 |
P2 |
9 |
P3 |
10 |
P4 |
11, 12 |
C1 |
15 |
C2, C3 |
Not Tested |
6.1.1.3 Method select (short fid)
Test Area Reference: API_1_SVW_SLCTS
6.1.1.3.1 Conformance Requirements
The method with the following header shall be compliant to its definition in the API.
public void select(short fid)
throws SIMViewException
6.1.1.3.1.1 Normal execution
– CRRN1: If the desired file is selected, no exception is thrown.
– CRRN2: After selecting a DF/MF no EF is selected.
– CRRN3: After selecting a linear fixed EF no record is selected.
– CRRN4: After selecting a cyclic EF the first record which is the last updated record is selected.
– CRRN5: The current files (file context) of any other applets shall not be changed [TS 43.019 [7] – clause5.2]. This will be tested during the testing of the framework.
–
1) An immediate child EF or DF of the current MF/DF can be selected,
2) A sibling DF of the current DF can be selected,
3) The current MF/DF it self can be selected,
4) The parent MF/DF of the current DF can be selected,
5) The MF can always be selected.
6.1.1.3.1.2 Parameter errors
No requirements.
6.1.1.3.1.3 Context errors
– CRRC1: If the file with a File-ID which matches fid could not be found according to the selection rules listed in CCRN6, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.FILE_NOT_FOUND.
– CRRC2: If the method call causes a memory problem (e.g. memory access error), an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.MEMORY_PROBLEM.
– CRRC3: If the method call causes an error to occur that is not expected and thus not handled, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.INTERNAL_ERROR.
6.1.1.3.2 Test Suite Files
Additional requirements for the GSM personalization: None
Test Script: API_1_SVW_SLCTS_1.scr
Test Applet: API_1_SVW_SLCTS_1.java
Load Script: API_1_SVW_SLCTS_1.ldr
Cleanup Script: API_1_SVW_SLCTS_1.clr
Parameter File: API_1_SVW_SLCTS_1.par
6.1.1.3.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
---|---|---|---|
0 |
SIM Initialization |
Responses ignored. |
|
1 |
Select EFICCID in MF (Transparent EF) fid = SIMView.FID_EF_ICCID select() |
No exception shall be thrown. |
|
2 |
EF not selected after MF/DF selection 1 – fid = SIMView.FID_MF select() fid = SIMView.FID_EF_ICCID select() 2 – fid = SIMView.FID_MF select() readBinary() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code NO_EF_SELECTED. |
|
3 |
No record is selected after selecting linear fixed EF 1 – fid = SIMView.FID_MF select() 2 – fid = FID_DF_SIMTEST select() 3 – fid =FID_EF_LARU select() 4 – recNumber = 0 mode = REC_ACC_MODE_ABSOLUTE_CURRENT readRecord() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – No exception shall be thrown. 4 – Shall throw sim.access.SIMViewException with reason code RECORD_NUMBER_NOT_AVAILABLE. |
|
4 |
Record pointer in selected cyclic EF 1 – fid = SIMView.FID_MF select() 2 – fid =FID_DF_SIMTEST select() 3 – fid = FID_EF_CARU select() 4 – byte[] data1 = { 1,2,3 } updateRecord(data1) 5 – fid = FID_EF_CARU select() readRecord(data2) compare data1 to data2 |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – No exception shall be thrown. 4 – No exception shall be thrown. 5 – The contents of data1 and data2 shall be identical. |
|
5 |
Selection possibilities 1 – fid = SIMView.FID_MF select() 2 – fid = SIMView.FID_DF_TELECOM select() 3 – fid = SIMView.FID_DF_GRAPHICS select() 4 – fid = SIMView.FID_DF_TELECOM select() 5 – fid = SIMView.FID_DF_GRAPHICS select() 6 – fid = SIMView.FID_MF select() 7 – fid = SIMView.FID_DF_GSM select() 8 – fid = SIMView.FID_DF_TELECOM select() 9 – fid = SIMView.FID_DF_TELECOM select() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – No exception shall be thrown. 4 – No exception shall be thrown. 5 – No exception shall be thrown. 6 – No exception shall be thrown. 7 – No exception shall be thrown. 8 – No exception shall be thrown. 9 – No exception shall be thrown. |
|
6 |
No selection of unreachable file 1 – fid = SIMView.FID_MF select() 2 – fid = SIMView.FID_EF_ACM select() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code FILE_NOT_FOUND. |
6.1.1.3.4 Test Coverage
CRR Number |
Test Case Number |
---|---|
N1 |
1 |
N2 |
2 |
N3 |
3 |
N4 |
4 |
N6 |
5 |
C1 |
6 |
C2, C3 |
Not Tested |
6.1.1.4 Method status
Test Area Reference: API_1_SVW_STAT_BSS
6.1.1.4.1 Conformance Requirements
The method with the following header shall be compliant to its definition in the API.
public short status(byte[] fci,
short fciOffset,
short fciLength)
throws java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException,
SIMViewException
6.1.1.4.1.1 Normal execution
– CRRN1: The FCI (File Control Information) of the current DF (or MF) is returned in the same format as for a SELECT command in case of selecting an MF/DF (described in 3GPP TS 43.019 [7], clause 9.2.1).
– CRRN2: If the length fciLength is greater than or equal to the length of the FCI structure, the whole FCI structure is copied into the array fci and the length of the FCI which has been written to the array fci is returned.
– CRRN3: If the length fciLength is less than the length of the FCI structure, the first part of the FCI structure is copied into the array fci and the length of the FCI which has been written to the array fci is returned.
6.1.1.4.1.2 Parameter errors
– CRRP1: If the array fci is null, an instance of NullPointerException shall be thrown.
– CRRP2: If fciOffset is less than 0, an instance of ArrayIndexOutOfBoundsException shall be thrown.
– CRRP3: If fciLength is less than 0, an instance of ArrayIndexOutOfBoundsException shall be thrown.
– CRRP4: If fciOffset plus fciLength is greater than the length of the array fci.length, or fciOffset equals fci.length, an instance of ArrayIndexOutOfBoundsException shall be thrown.
6.1.1.4.1.3 Context errors
– CRRC1: If the method call causes a memory problem (e.g. memory access error), an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.MEMORY_PROBLEM.
– CRRC2: If the method call causes an error to occur that is not expected and thus not handled, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.INTERNAL_ERROR.
6.1.1.4.2 Test Suite Files
Additional requirements for the GSM personalization:
Test Script: API_1_SVW_STAT_BSS_1.scr
Test Applet: API_1_SVW_STAT_BSS_1.java
Load Script: API_1_SVW_STAT_BSS_1.ldr
Cleanup Script: API_1_SVW_STAT_BSS_1.clr
Parameter File: API_1_SVW_STAT_BSS_1.par
6.1.1.4.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
---|---|---|---|
0 |
SIM Initialization |
Responses ignored. |
|
1 |
Status of MF byte[] fci = new byte[34] fciOffset = 0 fciLength = 7 status() |
No exception shall be thrown. Shall return 7. fci shall contain the entire FCI structure. <Description of fci: XX XX XX XX 3F 00 01 > |
|
2 |
Status after select EFICCID in MF 1 – fid = SIMView.FID_DF_GSM fciOffset = 0 fciLength = 34 len = select() 2 – byte[] fci2 = new byte[34] len2 = status() 3 – Compare len and len2 4 – Compare the len bytes of fci and fci2 |
1 – No exception shall be thrown. Shall return a value between 22 and 34. 2 – No exception shall be thrown. Shall return 22 or more. 3 – len and len2 shall be identical 4 – fci and fci2 shall be identical |
|
3 |
Status of DFTelecom 1 – fid = SIMView.FID_DF_TELECOM select() 2 – fciOffset = 0 fciLength = 100 status() |
1 – No exception shall be thrown. Shall return a value between 22 and 34. 2 – No exception shall be thrown. Shall return a value between 22 and34. fci shall contain the entire FCI structure (check that returned value is equal to 13 plus the "length of following data" – fci[12]).FID of the returned fci (fci[4:5]) is FID_DF_TELECOM. |
|
4 |
Status DFTELECOM fciOffset = 0 fciLength = 7 status() |
No exception shall be thrown. Shall return 7. fci shall contain the first 7 bytes of the FCI structure starting at index 0. FID of the returned fci (fci[4:5]) is FID_DF_TELECOM. |
|
5 |
fci is null byte[] nullBuffer = null fciOffset = 0 fciLength = 34 status() |
Shall throw java.lang.NullPointerException. |
|
6 |
fciOffset < 0 fciOffset = -1 fciLength = 34 status() |
Shall throw java.lang.ArrayIndexOutOfBoundsException. |
|
7 |
fciLength < 0 fciOffset = 0 fciLength = -1 status() |
Shall throw java.lang.ArrayIndexOutOfBoundsException. |
|
8 |
fciOffset + fciLength > fci.length fciOffset = 20 fciLength = 15 status() |
Shall throw java.lang.ArrayIndexOutOfBoundsException. |
|
9 |
fciOffset fci.length fciOffset = 34 fciLength = 1 status() |
Shall throw java.lang.ArrayIndexOutOfBoundsException. |
6.1.1.4.4 Test Coverage
CRR Number |
Test Case Number |
---|---|
N1 |
1-4 |
N2 |
2, 3 |
N3 |
1, 4 |
P1 |
5 |
P2 |
6 |
P3 |
7 |
P4 |
8, 9 |
C1, C2 |
Not Tested |
6.1.1.5 Method readBinary
Test Area Reference: API_1_SVW_REDBS_BSS
6.1.1.5.1 Conformance Requirements
The method with the following header shall be compliant to its definition in the API.
public short readBinary(short fileOffset,
byte[] resp,
short respOffset,
short respLength)
throws java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException,
SIMViewException
6.1.1.5.1.1 Normal execution
– CRRN1: If data can be accessed at the specified offset, the value respOffset plus respLength are returned and the data bytes of the currently selected transparent file are returned in resp.
6.1.1.5.1.2 Parameter errors
– CRRP1: If fileOffset is less than 0, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.OUT_OF_FILE_BOUNDARIES.
– CRRP2: If fileOffset plus respLength exceeds the length of the file, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.OUT_OF_FILE_BOUNDARIES.
– CRRP3: If the array resp is null, an instance of NullPointerException shall be thrown.
– CRRP4: If respOffset is less than 0, an instance of ArrayIndexOutOfBoundsException shall be thrown.
– CRRP5: If respLength is less than 0, an instance of ArrayIndexOutOfBoundsException shall be thrown.
– CRRP6: If respOffset plus respLength is greater than the length of the array resp.length, an instance of ArrayIndexOutOfBoundsException shall be thrown.
6.1.1.5.1.3 Context errors
– CRRC1: If the calling applet has currently no EF selected, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.NO_EF_SELECTED.
– CRRC2: If the currently selected EF is not transparent, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.FILE_INCONSISTENT.
– CRRC3: If the calling applet does not fulfil the access condition, READ, to perform this function, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.AC_NOT_FULFILLED.
– CRRC4: If the currently selected EF is invalidated and the file status of the EF does not allow for the reading of an invalidated file, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.INVALIDATION_STATUS_CONTRADICTION.
– CRRC5: If the method call causes a memory problem (e.g. memory access error), an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.MEMORY_PROBLEM.
– CRRC6: If the method call causes an error to occur that is not expected and thus not handled, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.INTERNAL_ERROR.
6.1.1.5.2 Test Suite Files
Additional requirements for the GSM personalization: none.
Test Script: API_1_SVW_REDBS_BSS_1.scr
Test Applet: API_1_SVW_REDBS_BSS_1.java
Load Script: API_1_SVW_REDBS_BSS_1.ldr
Cleanup Script: API_1_SVW_REDBS_BSS_1.clr
Parameter File: API_1_SVW_REDBS_BSS_1.par
6.1.1.5.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
---|---|---|---|
0 |
SIM Initialization |
Responses ignored |
|
1 |
Read from EFICCID in MF (Transparent EF) 1 – fid = SIMView.FID_EF_ICCID select() 2 – fileOffset = 0 byte[] resp = new byte[20] resp[0:19] = ’55’ respOffset = 10 respLength = 10 readBinary() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. Shall return 20. resp shall contain the entire contents of EFICCID starting at index 10. <Description of resp: 55 55 55 55 55 55 55 55 55 55 0F FF FF FF FF FF FF FF FF FF > |
|
2 |
Read from EFICCID in MF resp[0:19] = ’55’ fileOffset = 5 respOffset = 10 respLength = 5 readBinary() |
No exception shall be thrown. Shall return 15. resp shall contain the last 5 bytes of EFICCID starting at index 10. <Description of resp: 55 55 55 55 55 55 55 55 55 55 FF FF FF FF FF 55 55 55 55 55 > |
|
3 |
Offset into File out of bounds fileOffset = -1 respOffset = 0 respLength = 10 readBinary() |
Shall throw sim.access.SIMViewException with reason code OUT_OF_FILE_BOUNDARIES. |
|
4 |
fileOffset + respLength > EF length fileOffset = 9 respOffset = 0 respLength = 2 readBinary() |
Shall throw sim.access.SIMViewException with reason code OUT_OF_FILE_BOUNDARIES. |
|
5 |
resp is null byte[] nullBuffer = null fileOffset = 0 respOffset = 0 respLength = 10 readBinary() |
Shall throw java.lang.NullPointerException. |
|
6 |
respOffset < 0 fileOffset = 0 respOffset = -1 respLength = 10 readBinary() |
Shall throw java.lang. ArrayIndexOutOfBoundsException. |
|
7 |
respLength < 0 fileOffset = 0 respOffset = 0 respLength = -1 readBinary() |
Shall throw java.lang. ArrayIndexOutOfBoundsException. |
|
8 |
respOffset + respLength > resp.length fileOffset = 0 respOffset = 10 respLength = 11 readBinary() |
Shall throw java.lang. ArrayIndexOutOfBoundsException. |
|
9 |
EF is not Transparent 1 – fid = FID_DF_SIMTEST select() 2 – fid = FID_EF_LARU select() 3 – fileOffset = 0 respOffset = 0 respLength = 1 readBinary() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – Shall throw sim.access.SIMViewException with reason code FILE_INCONSISTENT. |
|
10 |
Access condition not fulfilled 1 – fid = DFSIMTTEST select() 2 – fid = EFTNR select() 3 – fileOffset = 0 respOffset = 0 respLength = 1 readBinary() |
Shall throw sim.access.SIMViewException with reason code AC_NOT_FULFILLED. |
|
11 |
EF is invalidated 1 – fid = EFTNU invalidate() 2 – readBinary() 3 – rehabilitate() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code INVALIDATION_STATUS_CONTRADICTION. 3 – No exception shall be thrown. |
|
12 |
No EF selected 1- fid = SIMView.FID_MF select() 2 readBinary() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code NO_EF_SELECTED. |
6.1.1.5.4 Test Coverage
CRR Number |
Test Case Number |
---|---|
N1 |
1-2 |
P1 |
3 |
P2 |
4 |
P3 |
5 |
P4 |
6 |
P5 |
7 |
P6 |
8, |
C1 |
12 |
C2 |
9 |
C3 |
10 |
C4 |
11 |
C5, C6 |
Not Tested |
6.1.1.6 Method updateBinary
Test Area Reference: API_1_SVW_UPDBS_BSS
6.1.1.6.1 Conformance Requirements
The method with the following header shall be compliant to its definition in the API.
public void updateBinary(short fileOffset,
byte[] data,
short dataOffset,
short dataLength)
throws java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException,
SIMViewException
6.1.1.6.1.1 Normal execution
– CRRN1: The currently selected transparent file is updated starting at fileOffset, with the string of dataLength bytes in the array data starting at dataOffset.
6.1.1.6.1.2 Parameter errors
– CRRP1: If fileOffset is less than 0, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.OUT_OF_FILE_BOUNDARIES.
– CRRP2: If fileOffset plus dataLength exceeds the length of the file, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.OUT_OF_FILE_BOUNDARIES.
– CRRP3: If the array data is null, an instance of NullPointerException shall be thrown.
– CRRP4: If dataOffset is less than 0, an instance of ArrayIndexOutOfBoundsException shall be thrown.
– CRRP5: If dataLength is less than 0, an instance of ArrayIndexOutOfBoundsException shall be thrown.
– CRRP6: If dataOffset plus dataLength greater than the length of the array data.length an instance of ArrayIndexOutOfBoundsException shall be thrown.
6.1.1.6.1.3 Context errors
– CRRC1: If the calling applet has currently no EF selected, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.NO_EF_SELECTED.
– CRRC2: If the currently selected EF is not transparent, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.FILE_INCONSISTENT.
– CRRC3: If the calling applet does not fulfil the access condition, UPDATE, to perform this function, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.AC_NOT_FULFILLED.
– CRRC4: If the currently selected EF is invalidated and the file status of the EF does not allow for updating of an invalidated file, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.INVALIDATION_STATUS_CONTRADICTION.
– CRRC5: If the method call causes a memory problem (e.g. memory access error), an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.MEMORY_PROBLEM.
– CRRC6: If the method call causes an error to occur that is not expected and thus not handled, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.INTERNAL_ERROR.
6.1.1.6.2 Test Suite Files
Additional requirements for the GSM personalization: None
Test Script: API_1_SVW_UPDBS_BSS_1.scr
Test Applet: API_1_SVW_UPDBS_BSS_1.java
Load Script: API_1_SVW_UPDBS_BSS_1.ldr
Cleanup Script: API_1_SVW_UPDBS_BSS_1.clr
Parameter File: API_1_SVW_UPDBS_BSS_1.par
6.1.1.6.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
---|---|---|---|
0 |
SIM Initialization |
Responses ignored. |
|
1 |
No EF selected fileOffset = 0 byte[] data = new byte[20] data[0] = ’55’ dataOffset = 0 dataLength = 10 updateBinary() |
Shall throw sim.access.SIMViewException with reason code NO_EF_SELECTED. |
|
2 |
Update Transparent EF 1 – fid = DFSIMTEST select() 2 – fid = EFTARU select() 3 – fileOffset = 3 data[0] = ’55’ dataOffset = 0 dataLength = 1 updateBinary() 4 – fileOffset = 3 respOffset = 0 respLength = 1 readBinary() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – No exception shall be thrown. 4 – No exception shall be thrown. Data in resp[0] shall be ’55’. |
|
3 |
1 – fileOffset = 254 data[0] = ’55’ data[1] = ‘AA’ data[2] = ’66’ dataOffset = 0 dataLength = 3 updateBinary() 2 – fileOffset = 254 respOffset = 0 respLength = 3 readBinary() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. Data in resp shall be resp[0] = ’55’ resp[1] = ‘AA’ resp[2] = ’66’ |
|
4 |
Offset into File out of bounds fileOffset = -1 dataOffset = 0 dataLength = 10 updateBinary() |
Shall throw sim.access.SIMViewException with reason code OUT_OF_FILE_BOUNDARIES. |
|
5 |
fileOffset + dataLength > EF length fileOffset = 259 dataOffset = 0 dataLength = 2 updateBinary() |
Shall throw sim.access.SIMViewException with reason code OUT_OF_FILE_BOUNDARIES. |
|
6 |
data is null byte[] nullBuffer = null fileOffset = 0 dataOffset = 0 dataLength = 10 updateBinary() |
Shall throw java.lang.NullPointerException. |
|
7 |
dataOffset < 0 fileOffset = 0 dataOffset = -1 dataLength = 10 updateBinary() |
Shall throw java.lang. ArrayIndexOutOfBoundsException. |
|
8 |
dataLength < 0 fileOffset = 0 dataOffset = 0 dataLength = -1 updateBinary() |
Shall throw java.lang. ArrayIndexOutOfBoundsException. |
|
9 |
dataOffset + dataLength > data.length fileOffset = 0 dataOffset = 10 dataLength = 11 updateBinary() |
Shall throw java.lang. ArrayIndexOutOfBoundsException. |
|
10 |
EF is not Transparent 1 – fid = FID_DF_SIMTEST select() 2 – fid = FID_EF_LARU select() 3 – fileOffset = 0 data[0] = ’55’ dataOffset = 0 dataLength = 1 updateBinary() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – Shall throw sim.access.SIMViewException with reason code FILE_INCONSISTENT. |
|
11 |
Access condition not fulfilled 1 – fid = DFSIMTEST select() fid = EFTNU select() 2 – fileOffset = 0 data[0] = ’55’ dataOffset = 0 dataLength = 1 updateBinary() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code AC_NOT_FULFILLED. |
|
12 |
EF is invalidated 1 – fid = EFTNR invalidate() 2 – fileOffset = 0 data[0] = ’55’ dataOffset = 0 dataLength = 1 updateBinary() 3 – rehabilitate() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code INVALIDATION_STATUS_CONTRADICTION. 3 – No exception shall be thrown. |
6.1.1.6.4 Test Coverage
CRR Number |
Test Case Number |
---|---|
N1 |
2, 3 |
P1 |
4 |
P2 |
5 |
P3 |
6 |
P4 |
7 |
P5 |
8 |
P6 |
9 |
C1 |
1 |
C2 |
10 |
C3 |
11 |
C4 |
12 |
C5, C6 |
Not Tested |
6.1.1.7 Method readRecord
Test Area Reference: API_1_SVW_REDRSBS_BSS
6.1.1.7.1 Conformance Requirements
The method with the following header shall be compliant to its definition in the API.
public short readRecord(short recNumber,
byte mode,
short recOffset,
byte[] resp,
short respOffset,
short respLength)
throws java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException,
SIMViewException
6.1.1.7.1.1 Normal execution
– CRRN1: The data bytes from the record, specified by mode and recNumber of the currently selected linear fixed or cyclic EF, is read at recOffset. A total of respLength bytes of this data is copied to the array resp at respOffset.
– CRRN2: If the access mode is REC_ACC_MODE_ABSOLUTE_CURRENT:
– if recNumber is not 0, the record addressed by recNumber will be read;
– if recNumber is 0 the current selected record will be read; and
– the current record pointer shall not change.
– CRRN3: If the access mode is REC_ACC_MODE_NEXT:
– the next record relative to the current selected record will be selected and read;
– if no current record is selected, the first record will be selected and read;
– if the current record pointer is set to the last record for a cyclic EF the record pointer is set to the first record and the record is read;
– the current record pointer of any other applet shall not be changed.
– CRRN4: If the access mode is REC_ACC_MODE_PREVIOUS:
– the previous record relative to the current selected record will be selected and read;
– if no current record is selected, the last record will be selected and read;
– if the current record pointer is set to the first record, for a linear fixed EF the method responses with an error exception and for a cyclic EF the record pointer is set to the last record and the record is read;
– the current record pointer of any other applet shall not be changed.
6.1.1.7.1.2 Parameter errors
– CRRP1: If the currently selected EF is linear fixed and the access mode is REC_ACC_MODE_ABSOLUTE_CURRENT and recNumber is less than 0 or greater than records available, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.RECORD_NUMBER_NOT_AVAILABLE.
– CRRP2: If the currently selected EF is linear fixed and the access mode is REC_ACC_MODE_ABSOLUTE_CURRENT, recNumber is 0 and there is no current record selected, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.RECORD_NUMBER_NOT_AVAILABLE.
– CRRP3: If the currently selected EF is linear fixed and the access mode is REC_ACC_MODE_NEXT and the current record pointer is set to the last record, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.RECORD_NUMBER_NOT_AVAILABLE.
– CRRP4: If the currently selected EF is linear fixed and the access mode is REC_ACC_MODE_PREVIOUS and the current record pointer is set to the first record, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.RECORD_NUMBER_NOT_AVAILABLE.
– CRRP5: If the specified offset into the selected record recOffset is less than 0, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.OUT_OF_RECORD_BOUNDARIES.
– CRRP6: If recOffset plus respLength is greater than the record length, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.OUT_OF_RECORD_BOUNDARIES.
– CRRP7: If the access mode is not between 2 and 4 inclusive (2 = REC_ACC_MODE_NEXT, etc.), an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.INVALID_MODE.
– CRRP8: If the array resp is null, an instance of NullPointerException shall be thrown.
– CRRP9: If respOffset is less than 0, an instance of ArrayIndexOutOfBoundsException shall be thrown.
– CRRP10: If respLength is less than 0, an instance of ArrayIndexOutOfBoundsException shall be thrown.
– CRRP11: If respOffset plus respLength is greater than the length of the array resp.length, or respOffset equals resp.length, an instance of ArrayIndexOutOfBoundsException shall be thrown.
6.1.1.7.1.3 Context errors
– CRRC1: If the calling applet has currently no EF selected, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.NO_EF_SELECTED.
– CRRC2: If the currently selected EF is neither linear fixed nor cyclic, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.FILE_INCONSISTENT.
– CRRC3: If the calling applet does not fulfil the access condition, READ, to perform this function, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.AC_NOT_FULFILLED.
– CRRC4: If the currently selected EF is invalidated and the file status of the EF does not allow for reading an invalidated file, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.INVALIDATION_STATUS_CONTRADICTION.
– CRRC5: If the method call causes a memory problem (e.g. memory access error), an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.MEMORY_PROBLEM.
– CRRC6: If the method call causes an error to occur that is not expected and thus not handled, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.INTERNAL_ERROR.
6.1.1.7.2 Test Suite Files
Additional requirements for the GSM personalization: None
Test Script: API_1_SVW_REDRSBS_BSS_1.scr
Test Applet: API_1_SVW_REDRSBS_BSS_1.java
Load Script: API_1_SVW_REDRSBS_BSS_1.ldr
Cleanup Script: API_1_SVW_REDRSBS_BSS_1.clr
Parameter File: API_1_SVW_REDRSBS_BSS_1.par
6.1.1.7.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
---|---|---|---|
0 |
SIM Initialization |
Responses ignored. |
|
1 |
No EF selected recNumber = 1 mode = REC_ACC_MODE_ABSOLUTE_CURRENT recOffset = 0 byte[] resp = new byte[20] respOffset = 0 respLength = 10 readRecord() |
Shall throw sim.access.SIMViewException with reason code NO_EF_SELECTED. |
|
2 |
Read Absolute and Current from Linear Fixed EF 1 – fid = DFSIMTEST select() 2 – fid = EFLARU select() // Record pointer not set. 3 – recNumber = 0 mode = REC_ACC_MODE_NEXT recOffset = 0 respOffset = 0 respLength = 4 readRecord() 4 – recNumber = 2 mode = REC_ACC_MODE_ABSOLUTE_CURRENT readRecord() 5 – recNumber = 1 readRecord() 6 – recNumber = 0 resp[0] = resp[1] = resp[2] = resp[3] = ’00’ readRecord() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – No exception shall be thrown. resp shall be: resp[0] = ’55’ resp[1] = ’55’ resp[2] = ’55’ resp[3] = ’55’ 4 – No exception shall be thrown. resp shall be: resp[0] = ‘AA’ resp[1] = ‘AA’ resp[2] = ‘AA’ resp[3] = ‘AA’ 5 – No exception shall be thrown. resp shall be: resp[0] = ’55’ resp[1] = ’55’ resp[2] = ’55’ resp[3] = ’55’ 6 – No exception shall be thrown. resp shall be: resp[0] = ’55’ resp[1] = ’55’ resp[2] = ’55’ resp[3] = ’55’ |
|
3 |
Read Next from Linear Fixed EF recNumber = 0 mode = REC_ACC_MODE_NEXT recOffset = 0 respOffset = 0 respLength = 4 readRecord() |
No exception shall be thrown. resp shall be: resp[0] = ‘AA’ resp[1] = ‘AA’ resp[2] = ‘AA’ resp[3] = ‘AA’ |
|
4 |
Read Next from Linear Fixed EF recNumber = 0 mode = REC_ACC_MODE_NEXT recOffset = 0 respOffset = 0 respLength = 4 readRecord() |
Shall throw sim.access.SIMViewException with reason code RECORD_NUMBER_NOT_AVAILABLE. |
|
5 |
Read Previous from Linear Fixed EF recNumber = 0 mode = REC_ACC_MODE_PREVIOUS recOffset = 0 respOffset = 0 respLength = 4 readRecord() |
No exception shall be thrown. resp shall be: resp[0] = ’55’ resp[1] = ’55’ resp[2] = ’55’ resp[3] = ’55’ |
|
6 |
Read Previous from Linear Fixed EF recNumber = 0 mode = REC_ACC_MODE_PREVIOUS recOffset = 0 respOffset = 0 respLength = 4 readRecord() |
Shall throw sim.access.SIMViewException with reason code RECORD_NUMBER_NOT_AVAILABLE. |
|
7 |
Read Absolute and Current from Cyclic EF 1 – fid = EFCARU select() 2 – recNumber = 2 mode = REC_ACC_MODE_ABSOLUTE_CURRENT recOffset = 0 respOffset = 0 respLength = 3 readRecord() 3 – recNumber = 1 readRecord() 4 – recNumber = 0 resp[0] = resp[1] = resp[2] = ’00 readRecord() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. resp shall be: resp[0] = ‘ AA’ resp[1] = ‘ AA’ resp[2] = ‘ AA’ 3 – No exception shall be thrown. resp shall be: resp[0] = ’55’ resp[1] = ’55’ resp[2] = ’55’ 4 – No exception shall be thrown. resp shall be: resp[0] = ’55’ resp[1] = ’55’ resp[2] = ’55’ |
|
8 |
Read Next from Cyclic EF recNumber = 0 mode = REC_ACC_MODE_NEXT recOffset = 0 respOffset = 0 respLength = 3 readRecord() |
No exception shall be thrown. resp shall be: resp[0] = ‘AA’ resp[1] = ‘AA’ resp[2] = ‘AA’ |
|
9 |
Read Next from Cyclic EF recNumber = 0 mode = REC_ACC_MODE_NEXT recOffset = 0 respOffset = 0 respLength = 3 readRecord() |
No exception shall be thrown. resp shall be: resp[0] = ’55’ resp[1] = ’55’ resp[2] = ’55’ |
|
10 |
Read Previous from Cyclic EF recNumber = 0 mode = REC_ACC_MODE_PREVIOUS recOffset = 0 respOffset = 0 respLength = 3 readRecord() |
No exception shall be thrown. resp shall be: resp[0] = ‘AA’ resp[1] = ‘AA’ resp[2] = ‘AA’ |
|
11 |
Read Previous from Cyclic EF recNumber = 0 mode = REC_ACC_MODE_PREVIOUS recOffset = 0 respOffset = 0 respLength = 3 readRecord() |
No exception shall be thrown. resp shall be: resp[0] = ’55’ resp[1] = ’55’ resp[2] = ’55’ |
|
12 |
Read Absolute from Linear Fixed EF beyond Records 1 – fid = EFLARU select() 2 – recNumber = -1 mode = REC_ACC_MODE_ABSOLUTE_CURRENT recOffset = 0 respOffset = 0 respLength = 4 readRecord() 3 – recNumber = 3 readRecord() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code RECORD_NUMBER_NOT_AVAILABLE. 3 – Shall throw sim.access.SIMViewException with reason code RECORD_NUMBER_NOT_AVAILABLE. |
|
13 |
No current record in linear fixed EF, read current 1 – fid = EFLARU select() // No curr rec 2 – recNumber = 0 // curr rec mode = REC_ACC_MODE_ABSOLUTE_CURRENT recOffset = 0 respOffset = 0 respLength = 4 readRecord() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code RECORD_NUMBER_NOT_AVAILABLE. |
|
14 |
recOffset < 0 1 – fid = EFLARU select() 2 – recNumber = 1 // rec 1 mode = REC_ACC_MODE_ABSOLUTE_CURRENT recOffset = -1 respOffset = 0 respLength = 4 readRecord() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code OUT_OF_RECORD_BOUNDARIES. |
|
15 |
recOffset + respLength > Record Length 1 – fid = EFLARU select() 2 – recNumber = 1 mode = REC_ACC_MODE_ABSOLUTE_CURRENT recOffset = 2 respOffset = 0 respLength = 4 readRecord() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code OUT_OF_RECORD_BOUNDARIES. |
|
16 |
Reading with invalid mode 1 – fid = EFLARU select() 2 – recNumber = 0 mode = 1 recOffset = 0 respOffset = 0 respLength = 4 readRecord() 3 – mode = 5 readRecord() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code INVALID_MODE. 3 – Shall throw sim.access.SIMViewException with reason code INVALID_MODE. |
|
17 |
resp is null byte[] nullBuffer = null mode = REC_ACC_MODE_ABSOLUTE_CURRENT respOffset = 0 respLength = 10 readRecord() |
Shall throw java.lang.NullPointerException. |
|
18 |
respOffset < 0 respOffset = -1 respLength = 10 readRecord () |
Shall throw java.lang. ArrayIndexOutOfBoundsException. |
|
19 |
respLength < 0 respOffset = 0 respLength = -1 readRecord () |
Shall throw java.lang. ArrayIndexOutOfBoundsException. |
|
20 |
respOffset + respLength > resp.length respOffset = 10 respLength = 11 readRecord () |
Shall throw java.lang. ArrayIndexOutOfBoundsException. |
|
21 |
EF is neither Cyclic nor Linear Fixed 1 – fid = DFSIMTEST select() 2 – fid = EFTNU select() 3 – respOffset = 0 respLength = 4 readRecord() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – Shall throw sim.access.SIMViewException with reason code FILE_INCONSISTENT. |
|
22 |
Access condition not fulfilled 1 – fid = EFCNR select() 2 – respLength = 3 readRecord() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code AC_NOT_FULFILLED. |
|
23 |
EF is invalidated 1 – fid = EFCNU invalidate() 2 – readRecord() 3 – rehabilitate() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code INVALIDATION_STATUS_CONTRADICTION. 3 – No exception shall be thrown. |
6.1.1.7.4 Test Coverage
CRR Number |
Test Case Number |
---|---|
N1 |
2-5, 7-11 |
N2 |
2, 7 |
N3 |
3, 8, 9 |
N4 |
5, 10, 11 |
P1 |
12 |
P2 |
13 |
P3 |
4 |
P4 |
6 |
P5 |
14 |
P6 |
15 |
P7 |
16 |
P8 |
17 |
P9 |
18 |
P10 |
19 |
P11 |
20 |
C1 |
1 |
C2 |
21 |
C3 |
22 |
C4 |
23 |
C5, C6 |
Not Tested |
6.1.1.8 Method updateRecord
Test Area Reference: API_1_SVW_UPDRSBS_BSS
6.1.1.8.1 Conformance Requirements
The method with the following header shall be compliant to its definition in the API.
public void updateRecord(short recNumber,
byte mode,
short recOffset,
byte[] data,
short dataOffset,
short dataLength)
throws java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException,
SIMViewException
6.1.1.8.1.1 Normal execution
– CRRN1: dataLength bytes of the record specified by mode and recNumber of the current selected linear fixed or cyclic EF are updated at recOffset, by using the string of bytes in the array data starting at dataOffset.
– CRRN2: If the access mode is REC_ACC_MODE_ABSOLUTE_CURRENT and the file is a linear fixed EF:
– the record addressed by recNumber will be updated;
– if recNumber is 0 the current selected record will be updated; and
– the current record pointer shall not change.
– CRRN3: If the access mode is REC_ACC_MODE_NEXT and the file is a linear fixed EF:
– the next record relative to the current selected record will be selected and updated;
– if no current record is selected, the first record will be selected and updated;
– the current record pointer of any other applet shall not be changed.
– CRRN4: If the access mode is REC_ACC_MODE_PREVIOUS:
– the previous record relative to the current selected record will be selected and updated;
– if no current record is selected, the last record will be selected and updated;
– if a cyclic EF is updated, the oldest record will be updated independent of the current record pointer and this record becomes record number 1 and the current record;
– the current record pointer of any other applet shall not be changed in case of a linear fixed EF.
6.1.1.8.1.2 Parameter errors
– CRRP1: If the currently selected EF is linear fixed and the access mode is REC_ACC_MODE_ABSOLUTE_CURRENT and recNumber is less than 0 or greater than records available, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.RECORD_NUMBER_NOT_AVAILABLE.
– CRRP2: If the currently selected EF is linear fixed and the access mode is REC_ACC_MODE_ABSOLUTE_CURRENT, recNumber is 0 and there is no current record selected, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.RECORD_NUMBER_NOT_AVAILABLE.
– CRRP3: If the currently selected EF is linear fixed and the access mode is REC_ACC_MODE_NEXT and the current record pointer is set to the last record, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.RECORD_NUMBER_NOT_AVAILABLE.
– CRRP4: If the currently selected EF is linear fixed and the access mode is REC_ACC_MODE_PREVIOUS and the current record pointer is set to the first record; an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.RECORD_NUMBER_NOT_AVAILABLE.
– CRRP5: If the specified offset into the selected record recOffset is less than 0, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.OUT_OF_RECORD_BOUNDARIES.
– CRRP6: If recOffset plus dataLength is greater than the record length, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.OUT_OF_RECORD_BOUNDARIES.
– CRRP7: If the access mode is not between 2 and 4 inclusive (2 = REC_ACC_MODE_NEXT, etc.), an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.INVALID_MODE.
– CRRP8: If the currently selected EF is cyclic and the mode of record access mode is not REC_ACC_MODE_PREVIOUS, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.INVALID_MODE.
– CRRP9: If the array data is null, an instance of NullPointerException shall be thrown.
– CRRP10: If dataOffset is less than 0, an instance of ArrayIndexOutOfBoundsException shall be thrown.
– CRRP11: If dataLength is less than 0, an instance of ArrayIndexOutOfBoundsException shall be thrown.
– CRRP12: If dataOffset plus dataLength, is greater than the length of the array data.length, or dataOffset equals data.length, an instance of ArrayIndexOutOfBoundsException shall be thrown.
6.1.1.8.1.3 Context errors
– CRRC1: If the calling applet has currently no EF selected, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.NO_EF_SELECTED.
– CRRC2: If the currently selected EF is neither linear fixed nor cyclic, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.FILE_INCONSISTENT.
– CRRC3: If the calling applet does not fulfil the access condition, UPDATE, to perform this function, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.AC_NOT_FULFILLED.
– CRRC4: If the currently selected EF is invalidated and the file status of the EF does not allow for updating an invalidated file, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.INVALIDATION_STATUS_CONTRADICTION.
– CRRC5: If the method call causes a memory problem (e.g. memory access error), an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.MEMORY_PROBLEM.
– CRRC6: If the method call causes an error to occur that is not expected and thus not handled, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.INTERNAL_ERROR.
6.1.1.8.2 Test Suite Files
Additional requirements for the GSM personalization: This test is based on the assumption that the contents of the EFs in DFSIMTEST are identical to those defined in the default pre-personalization and the current record pointers have not been altered.
Test Script: API_1_SVW_UPDRSBS_BSS_1.scr
Test Applet: API_1_SVW_UPDRSBS_BSS_1.java
Load Script: API_1_SVW_UPDRSBS_BSS_1.ldr
Cleanup Script: API_1_SVW_UPDRSBS_BSS_1.clr
Parameter File: API_1_SVW_UPDRSBS_BSS_1.par
6.1.1.8.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
---|---|---|---|
0 |
SIM Initialization |
Responses ignored. |
|
1 |
No EF selected recNumber = 1 mode = REC_ACC_MODE_ABSOLUTE_CURRENT recOffset = 0 byte[] data = new byte[20] dataOffset = 0 dataLength = 10 updateRecord() |
Shall throw sim.access.SIMViewException with reason code NO_EF_SELECTED. |
|
2 |
Update Absolute and Current from Linear Fixed EF 1 – fid = DFSIMTEST select() 2 – fid = EFLARU select() // Record pointer not set. 3 – recNumber = 2 mode = REC_ACC_MODE_ABSOLUTE_CURRENT data[0:3] = ’11’ recOffset = 0 dataOffset = 0 dataLength = 4 updateRecord() respOffset = 0 respLength = 0 readRecord() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – No exception shall be thrown. Resp shall be: Resp[0] = ’11’ Resp[1] = ’11’ Resp[2] = ’11’ Resp[3] = ’11’ |
= 4 |
3 |
Update Current from Linear Fixed EF 1 – fid = DFSIMTEST select() 2 – fid = EFLARU select() // Set record pointer with mode "next". 3 – recNumber = 0 mode = REC_ACC_MODE_NEXT recOffset = 0 data[0:3] = ’00’ dataOffset = 0 dataLength = 4 updateRecord() // write data with mode "current" 4 – recNumber = 0 data[0:3] = ’22’ mode = REC_ACC_MODE_ABSOLUTE_CURRENT updateRecord() // read result with mode "absolute" respOffset = 0 respLength = 4 recNumber = 1 mode = REC_ACC_MODE_ABSOLUTE_CURRENT readRecord() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – No exception shall be thrown. 4 – No exception shall be thrown. resp shall be: resp[0] = ’22’ resp[1] = ’22’ resp[2] = ’22’ resp[3] = ’22’ |
|
4 |
Update Next from Linear Fixed EF, no record pointer set 1 – fid = FID_DF_SIMTEST select() 2 – fid = FID_EF_LARU select 3 – recNumber = 0 mode = REC_ACC_MODE_NEXT recOffset = 0 data[0:3] = ’33’ dataOffset = respOffset = 0 dataLength = respLength = 4 updateRecord() mode = REC_ACC_MODE_ABSOLUTE_CURRENT readRecord() |
1 – No exception shall be thrown. 2- No exception shall be thrown. 3 – No exception shall be thrown. Resp shall be: Resp[0] = ’33’ Resp[1] = ’33’ Resp[2] = ’33’ Resp[3] = ’33’ |
|
5 |
Update Next from Linear Fixed EF, record pointer set 1 – recNumber = 0 mode = REC_ACC_MODE_NEXT recOffset = 0 data[0:3] = ’44’ dataOffset = 0 dataLength = 4 updateRecord() 2 – mode = REC_ACC_MODE_ABSOLUTE_CURRENT readRecord() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. resp shall be: resp[0] = ’44’ resp[1] = ’44’ resp[2] = ’44’ resp[3] = ’44’ |
|
6 |
Update Next from Linear Fixed EF, no more records recNumber = 0 mode = REC_ACC_MODE_NEXT recOffset = 0 data[0:3] = ’55’ dataOffset = 0 dataLength = 4 updateRecord() |
Shall throw sim.access.SIMViewException with reason code RECORD_NUMBER_NOT_AVAILABLE. |
|
7 |
Update Previous from Linear Fixed EF, no record pointer set 1 – fid = DFSIMTEST select() 2 – fid = EFLARU select() 3 – recNumber = 0 mode = REC_ACC_MODE_PREVIOUS recOffset = 0 data[0:3] = ’66’ dataOffset = respOffset = 0 dataLength = respLength = 4 updateRecord() 4 – mode = REC_ACC_MODE_ABSOLUTE_CURRENT readRecord() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – No exception shall be thrown. 4 – No exception shall be thrown. resp shall be: resp[0] = ’66’ resp[1] = ’66’ resp[2] = ’66’ resp[3] = ’66’ |
|
8 |
Update Previous from Linear Fixed EF, record pointer set 1 – recNumber = 0 mode = REC_ACC_MODE_PREVIOUS recOffset = 0 data[0:3] = ’77’ dataOffset = respOffset = 0 dataLength = respLength = 4 updateRecord() readRecord() 2 – mode = REC_ACC_MODE_ABSOLUTE_CURRENT |
1 – No exception shall be thrown 2 – No exception shall be thrown. Resp shall be: Resp[0] = ‘7744’ Resp[1] = ‘7744’ Resp[2] = ‘7744’ Resp[3] = ‘7744’ |
|
9 |
Update Previous from Linear Fixed EF , no more records recNumber = 0 mode = REC_ACC_MODE_PREVIOUS recOffset = 0 data[0:3] = ’88’ dataOffset = respOffset = 0 dataLength = respLength = 4 updateRecord() |
Shall throw sim.access.SIMViewException with reason code RECORD_NUMBER_NOT_AVAILABLE. |
|
10 |
Update Previous from Cyclic EF 1 – fid = FID_DF_SIMTEST select() 2 – fid = FID_EF_CARU select() 3 – recNumber = 2 mode = REC_ACC_MODE_ABSOLUTE_CURRENT recOffset = 0 respOffset = 0 respLength = 3 readRecord() 4 – recNumber = 2 mode = REC_ACC_MODE_PREVIOUS data[0:2] = resp[0:2] ^ ‘FF’ dataOffset = 0 dataLength = 3 updateRecord() 5 – recNumber = 0 mode = REC_ACC_MODE_ABSOLUTE_CURRENT respOffset = 0 respLength = 3 readRecord() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – No exception shall be thrown. 4 – No exception shall be thrown. 5 – No exception shall be thrown. resp shall be: resp[0] = data[0] resp[1] = data[1] resp[2] = data[2] |
|
11 |
Update Absolute from Linear Fixed EF beyond Records 1 – fid = EFLARU select() 2 -recNumber = -1 mode = REC_ACC_MODE_ABSOLUTE_CURRENT recOffset = 0 dataOffset = 0 dataLength = 4 updateRecord() 2 – recNumber = 3 updateRecord() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code RECORD_NUMBER_NOT_AVAILABLE. 3 – Shall throw sim.access.SIMViewException with reason code RECORD_NUMBER_NOT_AVAILABLE. |
|
12 |
No current record in linear fixed EF, update current 1 – fid = EFLARU select() // No curr rec 2 – recNumber = 0 // curr rec mode = REC_ACC_MODE_ABSOLUTE_CURRENT recOffset = 0 dataOffset = 0 dataLength = 4 updateRecord() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code RECORD_NUMBER_NOT_AVAILABLE. |
|
13 |
recOffset < 0 1 – fid = EFLARU select() 2 – recNumber = 1 // rec 1 mode = REC_ACC_MODE_ABSOLUTE_CURRENT recOffset = -1 dataOffset = 0 dataLength = 4 updateRecord() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code OUT_OF_RECORD_BOUNDARIES. |
|
14 |
recOffset + dataLength > Record Length 1 – fid = EFLARU select() 2 – recNumber = 1 mode = REC_ACC_MODE_ABSOLUTE_CURRENT recOffset = 2 dataOffset = 0 dataLength = 4 updateRecord() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code OUT_OF_RECORD_BOUNDARIES. |
|
15 |
Updating with invalid mode 1 – fid = EFLARU select() 2 – recNumber = 0 mode = 1 recOffset = 0 dataOffset = 0 dataLength = 4 updateRecord() 3 – mode = 5 updateRecord() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code INVALID_MODE. 3 – Shall throw sim.access.SIMViewException with reason code INVALID_MODE. |
|
16 |
Updating Cyclic EF with invalid mode 1 – fid = DFSIMTEST select() 2 – fid = EFCARU select() 3 – recNumber = 0 mode = REC_ACC_MODE_NEXT recOffset = 0 data[0:2] = ’00’ dataOffset = 0 dataLength = 3 updateRecord() 4 – recNumber = 0 mode = REC_ACC_MODE_ABSOLUTE_CURRENT updateRecord() 5 – recNumber = 2 mode = REC_ACC_MODE_ABSOLUTE_CURRENT updateRecord() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – Shall throw sim.access.SIMViewException with reason code INVALID_MODE. 4 – Shall throw sim.access.SIMViewException with reason code INVALID_MODE. 5 – Shall throw sim.access.SIMViewException with reason code INVALID_MODE. |
|
17 |
data is null byte[] nullBuffer = null dataOffset = 0 dataLength = 10 updateRecord() |
Shall throw java.lang.NullPointerException. |
|
18 |
dataOffset < 0 dataOffset = -1 dataLength = 10 updateRecord() |
Shall throw java.lang. ArrayIndexOutOfBoundsException. |
|
19 |
dataLength < 0 dataOffset = 0 dataLength = -1 updateRecord() |
Shall throw java.lang. ArrayIndexOutOfBoundsException. |
|
20 |
dataOffset + dataLength > data.length dataOffset = 10 dataLength = 11 updateRecord() |
Shall throw java.lang. ArrayIndexOutOfBoundsException. |
|
21 |
EF is neither Cyclic nor Linear Fixed 1 – fid = DFSIMTEST select() 2 – fid = EFTNR select() 3 – dataOffset = 0 dataLength = 4 updateRecord() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – Shall throw sim.access.SIMViewException with reason code FILE_INCONSISTENT. |
|
22 |
Access condition not fulfilled 1 – fid = EFCNU select() 2 – recOffset = 0 dataOffset = 0 dataLength = 1 mode = REC_ACC_MODE_PREVIOUS updateRecord() 3 – fid = EFLNU select() 4 – recNumber = 1 mode = REC_ACC_MODE_ABSOLUTE_CURRENT recOffset = 0 dataOffset = 0 dataLength = 1 updateRecord() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code AC_NOT_FULFILLED. 3 – No exception shall be thrown. 4 – Shall throw sim.access.SIMViewException with reason code AC_NOT_FULFILLED. |
|
23 |
EF is invalidated 1 – fid = EFCNR mode = REC_ACC_MODE_PREVIOUS invalidate() 2 – updateRecord() 3 – rehabilitate() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code INVALIDATION_STATUS_CONTRADICTION. 3 – No exception shall be thrown. |
6.1.1.8.4 Test Coverage
CRR Number |
Test Case Number |
---|---|
N1 |
2, 3,4, 5, 7, 8, 10 |
N2 |
2, 3 |
N3 |
5, 6 |
N4 |
7, 8, 9, 10 |
P1 |
11 |
P2 |
12 |
P3 |
6 |
P4 |
9 |
P5 |
13 |
P6 |
14 |
P7 |
15 |
P8 |
16 |
P9 |
17 |
P10 |
18 |
P11 |
19 |
P12 |
20 |
C1 |
1 |
C2 |
21 |
C3 |
22 |
C4 |
23 |
C5, C6 |
Not Tested |
6.1.1.9 Method seek
Test Area Reference: API_1_SVW_SEEKB_BSS
6.1.1.9.1 Conformance Requirements
The method with the following header shall be compliant to its definition in the API.
public short seek(byte mode,
byte[] patt,
short pattOffset,
short pattLength)
throws java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException,
SIMViewException
6.1.1.9.1.1 Normal execution
– CRRN1: If the pattern in patt with the length pattLength at offset pattOffset is found in the record being specified by mode, the current record pointer is set to that record and the record number is returned. The record pointer of any other applet is not changed. This will be tested during the testing of the framework.
– CRRN2: If mode is SEEK_FROM_BEGINNING_FORWARD, the search starts with the first record forward towards the end of the file.
– CRRN3: If mode is SEEK_FROM_END_BACKWARD, the search starts with the last record backward towards the beginning of the file.
– CRRN4: If mode is SEEK_FROM_NEXT_FORWARD, the search starts from the next record after the current record pointer forward towards the end of file. If no current record pointer is selected, the search starts with the first record.
– CRRN5: If mode is SEEK_FROM_PREVIOUS_BACKWARD, the search starts from the previous record before the current record pointer backward towards the beginning of the file. If no current record pointer is selected the search starts with the last record.
– CRRN6: If pattern in patt is not found, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.PATTERN_NOT_FOUND.
– CRRN7: If mode is SEEK_FROM_NEXT_FORWARD and the record pointer is at the last record, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.PATTERN_NOT_FOUND.
– CRRN8: If mode is SEEK_FROM_PREVIOUS_BACKWARD and the record pointer is at the first record, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.PATTERN_NOT_FOUND.
6.1.1.9.1.2 Parameter errors
– CRRP1: If mode is not between 0 and 3 inclusive (0 = SEEK_FROM_BEGINNING_FORWARD, etc.), an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.INVALID_MODE.
– CRRP2: If the pattern array patt is null, an instance of NullPointerException shall be thrown.
– CRRP3: If pattOffset is less than 0, an instance of ArrayIndexOutOfBoundsException shall be thrown.
– CRRP4: If pattLength is less than 0, an instance of ArrayIndexOutOfBoundsException shall be thrown.
– CRRP5: If pattLength is greater than the size of the record of the currently selected EF, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.OUT_OF_RECORD_BOUNDARIES.
– CRRP6: If pattOffset plus pattLength is greater than the length of the pattern array patt.length, an instance of ArrayIndexOutOfBoundsException shall be thrown.
6.1.1.9.1.3 Context errors
– CRRC1: If the calling applet has currently no EF selected, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.NO_EF_SELECTED.
– CRRC2: If the currently selected EF is not linear fixed, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.FILE_INCONSISTENT.
– CRRC3: If the calling applet does not fulfil the access condition, READ, to perform this function, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.AC_NOT_FULFILLED.
– CRRC4: If the currently selected EF is invalidated and the file status of the EF does not allow for reading an invalidated file, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.INVALIDATION_STATUS_CONTRADICTION.
– CRRC5: If the method call causes a memory problem (e.g. memory access error), an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.MEMORY_PROBLEM.
– CRRC6: If the method call causes an error to occur that is not expected and thus not handled, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.INTERNAL_ERROR.
6.1.1.9.2 Test Suite Files
Additional requirements for the GSM personalization: None
Test Script: API_1_SVW_SEEKB_BSS_1.scr
Test Applet: API_1_SVW_SEEKB_BSS_1.java
Load Script: API_1_SVW_SEEKB_BSS_1.ldr
Cleanup Script: API_1_SVW_SEEKB_BSS_1.ldr
Parameter File: API_1_SVW_SEEKB_BSS_1.par
6.1.1.9.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
---|---|---|---|
0 |
SIM Initialization |
Responses ignored. |
|
1 |
No EF selected Byte[] patt = new byte[20] pattOffset = 0 pattLength = 10 mode = SEEK_FROM_BEGINNING_FORWARD seek() |
Shall throw sim.access.SIMViewException with reason code NO_EF_SELECTED. |
|
2 |
Pattern not Found 1 – fid = DFSIMTEST select() 2 – fid = EFLARU select() 3 – patt[0] = ‘DA’ pattOffset = 0 pattLength = 1 mode = SEEK_FROM_BEGINNING_FORWARD seek() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – Shall throw sim.access.SIMViewException with reason code PATTERN_NOT_FOUND. |
|
3 |
Seek from Beginning Forward patt[0:2] = ’55’ pattOffset = 0 pattLength = 3 mode = SEEK_FROM_BEGINNING_FORWARD seek() |
No exception shall be thrown. Shall return 1 |
|
4 |
Seek from End Backward patt[0:2] = ’55’ pattOffset = 0 pattLength = 3 mode = SEEK_FROM_END_BACKWARD seek() |
No exception shall be thrown. Shall return 1 |
|
5 |
Seek from Next Forward patt[0:2] = ‘AA’ pattOffset = 0 pattLength = 3 mode = SEEK_FROM_NEXT_FORWARD seek() |
No exception shall be thrown. Shall return 2 |
|
6 |
Last Record, Seek from Next Forward mode = SEEK_FROM_NEXT_FORWARD seek() |
Shall throw sim.access.SIMViewException with reason code PATTERN_NOT_FOUND. |
|
7 |
Seek from Previous Backward patt[0:2] = ’55’ pattOffset = 0 pattLength = 3 mode = SEEK_FROM_PREVIOUS_BACKWARD seek() |
No exception shall be thrown. Shall return 1 |
|
8 |
First Record, Seek from Previous Backward SEEK_FROM_PREVIOUS_BACKWARD seek() |
Shall throw sim.access.SIMViewException with reason code PATTERN_NOT_FOUND. |
|
9 |
Pattern not Found (out of reach) patt[0:2] = ’55’ pattOffset = 0 pattLength = 3 mode = SEEK_FROM_NEXT_FORWARD seek() |
Shall throw sim.access.SIMViewException with reason code PATTERN_NOT_FOUND. |
|
10 |
Invalid mode 1 – mode = 4 seek() 2 – mode = -1 seek() |
1 – Shall throw sim.access.SIMViewException with reason code INVALID_MODE 2 – Shall throw sim.access.SIMViewException with reason code INVALID_MODE |
|
11 |
patt is null byte[] nullBuffer = null mode = SEEK_FROM_BEGINNING_FORWARD seek () |
Shall throw java.lang.NullPointerException. |
|
12 |
pattOffset < 0 patt[0:2] = ’55’ pattOffset = -1 pattLength = 3 mode = SEEK_FROM_BEGINNING_FORWARD seek() |
Shall throw java.lang. ArrayIndexOutOfBoundsException |
|
13 |
pattLength < 0 patt[0:2] = ’55’ pattOffset = 0 pattLength = -1 mode = SEEK_FROM_BEGINNING_FORWARD seek() |
Shall throw java.lang. ArrayIndexOutOfBoundsException |
|
14 |
pattLength > size of record patt[0:4] = ’55’ pattOffset = 0 pattLength = 4 mode = SEEK_FROM_BEGINNING_FORWARD seek() |
Shall throw sim.access.SIMViewException with reason code OUT_OF_RECORD_BOUNDARIES |
|
15 |
pattOffset + pattLength > patt.length patt[0:2] = ’55’ pattOffset = 1 pattLength = 3 mode = SEEK_FROM_BEGINNING_FORWARD seek() |
Shall throw java.lang. ArrayIndexOutOfBoundsException |
|
16 |
EF is not Linear Fixed 1 – fid = EFTNU select() 2 – pattOffset = 0 pattLength = 3 mode = SEEK_FROM_BEGINNING_FORWARD seek() 3 – fid = EFCNU select() seek() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code FILE_INCONSISTENT 3 – Shall throw sim.access.SIMViewException with reason code FILE_INCONSISTENT |
|
17 |
Access condition not fulfilled 1 – fid = EFLNR select() 2 – patt[0] = ’55’ pattOffset = 0 pattLength = 1 mode = SEEK_FROM_BEGINNING_FORWARD seek() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code AC_NOT_FULFILLED. |
|
18 |
EF is invalidated 1 – fid = EFLARU select() 2 – invalidate() 3 – patt[0] = ’55 pattOffset = 0 pattLength = 1 mode = SEEK_FROM_BEGINNING_FORWARD seek() 4 – rehabilitate() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – Shall throw sim.access.SIMViewException with reason code INVALIDATION_STATUS_CONTRADICTION. 4 – No exception shall be thrown. |
6.1.1.9.4 Test Coverage
CRR Number |
Test Case Number |
---|---|
N1 |
2, 3 – 6, 7 |
N2 |
3 |
N3 |
4 |
N4 |
5 |
N5 |
7 |
N6 |
2, 6, 8, 9 |
N7 |
6 |
N8 |
8 |
P1 |
10 |
P2 |
11 |
P3 |
12 |
P4 |
13 |
P5 |
14 |
P6 |
15 |
C1 |
1 |
C2 |
16 |
C3 |
17 |
C4 |
18 |
C5, C6 |
Not Tested |
6.1.1.10 Method increase
Test Area Reference: API_1_SVW_INCR_BS_BS
6.1.1.10.1 Conformance Requirements
The method with the following header shall be compliant to its definition in the API.
public short increase(byte[] incr,
short incrOffset,
byte[] resp,
short respOffset)
throws java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException,
SIMViewException
6.1.1.10.1.1 Normal execution
– CRRN1: The value in the array incr is added to the value of the last increased / updated record in the currently selected cyclic EF. The result is stored in the oldest record and returned in the array resp. The updated record becomes record number 1 and is selected as current record. The number of bytes of valid data in resp is returned.
6.1.1.10.1.2 Parameter errors
– CRRP1: If the array incr is null, an instance of NullPointerException shall be thrown.
– CRRP2: If incrOffset is less than 0, an instance of ArrayIndexOutOfBoundsException shall be thrown.
– CRRP3: If incrOffset plus the value 3, is greater than the length of the array incr.length, an instance of ArrayIndexOutOfBoundsException shall be thrown.
– CRRP4: If the result of the addition is greater than the maximum value of the record (represented by all bytes set to ‘FF’), an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.MAX_VALUE_REACHED.
– CRRP5: If the array resp is null, an instance of NullPointerException shall be thrown.
– CRRP6: If respOffset is less than 0, an instance of ArrayIndexOutOfBoundsException shall be thrown.
– CRRP7: If the remaining length of the array resp at the offset respOffset is less than the length of the record, an instance of ArrayIndexOutOfBoundsException shall be thrown.
6.1.1.10.1.3 Context errors
– CRRC1: If the calling applet has currently no EF selected, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.NO_EF_SELECTED.
– CRRC2: If the currently selected EF is not cyclic, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.FILE_INCONSISTENT.
– CRRC3: If increase is not allowed as indicated by the FCI byte 8 (TS 51.011 [3]: FCI structure of an EF returned by the SELECT command), an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.FILE_INCONSISTENT.
– CRRC4: If the calling applet does not fulfil the access condition, INCREASE, to perform this function, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.AC_NOT_FULFILLED.
– CRRC5: If the currently selected EF is invalidated, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.INVALIDATION_STATUS_CONTRADICTION.
– CRRC6: If the method call causes a memory problem (e.g. memory access error), an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.MEMORY_PROBLEM.
– CRRC7: If the method call causes an error to occur that is not expected and thus not handled, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.INTERNAL_ERROR.
6.1.1.10.2 Test Suite Files
Additional requirements for the GSM personalization: None
Test Script: API_1_SVW_INCR_BS_BS_1.scr
Test Applet: API_1_SVW_INCR_BS_BS_1.java
Load Script: API_1_SVW_INCR_BS_BS_1.ldr
Cleanup Script: API_1_SVW_INCR_BS_BS_1.clr
Parameter File: API_1_SVW_INCR_BS_BS_1.par
6.1.1.10.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
---|---|---|---|
0 |
SIM Initialization |
Responses ignored. |
|
1 |
No EF selected byte[] incr = new byte[4] byte[] resp = new byte[4] incrOffset = 0 respOffset = 0 increase() |
Shall throw sim.access.SIMViewException with reason code NO_EF_SELECTED. |
|
2 |
Increase , verify response 1 – fid = DFSIMTEST select() 2 – fid = EFCARU select() 3 – //Set both records to 00 00 00 mode = REC_ACC_MODE_PREVIOUS data[0:3] = 0 dataOffset = 0 dataLength = 3 updateRecord() updateRecord() 4 – incrOffset = 0 incr[2] = 1 respOffset = 0 increase() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – No exception shall be thrown. 4 – No exception shall be thrown. resp[] shall contain {0,0,1,0}. |
|
3 |
Increase, verify file 1 – incrOffset = 1 incr[2] = 0, incr[3] = 2 respOffset = 1 increase() 2 – resp[3] = 0 recNumber = 0 mode = REC_ACC_MODE_ABSOLUTE_CURRENT recOffset = 0 respOffset = 0 respLength = 0 readRecord() |
1 – No exception shall be thrown. resp[] shall contain {0,0,0,3}. 2 – No exception shall be thrown. resp[] shall contain {0,0,3,0}. |
|
4 |
incr is null byte[] nullBuffer = null incrOffset = 0 respOffset = 0 increase() |
Shall throw java.lang.NullPointerException. |
|
5 |
incrOffset < 0 incrOffset = -1 respOffset = 0 increase() |
Shall throw java.lang. ArrayIndexOutOfBoundsException. |
|
6 |
incrOffset + 3 > incr.length incrOffset = 2 respOffset = 0 increase() |
Shall throw java.lang. ArrayIndexOutOfBoundsException. |
|
7 |
Reach Maximum Value incr[0] = incr[1] = incr[2] = ‘FF’ incrOffset = 0 respOffset = 0 increase() |
Shall throw sim.access.SIMViewException with reason code MAX_VALUE_REACHED. |
|
8 |
resp is null incr[0] = incr[1] = 0x00′ incr[2] = ’02’ incrOffset = 0 byte[] respNull = null respOffset = 0 increase() |
Shall throw java.lang.NullPointerException. |
|
9 |
respOffset < 0 incrOffset = 0 respOffset = -1 increase() |
Shall throw java.lang. ArrayIndexOutOfBoundsException. |
|
10 |
respOffset + recordLength > resp.length incrOffset = 0 respOffset = 2 increase() |
Shall throw java.lang. ArrayIndexOutOfBoundsException. |
|
11 |
EF is not Cyclic 1 – fid = EFTARU select() 2 – incrOffset = 0 respOffset = 0 increase() 3 – fid = EFLARU select() 4 – incrOffset = 0 respOffset = 0 increase() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code FILE_INCONSISTENT. 3 – No exception shall be thrown. 4 – Shall throw sim.access.SIMViewException with reason code FILE_INCONSISTENT. |
|
12 |
Access condition not fulfilled 1 – fid = EFCNIC select() 2 – incrOffset = 0 respOffset = 0 increase() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code AC_NOT_FULFILLED. |
|
13 |
EF is invalidated 1 – fid = EFCARU select() 2 – invalidate() 3 – incrOffset = 0 respOffset = 0 increase() 4 – rehabilitate() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – Shall throw sim.access.SIMViewException with reason code INVALIDATION_STATUS_CONTRADICTION. 4 – No exception shall be thrown. |
|
14 |
Check increase not allowed from FCI 1 – fciOffset = 0 fciLength = 8 select (FID_EF_CINA, fci…) Verify FCI byte 8 (fci[7]) 2 – incrOffset = 0 respOffset = 0 increase() |
1 – No exception shall be thrown. Bit 7 of resp[7] shall not be set (0), indicating that increase is not allowed. 2 – Shall throw sim.access.SIMViewException with reason code FILE_INCONSISTENT |
6.1.1.10.4 Test Coverage
CRR Number |
Test Case Number |
---|---|
N1 |
2, 3 |
P1 |
4 |
P2 |
5 |
P3 |
6 |
P4 |
7 |
P5 |
8 |
P6 |
9 |
P7 |
10 |
C1 |
1 |
C2 |
11 |
C3 |
14 |
C4 |
12 |
C5 |
13 |
C6, C7 |
Not Tested |
6.1.1.11 Method invalidate
Test Area Reference: API_1_SVW_INVL
6.1.1.11.1 Conformance Requirements
The method with the following header shall be compliant to its definition in the API.
public void invalidate()
throws SIMViewException
6.1.1.11.1.1 Normal execution
– CRRN1: The currently selected EF of the calling applet shall be invalidated, i.e. the flag in the EF file status shall be changed accordingly.
6.1.1.11.1.2 Parameter errors
No requirements.
6.1.1.11.1.3 Context errors
– CRRC1: If the calling applet has currently no EF selected, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.NO_EF_SELECTED.
– CRRC2: If the calling applet does not fulfil the access condition, INVALIDATE, to perform this function, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.AC_NOT_FULFILLED.
– CRRC3: If the currently selected EF is already invalidated, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.INVALIDATION_STATUS_CONTRADICTION.
– CRRC4: If the method call causes a memory problem (e.g. memory access error), an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.MEMORY_PROBLEM.
– CRRC5: If the method call causes an error to occur that is not expected and thus not handled, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.INTERNAL_ERROR.
6.1.1.11.2 Test Suite Files
Additional requirements for the GSM personalization: None
Test Script: API_1_SVW_INVL_1.scr
Test Applet: API_1_SVW_INVL_1.java
Load Script: API_1_SVW_INVL_1.ldr
Cleanup Script: API_1_SVW_INVL_1.clr
Parameter File: API_1_SVW_INVL_1.par
6.1.1.11.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
---|---|---|---|
0 |
SIM Initialization |
Responses ignored. |
|
1 |
No EF is selected 1 – invalidate() |
1 – Shall throw sim.access.SIMViewException with reason code NO_EF_SELECTED. |
|
2 |
Invalidate EF 1 – fid = DFSIMTEST select() 2 – fid = EFTNR select() 3 – invalidate() 4 – rehabilitate() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – No exception shall be thrown. 4 – No exception shall be thrown. |
|
3 |
Access condition not fulfilled 1 – fid = EFCNIV select() 2 – invalidate() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code AC_NOT_FULFILLED. |
|
4 |
EF is already invalidated 1 – fid = EFTNR select() 2 – invalidate() 3 – invalidate() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – Shall throw sim.access.SIMViewException with reason code INVALIDATION_STATUS_CONTRADICTION. |
6.1.1.11.4 Test Coverage
CRR number |
Test Case Number |
---|---|
N1 |
2 |
C1 |
1 |
C2 |
3 |
C3 |
4 |
C4, C5 |
Not Tested |
6.1.1.12 Method rehabilitate
Test Area Reference: API_1_SVW_REHA
6.1.1.12.1 Conformance Requirements
The method with the following header shall be compliant to its definition in the API.
public void rehabilitate()
throws SIMViewException
6.1.1.12.1.1 Normal execution
– CRRN1: The currently selected EF of the calling applet shall be rehabilitated, i.e. the flag in the EF file status shall be changed accordingly.
6.1.1.12.1.2 Parameter errors
No requirements.
6.1.1.12.1.3 Context errors
– CRRC1: If the calling applet has currently no EF selected, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.NO_EF_SELECTED.
– CRRC2: If the calling applet does not fulfil the access condition, REHABILITATE, to perform this function, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.AC_NOT_FULFILLED.
– CRRC3: If the currently selected EF is not invalidated, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.INVALIDATION_STATUS_CONTRADICTION.
– CRRC4: If the method call causes a memory problem (e.g. memory access error), an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.MEMORY_PROBLEM.
– CRRC5: If the method call causes an error to occur that is not expected and thus not handled, an instance of SIMViewException shall be thrown. The reason code shall be SIMViewException.INTERNAL_ERROR.
6.1.1.12.2 Test Suite Files
Additional requirements for the GSM personalization: None
Test Script: API_1_SVW_REHA_1.scr
Test Applet: API_1_SVW_REHA_1.java
Load Script: API_1_SVW_REHA_1.ldr
Cleanup Script: API_1_SVW_REHA_1.clr
Parameter File: API_1_SVW_REHA_1.par
6.1.1.12.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
---|---|---|---|
0 |
SIM Initialization |
Responses ignored. |
|
1 |
No EF is selected 1 – rehabilitate() |
1 – Shall throw sim.access.SIMViewException with reason code NO_EF_SELECTED. |
|
2 |
Rehabilitate invalidated File 1 – fid = DFSIMTEST select() 2 – fid = EFCNR select() 3 – invalidate() 4 – rehabilitate() 5 – byte[] incr = new byte[3] = {0,0,1} incrOffset = 0 byte[] resp = new byte[1] = 1 respOffset = 0 increase() |
1 – No exception shall be thrown. 2 – No exception shall be thrown. 3 – No exception shall be thrown. 4 – No exception shall be thrown. 5 – No exception shall be thrown. resp[] shall contain {0,0,1}. |
|
3 |
Access condition not fulfilled 1 – fid = EFCNRH select() 2 – rehabilitate() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code AC_NOT_FULFILLED.. |
|
4 |
Rehabilitate validated File 1 – fid = EFCNR select() 2 – rehabilitate() |
1 – No exception shall be thrown. 2 – Shall throw sim.access.SIMViewException with reason code INVALIDATION_STATUS_CONTRADICTION. |
6.1.1.12.4 Test Coverage
CRR number |
Test Case Number |
---|---|
N1 |
2 |
C1 |
1 |
C2 |
3 |
C3 |
4 |
C4, C5 |
Not Tested |
6.1.2 Class SIMSystem
6.1.2.1 Method getTheSIMView
Test Area Reference: API_1_SSY_GETS
6.1.2.1.1 Conformance Requirement:
The method with following header shall compliant to its definition in the API.
public static SIMView getTheSIMView()
6.1.2.1.1.1 Normal execution
- CRRN1: returns a reference to class which implements the SIMView interface.
6.1.2.1.1.2 Parameters error
No requirements.
6.1.2.1.1.3 Context errors
No requirements.
6.1.2.1.2 Test suite files
No additional requirements for the GSM personalization:
Test Script: API_1_SSY_GETS_1.scr
Test Applet: API_1_SSY_GETS_1.java
Load Script: API_1_SSY_GETS_1.ldr
Cleanup Script: API_1_SSY_GETS_1.clr
Parameter File: API_1_SSY_GETS_1.par
6.1.2.1.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
1 |
reference not equal null after execute |
The returned reference shall be not null after execute |
|
2 |
reference to the GSM interface |
Returned a reference to the GSM interface |
6.1.2.1.4 Test Coverage
CRR number |
Test case number |
N1 |
1,2 |
6.1.3 Class SIMViewException
6.1.3.1 Method throwIt
Test Area Reference: API_1_SVE_THITS
6.1.3.1.1 Conformance Requirement:
The method with following header shall be compliant to its definition in the API.
public static void throwIt(short reason)
throws SIMViewException
6.1.3.1.1.1 Normal execution
– CRRN1: Throws the JCRE instance of SIMViewException with the specified reason.
– CRRN2: Extends javacard.framework.CardRuntimeException.
6.1.3.1.1.2 Parameter errors
No requirements.
6.1.3.1.1.3 Context errors
No requirements.
6.1.3.1.2 Test Suite Files
No additional requirements for the GSM personalization
Test Script: API_1_SVE_THITS_1.scr
Test Applet: API_1_SVE_THITS_1.java
Load Script: API_1_SVE_THITS_1.ldr
Cleanup Script: API_1_SVE_THITS_1.clr
Parameter File: API_1_SVE_THITS_1.par
6.1.3.1.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
1 |
Throws the JCRE instance of SIMViewException with the specified reason |
Reason = 0 |
|
2 |
Throws the JCRE instance of SIMViewException with the specified reason |
Reason = 1 |
|
3 |
Throws the JCRE instance of SIMViewException with the specified reason |
Reason = 15 |
|
4 |
SIMViewException extends javacard.framework.CardRuntimeException |
Reason = 0 |
|
5 |
SIMViewException extends javacard.framework.CardRuntimeException |
Reason = 1 |
|
6 |
SIMViewException extends javacard.framework.CardRuntimeException |
Reason = 15 |
6.1.3.1.4 Test Coverage
CRR number |
Test case number |
N1 |
1,2,3 |
N2 |
4,5,6 |
6.1.3.2 Constructor
Test Area Reference: API_1_SVE_COORS
6.1.3.2.1 Conformance Requirement:
The method with following header shall compliant to its definition in the API.
public SIMViewException(short reason)
throws SIMViewException
6.1.3.2.1.1 Normal execution
– CRRN1: Construct a SIMViewException with the specified reason.
6.1.3.2.1.2 Parameters error
No requirements.
6.1.3.2.1.3 Context errors
No requirements.
6.1.3.2.2 Test suite files
No additional requirements for the GSM personalization
Test Script: API_1_SVE_COORS_1.scr
Test Applet: API_1_SVE_COORS_1.java
Load Script: API_1_SVE_COORS.ldr
Cleanup Script: API_1_SVE_COORS.clr
Parameter File: API_1_SVE_COORS.par
6.1.3.2.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
1 |
SIMViewException with the specified reason (The reason shall set with setReason and compare the Exception with getReason) |
Reason (specified) |
6.1.3.2.4 Test Coverage
CRR number |
Test case number |
N1 |
1 |
6.1.3.3 Reason Codes
Test Area Reference: API_1_SVE_CONS
6.1.3.3.1 Conformance Requirement:
There is no API, only constants. This constants shall compliant to its definition in the API.
6.1.3.3.1.1 Normal execution
– CRRN1: The Constants of the class SIMViewException shall all have the same name and value defined in the 3GPP TS 43.019 [7].
– CRRN2: Constructs SIMViewException a Exception with the specified reason.
6.1.3.3.1.2 Parameters error
No requirements.
6.1.3.3.1.3 Context errors
No requirements.
6.1.3.3.2 Test suite files
None.
6.1.3.3.3 Test Procedure
The constants in Java are resolved at compilation time, therefore a runtime test is not useful. No test of constants will be performed