|
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 CTestStep derived implementation |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file loadcpmStep.cpp |
|
20 */ |
|
21 #include "getinienumerateStep.h" |
|
22 |
|
23 using namespace RootServer; |
|
24 |
|
25 //NET-CONFIGURATOR-I-0018-HP |
|
26 //Getting Info about CPM in a Configurator |
|
27 CGetInfoCpm::~CGetInfoCpm() |
|
28 /** |
|
29 * Destructor |
|
30 */ |
|
31 { |
|
32 } |
|
33 |
|
34 CGetInfoCpm::CGetInfoCpm() |
|
35 /* |
|
36 * Constructor |
|
37 */ |
|
38 { |
|
39 |
|
40 SetTestStepName(KGetInfoCpm); |
|
41 |
|
42 } |
|
43 /** |
|
44 * @see GetInfoCpm test case NET-CONFIGURATOR-I-0018-HP |
|
45 * |
|
46 * doTestStepL virtual function does the below action |
|
47 * Connect to a configurator |
|
48 * Configurator get the module inidata section. Inidata section contains |
|
49 module initialisation information in the module's configuration file. |
|
50 * close the connection to configuator |
|
51 * Expected:-GetInfoCpm return kerrNone |
|
52 */ |
|
53 TVerdict CGetInfoCpm::doTestStepL() |
|
54 { |
|
55 |
|
56 SetTestStepResult(EFail); |
|
57 _LIT8(KNameDummyCpm,"DummyCpm"); |
|
58 |
|
59 RBuf8 data; |
|
60 data.Create(100); |
|
61 TInt actualdatasize; |
|
62 |
|
63 //Configurator call to get the module inidata section |
|
64 TInt error = iConfigurator.GetModuleIniData(KNameDummyCpm(), data, actualdatasize); |
|
65 if (error == KErrOverflow) |
|
66 { |
|
67 INFO_PRINTF2(_L("GetModuleIniData returned KErrOverflow (%d) \n"), error); |
|
68 data.ReAlloc(actualdatasize); |
|
69 error = iConfigurator.GetModuleIniData(KNameDummyCpm(), data, actualdatasize); |
|
70 } |
|
71 else if (error == KErrRSModuleUnknown ) |
|
72 { |
|
73 INFO_PRINTF2(_L("GetModuleIniData returned KErrRSModuleUnknown (%d) \n"), error); |
|
74 } |
|
75 else if (error == KErrNone) |
|
76 { |
|
77 INFO_PRINTF1(_L("GetModuleIniData Sucessful")); |
|
78 SetTestStepResult(EPass); |
|
79 } |
|
80 else |
|
81 { |
|
82 INFO_PRINTF2(_L("GetModuleIniData (DummyCpm) returned Error (%d) \n"), error); |
|
83 } |
|
84 |
|
85 data.Close(); |
|
86 return TestStepResult(); |
|
87 } |
|
88 |
|
89 //NET-CONFIGURATOR-I-0019-HP |
|
90 //Getting ini data section which should be long |
|
91 CGetLongIniInfoCpm::~CGetLongIniInfoCpm() |
|
92 /** |
|
93 * Destructor |
|
94 */ |
|
95 { |
|
96 } |
|
97 |
|
98 CGetLongIniInfoCpm::CGetLongIniInfoCpm() |
|
99 /* |
|
100 * Constructor |
|
101 */ |
|
102 { |
|
103 SetTestStepName(KGetLongIniInfoCpm); |
|
104 } |
|
105 /** |
|
106 * @see GetLongIniInfoCpm test case NET-CONFIGURATOR-I-0019-HP |
|
107 * |
|
108 * doTestStepL virtual function does the below action |
|
109 * Connect to a configurator |
|
110 * Configurator get the long module inidata section. Inidata section contains |
|
111 module initialisation information in the module's configuration file. |
|
112 * close the connection to configuator |
|
113 * Expected:-GetLongIniInfoCpm return kerrNone |
|
114 ********************************************************************************** |
|
115 * Result of this test case in not important because extreme testing is not required |
|
116 * Long line of ini data is not consider for testing |
|
117 ********************************************************************************** |
|
118 */ |
|
119 TVerdict CGetLongIniInfoCpm::doTestStepL() |
|
120 { |
|
121 SetTestStepResult(EFail); |
|
122 _LIT8(KNameDummyCpm9,"DummyCpm9"); |
|
123 |
|
124 RBuf8 data; |
|
125 data.Create(100); |
|
126 TInt actualdatasize; |
|
127 |
|
128 //Configurator call to get the module inidata section |
|
129 TInt error = iConfigurator.GetModuleIniData(KNameDummyCpm9(), data, actualdatasize); |
|
130 if (error == KErrOverflow) |
|
131 { |
|
132 INFO_PRINTF2(_L("GetModuleIniData returned KErrOverflow (%d) \n"), error); |
|
133 } |
|
134 else if (error == KErrRSModuleUnknown ) |
|
135 { |
|
136 INFO_PRINTF2(_L("GetModuleIniData returned KErrRSModuleUnknown (%d) \n"), error); |
|
137 } |
|
138 else if (error == KErrNone) |
|
139 { |
|
140 INFO_PRINTF1(_L("GetModuleIniData Sucessful")); |
|
141 SetTestStepResult(EPass); |
|
142 } |
|
143 else |
|
144 { |
|
145 INFO_PRINTF2(_L("GetModuleIniData (DummyCpm) returned Error (%d) \n"), error); |
|
146 } |
|
147 return TestStepResult(); |
|
148 } |
|
149 |
|
150 |
|
151 //NET-CONFIGURATOR-I-0020-HP |
|
152 //Getting ini data section which should multiple lines of ini data |
|
153 CGetMultiLineIniInfoCpm::~CGetMultiLineIniInfoCpm() |
|
154 /** |
|
155 * Destructor |
|
156 */ |
|
157 { |
|
158 } |
|
159 |
|
160 CGetMultiLineIniInfoCpm::CGetMultiLineIniInfoCpm() |
|
161 /* |
|
162 * Constructor |
|
163 */ |
|
164 { |
|
165 SetTestStepName(KGetMultiLineIniInfoCpm); |
|
166 } |
|
167 /** |
|
168 * @see GetMultiLineIniInfoCpm test case NET-CONFIGURATOR-I-0020-HP |
|
169 * |
|
170 * doTestStepL virtual function does the below action |
|
171 * Connect to a configurator |
|
172 * Configurator get the multiple line module inidata section. Inidata section contains |
|
173 module initialisation information in the module's configuration file. |
|
174 * close the connection to configuator |
|
175 * Expected:-GetMultiLineIniInfoCpm return kerrNone |
|
176 ********************************************************************************** |
|
177 * Result of this test case in not important because extreme testing is not required |
|
178 * MultiLine line ini data is not consider for testing |
|
179 ********************************************************************************** |
|
180 */ |
|
181 TVerdict CGetMultiLineIniInfoCpm::doTestStepL() |
|
182 { |
|
183 SetTestStepResult(EFail); |
|
184 _LIT8(KNameDummyCpm10,"DummyCpm10"); |
|
185 |
|
186 RBuf8 data; |
|
187 data.Create(100); |
|
188 TInt actualdatasize; |
|
189 |
|
190 //Configurator call to get the module inidata section |
|
191 TInt error = iConfigurator.GetModuleIniData(KNameDummyCpm10(), data, actualdatasize); |
|
192 if (error == KErrOverflow) |
|
193 { |
|
194 INFO_PRINTF2(_L("GetModuleIniData returned KErrOverflow (%d) \n"), error); |
|
195 data.ReAlloc(actualdatasize); |
|
196 error = iConfigurator.GetModuleIniData(KNameDummyCpm10(), data, actualdatasize); |
|
197 SetTestStepResult(EFail); |
|
198 } |
|
199 else if (error == KErrRSModuleUnknown ) |
|
200 { |
|
201 INFO_PRINTF2(_L("GetModuleIniData returned KErrRSModuleUnknown (%d) \n"), error); |
|
202 } |
|
203 else if (error == KErrNone) |
|
204 { |
|
205 INFO_PRINTF1(_L("GetModuleIniData Sucessful")); |
|
206 SetTestStepResult(EPass); |
|
207 } |
|
208 else |
|
209 { |
|
210 INFO_PRINTF2(_L("GetModuleIniData (DummyCpm10) returned Error (%d) \n"), error); |
|
211 } |
|
212 return TestStepResult(); |
|
213 } |
|
214 |
|
215 //NET-CONFIGURATOR-I-0021-HP |
|
216 //Getting Info about CPM in a Configurator without CMI files |
|
217 CGetInfoCpmWithoutCMI::~CGetInfoCpmWithoutCMI() |
|
218 /** |
|
219 * Destructor |
|
220 */ |
|
221 { |
|
222 } |
|
223 |
|
224 |
|
225 CGetInfoCpmWithoutCMI::CGetInfoCpmWithoutCMI() |
|
226 /** |
|
227 * Constructor |
|
228 */ |
|
229 { |
|
230 SetTestStepName(KGetInfoCpmWithoutCMI); |
|
231 } |
|
232 |
|
233 /** |
|
234 * @see GetInfoCpmWithoutCMI test case NET-CONFIGURATOR-I-0021-HP |
|
235 * |
|
236 * doTestStepL virtual function does the below action |
|
237 * Connect to a configurator |
|
238 * Configurator get the module inidata section. which has no CMI files |
|
239 * close the connection to configuator |
|
240 * Expected:-GetInfoCpmWithoutCMI return kerrNone |
|
241 */ |
|
242 TVerdict CGetInfoCpmWithoutCMI::doTestStepL() |
|
243 { |
|
244 |
|
245 SetTestStepResult(EFail); |
|
246 _LIT8(KNameDummyCpm,"DummyNoCMI"); |
|
247 |
|
248 RBuf8 data; |
|
249 data.Create(100); |
|
250 TInt actualdatasize; |
|
251 |
|
252 //Configurator call to get the module inidata section |
|
253 TInt error = iConfigurator.GetModuleIniData(KNameDummyCpm(), data, actualdatasize); |
|
254 if (error == KErrOverflow) |
|
255 { |
|
256 INFO_PRINTF2(_L("GetModuleIniData returned KErrOverflow (%d) \n"), error); |
|
257 data.ReAlloc(actualdatasize); |
|
258 error = iConfigurator.GetModuleIniData(KNameDummyCpm(), data, actualdatasize); |
|
259 SetTestStepResult(EFail); |
|
260 } |
|
261 else if (error == KErrRSModuleUnknown) |
|
262 { |
|
263 INFO_PRINTF2(_L("GetModuleIniData returned KErrRSModuleUnknown (%d) \n"), error); |
|
264 SetTestStepResult(EPass); |
|
265 } |
|
266 else if (error == KErrNone) |
|
267 { |
|
268 INFO_PRINTF1(_L("GetModuleIniData Sucessful")); |
|
269 } |
|
270 else |
|
271 { |
|
272 INFO_PRINTF2(_L("GetModuleIniData (DummyCpm) returned Error (%d) \n"), error); |
|
273 } |
|
274 return TestStepResult(); |
|
275 } |
|
276 |
|
277 //NET-CONFIGURATOR-I-0022-HP |
|
278 //Getting Info about CPM with cmi which does not have iniData section in CMI file |
|
279 CGetInfoCpmWithoutINI::~CGetInfoCpmWithoutINI() |
|
280 /** |
|
281 * Destructor |
|
282 */ |
|
283 { |
|
284 } |
|
285 |
|
286 CGetInfoCpmWithoutINI::CGetInfoCpmWithoutINI() |
|
287 /** |
|
288 * Constructor |
|
289 */ |
|
290 { |
|
291 |
|
292 SetTestStepName(KGetInfCpmWithoutINI); |
|
293 |
|
294 } |
|
295 /** |
|
296 * @see GetInfoCpmWithoutINI test case NET-CONFIGURATOR-I-0022-HP |
|
297 * |
|
298 * doTestStepL virtual function does the below action |
|
299 * Connect to a configurator |
|
300 * Configurator get the module inidata section. which has no INI section |
|
301 * close the connection to configuator |
|
302 * Expected:-GetInfoCpmWithoutCMI return kerrNone |
|
303 */ |
|
304 TVerdict CGetInfoCpmWithoutINI::doTestStepL() |
|
305 { |
|
306 SetTestStepResult(EFail); |
|
307 |
|
308 //Connection to the configurator |
|
309 _LIT8(KNameDummyCpm11,"DummyCpm11"); |
|
310 |
|
311 RBuf8 data; |
|
312 data.Create(100); |
|
313 TInt actualdatasize; |
|
314 |
|
315 //Configurator call to get the module inidata section |
|
316 TInt error = iConfigurator.GetModuleIniData(KNameDummyCpm11(), data, actualdatasize); |
|
317 if ( error == KErrOverflow) |
|
318 { |
|
319 INFO_PRINTF2(_L("GetModileIniData returned KErrOverflow (%d) \n"), error); |
|
320 data.ReAlloc(actualdatasize); |
|
321 error = iConfigurator.GetModuleIniData(KNameDummyCpm11(), data, actualdatasize); |
|
322 } |
|
323 else if ( error == KErrRSModuleUnknown) |
|
324 { |
|
325 INFO_PRINTF2(_L("GetModuleIniData returned KErrRSModuleUnknown (%d) \n"), error); |
|
326 } |
|
327 else if (error == KErrNone) |
|
328 { |
|
329 INFO_PRINTF1(_L("GetModuleIniData Sucessfully")); |
|
330 SetTestStepResult(EPass); |
|
331 } |
|
332 else |
|
333 { |
|
334 INFO_PRINTF2(_L("GetModuleIniData (DummyCpm11) returned Error (%d) \n"), error); |
|
335 } |
|
336 return TestStepResult(); |
|
337 } |
|
338 |
|
339 // NET-CONFIGURATOR-I-0023-HP |
|
340 //Getting Info about CPM with cmi iniData overflow |
|
341 CGetInfoCpmIniOverflow::~CGetInfoCpmIniOverflow() |
|
342 /** |
|
343 * Destructor |
|
344 */ |
|
345 { |
|
346 } |
|
347 |
|
348 CGetInfoCpmIniOverflow::CGetInfoCpmIniOverflow() |
|
349 /** |
|
350 * Constructor |
|
351 */ |
|
352 { |
|
353 |
|
354 SetTestStepName(KGetInfoCpmIniOverflow); |
|
355 |
|
356 } |
|
357 /** |
|
358 * @see GetInfoCpmIniOverflow test case NET-CONFIGURATOR-I-0023-HP |
|
359 * |
|
360 * doTestStepL virtual function does the below action |
|
361 * Connect to a configurator |
|
362 * Configurator get the module inidata section |
|
363 * close the connection to configuator |
|
364 * Expected:-GetInfoCpmIniOverflow return kerrOverflow |
|
365 */ |
|
366 TVerdict CGetInfoCpmIniOverflow::doTestStepL() |
|
367 { |
|
368 SetTestStepResult(EFail); |
|
369 _LIT8(KNameDummyCpm10,"DummyCpm10"); |
|
370 |
|
371 TBuf8<10> data; |
|
372 TInt actualdatasize; |
|
373 |
|
374 //Configurator call to get the module inidata section |
|
375 TInt error = iConfigurator.GetModuleIniData(KNameDummyCpm10(), data, actualdatasize); |
|
376 if (error == KErrOverflow) |
|
377 { |
|
378 INFO_PRINTF2(_L("GetModileIniData returned KErrOverflow (%d) \n"), error); |
|
379 SetTestStepResult(EPass); |
|
380 } |
|
381 else if (error == KErrRSModuleUnknown) |
|
382 { |
|
383 INFO_PRINTF2(_L("GetModuleIniData returned KErrRSModuleUnknown (%d) \n"), error); |
|
384 } |
|
385 else if (error == KErrNone) |
|
386 { |
|
387 INFO_PRINTF1(_L("GetModuleIniData Sucessful")); |
|
388 } |
|
389 else |
|
390 { |
|
391 INFO_PRINTF2(_L("GetModuleIniData (DummyCpm) returned Error (%d) \n"), error); |
|
392 } |
|
393 return TestStepResult(); |
|
394 } |
|
395 |
|
396 //NET-CONFIGURATOR-I-0024-HP |
|
397 //Request for The list of modules in The configurator |
|
398 CListModules::~CListModules() |
|
399 /** |
|
400 * Destructor |
|
401 */ |
|
402 { |
|
403 } |
|
404 |
|
405 CListModules::CListModules() |
|
406 /** |
|
407 * Constructor |
|
408 */ |
|
409 { |
|
410 SetTestStepName(KListModules); |
|
411 } |
|
412 /** |
|
413 * @see ListModules test case NET-CONFIGURATOR-I-0024-HP |
|
414 * |
|
415 * doTestStepL virtual function does the below action |
|
416 * Connect to a configurator |
|
417 * Configurator Enables the client to assemble a list of modules for matching group |
|
418 * Configurator close the connection to configuator |
|
419 * Expected:-ListModules return all the modules |
|
420 */ |
|
421 TVerdict CListModules::doTestStepL() |
|
422 { |
|
423 SetTestStepResult(EFail); |
|
424 TRSIter position; |
|
425 |
|
426 _LIT8(KGroupName, "Group1"); |
|
427 _LIT8(KDummyCpm,"DummyCpm"); |
|
428 _LIT8(KDummyCpm2,"DummyCpm2"); |
|
429 _LIT8(KDummyCpm3,"DummyCpm3"); |
|
430 |
|
431 TCFModuleName moduleName; |
|
432 TCFGroupName groupName(KGroupName); |
|
433 TCFGroupName cpmName[3]; |
|
434 |
|
435 cpmName[0].Copy(KDummyCpm); |
|
436 cpmName[1].Copy(KDummyCpm2); |
|
437 cpmName[2].Copy(KDummyCpm3); |
|
438 |
|
439 TInt dummyCpm = 0; |
|
440 TInt dummyCpm2 = 0; |
|
441 TInt dummyCpm3 = 0; |
|
442 TInt cpmCount = 0; |
|
443 |
|
444 //Enables the client to assemble a list of modules for matching group by retrieving the |
|
445 // name of one module at a time from all modules |
|
446 while(KErrNone == iConfigurator.EnumerateModules(groupName, position , moduleName)) |
|
447 { |
|
448 if(cpmName[0].CompareF(moduleName)==0) |
|
449 { |
|
450 if(dummyCpm == EModuleNotFoundEarlier) |
|
451 { |
|
452 cpmCount++; |
|
453 dummyCpm = EModuleFoundNow; |
|
454 } |
|
455 } |
|
456 else if(cpmName[1].CompareF(moduleName)==0) |
|
457 { |
|
458 if(dummyCpm2 == EModuleNotFoundEarlier) |
|
459 { |
|
460 cpmCount++; |
|
461 dummyCpm2 = EModuleFoundNow; |
|
462 } |
|
463 } |
|
464 else if(cpmName[2].CompareF(moduleName)==0) |
|
465 { |
|
466 if(dummyCpm3 == EModuleNotFoundEarlier) |
|
467 { |
|
468 cpmCount++; |
|
469 dummyCpm3 = EModuleFoundNow; |
|
470 } |
|
471 } |
|
472 } |
|
473 |
|
474 if(cpmCount == 3) |
|
475 { |
|
476 SetTestStepResult(EPass); |
|
477 } |
|
478 return TestStepResult(); |
|
479 } |
|
480 |
|
481 //NET-CONFIGURATOR-I-0025-HP |
|
482 //Enumerate one group and then enumerate another group |
|
483 |
|
484 CEnumerateGroup::~CEnumerateGroup() |
|
485 /** |
|
486 * Destructor |
|
487 */ |
|
488 { |
|
489 } |
|
490 |
|
491 CEnumerateGroup::CEnumerateGroup() |
|
492 /** |
|
493 * Constructor |
|
494 */ |
|
495 { |
|
496 SetTestStepName(KEnumerateGroup); |
|
497 } |
|
498 /** |
|
499 * @see EnumerateGroup test case NET-CONFIGURATOR-I-0025-HP |
|
500 * |
|
501 * doTestStepL virtual function does the below action |
|
502 * Connect to a configurator |
|
503 * Configurator Enables the client to assemble a list of modules for matching groups |
|
504 * Configurator close the connection to configuator |
|
505 * Expected:-EnumerateGroup return list of mosules |
|
506 */ |
|
507 TVerdict CEnumerateGroup::doTestStepL() |
|
508 { |
|
509 SetTestStepResult(EFail); |
|
510 TRSIter position; |
|
511 TCFModuleName moduleName; |
|
512 _LIT8(KGroupName1, "Group1"); |
|
513 |
|
514 TCFGroupName groupName1(KGroupName1); |
|
515 TCFGroupName cpmName[3]; |
|
516 |
|
517 |
|
518 _LIT8(KDummyCpm,"DummyCpm"); |
|
519 _LIT8(KDummyCpm2,"DummyCpm2"); |
|
520 _LIT8(KDummyCpm3,"DummyCpm3"); |
|
521 |
|
522 cpmName[0].Copy(KDummyCpm); |
|
523 cpmName[1].Copy(KDummyCpm2); |
|
524 cpmName[2].Copy(KDummyCpm3); |
|
525 |
|
526 |
|
527 TInt dummyCpm = 0; |
|
528 TInt dummyCpm2 = 0; |
|
529 TInt dummyCpm3 = 0; |
|
530 |
|
531 TInt cpmCount1 = 0; |
|
532 TInt cpmCount2 = 0; |
|
533 //Enables the client to assemble a list of modules for matching one group by retrieving the |
|
534 //name of one module at a time from all modules |
|
535 while(KErrNone == iConfigurator.EnumerateModules(groupName1, position , moduleName)) |
|
536 { |
|
537 if(cpmName[0].CompareF(moduleName)==0) |
|
538 { |
|
539 if(dummyCpm == EModuleNotFoundEarlier) |
|
540 { |
|
541 cpmCount1++; |
|
542 dummyCpm = EModuleFoundNow; |
|
543 } |
|
544 } |
|
545 else if(cpmName[1].CompareF(moduleName)==0) |
|
546 { |
|
547 if(dummyCpm2 == EModuleNotFoundEarlier) |
|
548 { |
|
549 cpmCount1++; |
|
550 dummyCpm2 = EModuleFoundNow; |
|
551 } |
|
552 } |
|
553 else if(cpmName[2].CompareF(moduleName)==0) |
|
554 { |
|
555 if(dummyCpm3 == EModuleNotFoundEarlier) |
|
556 { |
|
557 cpmCount1++; |
|
558 dummyCpm3 = EModuleFoundNow; |
|
559 } |
|
560 } |
|
561 } |
|
562 |
|
563 _LIT8(KGroupName2, "Group2"); |
|
564 TCFGroupName groupName2(KGroupName2); |
|
565 |
|
566 _LIT8(KDummyCpm4,"DummyCpm4"); |
|
567 _LIT8(KDummyCpm5,"DummyCpm5"); |
|
568 |
|
569 cpmName[0].Copy(KDummyCpm4); |
|
570 cpmName[1].Copy(KDummyCpm5); |
|
571 |
|
572 dummyCpm = 0; |
|
573 dummyCpm2 = 0; |
|
574 |
|
575 // Enables the client to assemble a list of modules for matching another group by retrieving the |
|
576 // name of one module at a time from all modules |
|
577 |
|
578 while(KErrNone == iConfigurator.EnumerateModules(groupName2, position , moduleName)) |
|
579 { |
|
580 |
|
581 if(cpmName[0].CompareF(moduleName)==0) |
|
582 { |
|
583 if(dummyCpm == EModuleNotFoundEarlier) |
|
584 { |
|
585 cpmCount2++; |
|
586 dummyCpm = EModuleFoundNow; |
|
587 } |
|
588 } |
|
589 else |
|
590 if(cpmName[1].CompareF(moduleName)==0) |
|
591 { |
|
592 if(dummyCpm2 == EModuleNotFoundEarlier) |
|
593 { |
|
594 cpmCount2++; |
|
595 dummyCpm2 = EModuleFoundNow; |
|
596 } |
|
597 } |
|
598 } |
|
599 |
|
600 if(cpmCount1 == 3 && cpmCount2 == 2) |
|
601 { |
|
602 SetTestStepResult(EPass); |
|
603 } |
|
604 return TestStepResult(); |
|
605 } |
|
606 |
|
607 //NET-CONFIGURATOR-I-0026-HP |
|
608 //Enumerate cpm with two cmi file which has same CPM name |
|
609 CEnumeratCpmwithTwoCmi::~CEnumeratCpmwithTwoCmi() |
|
610 /** |
|
611 * Destructor |
|
612 */ |
|
613 { |
|
614 } |
|
615 |
|
616 CEnumeratCpmwithTwoCmi::CEnumeratCpmwithTwoCmi() |
|
617 /** |
|
618 * Constructor |
|
619 */ |
|
620 { |
|
621 |
|
622 SetTestStepName(KEnumeratCpmwithTwoCmi); |
|
623 } |
|
624 /** |
|
625 * @see CnumeratCpmwithTwoCmi test case NET-CONFIGURATOR-I-0026-HP |
|
626 * |
|
627 * doTestStepL virtual function does the below action |
|
628 * Connect to a configurator |
|
629 * Configurator Enables the client to assemble a list of modules for matching groups |
|
630 * Configurator close the connection to configuator |
|
631 * Expected:-EnumeratCpmwithTwoCmi return list of modules |
|
632 */ |
|
633 TVerdict CEnumeratCpmwithTwoCmi::doTestStepL() |
|
634 { |
|
635 |
|
636 SetTestStepResult(EFail); |
|
637 TRequestStatus status; |
|
638 RRsConfigurator configurator; |
|
639 //Connection to the configurator |
|
640 TInt result = configurator.Connect(); |
|
641 if (result == KErrNone) |
|
642 { |
|
643 INFO_PRINTF1(_L("Configurator Connection Sucessful")); |
|
644 TRSIter position; |
|
645 TCFModuleName moduleName; |
|
646 _LIT8(KGroupName, "Group5"); |
|
647 |
|
648 TCFGroupName groupName(KGroupName); |
|
649 TCFGroupName cpmName[2]; |
|
650 |
|
651 _LIT8(KDummyCpm12,"DummyCpms"); |
|
652 _LIT8(KDummyCpm13,"DummyCpms"); |
|
653 cpmName[0].Copy(KDummyCpm12); |
|
654 cpmName[1].Copy(KDummyCpm13); |
|
655 |
|
656 TInt dummyCpm12 = 0; |
|
657 TInt dummyCpm13 = 0; |
|
658 TInt moduleCount = 0; |
|
659 |
|
660 //Enables the client to assemble a list of modules for matching group by retrieving the |
|
661 //name of one module at a time from all modules |
|
662 while(KErrNone == configurator.EnumerateModules(groupName, position , moduleName)) |
|
663 { |
|
664 if(cpmName[0].CompareF(moduleName)==0) |
|
665 { |
|
666 if(dummyCpm12 == EModuleNotFoundEarlier) |
|
667 { |
|
668 moduleCount++; |
|
669 dummyCpm12 = EModuleFoundNow; |
|
670 } |
|
671 } |
|
672 else |
|
673 if(cpmName[1].CompareF(moduleName) == 0) |
|
674 { |
|
675 if(dummyCpm13 == EModuleNotFoundEarlier) |
|
676 { |
|
677 moduleCount++; |
|
678 dummyCpm13 = EModuleFoundNow; |
|
679 } |
|
680 } |
|
681 } |
|
682 |
|
683 if(moduleCount == 1) |
|
684 { |
|
685 SetTestStepResult(EPass); |
|
686 } |
|
687 //Close to the configurator connection |
|
688 configurator.Close(); |
|
689 } |
|
690 else |
|
691 { |
|
692 INFO_PRINTF1(_L("Configurator Connection Failure \n")); |
|
693 } |
|
694 return TestStepResult(); |
|
695 } |
|
696 |
|
697 |
|
698 //NET-CONFIGURATOR-I-0027-HP |
|
699 //Enumerate cpm in a group which has only one CMI file |
|
700 CEnumeratCpmwithOneCmi::~CEnumeratCpmwithOneCmi() |
|
701 /** |
|
702 * Destructor |
|
703 */ |
|
704 { |
|
705 } |
|
706 |
|
707 CEnumeratCpmwithOneCmi::CEnumeratCpmwithOneCmi() |
|
708 /** |
|
709 * Constructor |
|
710 */ |
|
711 { |
|
712 |
|
713 SetTestStepName(KEnumeratCpmwithOneCmi); |
|
714 } |
|
715 /** |
|
716 * @see EnumeratCpmwithOneCmi test case NET-CONFIGURATOR-I-0027-HP |
|
717 * |
|
718 * doTestStepL virtual function does the below action |
|
719 * Connect to a configurator |
|
720 * Configurator Enables the client to assemble a list of modules for matching groups which is having one cmi file |
|
721 * Configurator close the connection to configuator |
|
722 * Expected:-EnumeratCpmwithOneCmi return list of modules |
|
723 */ |
|
724 TVerdict CEnumeratCpmwithOneCmi::doTestStepL() |
|
725 { |
|
726 |
|
727 SetTestStepResult(EFail); |
|
728 TRequestStatus status; |
|
729 RRsConfigurator configurator; |
|
730 |
|
731 //Connection to the configurator |
|
732 TInt result = configurator.Connect(); |
|
733 if (result == KErrNone) |
|
734 { |
|
735 |
|
736 INFO_PRINTF1(_L("Configurator Connection Sucessful")); |
|
737 TRSIter position; |
|
738 TCFModuleName moduleName; |
|
739 _LIT8(KGroupName, "Group6"); |
|
740 |
|
741 TCFGroupName groupName(KGroupName); |
|
742 |
|
743 _LIT8(KDummyCpm14,"DummyCpm14"); |
|
744 |
|
745 TCFGroupName aGroupName; |
|
746 aGroupName.Copy(KDummyCpm14); |
|
747 TInt dummyCpm14 = 0; |
|
748 TInt moduleCount = 0; |
|
749 //Enables the client to assemble a list of modules for matching group by retrieving the |
|
750 //name of one module at a time from all modules |
|
751 while(KErrNone == configurator.EnumerateModules(groupName, position , moduleName)) |
|
752 { |
|
753 |
|
754 if(aGroupName.CompareF(moduleName)==0) |
|
755 { |
|
756 if(dummyCpm14 == EModuleNotFoundEarlier) |
|
757 { |
|
758 moduleCount++; |
|
759 dummyCpm14 = EModuleFoundNow; |
|
760 } |
|
761 } |
|
762 |
|
763 } |
|
764 if(moduleCount == 1) |
|
765 { |
|
766 SetTestStepResult(EPass); |
|
767 } |
|
768 //Close to the configurator connection |
|
769 configurator.Close(); |
|
770 } |
|
771 else |
|
772 { |
|
773 INFO_PRINTF1(_L("Configurator Connection Failure \n")); |
|
774 } |
|
775 return TestStepResult(); |
|
776 } |
|
777 |
|
778 |
|
779 //NET-CONFIGURATOR-I-0028-HP |
|
780 //Request for The list of modules in The configurator unknown group name |
|
781 CListModulesGroupUnknown::~CListModulesGroupUnknown() |
|
782 /** |
|
783 * Destructor |
|
784 */ |
|
785 { |
|
786 } |
|
787 |
|
788 CListModulesGroupUnknown::CListModulesGroupUnknown() |
|
789 /** |
|
790 * Constructor |
|
791 */ |
|
792 { |
|
793 SetTestStepName(KListModulesGroupUnknown); |
|
794 } |
|
795 /** |
|
796 * @see CListModulesGroupUnknown test case NET-CONFIGURATOR-I-0028-HP |
|
797 * |
|
798 * doTestStepL virtual function does the below action |
|
799 * Connect to a configurator |
|
800 * Configurator Enables the client to assemble a list of modules for matching groups which is having one cmi file |
|
801 * Configurator close the connection to configuator |
|
802 * Expected:-CListModulesGroupUnknown return KErrRSModuleUnknown |
|
803 */ |
|
804 TVerdict CListModulesGroupUnknown::doTestStepL() |
|
805 { |
|
806 SetTestStepResult(EFail); |
|
807 RRsConfigurator configurator; |
|
808 //Connection to the configurator |
|
809 TInt err = configurator.Connect(); |
|
810 if (err == KErrNone) |
|
811 { |
|
812 INFO_PRINTF1(_L("Configurator Connection Sucessful")); |
|
813 |
|
814 TRSIter position; |
|
815 TCFModuleName moduleName; |
|
816 _LIT8(KGroupName, "UnknownGrp"); |
|
817 TCFGroupName groupName(KGroupName); |
|
818 //Enables the client to assemble a list of modules for matching group by retrieving the |
|
819 //name of one module at a time from all modules |
|
820 TInt istatus = configurator.EnumerateModules(groupName, position , moduleName); |
|
821 if(istatus == KErrNone) |
|
822 { |
|
823 INFO_PRINTF1(_L("EnumerateModules Sucessful \n")); |
|
824 } |
|
825 else |
|
826 if (istatus == KErrRSModuleUnknown ) |
|
827 { |
|
828 INFO_PRINTF2(_L("GetModileIniData returned KErrRSModuleUnknown (%d) \n"), istatus); |
|
829 SetTestStepResult(EPass); |
|
830 } |
|
831 else |
|
832 { |
|
833 INFO_PRINTF2(_L("GetModileIniData returned (%d) \n"), istatus); |
|
834 } |
|
835 //Close to the configurator connection |
|
836 configurator.Close(); |
|
837 } |
|
838 else |
|
839 { |
|
840 INFO_PRINTF1(_L("Configurator Connection Failure \n")); |
|
841 } |
|
842 return TestStepResult(); |
|
843 } |
|
844 |
|
845 |
|
846 |