|
1 // Copyright (c) 2005-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 // Example file/test code to demonstrate how to develop a TestExecute Server |
|
15 // Developers should take this project as a template and substitute their own |
|
16 // for (WINS && !EKA2) versions will be xxxServer.Dll and require a thread to be started |
|
17 // in the process of the client. The client initialises the server by calling the |
|
18 // one and only ordinal. |
|
19 // |
|
20 // |
|
21 |
|
22 /** |
|
23 @file Te_integration_stltsySuiteServer.cpp |
|
24 @internalTechnology |
|
25 */ |
|
26 |
|
27 #include "te_integration_stltsysuiteserver.h" |
|
28 #include "testltsysmscontrolreceivesmscase1step.h" |
|
29 #include "testltsysmscontrolsendsmscase1step.h" |
|
30 #include "testltsycallcontrolbase.h" |
|
31 #include "testltsycallcontroldialhangupcase.h" |
|
32 #include "testltsycallcontrolnotifyincomingcallcase1.h" |
|
33 #include "testltsycallcontrolnotifyincomingcallcase2.h" |
|
34 #include "testltsycallcontrolnotifyincomingcallcase3.h" |
|
35 #include "testltsycallcontrolswapcalls.h" |
|
36 #include "testltsycallcontrolcustomapiterminateallcalls.h" |
|
37 #include "testltsycallcontrolphoneterminateallcalls.h" |
|
38 #include "testltsycallcontroldialemergencycall.h" |
|
39 #include "testltsycallcontroldialbadcall.h" |
|
40 #include "testltsycallcontroldialselfcall.h" |
|
41 #include "testltsycallcontroldialemergencycallstopallcalls.h" |
|
42 |
|
43 #include "testltsyopenphone.h" |
|
44 #include "testltsyclosephone.h" |
|
45 #include "testltsyclosephone.h" |
|
46 #include "testltsyopenphone.h" |
|
47 #include "testltsygetphonebatteryinfo.h" |
|
48 #include "testltsygetphonesignalstrength.h" |
|
49 #include "testltsygetphonebatterycap.h" |
|
50 #include "testltsygetphonesignalcap.h" |
|
51 #include "testltsyphonegetfdnstatus.h" |
|
52 #include "testltsyphonegetnetworkregistrationstatus.h" |
|
53 #include "testltsyphonegetphoneid.h" |
|
54 #include "testltsyphonegetdetectednetworks.h" |
|
55 #include "testltsyphonegetdetectednetworkscancel.h" |
|
56 #include "testltsyphonesetnetworkselectionsetting.h" |
|
57 #include "testltsyphoneselectnetwork.h" |
|
58 #include "testltsyphonegethomenetwork.h" |
|
59 #include "testltsyphonegetcurrentnetworkinfo.h" |
|
60 #include "testltsyphonegetcellinfo.h" |
|
61 #include "testltsyphoneregistercellinfochangenotification.h" |
|
62 |
|
63 |
|
64 #include "testltsypktopenpacket.h" |
|
65 #include "testltsypktclosepacket.h" |
|
66 #include "testltsypktopencontext.h" |
|
67 #include "testltsypktinitialisecontext.h" |
|
68 #include "testltsypktclosecontext.h" |
|
69 #include "testltsypktattachnetwork.h" |
|
70 #include "testltsypktdetachnetwork.h" |
|
71 #include "testltsypktactivatecontext.h" |
|
72 #include "testltsypktdeactivatecontext.h" |
|
73 #include "testltsypktdeletecontext.h" |
|
74 #include "testltsypktgetservicestatus.h" |
|
75 #include "testltsypktgetnwkregistrationstatus.h" |
|
76 #include "testltsypktgetcontextconfig.h" |
|
77 #include "testltsypktgetdefaultparams.h" |
|
78 #include "testltsypktsetdefaultparams.h" |
|
79 #include "testltsypktgetcontextinfo.h" |
|
80 #include "testltsypktsetcontextconfig.h" |
|
81 #include "testltsypktopencontextqos.h" |
|
82 #include "testltsypktclosecontextqos.h" |
|
83 #include "testltsypktgetcontextqosprofile.h" |
|
84 #include "testltsypktsetcontextqosprofile.h" |
|
85 #include "testltsypktgetstaticcapabilities.h" |
|
86 #include "testltsypktgetdynamiccapabilities.h" |
|
87 |
|
88 #include "testltsyopensms.h" |
|
89 #include "testltsysmssend.h" |
|
90 #include "testltsyopensmsstore.h" |
|
91 #include "testltsyclosesms.h" |
|
92 #include "testltsyclosesmsstore.h" |
|
93 #include "testltsygetmessagestoreinfo.h" |
|
94 #include "testltsysmsstoregetinfo.h" |
|
95 #include "testltsysmsack.h" |
|
96 #include "testltsysmsnack.h" |
|
97 #include "testltsysmsreceive.h" |
|
98 #include "testltsysmssendinvalidparam.h" |
|
99 #include "testltsysmsread.h" |
|
100 #include "testltsysmsreadinvalidindex.h" |
|
101 #include "testltsysmsdelete.h" |
|
102 #include "testltsysmsdeleteinvalidindex.h" |
|
103 #include "testltsysmsdeleteall.h" |
|
104 #include "testltsysmsstore.h" |
|
105 #include "testltsysmswrite.h" |
|
106 #include "testltsysmswriteinvalidparam.h" |
|
107 |
|
108 #include "testltsyphbkopen.h" |
|
109 #include "testltsyphbkclose.h" |
|
110 #include "testltsyphbkgetstoreinfo.h" |
|
111 #include "testltsyphbkdelete.h" |
|
112 #include "testltsyphbkdeleteinvalidindex.h" |
|
113 #include "testltsyphbkwrite.h" |
|
114 #include "testltsyphbkwriteinvalidindex.h" |
|
115 #include "testltsyphbkread.h" |
|
116 #include "testltsyphbkreadinvalidindex.h" |
|
117 |
|
118 _LIT(KServerName,"Te_integration_stltsySuite"); |
|
119 CTe_integration_stltsySuite* CTe_integration_stltsySuite::NewL() |
|
120 /** |
|
121 * @return - Instance of the test server |
|
122 * Same code for Secure and non-secure variants |
|
123 * Called inside the MainL() function to create and start the |
|
124 * CTestServer derived server. |
|
125 */ |
|
126 { |
|
127 CTe_integration_stltsySuite * server = new (ELeave) CTe_integration_stltsySuite(); |
|
128 CleanupStack::PushL(server); |
|
129 |
|
130 server->ConstructL(KServerName); |
|
131 CleanupStack::Pop(server); |
|
132 return server; |
|
133 } |
|
134 CTe_integration_stltsySuite::CTe_integration_stltsySuite() |
|
135 : CTestServer() |
|
136 , iSharedData(NULL) |
|
137 /** |
|
138 Constructor |
|
139 */ |
|
140 { |
|
141 } |
|
142 |
|
143 void CTe_integration_stltsySuite::ConstructL(const TDesC& aName) |
|
144 /** |
|
145 Constructs a CTestTelephonySharedData ojbect to |
|
146 hold the shared data (CTelephony object) |
|
147 */ |
|
148 { |
|
149 CTestServer::ConstructL(aName); |
|
150 iSharedData = CTestLtsySharedData::NewL(); |
|
151 iTestModel = CTestLtsyModel::NewL(); |
|
152 } |
|
153 |
|
154 CTe_integration_stltsySuite::~CTe_integration_stltsySuite() |
|
155 /** |
|
156 Destructor deleting the CTestTelephonySharedData ojbect. |
|
157 */ |
|
158 { |
|
159 delete iSharedData; |
|
160 delete iTestModel; |
|
161 } |
|
162 |
|
163 // Secure variants much simpler |
|
164 // For EKA2, just an E32Main and a MainL() |
|
165 LOCAL_C void MainL() |
|
166 /** |
|
167 * Secure variant |
|
168 * Much simpler, uses the new Rendezvous() call to sync with the client |
|
169 */ |
|
170 { |
|
171 // Leave the hooks in for platform security |
|
172 #if (defined __DATA_CAGING__) |
|
173 RProcess().DataCaging(RProcess::EDataCagingOn); |
|
174 RProcess().DataCaging(RProcess::ESecureApiOn); |
|
175 #endif |
|
176 CActiveScheduler* sched=NULL; |
|
177 sched=new(ELeave) CActiveScheduler; |
|
178 CActiveScheduler::Install(sched); |
|
179 CTe_integration_stltsySuite* server = NULL; |
|
180 // Create the CTestServer derived server |
|
181 TRAPD(err,server = CTe_integration_stltsySuite::NewL()); |
|
182 if(!err) |
|
183 { |
|
184 // Sync with the client and enter the active scheduler |
|
185 RProcess::Rendezvous(KErrNone); |
|
186 sched->Start(); |
|
187 } |
|
188 delete server; |
|
189 delete sched; |
|
190 } |
|
191 |
|
192 |
|
193 |
|
194 GLDEF_C TInt E32Main() |
|
195 /** |
|
196 * @return - Standard Epoc error code on process exit |
|
197 * Secure variant only |
|
198 * Process entry point. Called by client using RProcess API |
|
199 */ |
|
200 { |
|
201 __UHEAP_MARK; |
|
202 CTrapCleanup* cleanup = CTrapCleanup::New(); |
|
203 if(cleanup == NULL) |
|
204 { |
|
205 return KErrNoMemory; |
|
206 } |
|
207 TRAPD(err,MainL()); |
|
208 delete cleanup; |
|
209 __UHEAP_MARKEND; |
|
210 return err; |
|
211 } |
|
212 |
|
213 |
|
214 CTestStep* CTe_integration_stltsySuite::CreateTestStep(const TDesC& aStepName) |
|
215 /** |
|
216 * @return - A CTestStep derived instance |
|
217 * Secure and non-secure variants |
|
218 * Implementation of CTestServer pure virtual |
|
219 */ |
|
220 { |
|
221 CTestStep* testStep = NULL; |
|
222 |
|
223 if(aStepName == KCTestLtsySmsControlReceiveSmsCase1Step) |
|
224 testStep = new CCTestLtsySmsControlReceiveSmsCase1Step(); |
|
225 else if(aStepName == KCTestLtsySmsControlSendSmsCase1Step) |
|
226 testStep = new CCTestLtsySmsControlSendSmsCase1Step(); |
|
227 else if(aStepName==KTestLtsyOpenPhone) |
|
228 testStep = new CTestLtsyOpenPhone(*iTestModel); |
|
229 else if(aStepName==KTestLtsyClosePhone) |
|
230 testStep = new CTestLtsyClosePhone(*iTestModel); |
|
231 else if(aStepName==KTestLtsyPhoneGetFdnStatus) |
|
232 testStep = new CTestLtsyPhoneGetFdnStatus(*iTestModel); |
|
233 else if(aStepName==KTestLtsyPhoneGetNetworkRegistrationStatus) |
|
234 testStep = new CTestLtsyPhoneGetNetworkRegistrationStatus(*iTestModel); |
|
235 else if(aStepName==KTestLtsyPhoneGetPhoneID) |
|
236 testStep = new CTestLtsyPhoneGetPhoneID(*iTestModel); |
|
237 else if(aStepName==KTestLtsyPhoneGetDetectedNetworks) |
|
238 testStep = new CTestLtsyPhoneGetDetectedNetworks(*iTestModel); |
|
239 else if(aStepName==KTestLtsyPhoneGetDetectedNetworksCancelCancel) |
|
240 testStep = new CTestLtsyPhoneGetDetectedNetworksCancelCancel(*iTestModel); |
|
241 else if(aStepName==KTestLtsyPhoneSetNetworkSelectionSetting) |
|
242 testStep = new CTestLtsyPhoneSetNetworkSelectionSetting(*iTestModel); |
|
243 else if(aStepName==KTestLtsyPhoneSelectNetwork) |
|
244 testStep = new CTestLtsyPhoneSelectNetwork(*iTestModel); |
|
245 else if(aStepName==KTestLtsyGetPhoneBatteryInfo) |
|
246 testStep = new CTestLtsyGetPhoneBatteryInfo(*iTestModel); |
|
247 else if(aStepName==KTestLtsyGetPhoneSingalStrength) |
|
248 testStep = new CTestLtsyGetPhoneSignalStrength(*iTestModel); |
|
249 else if(aStepName==KTestLtsyGetPhoneBatteryCap) |
|
250 testStep = new CTestLtsyGetPhoneBatteryCap(*iTestModel); |
|
251 else if(aStepName==KTestLtsyGetPhoneSingalCap) |
|
252 testStep = new CTestLtsyGetPhoneSignalCap(*iTestModel); |
|
253 else if(aStepName==KTestLtsyPhoneGetHomeNetwork) |
|
254 testStep = new CTestLtsyPhoneGetHomeNetwork(*iTestModel); |
|
255 else if(aStepName==KTestLtsyPhoneGetCurrentNetworkInfo) |
|
256 testStep = new CTestLtsyPhoneGetCurrentNetworkInfo(*iTestModel); |
|
257 else if(aStepName==KTestLtsyPhoneRegisterCellInfoChangeNotification) |
|
258 testStep = new CTestLtsyPhoneRegisterCellInfoChangeNotification(*iTestModel); |
|
259 else if(aStepName==KTestLtsyPhoneGetCellInfo) |
|
260 testStep = new CTestLtsyPhoneGetCellInfo(*iTestModel); |
|
261 else if(aStepName==KTestLtsyPktActivateContext) |
|
262 testStep = new CTestLtsyPktActivateContext(*iTestModel); |
|
263 else if(aStepName==KTestLtsyPktAttachNetwork) |
|
264 testStep = new CTestLtsyPktAttachNetwork(*iTestModel); |
|
265 else if(aStepName==KTestLtsyPktCloseContext) |
|
266 testStep = new CTestLtsyPktCloseContext(*iTestModel); |
|
267 else if(aStepName==KTestLtsyPktCloseContextQos) |
|
268 testStep = new CTestLtsyPktCloseContextQos(*iTestModel); |
|
269 else if(aStepName==KTestLtsyPktClosePacket) |
|
270 testStep = new CTestLtsyPktClosePacket(*iTestModel); |
|
271 else if(aStepName==KTestLtsyPktDeactivateContext) |
|
272 testStep = new CTestLtsyPktDeactivateContext(*iTestModel); |
|
273 else if(aStepName==KTestLtsyPktDeleteContext) |
|
274 testStep = new CTestLtsyPktDeleteContext(*iTestModel); |
|
275 else if(aStepName==KTestLtsyPktDetachNetwork) |
|
276 testStep = new CTestLtsyPktDetachNetwork(*iTestModel); |
|
277 else if(aStepName==KTestLtsyPktGetContextConfig) |
|
278 testStep = new CTestLtsyPktGetContextConfig(*iTestModel); |
|
279 else if(aStepName==KTestLtsyPktGetContextInfo) |
|
280 testStep = new CTestLtsyPktGetContextInfo(*iTestModel); |
|
281 else if(aStepName==KTestLtsyPktGetContextQoSProfile) |
|
282 testStep = new CTestLtsyPktGetContextQoSProfile(*iTestModel); |
|
283 else if(aStepName==KTestLtsyPktGetDefaultParams) |
|
284 testStep = new CTestLtsyPktGetDefaultParams(*iTestModel); |
|
285 else if(aStepName==KTestLtsyPktNetworkRegistrationStatus) |
|
286 testStep = new CTestLtsyPktNetworkRegistrationStatus(*iTestModel); |
|
287 else if(aStepName==KTestLtsyPktGetServiceStatust) |
|
288 testStep = new CTestLtsyPktGetServiceStatus(*iTestModel); |
|
289 else if(aStepName==KTestLtsyPktInitialiseContext) |
|
290 testStep = new CTestLtsyPktInitialiseContext(*iTestModel); |
|
291 else if(aStepName==KTestLtsyPktGetStaticCapabilities) |
|
292 testStep = new CTestLtsyPktGetStaticCapabilities(*iTestModel); |
|
293 else if(aStepName==KTestLtsyPktGetDynamicCapabilities) |
|
294 testStep = new CTestLtsyPktGetDynamicCapabilities(*iTestModel); |
|
295 else if(aStepName==KTestLtsyPktOpenContext) |
|
296 testStep = new CTestLtsyPktOpenContext(*iTestModel); |
|
297 else if(aStepName==KTestLtsyPktOpenContextQos) |
|
298 testStep = new CTestLtsyPktOpenContextQos(*iTestModel); |
|
299 else if(aStepName==KTestLtsyPktOpenPacket) |
|
300 testStep = new CTestLtsyPktOpenPacket(*iTestModel); |
|
301 else if(aStepName==KTestLtsyPktSetContextConfig) |
|
302 testStep = new CTestLtsyPktSetContextConfig(*iTestModel); |
|
303 else if(aStepName==KTestLtsyPktSetContextQoSProfile) |
|
304 testStep = new CTestLtsyPktSetContextQoSProfile(*iTestModel); |
|
305 else if(aStepName==KTestLtsyPktSetDefaultParams) |
|
306 testStep = new CTestLtsyPktSetDefaultParams(*iTestModel); |
|
307 else if (aStepName == KTestLtsyCallControlNotifyIncomingCallCase1) |
|
308 testStep = new CTestLtsyCallControlNotifyIncomingCallCase1(*iTestModel); |
|
309 else if (aStepName == KTestLtsyCallControlDialHangupCase) |
|
310 testStep = new CTestLtsyCallControlDialHangupCase(*iTestModel); |
|
311 else if (aStepName == KTestLtsyCallControlNotifyIncomingCallCase2) |
|
312 testStep = new CTestLtsyCallControlNotifyIncomingCallCase2(*iTestModel); |
|
313 else if (aStepName == KTestLtsyCallControlNotifyIncomingCallCase3) |
|
314 testStep = new CTestLtsyCallControlNotifyIncomingCallCase3(*iTestModel); |
|
315 else if (aStepName == KTestLtsyCallControlSwapCalls) |
|
316 testStep = new CTestLtsyCallControlSwapCalls(*iTestModel); |
|
317 else if (aStepName == KTestLtsyCallControlCustomAPITerminateAllCalls) |
|
318 testStep = new CTestLtsyCallControlCustomAPITerminateAllCalls(*iTestModel); |
|
319 else if (aStepName == KTestLtsyCallControlPhoneTerminateAllCalls) |
|
320 testStep = new CTestLtsyCallControlPhoneTerminateAllCalls(*iTestModel); |
|
321 else if (aStepName == KTestLtsyCallControlDialEmergencyCall) |
|
322 testStep = new CTestLtsyCallControlDialEmergencyCall(*iTestModel); |
|
323 else if (aStepName == KTestLtsyCallControlBase) |
|
324 testStep = new CTestLtsyCallControlBase(*iTestModel); |
|
325 else if(aStepName == KCTestLtsyOpenSms) |
|
326 testStep = new CTestLtsyOpenSms(*iTestModel); |
|
327 else if(aStepName == KCTestLtsyOpenSmsStore) |
|
328 testStep = new CTestLtsyOpenSmsStore(*iTestModel); |
|
329 else if(aStepName == KCTestLtsySmsSend) |
|
330 testStep = new CTestLtsySmsSend(*iTestModel); |
|
331 else if(aStepName == KCTestLtsyCloseSms) |
|
332 testStep = new CTestLtsyCloseSms(*iTestModel); |
|
333 else if(aStepName == KCTestLtsyCloseSmsStore) |
|
334 testStep = new CTestLtsyCloseSmsStore(*iTestModel); |
|
335 else if(aStepName == KCTestLtsyGetMessageStoreInfo) |
|
336 testStep = new CTestLtsyGetMessageStoreInfo(*iTestModel); |
|
337 else if(aStepName == KCTestLtsySmsStoreGetInfo) |
|
338 testStep = new CTestLtsySmsStoreGetInfo(*iTestModel); |
|
339 else if(aStepName == KCTestLtsySmsReceive) |
|
340 testStep = new CTestLtsySmsReceive(*iTestModel); |
|
341 else if(aStepName == KCTestLtsySmsAck) |
|
342 testStep = new CTestLtsySmsAck(*iTestModel); |
|
343 else if(aStepName == KCTestLtsySmsNack) |
|
344 testStep = new CTestLtsySmsNack(*iTestModel); |
|
345 else if(aStepName == KCTestLtsySmsSendInvalidParam) |
|
346 testStep = new CTestLtsySmsSendInvalidParam(*iTestModel); |
|
347 else if(aStepName == KCTestLtsySmsRead) |
|
348 testStep = new CTestLtsySmsRead(*iTestModel); |
|
349 else if(aStepName == KCTestLtsySmsReadInvalidIndex) |
|
350 testStep = new CTestLtsySmsReadInvalidIndex(*iTestModel); |
|
351 else if(aStepName == KCTestLtsySmsDelete) |
|
352 testStep = new CTestLtsySmsDelete(*iTestModel); |
|
353 else if(aStepName == KCTestLtsySmsDeleteInvalidIndex) |
|
354 testStep = new CTestLtsySmsDeleteInvalidIndex(*iTestModel); |
|
355 else if(aStepName == KCTestLtsySmsDeleteAll) |
|
356 testStep = new CTestLtsySmsDeleteAll(*iTestModel); |
|
357 else if(aStepName == KCTestLtsySmsStore) |
|
358 testStep = new CTestLtsySmsStore(*iTestModel); |
|
359 else if(aStepName == KCTestLtsySmsWrite) |
|
360 testStep = new CTestLtsySmsWrite(*iTestModel); |
|
361 else if(aStepName == KCTestLtsySmsWriteInvalidParam) |
|
362 testStep = new CTestLtsySmsWriteInvalidParam(*iTestModel); |
|
363 else if(aStepName == KCTestLtsyPhbkOpen) |
|
364 testStep = new CTestLtsyPhbkOpen(*iTestModel); |
|
365 else if(aStepName == KCTestLtsyPhbkClose) |
|
366 testStep = new CTestLtsyPhbkClose(*iTestModel); |
|
367 else if(aStepName == KCTestLtsyPhbkGetStoreInfo) |
|
368 testStep = new CTestLtsyPhbkGetStoreInfo(*iTestModel); |
|
369 else if(aStepName == KCTestLtsyPhbkDelete) |
|
370 testStep = new CTestLtsyPhbkDelete(*iTestModel); |
|
371 else if(aStepName == KCTestLtsyPhbkDeleteInvalidIndex) |
|
372 testStep = new CTestLtsyPhbkDeleteInvalidIndex(*iTestModel); |
|
373 else if(aStepName == KCTestLtsyPhbkWrite) |
|
374 testStep = new CTestLtsyPhbkWrite(*iTestModel); |
|
375 else if(aStepName == KCTestLtsyPhbkWriteInvalidIndex) |
|
376 testStep = new CTestLtsyPhbkWriteInvalidIndex(*iTestModel); |
|
377 else if(aStepName == KCTestLtsyPhbkRead) |
|
378 testStep = new CTestLtsyPhbkRead(*iTestModel); |
|
379 else if(aStepName == KCTestLtsyPhbkReadInvalidIndex) |
|
380 testStep = new CTestLtsyPhbkReadInvalidIndex(*iTestModel); |
|
381 else if (aStepName == KTestLtsyCallControlDialBadCall) |
|
382 testStep = new CTestLtsyCallControlDialBadCall(*iTestModel); |
|
383 else if (aStepName == KTestLtsyCallControlDialSelfCall) |
|
384 testStep = new CTestLtsyCallControlDialSelfCall(*iTestModel); |
|
385 else if (aStepName == KTestLtsyCallControlDialEmergencyCallStopAllCall) |
|
386 testStep = new CTestLtsyCallControlDialEmergencyCallStopAllCall(*iTestModel); |
|
387 |
|
388 return testStep; |
|
389 } |