6.2.4 Class EnvelopeHandler
3GPP51.013Release 17Test specification for Subscriber Identity Module (SIM) Application Programming Interface (API) for Java CardTS
6.2.4.1 Method getEnvelopeTag
Test Area Reference: API_2_ENH_GENT
6.2.4.1.1 Conformance Requirement:
The method with following header shall be compliant to its definition in the API.
public byte getEnvelopeTag()
6.2.4.1.1.1 Normal execution
– CRRN1: The method shall return the Envelope BER-TLV tag.
– CRRN2: The Envelope BER TAG is available for all triggered toolkit applets from the invocation to the termination of their processToolkit method if the EnvelopeHandler is available.
6.2.4.1.1.2 Parameters error
No requirements.
6.2.4.1.1.3 Context errors
No requirements.
6.2.4.1.2 Test suite files
Test Script: API_2_ENH_GENT_1.scr
Test Applet: API_2_ENH_GENT_1.java
Load Script: API_2_ENH_GENT_1.ldr
Cleanup Script: API_2_ENH_GENT_1.clr
Parameter File: API_2_ENH_GENT_1.par
6.2.4.1.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
1 |
getEnvelopeTag called just after triggering of the application. |
Returns 0xD1 |
|
2 |
getEnvelopeTag called after a proactive command. |
Returns 0xD1 |
|
3 |
getEnvelopeTag called after a second proactive command. |
Returns 0xD1 |
6.2.4.1.4 Test Coverage
CRR number |
Test case number |
N1 |
1, 2, 3 |
N2 |
1, 2, 3 |
6.2.4.2 Method getItemIdentifier
Test Area Reference: API_2_ENH_GIID
6.2.4.2.1 Conformance Requirement:
The method with following header shall be compliant to its definition in the API.
public byte getItemIdentifier()
throws ToolkitException
6.2.4.2.1.1 Normal execution
– CRRN1:The method shall return the item identifier byte value.
– CRRN2:The item identifier byte value returned shall be from the first Item Identifier TLV element.
– CRRN3: If the element is available it becomes the TLV selected.
– CRRN4: The item identifier is available for all triggered toolkit applets from the invocation to the termination of their processToolkit method if the EnvelopeHandler is available.
6.2.4.2.1.2 Parameters error
No requirements.
6.2.4.2.1.3 Context errors
– CRRC1: The method shall throw ToolkitException (UNAVAILABLE_ELEMENT) if the item identifier TLV is not present.
– CRRC2: The method shall throw ToolkitException (OUT_OF_TLV_BOUNDARIES) if the item identifier byte is missing in the Item Identifier Simple TLV.
6.2.4.2.2 Test suite files
Test Script: API_2_ENH_GIID_1.scr
Test Applet: API_2_ENH_GIID_1.java
Load Script: API_2_ENH_GIID_1.ldr
Cleanup Script: API_2_ENH_GIID_1.clr
Parameter File: API_2_ENH_GIID_1.par
6.2.4.2.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
1 |
Send envelope SMS-PP Formatted with item identifier TLV and identifier value of 03 |
Returns 03 |
|
2 |
Send envelope SMS-PP Formatted with two item identifier TLV with first value FF and second 44 |
Returns FF |
|
3 |
Send envelope SMS-PP Formatted with two item identifier TLV with first value 81 and second 44, call twice the method getItemIdentifier |
Returns 81 Returns 81 |
|
4 |
Send envelope SMS-PP Formatted with item identifier TLV and value of 66. FindTLV with TAG 02. getItemIdentifier and then getValueByte with offset 0 |
getItemIdentifier=getValueByte |
|
5 |
Send envelope SMS-PP Formatted without item identifier TLV and getItemIdentifier |
ToolkitException (UNAVAILABLE_ELEMENT) |
|
6 |
Send Envelope SMS-PP Formatted with item identifier TLV (66), send proactive command. Then getItemIdentifier |
Returns 66 |
|
7 |
Send Envelope SMS-PP Formatted with item identifier TLV but without item number |
ToolkitException (OUT_OF_TLV_BOUNDARIES) |
6.2.4.2.4 Test Coverage
CRR number |
Test case number |
N1 |
1, 2, 3 |
N2 |
2, 3 |
N3 |
4 |
N4 |
6 |
C1 |
5 |
C2 |
7 |
6.2.4.3 Method getSecuredDataLength
Test Area Reference: API_2_ENH_GSDL
6.2.4.3.1 Conformance Requirement:
The method with following header shall be compliant to its definition in the API.
public short getSecuredDataLength()
throws ToolkitException
6.2.4.3.1.1 Normal execution
– CRRN1: The method shall return the length of the Secured Data from the Command Packet in the SMS TPDU (simple or concatenated ) or Cell Broadcast Page Simple TLV contained in the Envelope handler.
– CRRN2: The length is from the first SMS TPDU TLV or Cell Broadcast Page Simple TLV.
– CRRN3: The length should not include padding bytes.
– CRRN4: The method can be used if the event is EVENT_FORMATTED_SMS_PP_ENV and if the SMS TP‑UD is formatted according to 3GPP TS 23.048 [8].
– CRRN5: The method can be used if the event is EVENT_FORMATTED_SMS_PP_UPD and if the SMS TP‑UD is formatted according to 3GPP TS 23.048 [8].
– CRRN6: The method can be used if the event is EVENT_FORMATTED_SMS_CB and if the Cell Broadcast Page is formatted according to 3GPP TS 23.048 [8].
– CRRN7: If the method is successful and if the event is EVENT_FORMATTED_SMS_PP_ENV, the selected TLV should be the SMS TPDU TLV.
– CRRN8: If the method is successful and if the event is EVENT_FORMATTED_SMS_PP_UPD, the selected TLV should be the SMS TPDU TLV.
– CRRN9: If the method is successful and if the event is EVENT_FORMATTED_SMS_CB, the selected TLV should be the Cell Broadcast Page TLV.
6.2.4.3.1.2 Parameters error
No requirements.
6.2.4.3.1.3 Context errors
– CRRC1: The method shall thrown ToolkitException (UNAVAILABLE_ELEMENT) in case of unavailable SMS TPDU TLV element or Cell Broadcast Page Simple TLV.
– CRRC2: The method shall thrown ToolkitException (UNAVAILABLE_ELEMENT) in case of wrong data format.
6.2.4.3.2 Test suite files
Specific triggering:
– FORMATTED SMS CB.
– UNFORMATTED SMS CB.
– FORMATTED SMS PP UPD.
– UNFORMATED SMS PP ENV.
– For Formatted triggering if CC/RC/DS is used, the security parameters are the one used for downloading applications.
Test Script: API_2_ENH_GSDL_1.scr
Test Applet: API_2_ENH_GSDL_1.java
Load Script: API_2_ENH_GSDL_1.ldr
Cleanup Script: API_2_ENH_GSDL_1.clr
Parameter File: API_2_ENH_GSDL_1.par
6.2.4.3.3 Test procedure
Id |
Description |
API Expectation |
APDU Expectation |
---|---|---|---|
FORMATTED SMS PP ENV Triggering |
|||
1 |
Test with FORMATTED_SMS_PP_ENV and TP-OA length of 2 |
Returns 0x002A |
|
2 |
Test with TP-OA length of 6 |
Returns 0x002A |
|
3 |
Test with TP-OA length of 12 |
Returns 0x002A |
|
4 |
Test with RC/CC/DS length of 0 |
Returns 0x0010 |
|
5 |
Test with RC/CC/DS length of 8 |
Returns 0x0010 |
|
6 |
Test with PCNTR = 0 |
Returns 0x0010 |
|
7 |
Test with PCNTR = 7 |
Returns 0x0005 |
|
8 |
Test with Secured Data Length = 00 |
Returns 0x0000 |
|
9 |
Test with Secured Data Length = 0x33 |
Returns 0x0033 |
|
10 |
Test with Secured Data Length = 0x6C (UDL = 0x7F) |
Returns 0x006C |
|
11 |
Test with Secured Data Length = 0x6D (UDL = 0x80) |
Returns 0x006D |
|
12 |
Test with Secured Data Length = maximum length for one envelope : 0x79 (UDL = 0x8C) |
Returns 0x0079 |
|
13 |
Verify it is the first TPDU TLV: Send a SMS PP with 2 TPDU TLV and inside two different secured data lengths: 5 and 10 |
Returns 0x0005 |
|
14 |
Test with secured data length = 0x7F (2 concatenated envelopes are needed) |
Returns 0x007F |
|
15 |
Test with secured data length = 0x80 (2 concatenated envelopes are needed) |
Returns 0x0080 |
|
16 |
Test with secured data length = maximum length for 2 concatenated envelopes : 0xFA |
Returns 0x00FA |
|
17 |
Test with FORMATTED_SMS_PP_ENV Verify after call of the method the current TLV is the TPDU TLV: findTLV device identities, getSecuredDataLength and then getValueByte to verify that the current TLV is the TPDU TLV |
getValueByte returns 0x0040 |
|
FORMATTED SMS PP UPD Triggering |
|||
18 |
Same test as 1 but with FORMATTED_SMS_PP_UPD |
Returns 0x002A |
|
19 |
Same test as 2 but with FORMATTED_SMS_PP_UPD |
Returns 0x002A |
|
20 |
Same test as 3 but with FORMATTED_SMS_PP_UPD |
Returns 0x002A |
|
21 |
Same test as 4 but with FORMATTED_SMS_PP_UPD |
Returns 0x0010 |
|
22 |
Same test as 5 but with FORMATTED_SMS_PP_UPD |
Returns 0x0010 |
|
23 |
Same test as 6 but with FORMATTED_SMS_PP_UPD |
Returns 0x0010 |
|
24 |
Same test as 7 but with FORMATTED_SMS_PP_UPD |
Returns 0x0005 |
|
25 |
Same test as 8 but with FORMATTED_SMS_PP_UPD |
Returns 0x0000 |
|
26 |
Same test as 9 but with FORMATTED_SMS_PP_UPD |
Returns 0x0033 |
|
27 |
Same test as 10 but with FORMATTED_SMS_PP_UPD |
Returns 0x006C |
|
28 |
Same test as 11 but with FORMATTED_SMS_PP_UPD |
Returns 0x006D |
|
29 |
Same test as 12 but with FORMATTED_SMS_PP_UPD |
Returns 0x0079 |
|
30 |
Same test as 13 but with FORMATTED_SMS_PP_UPD |
Returns 0x0005 |
|
31 |
Test with secured data length = 0x7F (2 concatenated envelopes are needed) |
Returns 0x007F |
|
32 |
Test with secured data length = 0x80 (2 concatenated envelopes are needed) |
Returns 0x0080 |
|
33 |
Test with secured data length = maximum length for 2 concatenated envelopes : 0xFA |
Returns 0x00FA |
|
34 |
Test with FORMATTED_SMS_PP_UPD Verify after call of the method the current TLV is the TPDU TLV: findTLV device identities, getSecuredDataLength and then getValueByte to verify that the current TLV is the TPDU TLV |
getValueByte returns 0x0040 |
|
FORMATTED SMS CB Triggering |
|||
35 |
Same test as 4 but with FORMATTED_SMS_CB |
Returns 0x0010 |
|
36 |
Same test as 5 but with FORMATTED_SMS_CB |
Returns 0x0010 |
|
37 |
Same test as 6 but with FORMATTED_SMS_CB |
Returns 0x0010 |
|
38 |
Same test as 7 but with FORMATTED_SMS_CB |
Returns 0x0005 |
|
39 |
Same test as 8 but with FORMATTED_SMS_CB |
Returns 0x0000 |
|
40 |
Same test as 9 but with FORMATTED_SMS_CB |
Returns 0x0033 |
|
41 |
Same test as 12 but with maximum secured data length: 0x42, and FORMATTED_SMS_CB |
Returns 0x0042 |
|
42 |
Test with FORMATTED_SMS_CB Verify after call of the method the current TLV is the Cell Broadcast Page TLV: findTLV device identities, getSecuredDataLength and then getValueByte to verify that the current TLV is the Cell Broadcast Page TLV |
getValueByte returns 0x00 |
|
Error tests |
|||
43 |
Send an envelope SMS CB, getSecuredDataLength |
ToolkitException UNAVAILABLE_ELEMENT |
|
44 |
Send an envelope SMS PP unformatted |
ToolkitException UNAVAILABLE_ELEMENT |
6.2.4.3.4 Test Coverage
CRR number |
Test case number |
N1 |
1 to 42 |
N2 |
13, 30 |
N3 |
6, 7, 23, 24, 37, 38 |
N4 |
1 to 17 |
N5 |
18 to 34 |
N6 |
35 to 42 |
N7 |
17 |
N8 |
34 |
N9 |
42 |
C1 |
43 |
C2 |
44 |
6.2.4.4 Method getSecuredDataOffset
Test Area Reference: API_2_ENH_GSDO
6.2.4.4.1 Conformance Requirement:
The method with following header shall be compliant to its definition in the API.
public short getSecuredDataOffset()
throws ToolkitException
6.2.4.4.1.1 Normal execution
- CRRN1: The method shall return the offset of the secured data first byte contained in a SMS TPDU TLV.
- CRRN2: The offset is from the first SMS TPDU TLV.
- CRRN3: The method can be used if the event is EVENT_FORMATTED_SMS_PP_ENV and if the SMS TP-UD is formatted according to 3GPP TS 23.048 [8].
- CRRN4: The method can be used if the event is EVENT_FORMATTED_SMS_PP_UPD and if the SMS TP-UD is formatted according to 3GPP TS 23.048 [8].
- CRRN5: The method can be used if the event is EVENT_FORMATTED_SMS_CB and if the Cell Broadcast Page is formatted according to 3GPP TS 23.048 [8].
- CRRN6: If the method is successful and if the event is EVENT_FORMATTED_SMS_PP_ENV, the selected TLV should be the SMS TPDU TLV.
- CRRN7: If the method is successful and if the event is EVENT_FORMATTED_SMS_PP_UPD, the selected TLV should be the SMS TPDU TLV.
- CRRN8: If the method is successful and if the event is EVENT_FORMATTED_SMS_CB, the selected TLV should be the Cell Broadcast Page TLV.
- CRNN9: If the Secured Data length is zero the value returned shall be the offset of the first byte following the 3GPP TS 23.048 [8] Command Packet structure.
6.2.4.4.1.2 Parameters error
No requirements.
6.2.4.4.1.3 Context errors
- CRRC1: The method shall thrown ToolkitException (UNAVAILABLE_ELEMENT) in case of unavailable SMS TPDU TLV element.
- CRRC2: The method shall thrown ToolkitException (UNAVAILABLE_ELEMENT) in case of wrong data format.
6.2.4.4.2 Test suite files
Specific triggering:
– FORMATTED SMS CB.
– UNFORMATTED SMS CB.
– FORMATTED SMS PP UPD.
– UNFORMATED SMS PP ENV.
– For Formatted triggering if CC/RC/DS is used, the security parameters are the one used for downloading applications.
Test Script: API_2_ENH_GSDO_1.scr
Test Applet: API_2_ENH_GSDO_1.java
Load Script: API_2_ENH_GSDO_1.ldr
Cleanup Script: API_2_ENH_GSDO_1.clr
Parameter File: API_2_ENH_GSDO_1.par
6.2.4.4.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
---|---|---|---|
FORMATTED SMS PP ENV triggering |
|||
1 |
Test with TP-OA length of 2 and RC/CC/DS length is 0 |
Returns 0x21 |
|
2 |
Test with TP-OA length of 6 and RC/CC/DS length is 0 |
Returns 0x23 |
|
3 |
Test with TP-OA length of 12 and RC/CC/DS length is 0 |
Returns 0x26 |
|
4 |
Test with RC/CC/DS length of 0 and TP-OA length is 2 |
Returns 0x21 |
|
5 |
Test with RC/CC/DS length of 8 and TP-OA length is 2 |
Returns 0x29 |
|
6 |
Send a SMS PP with 2 TPDU TLV and inside two different secured data offsets |
Returns 0x24 ( the first offset ) |
|
7 |
Same test as 1 but without any secured data |
Returns 0x21 |
|
8 |
Test with FORMATTED_SMS_PP ENV Verify after call of the method the current TLV is the TPDU TLV: findTLV device identities, getSecuredDataOffset and then getValueByte to verify that the current TLV is the TPDU TLV |
Returns 0x40 |
|
9 |
Same test as 1, but with a concatenated SMS (2 Short Messages and maximum Secured Data Length = 0x00FA) |
Returns 0x21 |
|
FORMATTED SMS PP UPR triggering |
|||
10 |
Same test as 1 but with FORMATTED_SMS_PP_UPD |
Returns 0x21 |
|
11 |
Same test as 2 but with FORMATTED_SMS_PP_UPD |
Returns 0x23 |
|
12 |
Same test as 3 but with FORMATTED_SMS_PP_UPD |
Returns 0x26 |
|
13 |
Same test as 4 but with FORMATTED_SMS_PP_UPD |
Returns 0x21 |
|
14 |
Same test as 5 but with FORMATTED_SMS_PP_UPD |
Returns 0x29 |
|
15 |
Same test as 6 but with FORMATTED_SMS_PP_UPD |
Returns 0x24 ( the first offset ) |
|
16 |
Same test as 7 but with FORMATTED_SMS_PP_UPD |
Returns 0x21 |
|
17 |
Test with FORMATTED_SMS_PP UPD Verify after call of the method the current TLV is the TPDU TLV: findTLV device identities, getSecuredDataOffset and then getValueByte to verify that the current TLV is the TPDU TLV |
Returns 0x40 |
|
18 |
Same test as 10, but with a concatenated SMS (2 Short Messages and maximum Secured Data Length = 0x00FA) |
Returns 0x21 |
|
FORMATTED SMS CB triggering |
|||
19 |
Same test as 4 but with FORMATTED_SMS_CB |
Returns 0x16 |
|
20 |
Same test as 5 but with FORMATTED_SMS_CB |
Returns 0x1E |
|
21 |
Same test as 7 but with FORMATTED_SMS_CB |
Returns 0x16 |
|
22 |
Test with FORMATTED_SMS_CB Verify after call of the method the current TLV is the Cell Broadcast Page TLV: findTLV device identities, getSecuredDataOffset and then getValueByte to verify that the current TLV is the Cell Broadcast Page TLV |
Returns 0x00 |
|
UNFORMATTED Triggering |
|||
23 |
Send an UNFORMATTED SMS CB envelope, getSecuredDataOffset |
ToolkitException UNAVAILABLE_ELEMENT |
|
24 |
Send an UNFORMATTED SMS PP envelope, getSecuredDataOffset |
ToolkitException UNAVAILABLE_ELEMENT |
6.2.4.4.4 Test Coverage
CRR number |
Test case number |
N1 |
1 to 22. |
N2 |
6, 15. |
N3 |
1 to 9. |
N4 |
10 to 18. |
N5 |
19, 20, 21, 22 |
N6 |
8 |
N7 |
17 |
N8 |
22 |
N9 |
7, 16, 21. |
C1 |
23 |
C2 |
24 |
6.2.4.5 Method getTheHandler
Test Area Reference: API_2_ENH_GTHD
6.2.4.5.1 Conformance Requirements
The method with following header shall be compliant to its definition in the API.
public static EnvelopeHandler getTheHandler()
throws ToolkitException
6.2.4.5.1.1 Normal execution
- CRRN1: The method shall return the single system instance of the EnvelopeHandler class.
- CRRN2: The EnvelopeHandler is a Temporary JCRE Entry Point Object ( see Javacard 2.1 Runtime Environment (JCRE) Specification [12])
6.2.4.5.1.2 Parameters error
No requirements.
6.2.4.5.1.3 Context errors
- CRRC1: The method shall thrown ToolkitException (HANDLER_NOT_AVAILABLE) if the handler is busy.
6.2.4.5.2 Test suite files
Test Script: API_2_ENH_GTHD_1.scr
Test Applet: API_2_ENH_GTHD_1.java
Load Script: API_2_ENH_GTHD_1.ldr
Cleanup Script: API_2_ENH_GTHD_1.clr
Parameter File: API_2_ENH_GTHD_1.par
6.2.4.5.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
1 |
getTheHandler twice |
The returned objects shall be the same |
|
2 |
Verify that getTheHandler returns an EnvelopeHandler GetTheHandler |
The reference returned shall be an EnvelopeHandler (check cast) |
|
3 |
Verify the returned value is not null GetTheHandler |
The reference returned shall not be null. |
6.2.4.5.4 Test Coverage
CRR number |
Test case number |
N1 |
1, 2, 3 |
N2 |
Checked in Framework tests: FWK_API_HEPO (test case 1) |
C1 |
Checked in Framework tests: FWK_MHA_ENHD |
6.2.4.6 Method getTPUDLOffset
Test Area Reference: API_2_ENH_GTPO
6.2.4.6.1 Conformance Requirement:
The method with following header shall be compliant to its definition in the API.
public short getTPUDLOffset()
throws ToolkitException
6.2.4.6.1.1 Normal execution
- CRRN1: The method shall return the TPUDL offset in a SMS TPDU TLV.
- CRRN2: The offset is from the first SMS TPDU TLV.
- CRRN3: The method can be used if the event is EVENT_FORMATTED_SMS_PP_ENV.
- CRRN4: The method can be used if the event is EVENT_FORMATTED_SMS_PP_UPD.
- CRRN5: The method can be used if the event is EVENT_UNFORMATTED_SMS_PP_ENV.
- CRRN6: The method can be used if the event is EVENT_UNFORMATTED_SMS_PP_UPD.
- CRRN7: If the method is successful, the selected TLV should be the SMS TPDU TLV.
6.2.4.6.1.2 Parameters error
No requirements.
6.2.4.6.1.3 Context errors
- CRRC1: The method shall thrown ToolkitException (UNAVAILABLE_ELEMENT) in case of unavailable SMS TPDU TLV element.
- CRRC2: The method shall thrown ToolkitException (UNAVAILABLE_ELEMENT) if the TPUDL field does not exist.
6.2.4.6.2 Test suite files
Specific triggering:
– FORMATTED SMS PP UPD.
– UNFORMATTED SMS PP UPD.
– UNFORMATTED SMS PP ENV.
– UNFORMATTED SMS CB.
Test Script: API_2_ENH_GTPO_1.scr
Test Applet: API_2_ENH_GTPO_1.java
Load Script: API_2_ENH_GTPO_1.ldr
Cleanup Script: API_2_ENH_GTPO_1.clr
Parameter File: API_2_ENH_GTPO_1.par
6.2.4.6.3 Test procedure
Id |
Description |
API Expectation |
APDU Expectation |
FORMATTED SMS PP ENV triggering |
|||
1 |
Test with TP-OA length of 2 |
Returns 0x0D |
|
2 |
Test with TP-OA length of 6 |
Returns 0x0F |
|
3 |
Test with TP-OA length of 12 |
Returns 0x12 |
|
4 |
Send a SMS PP with 2 TPDU TLV and inside two different UDL offsets |
Returns 0x10 (the first offset) |
|
5 |
Same test as 1, but with a concatenated SMS (2 Short Messages and maximum Secured Data Length = 0x00FA) |
Returns 0x0D |
|
6 |
Verify after call of the method the current TLV is the TPDU TLV: findTLV device identities, getTPUDLOffset and then getValueByte to verify that the current TLV is the TPDU TLV |
Returns 0x40 |
|
FORMATTED SMS PP UPD triggering |
|||
7 |
Same test as 1 but with FORMATTED_SMS_PP_UPD |
Returns 0x0D |
|
8 |
Same test as 2 but with FORMATTED_SMS_PP_UPD |
Returns 0x0F |
|
9 |
Same test as 3 but with FORMATTED_SMS_PP_UPD |
Returns 0x12 |
|
10 |
Same test as 4 but with FORMATTED_SMS_PP_UPD |
Returns 0x10 (the first offset) |
|
11 |
Same test as 7, but with a concatenated SMS (2 Short Messages and maximum Secured Data Length = 0x00FA) |
Returns 0x0D |
|
UNFORMATTED SMS PP UPD triggering |
|||
12 |
Same test as 1 but with UNFORMATTED_SMS_PP_UPD |
Returns 0x0D |
|
13 |
Same test as 2 but with UNFORMATTED_SMS_PP_UPD |
Returns 0x0F |
|
14 |
Same test as 3 but with UNFORMATTED_SMS_PP_UPD |
Returns 0x12 |
|
15 |
Same test as 4 but with UNFORMATTED_SMS_PP_UPD |
Returns 0x12 (the first offset) |
|
16 |
Same test as 12, but with a concatenated SMS (2 Short Messages and maximum User Data Length = 0x010C) |
Returns 0x0D |
|
UNFORMATTED SMS PP ENV triggering |
|||
17 |
Same test as 1 but with UNFORMATTED_SMS_PP_ENV |
Returns 0x0D |
|
18 |
Same test as 2 but with UNFORMATTED_SMS_PP_ENV |
Returns 0x0F |
|
19 |
Same test as 3 but with UNFORMATTED_SMS_PP_ENV |
Returns 0x12 |
|
20 |
Same test as 4 but with UNFORMATTED_SMS_PP_ENV |
Returns 0x10 (the first offset) |
|
21 |
Same test as 17, but with a concatenated SMS (2 Short Messages and maximum User Data Length = 0x010C) |
Returns 0x0D |
|
SMS CB triggering |
|||
22 |
Send an envelope SMS CB, getTPUDLOffset |
ToolkitException UNAVAILABLE_ELEMENT |
6.2.4.6.4 Test Coverage
CRR number |
Test case number |
N1 |
1 to 21. |
N2 |
4, 10, 15, 20. |
N3 |
1, 2, 3, 4, 5, 6 |
N4 |
7, 8, 9, 10, 11 |
N5 |
12, 13, 14, 15, 16 |
N6 |
17, 18, 19, 20, 21 |
N7 |
6 |
C1 |
22 |
C2 |
Not applicable |
6.2.4.7 Method getLength
Test Area Reference: API_2_ENH_GLEN
6.2.4.7.1 Conformance Requirement
The method with following header shall be compliant to its definition in the API.
public short getLength()
throws ToolkitException
6.2.4.7.1.1 Normal execution
- CRRN1: returns the length in bytes of the TLV list.
6.2.4.7.1.2 Parameter Error
No requirements.
6.2.4.7.1.3 Context errors
- CRRC1: if the handler is busy an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException.HANDLER_NOT_AVAILABLE.
6.2.4.7.2 Test Suite files
Specific triggering: None
Test Script: API_2_ENH_GLEN_1.scr
Test Applet: API_2_ENH_GLEN_1.java
Load Script: API_2_ENH_GLEN_1.ldr
Cleanup Script: API_2_ENH_GLEN_1.clr
Parameter File: API_2_ENH_GLEN_1.par
6.2.4.7.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
1 |
Send an envelope SMS PP with BER length of 0x31 |
Result of getLength() is 0x0031 |
|
2 |
Send an envelope SMS PP with BER length of 0x7F |
Result of getLength() is 0x007Fh |
|
3 |
Send an envelope SMS PP with BER length of 81 80 |
Result of getLength() is 0x0080h |
|
4 |
Send an envelope SMS PP with BER length of 81 FC (maximum length for a single SMS) |
Result of getLength() is 0x00FCh |
|
5 |
Send formatted SMS with BER length of 0x00FF, using 2 concatenated SMS |
Result of getLength() is 0x00FFh |
|
6 |
Send formatted SMS with BER length of 0x0100, using 2 concatenated SMS |
Result of getLength() is 0x0100h |
|
7 |
Send formatted SMS with maximum user data length (0x10D) (BER length:0x012F), using 2 concatenated SMS |
Result of getLength() is 0x012Fh |
6.2.4.7.4 Test Coverage
CRR number |
Test case number |
N1 |
1, 2, 3, 4, 5, 6, 7 |
C1 |
Does not apply for EnvelopeHandler |
6.2.4.8 Method copy
Test Area Reference: API_2_ENH_COPY_BSS
6.2.4.8.1 Conformance Requirement
The method with following header shall be compliant to its definition in the API.
public short copy(byte[] dstBuffer,
short dstOffset,
short dstLength)
throws java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException,
ToolkitException
6.2.4.8.1.1 Normal execution
- CRRN1: copies the simple TLV list contained in the handler to the destination byte array.
- CRRN2: returns dstOffset + dstLength.
6.2.4.8.1.2 Parameter errors
- CRRP1: if dstBuffer is null a NullPointerException is thrown.
- CRRP2: if dstOffset or dstLength or both would cause access outside array bounds, or if dstLength is negative, an ArrayIndexOutOfBoundsException is thrown.
- CRRP3: if dstLength is grater than the length of the simple TLV List, an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException. OUT_OF_TLV_BOUNDARIES.
6.2.4.8.1.3 Context errors
- CRRC1: if the handler is busy an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException HANDLER_NOT_AVAILABLE.
6.2.4.8.2 Test Suite files
Specific triggering: None
Test Script: API_2_ENH_COPY_BSS_1.scr
Test Applet: API_2_ENH_COPY_BSS_1.java
Load Script: API_2_ENH_COPY_BSS_1.ldr
Cleanup Script: API_2_ENH_COPY_BSS_1.clr
Parameter File: API_2_ENH_COPY_BSS_1.par
6.2.4.8.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
---|---|---|---|
1 |
NULL as parameter to dstBuffer |
NullPointerException is thrown |
|
2 |
dstOffset ≥ dstBuffer.length dstBuffer.length = 5 dstOffset = 5 dstLength = 1 |
ArrayIndexOutOfBoundsException is thrown |
|
3 |
dstOffset < 0 dstBuffer.length = 5 dstOffset = -1 dstLength = 1 |
ArrayIndexOutOfBoundsException is thrown |
|
4 |
dstLength > dstBuffer.length dstBuffer.length = 5 dstOffset = 0 dstLength = 6 |
ArrayIndexOutOfBoundsException is thrown |
|
5 |
DstOffset + dstLength > dstBuffer.length DstBuffer.length = 5 DstOffset = 3 DstLength = 3 |
ArrayIndexOutOfBoundsException is thrown |
|
6 |
dstLength < 0 dstBuffer.length = 5 dstOffset = 0 dstLength = -1 |
ArrayIndexOutOfBoundsException is thrown |
|
7 |
DstLength > length of the simple TLV list DstBuffer.length = 48 DstOffset = 0 DstLength = 48 |
ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown |
|
8 |
Successful call, dstBuffer is the whole buffer DstBuffer.length = 47 DstOffset = 0 DstLength = 47 |
Result of copy() is 0X0047 |
|
9 |
Compare the buffer |
Result of arrayCompare() is 0 |
|
10 |
Successful call, dstBuffer is part of a buffer DstBuffer.length = 50 dstOffset = 3 dstLength = 47 |
Result of copy() is 0X0032 |
|
11 |
Compare the whole buffer |
Result of arrayCompare() is 0 |
|
12 |
Successful call, dstBuffer is part of a buffer dstBuffer.length = 15 dstOffset = 3 dstLength = 6 |
Result of copy() is 0X0009 |
|
13 |
Compare the whole buffer |
Result of arrayCompare() is 0 |
|
14 |
Successful call, dstBuffer is part of a buffer dstBuffer.length = 260 dstOffset = 257 dstLength = 3 |
Result of copy() is 0X0104 |
|
15 |
Compare the whole buffer |
Result of arrayCompare() is 0 |
|
16 |
Successful call, copy with length =0 dstBuffer.length = 260 dstOffset = 260 dstLength = 0 |
Result of copy() is 0x104 |
|
Send a Formatted SMS PP with the maximum user data length = 0x010D, using 2 concatenated envelopes |
|||
17 |
Successful call, copy with length =299 dstBuffer.length = 299 dstOffset = 0 dstLength = 299 |
Result of copy() is 0x12B |
6.2.4.8.4 Test Coverage
CRR number |
Test case number |
N1 |
9, 11, 13, 15 |
N2 |
8, 10, 12, 14, 16, 17 |
P1 |
1 |
P2 |
2, 3, 4, 5, 6 |
P3 |
7 |
C1 |
Does not apply for EnvelopeHandler |
6.2.4.9 Method findTLV
Test Area Reference: API_2_ENH_FINDBB
6.2.4.9.1 Conformance Requirement
The method with following header shall be compliant to its definition in the API.
public byte findTLV(byte tag, byte occurrence)
throws ToolkitException
6.2.4.9.1.1 Normal execution
Looks for the indicated occurrence of a TLV element from the beginning of the TLV list (handler buffer):
- CRRN1: the method is successful if the required occurrence exists then the corresponding TLV becomes current.
- CRRN2: if the method is successful then it returns TLV_FOUND_CR_SET when Comprehension Required flag is set.
- CRRN3: if the method is successful then it returns TLV_FOUND_CR_NOT_SET when Comprehension Required flag is not set.
- CRRN4: if the required occurrence of the TLV element does not exist, the current TLV is no longer defined and TLV_NOT_FOUND is returned.
- CRRN5: The search method is comprehension required flag independent.
6.2.4.9.1.2 Parameter errors
- CRRP1: if an input parameter is not valid (e.g. occurrence = 0) an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException BAD_INPUT_PARAMETER.
6.2.4.9.1.3 Context errors
- CRRC1: if the handler is busy an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException HANDLER_NOT_AVAILABLE.
6.2.4.9.2 Test Suite files
Specific triggering: None
Test Script: API_2_ENH_FINDBB_1.scr
Test Applet: API_2_ENH_FINDBB_1.java
Load Script: API_2_ENH_FINDBB_1.ldr
Cleanup Script: API_2_ENH_FINDBB_1.clr
Parameter File: API_2_ENH_FINDBB_1.par
6.2.4.9.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
---|---|---|---|
Trig the applet with SMS PP including one more tag 02 and one TAG 04 |
|||
1 |
Invalid input parameter Occurrence = 0 |
ToolkitException.BAD_INPUT_PARAMETER is thrown |
|
2 |
Search 1st TLV Tag = 02h Occurrence = 1 |
Result is TLV_FOUND_CR_SET |
|
3 |
Call the getValueLength() method |
Result is 0x02 |
|
4 |
Search 2nd TLV Tag = 06h Occurrence = 1 |
Result is TLV_FOUND_CR_SET |
|
5 |
Call the getValueLength() method |
Result is 0x05h |
|
6 |
Select a TLV (tag 02h) |
||
Search a wrong tag Tag = 03h Occurrence = 1 |
Result is TLV_NOT_FOUND |
||
7 |
Call the getValueLength() method |
ToolkitException.UNAVAILABLE_ELEMENT is thrown. |
|
8 |
Search a tag with wrong occurrence Tag = 02h Occurrence = 3 |
Result is TLV_NOT_FOUND |
|
9 |
Call the getValueLength() method |
ToolkitException.UNAVAILABLE_ELEMENT is thrown. |
|
10 |
Search the TLV Tag = 02h Occurrence = 2 |
Result is TLV_FOUND_CR_NOT_SET |
|
11 |
Search the TLV Tag = 04h Occurrence = 1 |
Result is TLV_FOUND_CR_NOT_SET |
|
12 |
Search tag 86h Tag = 86h Occurrence = 1 |
Result is TLV_FOUND_CR_SET |
|
13 |
Search tag 84h Tag = 84h Occurrence = 1 |
Result is TLV_FOUND_CR_NOT_SET |
6.2.4.9.4 Test Coverage
CRR number |
Test case number |
N1 |
3, 5 |
N2 |
2, 4 |
N3 |
10, 11 |
N4 |
6, 7, 8, 9 |
N5 |
12, 13 |
P1 |
1 |
C1 |
Does not apply for EnvelopeHandler |
6.2.4.10 Method getValueLength
Test Area Reference: API_2_ENH_GVLE
6.2.4.10.1 Conformance Requirement
The method with following header shall be compliant to its definition in the API.
public short getValueLength()
throws ToolkitException
6.2.4.10.1.1 Normal execution
- CRRN1: gets and returns the binary length of the value field for the last TLV element which has been found in the handler.
6.2.4.10.1.2 Parameter errors
No requirements.
6.2.4.10.1.3 Context errors
- CRRC1: if the handler is busy an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException HANDLER_NOT_AVAILABLE.
- CRRC2: in case of unavailable TLV element an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException UNAVAILABLE_ELEMENT.
6.2.4.10.2 Test Suite files
Specific triggering: None
Test Script: API_2_ENH_GVLE_1.scr
Test Applet: API_2_ENH_GVLE_1.java
Load Script: API_2_ENH_GVLE_1.ldr
Cleanup Script: API_2_ENH_GVLE_1.clr
Parameter File: API_2_ENH_GVLE_1.par
6.2.4.10.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
Fill the SMS PP with TLV: Tag 33, Length C8 |
|||
1 |
getValueLength() |
ToolkitException.UNAVAILABLE_ELEMENT is thrown |
|
2 |
Search TLV 02h |
||
getValueLength() |
Result is 0X0002 |
||
3 |
Search TLV 0Bh |
||
getValueLength() |
Result is 0X0024 |
||
4 |
Search TLV 33h |
||
getValueLength() |
Result is 0X00C8 |
||
Send Formatted SMS PP with the maximum user data length = 0x010D, using 2 concatenated envelopes |
|||
5 |
Search SMS TPDU TAG |
||
getValueLength() |
Result is 0X0120 |
6.2.4.10.4 Test Coverage
CRR number |
Test case number |
N1 |
2, 3, 4, 5 |
C1 |
Does not apply for EnvelopeHandler |
C2 |
1 |
6.2.4.11 Method getValueByte
Test Area Reference: API_2_ENH_GVBYS
6.2.4.11.1 Conformance Requirement
The method with following header shall be compliant to its definition in the API.
public byte getValueByte(short valueOffset)
throws ToolkitException
6.2.4.11.1.1 Normal execution
- CRRN1: Gets a byte from the last TLV element which has been found in the handler and returns its value (1 byte).
6.2.4.11.1.2 Parameter errors
- CRRP1: if valueOffset is out of the current TLV an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException OUT_OF_TLV_BOUNDARIES.
6.2.4.11.1.3 Context errors
- CRRC1: if the handler is busy an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException HANDLER_NOT_AVAILABLE.
- CRRC2: in case of unavailable TLV element an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException UNAVAILABLE_ELEMENT.
6.2.4.11.2 Test Suite files
Specific triggering: None
Test Script: API_2_ENH_GVBYS_1.scr
Test Applet: API_2_ENH_GVBYS_1.java
Load Script: API_2_ENH_GVBYS_l.dr
Cleanup Script: API_2_ENH_GVBYS_1.clr
Parameter File: API_2_ENH_GVBYS_1.par
6.2.4.11.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
Fill the SMS PP with TLV: Tag 33, Length C8 Value 01 02 … |
|||
1 |
getValueByte(0) |
ToolkitException.UNAVAILABLE_ELEMENT is thrown |
|
2 |
Search TLV 02h |
||
getValueByte(2) |
ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown |
||
3 |
Search TLV 02h |
||
getValueByte(1) |
Result is 0x81 |
||
4 |
Search TLV 02h (Device Identities TLV) |
||
getValueByte(0) |
Result is 83h (Source) |
||
5 |
Search TLV 33h |
||
getValueByte(7E) |
Result is 0x7F |
||
6 |
Search TLV 33h |
||
getValueByte(80) |
Result is 0x81 |
||
7 |
getValueByte(7F) |
Result is 0x80 |
|
8 |
Search TLV B3h |
||
getValueByte(C7) |
Result is 0xC8 |
||
Send Formatted SMS PP with the maximum user data length = 0x010D, using 2 concatenated envelopes |
|||
9 |
Search SMS TPDU TAG |
||
getValueByte(0x011F) |
Result is 0xFA |
6.2.4.11.4 Test Coverage
CRR number |
Test case number |
N1 |
3, 4, 5, 6, 7, 8, 9 |
P1 |
2 |
C1 |
Does not apply for EnvelopeHandler |
C2 |
1 |
6.2.4.12 Method copyValue
Test Area Reference: API_2_ENH_CPYVS_BSS
6.2.4.12.1 Conformance Requirement
The method with following header shall be compliant with its definition in the API.
public short copyValue(short valueOffset,
byte[] dstBuffer,
short dstOffset,
short dstLength)
throws java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException,
ToolkitException
6.2.4.12.1.1 Normal execution
- CRRN1: copies a part of the last TLV element which has been found, into a destination. buffer.
- CRRN2: returns dstOffset + dstLength.
6.2.4.12.1.2 Parameter errors
- CRRP1: if dstBuffer is null NullPointerException is thrown.
- CRRP2: if dstOffset or dstLength or both would cause access outside array bounds, or if dstLength is negative ArrayIndexOutOfBoundsException is thrown.
- CRRP3: if valueOffset, dstLength or both are out of the current TLV an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException OUT_OF_TLV_BOUNDARIES.
6.2.4.12.1.3 Context errors
- CRRC1: if the handler is busy an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException HANDLER_NOT_AVAILABLE.
- CRRC2: in case of unavailable TLV element an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException UNAVAILABLE_ELEMENT.
6.2.4.12.2 Test Suite files
Specific triggering: None
Test Script: API_2_ENH_CPYVS_BSS_1.scr
Test Applet: API_2_ENH_CPYVS_BSS_1.java
Load Script: API_2_ENH_CPYVS_BSS_1.ldr
Cleanup Script: API_2_ENH_CPYVS_BSS_1.clr
Parameter File: API_2_ENH_CPYVS_BSS_1.par
6.2.4.12.3 Test procedure
Id |
Description |
API Expectation |
APDU Expectation |
---|---|---|---|
1 |
Search TLV 02h |
||
copyValue() with a null dstBuffer |
NullPointerException is thrown |
||
2 |
Search TLV 0Bh |
||
dstOffset ≥ dstBuffer.length dstBuffer.length = 5 dstOffset = 5 dstLength = 1 |
ArrayIndexOutOfBoundsException is thrown |
||
3 |
dstOffset < 0 dstBuffer.length = 5 dstOffset = -1 dstLength = 1 |
ArrayIndexOutOfBoundsException is thrown |
|
4 |
dstLength >dstBuffer.length dstBuffer.length = 5 dstOffset = 0 dstLength = 6 |
ArrayIndexOutOfBoundsException is thrown |
|
5 |
dstOffset + dstLength >dstBuffer.length dstBuffer.length = 5 dstOffset = 3 dstLength = 3 |
ArrayIndexOutOfBoundsException is thrown |
|
6 |
dstLength < 0 dstBuffer.length = 5 dstOffset = 0 dstLength = -1 |
ArrayIndexOutOfBoundsException is thrown |
|
7 |
Search TLV 06h |
||
valueOffset ≥ TLV Length valueOffset = 6 dstBuffer.length = 15 dstOffset = 0 dstLength = 1 |
ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown |
||
8 |
valueOffset < 0 valueOffset = -1 dstBuffer.length = 15 dstOffset = 0 dstLength = 1 |
ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown |
|
9 |
dstLength > TLV length valueOffset = 0 dstBuffer.length = 15 dstOffset = 0 dstLength = 7 |
ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown |
|
10 |
valueOffset + dstLength > TLV length valueOffset = 2 dstBuffer.length = 15 dstOffset = 0 dstLength = 5 |
ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown |
|
11 |
Search TLV 01h |
||
copyValue() |
ToolkitException.UNAVAILABLE_ELEMENT is thrown on the copyValue() method |
||
12 |
Search TLV 06h |
||
Successful call valueOffset = 0 dstBuffer.length = 6 dstOffset = 0 dstLength = 6 |
Result of copyValue() is 0x0006 |
||
13 |
Compare buffer buffer = 81 11 22 33 44 F5 |
Result is 00h |
|
14 |
initialise dstBuffer dstBuffer = 55 55 … 55 |
||
Successful call valueOffset = 1 dstBuffer.length = 20 dstOffset = 3 dstLength = 4 |
Result of copyValue() is 0x0007 |
||
15 |
Compare buffer buffer = 55 55 55 11 22 33 44 55 55 55 55 55 55 55 55 55 55 55 55 55 |
Result is 00h |
|
16 |
Successful call, copy with length =0 dstBuffer.length = 20 dstOffset = 20 dstLength = 0 |
Result of copyValue() is 20 |
|
Send Formatted SMS with the maximum user data length = 0x010D, using 2 concatenated envelopes |
|||
17 |
Search SMS TPDU TAG |
||
Successful call valueOffset = 0x11 dstBuffer.length = 0x010D dstOffset = 0 dstLength = 0x010D |
Result of copyValue() is 0x010D |
||
18 |
Compare buffer buffer = 0348 header and secured data (01 … FA) |
Result is 00h |
|
19 |
Initialise dstBuffer dstBuffer = 55 55 … 55 |
||
Successful call valueOffset = 0x0111 dstBuffer.length = 0x010D dstOffset = 0x0100 dstLength = 0x000D |
Result of copyValue() is 0x010D |
||
20 |
Compare buffer buffer = 55 55 55 55 55 55 55 55 … 55 55 EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA |
Result is 00h |
6.2.4.12.4 Test Coverage
CRR number |
Test case number |
N1 |
13, 15, 18, 20 |
N2 |
12, 14, 16, 17, 19 |
P1 |
1 |
P2 |
2, 3, 4, 5, 6 |
P3 |
7, 8, 9, 10 |
C1 |
Does not apply for EnvelopeHandler |
C2 |
11 |
6.2.4.13 Method compareValue
Test Area Reference: API_2_ENH_CPRVS_BSS
6.2.4.13.1 Conformance requirement
The method with following header shall be compliant to its definition in the API.
public byte compareValue(short valueOffset,
byte[] compareBuffer,
short compareOffset,
short compareLength)
throws java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException,
ToolkitException
6.2.4.13.1.1 Normal execution
Compares the last found TLV element with a buffer:
- CRRN1: returns 0 if identical.
- CRRN2: returns -1 if the first miscomparing byte in simple TLV List is less than that in compareBuffer.
- CRRN3: returns 1 if the first miscomparing byte in simple TLV List is greater than that in compareBuffer.
6.2.4.13.1.2 Parameter errors
- CRRP1: if compareBuffer is null NullPointerException shall be thrown.
- CRRP2: if compareOffset or compareLength or both would cause access outside array bounds, or if compareLength is negative ArrayIndexOutOfBoundsException shall be thrown.
- CRRP3: if valueOffset, dstLength or both are out of the current TLV an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException OUT_OF_TLV_BOUNDARIES.
6.2.4.13.1.3 Context errors
- CRRC1: if the handler is busy an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException HANDLER_NOT_AVAILABLE.
- CRRC2: in case of unavailable TLV element an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException UNAVAILABLE_ELEMENT.
6.2.4.13.2 Test Suite files
Specific triggering: None
Test Script: API_2_ENH_CPRVS_BSS_1.scr
Test Applet: API_2_ENH_CPRVS_BSS_1.java
Load Script: API_2_ENH_CPRVS_BSS_1.ldr
Cleanup Script: API_2_ENH_CPRVS_BSS_1.clr
Parameter File: API_2_ENH_CPRVS_BSS_1.par
6.2.4.13.3 Test procedure
Id |
Description |
API Expectation |
APDU Expectation |
---|---|---|---|
1 |
Search TLV 02h |
||
compareValue() with a null compareBuffer |
NullPointerException is thrown |
||
2 |
Search TLV 0Bh |
||
compareOffset ≥ compareBuffer.length compareBuffer.length = 5 compareOffset = 5 compareLength = 1 |
ArrayIndexOutOfBoundsException is thrown |
||
3 |
compareOffset < 0 compareBuffer.length = 5 compareOffset = -1 compareLength = 1 |
ArrayIndexOutOfBoundsException is thrown |
|
4 |
compareLength >compareBuffer.length compareBuffer.length = 5 compareOffset = 0 compareLength = 6 |
ArrayIndexOutOfBoundsException is thrown |
|
5 |
compareOffset + compareLength >compareBuffer.length compareBuffer.length = 5 compareOffset = 3 compareLength = 3 |
ArrayIndexOutOfBoundsException is thrown |
|
6 |
compareLength < 0 compareBuffer.length = 5 compareOffset = 0 compareLength = -1 |
ArrayIndexOutOfBoundsException is thrown |
|
7 |
Search TLV 06h |
||
valueOffset ≥ TLV Length valueOffset = 6 compareBuffer.length = 15 compareOffset = 0 compareLength = 1 |
ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown |
||
8 |
valueOffset < 0 valueOffset = -1 compareBuffer.length = 15 compareOffset = 0 compareLength = 1 |
ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown |
|
9 |
compareLength > TLV length valueOffset = 0 compareBuffer.length = 15 compareOffset = 0 compareLength = 7 |
ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown |
|
10 |
valueOffset + compareLength > TLV length valueOffset = 2 compareBuffer.length = 15 compareOffset = 0 compareLength = 5 |
ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown |
|
11 |
Search TLV 01h |
Result is TLV_NOT_FOUND |
|
compareValue() |
ToolkitException.UNAVAILABLE_ELEMENT is thrown |
||
12 |
Search TLV 06h |
||
Initialise compareBuffer compareBuffer = 81 11 22 33 44 F5 |
|||
Compare buffers valueOffset = 0 compareOffset = 0 compareLength = 6 |
Result is 00h |
||
13 |
Initialise compareBuffer compareBuffer = 7F 11 22 33 44 F5 |
||
Compare buffers with same parameters |
Result is -1 |
||
14 |
Initialise compareBuffer compareBuffer = 83 11 22 33 44 F5 |
||
Compare buffers with same parameters |
Result is -1 |
||
15 |
Initialise compareBuffer compareBuffer = 55 55 55 81 11 22 33 44 F5 55 55 55 55 55 |
||
Compare buffers valueOffset = 1 compareOffset = 4 compareLength = 5 |
Result is 00h |
||
16 |
Initialise compareBuffer compareBuffer = 55 55 55 81 10 22 33 44 F5 55 55 55 55 55 |
||
Compare buffers with same parameters |
Result is +1 |
||
17 |
Initialise compareBuffer compareBuffer = 55 55 55 81 12 22 33 44 F5 55 55 55 55 55 |
||
Compare buffers with same parameters |
Result is -1 |
||
18 |
Successful call, compareValue with length =0 CompareBuffer.length = 15 CompareOffset = 15 CompareLength = 0 |
Result of compareValue() is 0 |
|
Send Formatted SMS PP with the maximum user data length = 0x010D, using 2 concatenated envelopes |
|||
Search SMS TPDU TAG |
|||
Initialise compareBuffer compareBuffer = 0348 header and formatted data(01 02 … FA) |
|||
19 |
Compare buffers valueOffset = 0x11 compareOffset = 0 compareLength = 0x010D compareBufferLength = 0x010D |
Result is 00h |
|
20 |
Compare buffers valueOffset = 0x0111 compareOffset = 0x0100 compareLength = 0x000D compareBufferLength = 0x010D |
Result is 00h |
6.2.4.13.4 Test Coverage
CRR number |
Test case number |
N1 |
12, 15, 19, 20 |
N2 |
13, 16, 18 |
N3 |
14, 17 |
P1 |
1 |
P2 |
2, 3, 4, 5, 6 |
P3 |
7, 8, 9, 10 |
C1 |
Does not apply for EnvelopeHandler |
C2 |
11 |
6.2.4.14 Method findAndCopyValue(byte tag, byte[] dstBuffer, short dstOffset)
Test Area Reference: API_2_ENH_FACYB_BS
6.2.4.14.1 Conformance requirement
The method with following header shall be compliant to its definition in the API.
public short findAndCopyValue(byte tag,
byte[] dstBuffer,
short dstOffset)
throws java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException,
ToolkitException
6.2.4.14.1.1 Normal execution
- CRRN1: looks for the first occurrence of a TLV element from the beginning of a TLV list and copy its value into a destination buffer.
- CRRN2: if no TLV element is found, the UNAVAILABLE_ELEMENT exception is thrown and the current TLV is no longer defined.
- CRRN3: if the method is successful then the corresponding TLV becomes current and dstOffset + length of the copied value is returned.
- CRRN4: The search method is comprehension required flag independent.
6.2.4.14.1.2 Parameter errors
- CRRP1: if dstBuffer is null NullPointerException shall be thrown.
- CRRP2: if dstOffset would cause access outside array bounds ArrayIndexOutOfBoundsException shall be thrown.
6.2.4.14.1.3 Context errors
- CRRC1: if the handler is busy an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException HANDLER_NOT_AVAILABLE.
6.2.4.14.2 Test Suite files
Specific triggering: None
Test Script: API_2_ENH_FACYB_BS_1.scr
Test Applet: API_2_ENH_FACYB_BS_1.java
Load Script: API_2_ENH_FACYB_BS_1.ldr
Cleanup Script: API_2_ENH_FACYB_BS_1.clr
Parameter File: API_2_ENH_FACYB_BS_1.par
6.2.4.14.3 Test procedure
Id |
Description |
API Expectation |
APDU Expectation |
---|---|---|---|
Fill the SMS PP with TLV: Tag 02 Value 22 44 Tag 33, Length C4 Value 01 02 … |
|||
1 |
FindAndCopyValue() with a null dstBuffer |
NullPointerException is thrown |
|
2 |
dstOffset ≥ dstBuffer.length tag = 06h dstBuffer.length = 06 dstOffset = 06 |
ArrayIndexOutOfBoundsException is thrown |
|
3 |
dstOffset < 0 dstBuffer.length = 06 dstOffset = -1 |
ArrayIndexOutOfBoundsException is thrown |
|
4 |
length > dstBuffer.length dstBuffer.length = 05 dstOffset = 0 |
ArrayIndexOutOfBoundsException is thrown |
|
5 |
DstOffset + length >dstBuffer.length DstBuffer.length = 06 DstOffset = 1 |
ArrayIndexOutOfBoundsException is thrown |
|
6 |
Select a TLV (tag 02h) |
||
findAndCopyValue() tag = 03h |
ToolkitException.UNAVAILABLE_ELEMENT is thrown |
||
7 |
Call the getValueLength() method |
ToolkitException.UNAVAILABLE_ELEMENT is thrown. |
|
8 |
Successful call Tag = 06h DstBuffer.length = 06 DstOffset = 0 |
Result of findAndCopyValue () is 0006 |
|
9 |
Compare buffer buffer = 81 11 22 33 44 F5 |
Result is 00h |
|
10 |
initialise dstBuffer dstBuffer = 55 55 … 55 |
||
Successful call dstBuffer.length = 12 dstOffset = 2 |
Result of findAndCopyValue () is 0008 |
||
11 |
Compare buffer buffer = 55 55 81 11 22 33 44 F5 55 55 55 55 |
Result is 00h |
|
12 |
Successful call tag = 02h dstBuffer.length = 2 dstOffset = 0 |
Result of findAndCopyValue () is 0002 |
|
13 |
Compare buffer buffer = 83 81 |
Result is 00h |
|
14 |
Successful call (with tag 82h) tag = 82h dstBuffer.length = 02 dstOffset = 0 |
Result of findAndCopyValue () is 0002 |
|
15 |
Compare buffer buffer = 83 81 |
Result is 00h |
|
16 |
Successful call (with tag B3h) tag = B3h dstBuffer.length = C4 dstOffset = 0 |
Result of findAndCopyValue () is 00C4 |
|
17 |
Compare buffer buffer = 01 02 … C4 |
Result is 00h |
|
Send Formatted SMS PP with the maximum user data length = 0x010D, using 2 concatenated envelopes |
|||
18 |
Successful call (with SMS TPDU TAG) tag = 0Bh dstBuffer.length = 0x011E dstOffset = 0 |
Result of findAndCopyValue () is 0x011E |
|
19 |
Compare buffer buffer = 0348 Header + secured data (01 02 … FA) |
Result is 00h |
|
20 |
Successful call (with SMS TPDU TAG) tag = 0Bh dstBuffer.length = 0x0220 dstOffset = 0x0100 |
Result of findAndCopyValue () is 0x021E |
|
21 |
Compare buffer buffer = 0348 Header + secured data (01 02 … FA) |
Result is 00h |
6.2.4.14.4 Test Coverage
CRR number |
Test case number |
N1 |
9, 11, 13 |
N2 |
6, 7 |
N3 |
8, 10, 12 |
N4 |
14, 15, 16, 17, 18, 19, 20, 21 |
P1 |
1 |
P2 |
2, 3, 4, 5 |
C1 |
Does not apply for EnvelopeHandler |
6.2.4.15 Method findAndCopyValue(byte tag, byte occurrence, short valueOffset, byte[] dstBuffer, short dstOffset, short dstLength)
Test Area Reference: API_2_ENH_FACYBS_BSS
6.2.4.15.1 Conformance requirement
The method with following header shall be compliant to its definition in the API.
public short findAndCopyValue(byte tag,
byte occurence,
short valueOffset,
byte[] dstBuffer,
short dstOffset,
short dstLength)
throws java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException,
ToolkitException
6.2.4.15.1.1 Normal execution
- CRRN1: looks for the indicated occurrence of a TLV element from the beginning of a TLV list and copy its value into a destination buffer.
- CRRN2: if no TLV element is found, the UNAVAILABLE_ELEMENT exception is thrown and the current TLV is no longer defined.
- CRRN3: if the method is successful then the corresponding TLV becomes current and dstOffset + dstLength is returned.
- CRRN4: The search method is comprehension required flag independent.
6.2.4.15.1.2 Parameter errors
- CRRP1: if dstBuffer is null NullPointerException shall be thrown.
- CRRP2: if dstOffset or dstLength or both would cause access outside array bounds, or if dstLength is negative ArrayIndexOutOfBoundsException shall be thrown.
- CRRP3: if valueOffset, dstLength or both are out of the current TLV an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException OUT_OF_TLV_BOUNDARIES.
6.2.4.15.1.3 Context errors
- CRRC1: if the handler is busy an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException HANDLER_NOT_AVAILABLE.
6.2.4.15.2 Test Suite files
Test Script: API_2_ENH_FACYBS_BSS_1.scr
Test Applet: API_2_ENH_FACYBS_BSS_1.java
Load Script: API_2_ENH_FACYBS_BSS_1.ldr
Cleanup Script: API_2_ENH_FACYBS_BSS_1.clr
Parameter File: API_2_ENH_FACYBS_BSS_1.par
6.2.4.15.3 Test procedure
Id |
Description |
API Expectation |
APDU Expectation |
---|---|---|---|
Fill the SMS PP with TLV: Tag 02 Value 22 44 Tag 33, Length C4 Value 01 02 … |
|||
1 |
findAndCopyValue() with a null dstBuffer |
NullPointerException is thrown |
|
2 |
dstOffset ≥ dstBuffer.length tag = 06h, occurrence = 1 valueOffset = 0 dstBuffer.length = 5 dstOffset = 5 dstLength = 1 |
ArrayIndexOutOfBoundsException is thrown |
|
3 |
dstOffset < 0 dstBuffer.length = 5 dstOffset = -1 dstLength = 1 |
ArrayIndexOutOfBoundsException is thrown |
|
4 |
dstLength >dstBuffer.length dstBuffer.length = 5 dstOffset = 0 dstLength = 6 |
ArrayIndexOutOfBoundsException is thrown |
|
5 |
dstOffset + dstLength >dstBuffer.length dstBuffer.length = 5 dstOffset = 3 dstLength = 3 |
ArrayIndexOutOfBoundsException is thrown |
|
6 |
dstLength < 0 dstBuffer.length = 5 dstOffset = 0 dstLength = -1 |
ArrayIndexOutOfBoundsException is thrown |
|
7 |
valueOffset ≥ Value Length tag = 06h, occurrence = 1 valueOffset = 6 dstBuffer.length = 15 dstOffset = 0 dstLength = 1 |
ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown |
|
8 |
valueOffset < 0 valueOffset = -1 dstBuffer.length = 15 dstOffset = 0 dstLength = 1 |
ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown |
|
9 |
dstLength > Value length valueOffset = 0 dstBuffer.length = 15 dstOffset = 0 dstLength = 7 |
ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown |
|
10 |
valueOffset + dstLength > Text String length valueOffset = 2 dstBuffer.length = 15 dstOffset = 0 dstLength = 5 |
ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown |
|
11 |
Select a TLV (tag 02h) |
||
findAndCopyValue() tag = 06h occurrence = 2 |
ToolkitException.UNAVAILABLE_ELEMENT is thrown |
||
12 |
Call the getValueLength() method |
ToolkitException.UNAVAILABLE_ELEMENT is thrown. |
|
13 |
Successful call tag = 06h, occurrence = 1 valueOffset = 0 dstBuffer.length = 06 dstOffset = 0 dstLength = 06 |
Result of findAndCopyValue() is 6 |
|
14 |
Compare buffer buffer = 81 11 22 33 44 F5 |
Result is 00h |
|
15 |
initialise dstBuffer dstBuffer = 55 55 … 55 |
||
Successful call tag = 06h, occurrence = 1 valueOffset = 2 dstBuffer.length = 12 dstOffset = 3 dstLength = 04 |
Result of findAndCopyValue () is 0007 |
||
16 |
Compare buffer buffer = 55 55 55 22 33 44 F5 55 55 55 55 55 |
Result is 00h |
|
17 |
Successful call tag = 02h, occurrence = 1 valueOffset = 0 dstBuffer.length = 12 dstOffset = 0 dstLength = 2 |
Result of findAndCopyValue() is 0002 |
|
18 |
Compare buffer buffer = 83 81 55 … 55 |
Result is 00h |
|
19 |
Successful call tag = 02h, occurrence = 2 valueOffset = 0 dstBuffer.length = 12 dstOffset = 0 dstLength = 2 |
Result of findAndCopyValue() is 0002 |
|
20 |
Compare buffer buffer = 22 44 55 … 55 |
Result is 00h |
|
21 |
Successful call (with tag 82h) tag = 82h occurrence = 1 valueOffset = 0 dstBuffer.length = 12 dstOffset = 0 dstLength = 02 |
Result of findAndCopyValue () is 0002 |
|
22 |
Compare buffer buffer = 83 81 55 … 55 |
Result is 00h |
|
23 |
Successful call (with tag 82h) tag = 82h occurrence = 2 valueOffset = 0 dstBuffer.length = 12 dstOffset = 0 dstLength = 02 |
Result of findAndCopyValue () is 0002 |
|
24 |
Compare buffer Buffer = 22 44 55 … 55 |
Result is 00h |
|
25 |
Successful call, findAndCopyValue with length =0 DstBuffer.length = 12 dstOffset = 12 dstLength = 0 |
Result of findAndCopyValue () is 12 |
|
Send Formatted SMS PP with the maximum user data length = 0x010D, using 2 concatenated envelopes |
|||
26 |
Successful call tag = 0Bh, occurrence = 1 valueOffset = 0x11 dstBuffer.length = 0x010D dstOffset = 0 dstLength = 0x010D |
Result of findAndCopyValue() is 0x010D |
|
27 |
Compare buffer buffer = 0348 Header + secured data (01 02 … FA) |
Result is 00h |
|
28 |
initialise dstBuffer dstBuffer = 55 55 … 55 |
||
Successful call tag = 0Bh, occurrence = 1 valueOffset = 0x0111 dstBuffer.length = 0x010D dstOffset = 0x0100 dstLength = 0x0D |
Result of findAndCopyValue () is 0x010D |
||
29 |
Compare buffer buffer = 55 55 … 55 55 EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA |
Result is 00h |
6.2.4.15.4 Test Coverage
CRR number |
Test case number |
N1 |
14, 15, 17, 19, 20 |
N2 |
11, 12 |
N3 |
13, 15, 17, 19, 25 |
N4 |
21, 22, 23, 24, 26, 27, 28,29 |
P1 |
1 |
P2 |
2, 3, 4, 5, 6 |
P3 |
7, 8, 9, 10 |
C1 |
Does not apply for EnvelopeHandler |
6.2.4.16 Method findAndCompareValue(byte tag, byte[] compareBuffer, short compareOffset)
Test Area Reference: API_2_ENH_FACRB_BS
6.2.4.16.1 Conformance requirement
The method with following header shall be compliant to its definition in the API.
public byte findAndCompareValue(byte tag,
byte[] compareBuffer,
short compareOffset)
throws java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException,
ToolkitException
6.2.4.16.1.1 Normal execution
Looks for the first occurrence of a TLV element from beginning of a TLV list and compare its value with a buffer:
- CRRN1: if no TLV element is found, the UNAVAILABLE_ELEMENT exception is thrown and the current TLV is no longer defined.
- CRRN2: if the method is successful then the corresponding TLV becomes current.
- CRRN3: if identical returns 0.
- CRRN4: if the first miscomparing byte in simple TLV is less than that in compareBuffer returns -1.
- CRRN5: if the first miscomparing byte in simple TLV is greater than that in compareBuffer returns 1.
- CRRN6: The search method is comprehension required flag independent.
6.2.4.16.1.2 Parameter errors
- CRRP1: if compareBuffer is null NullPointerException shall be thrown.
- CRRP2: if compareOffset would cause access outside array bounds ArrayIndexOutOfBoundsException shall be thrown.
6.2.4.16.1.3 Context errors
- CRRC1: if the handler is busy an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException HANDLER_NOT_AVAILABLE.
6.2.4.16.2 Test Suite files
Test Script: API_2_ENH_FACRB_BS_1.scr
Test Applet: API_2_ENH_FACRB_BS_1.java
Load Script: API_2_ENH_FACRB_BS_1.ldr
Cleanup Script: API_2_ENH_FACRB_BS_1.clr
Parameter File: API_2_ENH_FACRB_BS_1.par
6.2.4.16.3 Test procedure
Id |
Description |
API Expectation |
APDU Expectation |
Fill the SMS PP with TLV: Tag 02 Value 22 44 Tag 33, Length C4 Value 01 02 … |
|||
1 |
findAndCompareValue() with a null dstBuffer |
NullPointerException is thrown |
|
2 |
compareOffset ≥ compareBuffer.length tag = 06h compareBuffer.length = 12 compareOffset = 12 |
ArrayIndexOutOfBoundsException is thrown |
|
3 |
compareOffset < 0 compareBuffer.length = 12 compareOffset = -1 |
ArrayIndexOutOfBoundsException is thrown |
|
4 |
length > compareBuffer.length compareBuffer.length = 05 compareOffset = 0 |
ArrayIndexOutOfBoundsException is thrown |
|
5 |
compareOffset + length > compareBuffer.length compareBuffer.length = 12 compareOffset = 7 |
ArrayIndexOutOfBoundsException is thrown |
|
6 |
Select a TLV (tag 02h) |
||
findAndCompareValue() tag = 03h |
ToolkitException.UNAVAILABLE_ELEMENT is thrown |
||
7 |
Call the getValueLength() method |
ToolkitException.UNAVAILABLE_ELEMENT is thrown. |
|
8 |
Initialise compareBuffer compareBuffer = 81 11 22 33 44 F5 |
||
Compare buffers tag = 06h compareOffset = 0 |
Result is 00h |
||
9 |
Verify current TLV getValueLength() |
Result is 06 |
|
10 |
Initialise compareBuffer compareBuffer = 81 11 22 33 44 F4 |
||
Compare buffers with same parameters |
Result is +1 |
||
11 |
Initialise compareBuffer compareBuffer = 81 11 22 33 44 F6 |
||
Compare buffers with same parameters |
Result is -1 |
||
12 |
Initialise compareBuffer compareBuffer = 55 55 81 11 22 33 44 F5 55 55 55 55 |
||
Compare buffers compareOffset = 2 |
Result is 00h |
||
13 |
Initialise compareBuffer compareBuffer = 55 55 83 81 55 55 55 55 55 55 55 55 |
||
Compare buffers compareOffset = 2 |
Result is 00h |
||
14 |
Initialise compareBuffer compareBuffer = 55 55 83 80 55 55 55 55 55 55 55 55 |
||
Compare buffers compareOffset = 2 |
Result is +1 |
||
15 |
Initialise compareBuffer compareBuffer = 55 55 83 82 55 55 55 55 55 55 55 55 |
||
Compare buffers compareOffset = 2 |
Result is -1 |
||
16 |
Initialise compareBuffer compareBuffer = 83 81 55 55 55 55 55 55 55 55 55 55 |
||
Successful call (with tag 02h) tag = 02h compareBuffer.length = 12 compareOffset = 0 |
Result is 00h |
||
17 |
Initialise compareBuffer CompareBuffer = 01 02 … C4 |
||
Successful call (with tag B3h) Tag = B3h CompareBuffer.length = C4 CompareOffset = 0 |
Result is 00h |
||
Send Unformatted SMS PP with the maximum user data length = 0x010C, using 2 concatenated envelopes |
|||
Initialise compareBuffer CompareBuffer = 0340 Header + user data (00 01 02 … FF 01 … 0C) |
|||
18 |
Successful call (with SMS TPDU TAG) Tag = 0Bh CompareBuffer.length = 0x011E CompareOffset = 0 |
Result is 00h |
|
Initialise compareBuffer CompareBuffer = 55 55 … 55 CompareBuffer from offset 0x0100= 0340 Header + user data (00 01 02 … FF 01 … 0C) |
|||
19 |
Successful call (with SMS TPDU TAG) Tag = 0Bh CompareBuffer.length = 0x220 CompareOffset = 0x0100 |
Result is 00h |
6.2.4.16.4 Test Coverage
CRR number |
Test case number |
N1 |
6,7 |
N2 |
9 |
N3 |
8, 12, 13, 18, 19 |
N4 |
10, 14 |
N5 |
11, 15 |
N6 |
16, 17 |
P1 |
1 |
P2 |
2, 3, 4, 5 |
C1 |
Does not apply for EnvelopeHandler |
6.2.4.17 Method findAndCompareValue(byte tag, byte occurrence, short valueOffset, byte[] compareBuffer, short compareOffset, short compareLength)
Test Area Reference: API_2_ENH_FACRBBS_BSS
6.2.4.17.1 Conformance requirement
The method with following header shall be compliant to its definition in the API.
public byte findAndCompareValue(byte tag,
byte occurence,
short valueOffset,
byte[] compareBuffer,
short compareOffset,
short compareLength)
throws java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException,
ToolkitException
6.2.4.17.1.1 Normal execution
Looks for the indicated occurrence of a TLV element from the beginning of a TLV list and compare its value with a buffer:
- CRRN1: if no TLV element is found, the UNAVAILABLE_ELEMENT exception is thrown and the current TLV is no longer defined.
- CRRN2: if the method is successful then the corresponding TLV becomes current.
- CRRN3: if identical 0 is returned.
- CRRN4: if the first miscomparing byte in simple TLV is less than that in compareBuffer -1 is returned.
- CRRN5: if the first miscomparing byte in simple TLV is greater than that in compareBuffer 1 is returned
- CRRN6: The search method is comprehension required flag independent.
6.2.4.17.1.2 Parameter errors
- CRRP1: if compareBuffer is null NullPointerException shall be thrown.
- CRRP2: if compareOffset or compareLength or both would cause access outside array bounds, or if compareLength is negative ArrayIndexOutOfBoundsException shall be thrown.
- CRRP3: if valueOffset, compareLength or both are out of the current TLV an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException OUT_OF_TLV_BOUNDARIES.
- CRRP4: if an input parameter is not valid (e.g. occurence = 0) an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException BAD_INPUT_PARAMETER.
6.2.4.17.1.3 Context errors
- CRRC1: if the handler is busy an instance of ToolkitException shall be thrown. The reason code shall be ToolkitException HANDLER_NOT_AVAILABLE.
6.2.4.17.2 Test Suite files
Test Script: API_2_ENH_FACRBBS_BSS_1.scr
Test Applet: API_2_ENH_FACRBBS_BSS_1.java
Load Script: API_2_ENH_FACRBBS_BSS_1.ldr
Cleanup Script: API_2_ENH_FACRBBS_BSS_1.clr
Parameter File: API_2_ENH_FACRBBS_BSS_1.par
6.2.4.17.3 Test procedure
Id |
Description |
API Expectation |
APDU Expectation |
---|---|---|---|
Fill the SMS PP with TLV: Tag 02 Value 22 44 Tag 33, Length C4 Value 01 02 … |
|||
1 |
findAndCompareValue() with a null compareBuffer |
NullPointerException is thrown |
|
2 |
compareOffset ≥ compareBuffer.length tag = 06h, occurrence = 1 valueOffset = 0 compareBuffer.length = 6 compareOffset = 6 compareLength = 1 |
ArrayIndexOutOfBoundsException is thrown |
|
3 |
compareOffset < 0 compareBuffer.length = 6 compareOffset = -1 compareLength = 1 |
ArrayIndexOutOfBoundsException is thrown |
|
4 |
compareLength >compareBuffer.length compareBuffer.length = 5 compareOffset = 0 compareLength = 6 |
ArrayIndexOutOfBoundsException is thrown |
|
5 |
compareOffset + compareLength >compareBuffer.length compareBuffer.length = 5 compareOffset = 3 compareLength = 3 |
ArrayIndexOutOfBoundsException is thrown |
|
6 |
compareLength < 0 compareBuffer.length = 5 compareOffset = 0 compareLength = -1 |
ArrayIndexOutOfBoundsException is thrown |
|
7 |
valueOffset ≥ Value Length tag = 06h, occurrence = 1 valueOffset = 6 compareBuffer.length = 15 compareOffset = 0 compareLength = 1 |
ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown |
|
8 |
valueOffset < 0 valueOffset = -1 compareBuffer.length = 15 compareOffset = 0 compareLength = 1 |
ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown |
|
9 |
compareLength > Value length valueOffset = 0 compareBuffer.length = 15 compareOffset = 0 compareLength = 7 |
ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown |
|
10 |
valueOffset + compareLength > Value length valueOffset = 2 compareBuffer.length = 15 compareOffset = 0 compareLength = 5 |
ToolkitException.OUT_OF_TLV_BOUNDARIES is thrown |
|
11 |
Invalid parameter occurrence = 0 |
ToolkitException.BAD_INPUT_PARAMETER is thrown |
|
12 |
Select a TLV (tag 02h) |
||
findAndCompareValue() tag = 06h occurrence = 2 |
ToolkitException.UNAVAILABLE_ELEMENT is thrown |
||
13 |
Call the getValueLength() method |
ToolkitException.UNAVAILABLE_ELEMENT is thrown. |
|
14 |
Initialise compareBuffer compareBuffer = 81 11 22 33 44 F5 |
||
findAndCompareValue() tag = 06h, occurrence = 1 valueOffset = 0 compareOffset = 0 compareLength = 6 |
Result is 00h |
||
15 |
Verify current TLV getValueLength() |
Result is 0006 |
|
16 |
Initialise compareBuffer compareBuffer = 81 11 22 33 44 F4 |
||
Compare buffers with same parameters |
Result is +1 |
||
17 |
Initialise compareBuffer compareBuffer = 81 11 22 33 44 F6 |
||
Compare buffers with same parameters |
Result is -1 |
||
18 |
Initialise compareBuffer compareBuffer = 55 55 55 22 33 44 F5 55 55 55 55 |
||
Compare buffers valueOffset = 2 compareOffset = 3 compareLength = 4 |
Result is 00h |
||
19 |
Initialise compareBuffer compareBuffer = 55 55 55 22 33 45 F5 55 55 55 55 |
||
Compare buffers with same parameters |
Result is -1 |
||
20 |
Initialise compareBuffer compareBuffer = 55 55 55 22 33 43 F5 55 55 55 55 |
||
Compare buffers with same parameters |
Result is +1 |
||
21 |
Initialise compareBuffer compareBuffer = 83 81 55 55 55 55 55 55 55 55 55 55 |
||
findAndCompareValue() tag = 02h, occurrence = 1 valueOffset = 0 compareOffset = 0 compareLength = 2 |
Result is 00h |
||
22 |
Initialise compareBuffer compareBuffer = 22 44 55 55 55 55 55 55 55 55 55 55 |
||
findAndCompareValue() tag = 02h, occurrence = 2 valueOffset = 0 compareOffset = 0 compareLength = 2 |
Result is 00h |
||
23 |
Initialise compareBuffer compareBuffer = 22 45 55 55 55 55 55 55 55 55 55 55 |
||
findAndCompareValue() tag = 02h, occurrence = 2 valueOffset = 0 compareOffset = 0 compareLength = 2 |
Result is -1 |
||
24 |
Initialise compareBuffer compareBuffer = 83 81 55 55 55 55 55 55 55 55 55 55 |
||
Successful call (with tag 02h) tag = 02h, occurrence = 1 valueOffset = 0 compareBuffer.length = 12 compareOffset = 0 compareLength = 2 |
Result is 00h |
||
25 |
Initialise compareBuffer compareBuffer = 01 02 … C4 |
||
Successful call (with tag B3h) tag = B3h, occurrence = 1 valueOffset = 0 compareBuffer.length = 00C4 compareOffset = 0 compareLength = 00C4 |
Result is 00h |
||
26 |
Successful call, findAndCompareValue with length =0 DstBuffer.length = C4 DstOffset = C4 DstLength = 0 |
Result of findAndCompareValue() is 00h |
|
Send Formatted SMS PP with the maximum user data length = 0x010D, using 2 concatenated envelopes |
|||
Initialise compareBuffer CompareBuffer = 23.048 Header + secured data (01 02 … FA) |
|||
27 |
Successful call (with SMS TPDU TAG) tag = 0Bh, occurrence = 1 valueOffset = 0x11 compareBuffer.length = 0x010D compareOffset = 0 compareLength = 0x010D |
Result is 00h |
|
Initialise compareBuffer CompareBuffer = 55 55 … 55 EE EF F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA |
|||
28 |
Successful call (with SMS TPDU TAG) tag = 0Bh, occurrence = 1 valueOffset = 0x11 compareBuffer.length = 0x010D compareOffset = 0x0100 compareLength = 0x0D |
Result is 00h |
6.2.4.17.4 Test Coverage
CRR number |
Test case number |
N1 |
12, 13 |
N2 |
15 |
N3 |
14, 18, 21, 22, 26, 27, 28 |
N4 |
16, 20 |
N5 |
17, 19, 23 |
N6 |
24, 25 |
P1 |
1 |
P2 |
2, 3, 4, 5, 6 |
P3 |
7, 8, 9, 10 |
P4 |
11 |
C1 |
Does not apply for EnvelopeHandler |
6.2.4.18 Method getCapacity
Test Area Reference: API_2_ENH_GCAP
6.2.4.18.1 Conformance Requirement:
The method with following header shall be compliant to its definition in the API.
public byte getCapacity()
6.2.4.18.1.1 Normal execution
- CRRN1: The method shall return the maximum size of the Simple TLV list managed by the handler.
6.2.4.18.2 Test suite files
Test Script: API_2_ENH_GCAP_1.scr
Test Applet: API_2_ENH_GCAP_1.java
Load Script: API_2_ENH_GCAP_1.ldr
Cleanup Script: API_2_ENH_GCAP_1.clr
Parameter File: API_2_ENH_GCAP_1.par
6.2.4.18.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
1 |
EnvelopeHandler available 1 – Send envelope SMS-PP Formatted 2 – The applet calls the getLength() method 3 – The applet calls getCapacity()method |
1 – Applet is triggered 2 – No exception is thrown 3 – No exception is thrown; the capacity is greater than the BER TLV Length |
6.2.4.18.4 Test Coverage
CRR number |
Test case number |
N1 |
1 |
6.2.4.19 Method getUserDataLength
Test Area Reference: API_2_ENH_GUDL
6.2.4.19.1 Conformance Requirement:
The method with following header shall be compliant to its definition in the API.
public short getUserDataLength()
6.2.4.19.1.1 Normal execution
- CRRN1: The method shall return the length of the User Data contained in the SMS TPDU TLV element.
- CRRN2: The length is from the first SMS TPDU TLV element.
- CRRN3: If the SMS TPDU TLV element is available, it becomes the selected TLV
- CRRN4: The method can be used if the event is EVENT_FORMATTED_SMS_PP_ENV.
- CRRN5: The method can be used if the event is EVENT_FORMATTED_SMS_PP_UPD.
- CRRN6: The method can be used if the event is EVENT_UNFORMATED_SMS_PP_ENV.
- CRRN7: The method can be used if the event is EVENT_UNFORMATTED_SMS_PP_UDP.
6.2.4.19.1.2 Context errors
- CRRC1: The method shall throw UNAVAILABLE_ELEMENT in case of unavailable TPDU TLV element.
- CRRC2: The method shall throw UNAVAILABLE_ELEMENT in case of wrong data format.
6.2.4.19.2 Test suite files
Specific triggering:
- UNFORMATTED_SMS_PP_ENV
- FORMATTED_SMS_PP_UPD
- UNFORMATED_SMS_PP_UPD
- UNRECOGNIZED_ENVELOPE
- For Formatted triggering if CC/RC/DS is used, the security parameters are those used for downloading applications.
Test Script: API_2_ENH_GUDL_1.scr
Test Applet: API_2_ENH_GUDL_1.java
Load Script: API_2_ENH_GUDL_1.ldr
Cleanup Script: API_2_ENH_GUDL_1.clr
Parameter File: API_2_ENH_GUDL_1.par
6.2.4.19.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
FORMATTED SMS PP ENV Triggering |
|||
1 |
Test with FORMATTED_SMS_PP_ENV and TP-OA length of 2 and user data length of 0x3D |
Returns 0x003D |
|
2 |
Test with TP-OA length of 12 and user data length of 0x3D |
Returns 0x003D |
|
3 |
Test with RC/CC/DS length of 0 and secured data length of 0x10 |
Returns 0x0023 |
|
4 |
Test with RC/CC/DS length of 8 and secured data length of 0x10 |
Returns 0x002B |
|
5 |
Test with PCNTR = 0, no RC/CC/DS and data length of 0x10 |
Returns 0x0023 |
|
6 |
Test with PCNTR = 7, no RC/CC/DS and data length of 0x05 |
Returns 0x001F |
|
7 |
Test with SecuredDataLength = 00 and no RC/CC/DS |
Returns 0x0013 |
|
8 |
Test with UserDataLength = 0x7F |
Returns 0x007F |
|
9 |
Test with UserDataLength = 0x80 |
Returns 0x0080 |
|
10 |
Test with UserDataLength = maximum length (0x8C) for a single SMS |
Returns 0x008C |
|
11 |
Verify it is the first TPDU TLV: Send a SMS PP with 2 TPDU TLV with two different user data lengths: 0x18 and 0x23 |
Returns 0x0018 |
|
12 |
Send envelope SMS-PP Formatted. FindTLV() with TAG_DEVICE_IDENTITIES. GetUserDataLength() and then getValueByte() with offset 0 |
GetValueByte() returns 0x40(23.040 first byte) |
|
13 |
Test with UserDataLength = 0xFF with 2 concatenated SMS |
Returns 0x00FF |
|
14 |
Test with UserDataLength = 0x100 with 2 concatenated SMS |
Returns 0x0100 |
|
15 |
Test with UserDataLength = maximum length (0x010D) with 2 concatenated SMS |
Returns 0x010D |
|
FORMATTED SMS PP UPD Triggering |
|||
16 |
Test with FORMATTED_SMS_PP_UPD and TP-OA length of 2 and user data length of 0x3D |
Returns 0x003D |
|
17 |
Test with TP-OA length of 12 and user data length of 0x3D |
Returns 0x003D |
|
18 |
Test with RC/CC/DS length of 0 and secured data length of 0x10 |
Returns 0x0023 |
|
19 |
Test with RC/CC/DS length of 8 and secured data length of 0x10 |
Returns 0x002B |
|
20 |
Test with PCNTR = 0, no RC/CC/DS and data length of 0x10 |
Returns 0x0023 |
|
21 |
Test with PCNTR = 7, no RC/CC/DS and data length of 0x05 |
Returns 0x001F |
|
22 |
Test with SecuredDataLength = 00 and no RC/CC/DS |
Returns 0x0013 |
|
23 |
Test with UserDataLength = 0x7F |
Returns 0x007F |
|
24 |
Test with UserDataLength = 0x80 |
Returns 0x0080 |
|
25 |
Test with UserDataLength = maximum length(0x8C) for a single SMS |
Returns 0x008C |
|
26 |
Verify it is the first TPDU TLV: Send a SMS PP with 2 TPDU TLV with two different user data lengths: 0x18 and 0x23 |
Returns 0x0018 |
|
27 |
Send envelope SMS-PP Formatted. FindTLV() with TAG_DEVICE_IDENTITIES. GetUserDataLength() and then getValueByte() with offset 0 |
GetValueByte() returns 0x40(23.040 first byte) |
|
28 |
Test with UserDataLength = 0xFF with 2 concatenated SMS |
Returns 0x00FF |
|
29 |
Test with UserDataLength = 0x100 with 2 concatenated SMS |
Returns 0x0100 |
|
30 |
Test with UserDataLength = maximum length (0x010D) with 2 concatenated SMS |
Returns 0x010D |
|
UNFORMATTED SMS PP ENV Triggering |
|||
31 |
Test with UNFORMATTED_SMS_PP_ENV and TP-OA length of 2, and user data length of 0x3D |
Returns 0x003D |
|
32 |
Test with TP-OA length of 12, and user data length of 0x3D |
Returns 0x003D |
|
33 |
Test with UserDataLength = 0x00 |
Returns 0x0000 |
|
34 |
Test with UserDataLength = 0x7F |
Returns 0x007F |
|
35 |
Test with UserDataLength = 0x80 |
Returns 0x0080 |
|
36 |
Test with UserDataLength = maximum length: 0x8C for a single SMS |
Returns 0x008C |
|
37 |
Verify it is the first TPDU TLV: Send a SMS PP with 2 TPDU TLV with two different user data lengths: 0x18 and 0x23 |
Returns 0x0018 |
|
38 |
Send envelope SMS-PP Unformatted. FindTLV() with TAG_DEVICE_IDENTITIES. GetUserDataLength() and then getValueByte() with offset 0 (first user data = 0x55) |
GetValueByte() returns 0x00 (23.040 first byte) |
|
UNFORMATTED SMS PP UPD Triggering |
|||
39 |
Test with UNFORMATTED_SMS_PP_UPD and TP-OA length of 2, and user data length of 0x3D |
Returns 0x003D |
|
40 |
Test with TP-OA length of 12, and user data length of 0x3D |
Returns 0x003D |
|
41 |
Test with UserDataLength = 0x00 |
Returns 0x0000 |
|
42 |
Test with UserDataLength = 0x7F |
Returns 0x007F |
|
43 |
Test with UserDataLength = 0x80 |
Returns 0x0080 |
|
44 |
Test with UserDataLength = maximum length: 0x8C for a single SMS |
Returns 0x008C |
|
45 |
Verify it is the first TPDU TLV: Send a SMS PP with 2 TPDU TLV with two different user data lengths: 0x18 and 0x23 |
Returns 0x0018 |
|
46 |
Send envelope SMS-PP Unformatted. FindTLV() with TAG_DEVICE_IDENTITIES. GetUserDataLength() and then getValueByte() with offset 0 |
GetValueByte() returns 0x00 (23.040 first byte) |
|
UNRECOGNIZED_ENVELOPE Triggering |
|||
47 |
Test with an UNRECOGNIZED_ENVELOPE |
ToolkitException UNAVAILABLE_ELEMENT |
6.2.4.19.4 Test Coverage
CRR number |
Test case number |
N1 |
All test cases excepted: 53 |
N2 |
11, 26, 37, 45 |
N3 |
12, 27, 38, 46 |
N4 |
1 to 15 |
N5 |
16 to 30 |
N6 |
31 to 38 |
N7 |
39 to 46 |
C1 |
47 |
C2 |
Not applicable |
6.2.4.20 Method getChannelIdentifier
Test Area Reference: API_2_ENH_GCID
6.2.4.20.1 Conformance Requirement:
The method with following header shall be compliant to its definition in the API.
public byte getChannelIdentifier()
throws ToolkitException
6.2.4.20.1.1 Normal execution
- CRRN1: The method shall return the channel identifier byte value.
- CRRN2: The channel identifier byte value returned shall be from the first Channel status TLV element.
- CRRN3: If the element is available it becomes the currently selected TLV.
- CRRN4: The channel identifier is available for all triggered toolkit applets from the invocation to the termination of their processToolkit method if the EnvelopeHandler is available.
6.2.4.20.1.2 Context errors
- CRRC1: The method shall throw ToolkitException (UNAVAILABLE_ELEMENT) if the Channel status TLV is not present.
- CRRC2: The method shall throw ToolkitException (OUT_OF_TLV_BOUNDARIES) if the Simple TLV Channel Status length is equal to 0.
6.2.4.20.2 Test suite files
Test Script: API_2_ENH_GCID_1.scr
Test Applet: API_2_ENH_GCID_1.java
Load Script: API_2_ENH_GCID_1.ldr
Cleanup Script: API_2_ENH_GCID_1.clr
Parameter File: API_2_ENH_GCID_1.par
6.2.4.20.3 Test Procedure
Id |
Description |
API Expectation |
APDU Expectation |
0 |
1- Applet1 is installed with maximum number of channel = 07. 2- Applet1 builds proactive commands OPEN CHANNEL with init() method in order to open all channels. ProactiveHandler.send() methods are called. |
2- OPEN CHANNEL proactive command is fetched TERMINAL RESPONSE is issued with Channel Id from 01 to 07 |
|
1 |
1- Send envelope Event Download Channel Status with channel status TLV: channel status value = 0x8100. 2- Call EnvelopeHandler.getChannelIdentifier() method |
1- Applet1 is triggered 2- Returns 0x01 |
|
2 |
1- Send envelope Event Download Channel Status with two channel status TLV: first value = 0x8400 second value = 0x8500. 2- Call twice the EnvelopeHandler.getChannelIdentifier() method |
2- Returns 0x04 Returns 0x04 |
|
3 |
1- Send envelope Event Download Channel Status with channel status TLV: Channel Status value = 0x0605 ViewHandler.FindTLV() with Device IdentityTag. 2- Call EnvelopeHandler.getChannelIdentifier() method. 3- Compare EnvelopeHandler.getChannelIdentifier() and then ViewHandler.getValueByte(0). |
2- Returns 0x06 3- GetChannelIdentifier() =getValueByte(0) |
|
4 |
1- Send envelope Menu Selection without Channel Status TLV. 2- Call EnvelopeHandler.getChannelIdentifier() method. |
2- A Toolkit exception UNAVAILABLE_ELEMENT is thrown. |
|
5 |
1- Send Envelope Event Download Channel Status with Channel Status TLV: Channel status value = 0x0600 2- Call EnvelopeHandler.getChannelIdentifier() method. |
1- Returns 0x06 |
|
6 |
1- Send unrecognized envelope with a Channel Status TLV having a length equal to 0. 2- Call EnvelopeHandler.getChannelIdentifier() method. |
2- A Toolkit exception OUT_OF_TLV_BOUNDARIES is thrown. |
6.2.4.20.4 Test Coverage
CRR number |
Test case number |
N1 |
1, 2 |
N2 |
3 |
N3 |
3 |
N4 |
5 |
C1 |
4 |
C2 |
6 |