|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // The TEFUnit test suite for SmartCardApplication in the Common TSY. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 */ |
|
21 |
|
22 #include "cctsysmartcardapplicationfu.h" |
|
23 #include <etel.h> |
|
24 #include <etelmm.h> |
|
25 #include <et_clsvr.h> |
|
26 #include <ctsy/mmtsy_names.h> |
|
27 #include <ctsy/serviceapi/mmtsy_ipcdefs.h> |
|
28 #include "tmockltsydata.h" |
|
29 #include <ctsy/serviceapi/gsmerror.h> |
|
30 |
|
31 CTestSuite* CCTsySmartCardApplicationFU::CreateSuiteL(const TDesC& aName) |
|
32 { |
|
33 SUB_SUITE; |
|
34 |
|
35 ADD_TEST_STEP_ISO_CPP(CCTsySmartCardApplicationFU, TestReadScFile0001L); |
|
36 ADD_TEST_STEP_ISO_CPP(CCTsySmartCardApplicationFU, TestUpdateScFile0001L); |
|
37 ADD_TEST_STEP_ISO_CPP(CCTsySmartCardApplicationFU, TestGetScFileInfo0001L); |
|
38 ADD_TEST_STEP_ISO_CPP(CCTsySmartCardApplicationFU, TestGetSmartCardApplicationInfo0001L); |
|
39 ADD_TEST_STEP_ISO_CPP(CCTsySmartCardApplicationFU, TestSetSmartCardApplicationStatus0001L); |
|
40 ADD_TEST_STEP_ISO_CPP(CCTsySmartCardApplicationFU, TestEnumerateSmartCardApplications0001L); |
|
41 ADD_TEST_STEP_ISO_CPP(CCTsySmartCardApplicationFU, TestNotifySmartCardAppInfoChange0001L); |
|
42 |
|
43 END_SUITE; |
|
44 } |
|
45 |
|
46 |
|
47 // |
|
48 // Actual test cases |
|
49 // |
|
50 |
|
51 |
|
52 /** |
|
53 @SYMTestCaseID BA-CTSY-SMCA-MRSF-0001 |
|
54 @SYMComponent telephony_ctsy |
|
55 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::ReadScFile |
|
56 @SYMTestPriority High |
|
57 @SYMTestActions Invokes RMobilePhone::ReadScFile |
|
58 @SYMTestExpectedResults Pass |
|
59 @SYMTestType CT |
|
60 */ |
|
61 void CCTsySmartCardApplicationFU::TestReadScFile0001L() |
|
62 { |
|
63 |
|
64 OpenEtelServerL(EUseExtendedError); |
|
65 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
66 OpenPhoneL(); |
|
67 |
|
68 TRequestStatus reqStatus; |
|
69 RMobilePhone::TScFilePathWithAccessOffsets filePathOffsets; |
|
70 TBuf8<1> readBuffer; |
|
71 iPhone.ReadScFile(reqStatus, filePathOffsets, readBuffer); |
|
72 User::WaitForRequest(reqStatus); |
|
73 ASSERT_EQUALS(KErrNotSupported, reqStatus.Int()); |
|
74 |
|
75 AssertMockLtsyStatusL(); |
|
76 CleanupStack::PopAndDestroy(this); |
|
77 |
|
78 } |
|
79 |
|
80 |
|
81 /** |
|
82 @SYMTestCaseID BA-CTSY-SMCA-MUSF-0001 |
|
83 @SYMComponent telephony_ctsy |
|
84 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::UpdateScFile |
|
85 @SYMTestPriority High |
|
86 @SYMTestActions Invokes RMobilePhone::UpdateScFile |
|
87 @SYMTestExpectedResults Pass |
|
88 @SYMTestType CT |
|
89 */ |
|
90 void CCTsySmartCardApplicationFU::TestUpdateScFile0001L() |
|
91 { |
|
92 |
|
93 OpenEtelServerL(EUseExtendedError); |
|
94 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
95 OpenPhoneL(); |
|
96 |
|
97 TRequestStatus reqStatus; |
|
98 RMobilePhone::TScFilePathWithAccessOffsets filePathOffsets; |
|
99 TBuf8<1> updateBuffer; |
|
100 iPhone.UpdateScFile(reqStatus, filePathOffsets, updateBuffer); |
|
101 User::WaitForRequest(reqStatus); |
|
102 ASSERT_EQUALS(KErrNotSupported, reqStatus.Int()); |
|
103 |
|
104 AssertMockLtsyStatusL(); |
|
105 CleanupStack::PopAndDestroy(this); |
|
106 |
|
107 } |
|
108 |
|
109 |
|
110 /** |
|
111 @SYMTestCaseID BA-CTSY-SMCA-MGSFI-0001 |
|
112 @SYMComponent telephony_ctsy |
|
113 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::GetScFileInfo |
|
114 @SYMTestPriority High |
|
115 @SYMTestActions Invokes RMobilePhone::GetScFileInfo |
|
116 @SYMTestExpectedResults Pass |
|
117 @SYMTestType CT |
|
118 */ |
|
119 void CCTsySmartCardApplicationFU::TestGetScFileInfo0001L() |
|
120 { |
|
121 |
|
122 OpenEtelServerL(EUseExtendedError); |
|
123 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
124 OpenPhoneL(); |
|
125 |
|
126 TRequestStatus reqStatus; |
|
127 RMobilePhone::TScFilePath filePathId; |
|
128 TBuf8<1> info; |
|
129 iPhone.GetScFileInfo(reqStatus, filePathId, info); |
|
130 User::WaitForRequest(reqStatus); |
|
131 ASSERT_EQUALS(KErrNotSupported, reqStatus.Int()); |
|
132 |
|
133 AssertMockLtsyStatusL(); |
|
134 CleanupStack::PopAndDestroy(this); |
|
135 |
|
136 } |
|
137 |
|
138 |
|
139 /** |
|
140 @SYMTestCaseID BA-CTSY-SMCA-MGSCA-0001 |
|
141 @SYMComponent telephony_ctsy |
|
142 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::GetSmartCardApplicationInfo |
|
143 @SYMTestPriority High |
|
144 @SYMTestActions Invokes RMobilePhone::GetSmartCardApplicationInfo |
|
145 @SYMTestExpectedResults Pass |
|
146 @SYMTestType CT |
|
147 */ |
|
148 void CCTsySmartCardApplicationFU::TestGetSmartCardApplicationInfo0001L() |
|
149 { |
|
150 |
|
151 OpenEtelServerL(EUseExtendedError); |
|
152 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
153 OpenPhoneL(); |
|
154 |
|
155 TRequestStatus reqStatus; |
|
156 TUint appIndex(0); |
|
157 TBuf8<1> info; |
|
158 iPhone.GetSmartCardApplicationInfo(reqStatus, appIndex, info); |
|
159 User::WaitForRequest(reqStatus); |
|
160 ASSERT_EQUALS(KErrNotSupported, reqStatus.Int()); |
|
161 |
|
162 AssertMockLtsyStatusL(); |
|
163 CleanupStack::PopAndDestroy(this); |
|
164 |
|
165 } |
|
166 |
|
167 |
|
168 /** |
|
169 @SYMTestCaseID BA-CTSY-SMCA-MSSCAS-0001 |
|
170 @SYMComponent telephony_ctsy |
|
171 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::SetSmartCardApplicationStatus |
|
172 @SYMTestPriority High |
|
173 @SYMTestActions Invokes RMobilePhone::SetSmartCardApplicationStatus |
|
174 @SYMTestExpectedResults Pass |
|
175 @SYMTestType CT |
|
176 */ |
|
177 void CCTsySmartCardApplicationFU::TestSetSmartCardApplicationStatus0001L() |
|
178 { |
|
179 |
|
180 OpenEtelServerL(EUseExtendedError); |
|
181 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
182 OpenPhoneL(); |
|
183 |
|
184 TRequestStatus reqStatus; |
|
185 RMobilePhone::TAID aid; |
|
186 RMobilePhone::TSmartCardApplicationAction appAction(RMobilePhone::EScApplicationActivate); |
|
187 iPhone.SetSmartCardApplicationStatus(reqStatus, aid, appAction); |
|
188 User::WaitForRequest(reqStatus); |
|
189 ASSERT_EQUALS(KErrNotSupported, reqStatus.Int()); |
|
190 |
|
191 AssertMockLtsyStatusL(); |
|
192 CleanupStack::PopAndDestroy(this); |
|
193 |
|
194 } |
|
195 |
|
196 |
|
197 /** |
|
198 @SYMTestCaseID BA-CTSY-SMCA-MESCA-0001 |
|
199 @SYMComponent telephony_ctsy |
|
200 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::EnumerateSmartCardApplications |
|
201 @SYMTestPriority High |
|
202 @SYMTestActions Invokes RMobilePhone::EnumerateSmartCardApplications |
|
203 @SYMTestExpectedResults Pass |
|
204 @SYMTestType CT |
|
205 */ |
|
206 void CCTsySmartCardApplicationFU::TestEnumerateSmartCardApplications0001L() |
|
207 { |
|
208 |
|
209 OpenEtelServerL(EUseExtendedError); |
|
210 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
211 OpenPhoneL(); |
|
212 |
|
213 TRequestStatus reqStatus; |
|
214 TUint count; |
|
215 iPhone.EnumerateSmartCardApplications(reqStatus, count); |
|
216 User::WaitForRequest(reqStatus); |
|
217 ASSERT_EQUALS(KErrNotSupported, reqStatus.Int()); |
|
218 |
|
219 AssertMockLtsyStatusL(); |
|
220 CleanupStack::PopAndDestroy(this); |
|
221 |
|
222 } |
|
223 |
|
224 |
|
225 /** |
|
226 @SYMTestCaseID BA-CTSY-SMCA-MNSCAIC-0001 |
|
227 @SYMComponent telephony_ctsy |
|
228 @SYMTestCaseDesc Test support in CTSY for RMobilePhone::NotifySmartCardApplicationInfoChange |
|
229 @SYMTestPriority High |
|
230 @SYMTestActions Invokes RMobilePhone::NotifySmartCardApplicationInfoChange |
|
231 @SYMTestExpectedResults Pass |
|
232 @SYMTestType CT |
|
233 */ |
|
234 void CCTsySmartCardApplicationFU::TestNotifySmartCardAppInfoChange0001L() |
|
235 { |
|
236 |
|
237 OpenEtelServerL(EUseExtendedError); |
|
238 CleanupStack::PushL(TCleanupItem(Cleanup,this)); |
|
239 OpenPhoneL(); |
|
240 |
|
241 TRequestStatus reqStatus; |
|
242 RMobilePhone::TAID aid; |
|
243 RMobilePhone::TSmartCardApplicationEvent event; |
|
244 iPhone.NotifySmartCardApplicationInfoChange(reqStatus, aid, event); |
|
245 User::WaitForRequest(reqStatus); |
|
246 ASSERT_EQUALS(KErrNotSupported, reqStatus.Int()); |
|
247 |
|
248 AssertMockLtsyStatusL(); |
|
249 CleanupStack::PopAndDestroy(this); |
|
250 |
|
251 } |
|
252 |
|
253 |
|
254 |