|
1 /* |
|
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation of Module Test Automation Code for |
|
15 * Provisioning |
|
16 * |
|
17 */ |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <e32svr.h> |
|
21 #include <e32def.h> |
|
22 #include <StifParser.h> |
|
23 #include <Stiftestinterface.h> |
|
24 #include "moduletestprovisioning.h" |
|
25 #include <PushMessage.h> |
|
26 #include <MWPPhone.h> |
|
27 #include "CWPBootstrap.h" |
|
28 #include "CWPAdapter.h" |
|
29 #include "ProvisioningUIDs.h" |
|
30 #include <S32FILE.h> |
|
31 #include <S32STOR.h> |
|
32 #include <S32STD.h> |
|
33 #include <CWPParameter.h> |
|
34 #include <CWPCharacteristic.h> |
|
35 #include <WPAdapterUtil.h> |
|
36 #include "MWPBuilder.h" |
|
37 #include <WPWVAdapterResource.rsg> |
|
38 #include "ProvisioningInternalCRKeys.h" |
|
39 #include <centralrepository.h> |
|
40 #include <commdb.h> |
|
41 #include <ApAccessPointItem.h> |
|
42 #include <ApDataHandler.h> |
|
43 |
|
44 |
|
45 // EXTERNAL DATA STRUCTURES |
|
46 //extern ?external_data; |
|
47 |
|
48 // EXTERNAL FUNCTION PROTOTYPES |
|
49 //extern ?external_function( ?arg_type,?arg_type ); |
|
50 |
|
51 // CONSTANTS |
|
52 //const ?type ?constant_var = ?constant; |
|
53 |
|
54 // MACROS |
|
55 //#define ?macro ?macro_def |
|
56 |
|
57 // LOCAL CONSTANTS AND MACROS |
|
58 //const ?type ?constant_var = ?constant; |
|
59 //#define ?macro_name ?macro_def |
|
60 |
|
61 // MODULE DATA STRUCTURES |
|
62 //enum ?declaration |
|
63 //typedef ?declaration |
|
64 |
|
65 // LOCAL FUNCTION PROTOTYPES |
|
66 //?type ?function_name( ?arg_type, ?arg_type ); |
|
67 |
|
68 // FORWARD DECLARATIONS |
|
69 //class ?FORWARD_CLASSNAME; |
|
70 |
|
71 // ============================= LOCAL FUNCTIONS =============================== |
|
72 |
|
73 // ----------------------------------------------------------------------------- |
|
74 // ?function_name ?description. |
|
75 // ?description |
|
76 // Returns: ?value_1: ?description |
|
77 // ?value_n: ?description_line1 |
|
78 // ?description_line2 |
|
79 // ----------------------------------------------------------------------------- |
|
80 // |
|
81 /* |
|
82 ?type ?function_name( |
|
83 ?arg_type arg, // ?description |
|
84 ?arg_type arg) // ?description |
|
85 { |
|
86 |
|
87 ?code // ?comment |
|
88 |
|
89 // ?comment |
|
90 ?code |
|
91 } |
|
92 */ |
|
93 |
|
94 // ============================ MEMBER FUNCTIONS =============================== |
|
95 |
|
96 // ----------------------------------------------------------------------------- |
|
97 // Cmoduletestprovisioning::Delete |
|
98 // Delete here all resources allocated and opened from test methods. |
|
99 // Called from destructor. |
|
100 // ----------------------------------------------------------------------------- |
|
101 // |
|
102 void Cmoduletestprovisioning::Delete() |
|
103 { |
|
104 |
|
105 } |
|
106 |
|
107 // ----------------------------------------------------------------------------- |
|
108 // Cmoduletestprovisioning::RunMethodL |
|
109 // Run specified method. Contains also table of test mothods and their names. |
|
110 // ----------------------------------------------------------------------------- |
|
111 // |
|
112 TInt Cmoduletestprovisioning::RunMethodL(CStifItemParser& aItem) |
|
113 { |
|
114 |
|
115 TStifFunctionInfo const |
|
116 KFunctions[] = |
|
117 { |
|
118 // Copy this line for every implemented function. |
|
119 // First string is the function name used in TestScripter script file. |
|
120 // Second is the actual implementation member function. |
|
121 // Copy this line for every implemented function. |
|
122 // First string is the function name used in TestScripter script file. |
|
123 // Second is the actual implementation member function. |
|
124 ENTRY("Example", Cmoduletestprovisioning::ExampleL), |
|
125 ENTRY("Create", |
|
126 Cmoduletestprovisioning::CreateandDeleteL), |
|
127 ENTRY("CreateNewL", |
|
128 Cmoduletestprovisioning::CreateandDeleteNewL), |
|
129 ENTRY("Import", |
|
130 Cmoduletestprovisioning::ImportDocumentL), |
|
131 ENTRY("Populate", Cmoduletestprovisioning::PopulateL), |
|
132 ENTRY("ItemCount", |
|
133 Cmoduletestprovisioning::ItemCountL), |
|
134 ENTRY("InternAndExtern", |
|
135 Cmoduletestprovisioning::InternAndExternL), |
|
136 ENTRY("Save", Cmoduletestprovisioning::SaveL), |
|
137 ENTRY("Summary", |
|
138 Cmoduletestprovisioning::SummaryTitleandTextL), |
|
139 ENTRY("SetAsDefault", |
|
140 Cmoduletestprovisioning::SetAsDefaultL), |
|
141 ENTRY("StoreAndRestore", |
|
142 Cmoduletestprovisioning::StoreAndRestoreL), |
|
143 ENTRY("Details", Cmoduletestprovisioning::DetailsL), |
|
144 ENTRY("CreateContext", |
|
145 Cmoduletestprovisioning::CreateContextL), |
|
146 ENTRY("DeleteContext", |
|
147 Cmoduletestprovisioning::DeleteContextL), |
|
148 ENTRY("ContextDataCount", |
|
149 Cmoduletestprovisioning::ContextDataCountL), |
|
150 ENTRY("ContextUids", |
|
151 Cmoduletestprovisioning::ContextUidsL), |
|
152 ENTRY("ContextName", |
|
153 Cmoduletestprovisioning::ContextNameL), |
|
154 ENTRY("ContextTPS", |
|
155 Cmoduletestprovisioning::ContextTPSL), |
|
156 ENTRY("ContextProxies", |
|
157 Cmoduletestprovisioning::ContextProxiesL), |
|
158 ENTRY("Context", Cmoduletestprovisioning::ContextL), |
|
159 ENTRY("Builder", Cmoduletestprovisioning::BuilderL), |
|
160 ENTRY("CurrentContext", |
|
161 Cmoduletestprovisioning::CurrentContextL), |
|
162 ENTRY("CreateparameterNewL", |
|
163 Cmoduletestprovisioning::CreateparameterNewL), |
|
164 ENTRY("CreateparameterNewLC", |
|
165 Cmoduletestprovisioning::CreateparameterNewL), |
|
166 ENTRY("CSetandGetparamID", |
|
167 Cmoduletestprovisioning::CSetandGetparamIDL), |
|
168 ENTRY("CSetandGetparamName", |
|
169 Cmoduletestprovisioning::CSetandGetparamNameL), |
|
170 ENTRY( |
|
171 "CSetandGetparamValue", |
|
172 Cmoduletestprovisioning::CSetandGetparamValueL), |
|
173 ENTRY( |
|
174 "InternAndExternparam", |
|
175 Cmoduletestprovisioning::InternAndExternparamL), |
|
176 ENTRY("GetparamType", |
|
177 Cmoduletestprovisioning::GetparamTypeL), |
|
178 ENTRY( |
|
179 "InsertCharacteristic", |
|
180 Cmoduletestprovisioning::InsertCharacteristicL), |
|
181 ENTRY( |
|
182 "InsertLinkCharacteristic", |
|
183 Cmoduletestprovisioning::InsertLinkCharacteristicL), |
|
184 ENTRY( |
|
185 "SetandGetCharactername", |
|
186 Cmoduletestprovisioning::SetandGetCharacternameL), |
|
187 ENTRY( |
|
188 "SetDataCharacteristic", |
|
189 Cmoduletestprovisioning::SetDataCharacteristicL), |
|
190 ENTRY( |
|
191 "SetIndexDataCharacteristic", |
|
192 Cmoduletestprovisioning::SetIndexDataCharacteristicL), |
|
193 ENTRY( |
|
194 "DeleteAllDataCharacteristic", |
|
195 Cmoduletestprovisioning::DeleteAllDataCharacteristicL), |
|
196 ENTRY( |
|
197 "GetParamValuecharactristic", |
|
198 Cmoduletestprovisioning::GetParamValuecharactristicL), |
|
199 ENTRY("Accesspoint", |
|
200 Cmoduletestprovisioning::AccesspointL), |
|
201 ENTRY("ReadBuf", Cmoduletestprovisioning::ReadHBufCL), |
|
202 ENTRY("CheckURI", Cmoduletestprovisioning::CheckURI), |
|
203 ENTRY("CheckIPV6", Cmoduletestprovisioning::CheckIPV6), |
|
204 ENTRY("CheckIPV4", Cmoduletestprovisioning::CheckIPV4), |
|
205 ENTRY("CWPAdapter", |
|
206 Cmoduletestprovisioning::CWPAdapterL), |
|
207 ENTRY("DeleteContextData", |
|
208 Cmoduletestprovisioning::DeleteContextDataL), |
|
209 ENTRY("ContextExistsForUid", |
|
210 Cmoduletestprovisioning::ContextExistsForUidL), |
|
211 ENTRY("ContextExistsForTPS", |
|
212 Cmoduletestprovisioning::ContextExistsForTPSL), |
|
213 ENTRY("ExternparamL", |
|
214 Cmoduletestprovisioning::ExternparamL), |
|
215 ENTRY( |
|
216 "RegisterContextObserver", |
|
217 Cmoduletestprovisioning::RegisterContextObserverL), |
|
218 ENTRY( |
|
219 "UnRegisterContextObserver", |
|
220 Cmoduletestprovisioning::UnRegisterContextObserverL), |
|
221 ENTRY("SetAPDetails", |
|
222 Cmoduletestprovisioning::SetAPDetailsL), |
|
223 ENTRY("GetAPID", Cmoduletestprovisioning::GetAPIDL), |
|
224 }; |
|
225 |
|
226 const TInt count = sizeof(KFunctions) / sizeof(TStifFunctionInfo); |
|
227 |
|
228 return RunInternalL(KFunctions, count, aItem); |
|
229 |
|
230 } |
|
231 |
|
232 // ----------------------------------------------------------------------------- |
|
233 // Cmoduletestprovisioning::CreateandDeleteL |
|
234 // Example test method function. |
|
235 // (other items were commented in a header). |
|
236 // ----------------------------------------------------------------------------- |
|
237 // |
|
238 TInt Cmoduletestprovisioning::CreateandDeleteL() |
|
239 { |
|
240 CWPEngine* engine = CWPEngine::NewLC(); |
|
241 CleanupStack::PopAndDestroy(); |
|
242 return KErrNone; |
|
243 } |
|
244 |
|
245 // ----------------------------------------------------------------------------- |
|
246 // Cmoduletestprovisioning::CreateandDeleteNewL |
|
247 // Example test method function. |
|
248 // (other items were commented in a header). |
|
249 // ----------------------------------------------------------------------------- |
|
250 // |
|
251 TInt Cmoduletestprovisioning::CreateandDeleteNewL() |
|
252 { |
|
253 CWPEngine* engine = CWPEngine::NewL(); |
|
254 delete engine; |
|
255 return KErrNone; |
|
256 } |
|
257 |
|
258 // ----------------------------------------------------------------------------- |
|
259 // Cmoduletestprovisioning::SetUpEngineL |
|
260 // Example test method function. |
|
261 // (other items were commented in a header). |
|
262 // ----------------------------------------------------------------------------- |
|
263 // |
|
264 void Cmoduletestprovisioning::SetUpEngineL() |
|
265 { |
|
266 iEngine = CWPEngine::NewL(); |
|
267 } |
|
268 |
|
269 // ----------------------------------------------------------------------------- |
|
270 // Cmoduletestprovisioning::ImportDocumentL |
|
271 // Example test method function. |
|
272 // (other items were commented in a header). |
|
273 // ----------------------------------------------------------------------------- |
|
274 // |
|
275 TInt Cmoduletestprovisioning::ImportDocumentL(CStifItemParser& aItem) |
|
276 { |
|
277 TPtrC string; |
|
278 TInt error = aItem.GetNextString(string); |
|
279 if (error != KErrNone) |
|
280 { |
|
281 return error; |
|
282 |
|
283 } |
|
284 HBufC8* buf8 = GetfilecontentsL(string); |
|
285 TPtr8 buf8Ptr = buf8->Des(); |
|
286 |
|
287 CWPEngine* engine = CWPEngine::NewLC(); |
|
288 TRAPD(err, engine->ImportDocumentL(buf8Ptr)); |
|
289 |
|
290 CleanupStack::PopAndDestroy();//engine |
|
291 delete buf8;//buf |
|
292 |
|
293 if (err == KErrNone) |
|
294 return KErrNone; |
|
295 |
|
296 else |
|
297 return err; |
|
298 |
|
299 } |
|
300 // ----------------------------------------------------------------------------- |
|
301 // Cmoduletestprovisioning::CreateandDeleteL |
|
302 // Example test method function. |
|
303 // (other items were commented in a header). |
|
304 // ----------------------------------------------------------------------------- |
|
305 // |
|
306 TInt Cmoduletestprovisioning::PopulateL() |
|
307 { |
|
308 SetUpEngineL(); |
|
309 TRAPD(err, iEngine->PopulateL()); |
|
310 |
|
311 if (err != KErrNone) |
|
312 return err; |
|
313 |
|
314 else |
|
315 return KErrNone; |
|
316 } |
|
317 // ----------------------------------------------------------------------------- |
|
318 // Cmoduletestprovisioning::ImportL |
|
319 // Example test method function. |
|
320 // (other items were commented in a header). |
|
321 // ----------------------------------------------------------------------------- |
|
322 // |
|
323 |
|
324 TInt Cmoduletestprovisioning::ImportL(CStifItemParser& aItem) |
|
325 { |
|
326 TPtrC string; |
|
327 |
|
328 TInt error = aItem.GetNextString(string); |
|
329 if (error != KErrNone) |
|
330 { |
|
331 return error; |
|
332 |
|
333 } |
|
334 |
|
335 HBufC8 *buf8 = GetfilecontentsL(string); |
|
336 TPtr8 buf8Ptr = buf8->Des(); |
|
337 |
|
338 iEngine = CWPEngine::NewL(); |
|
339 TRAPD(err, iEngine->ImportDocumentL(buf8Ptr)); |
|
340 |
|
341 delete buf8; |
|
342 if (err != KErrNone) |
|
343 return err; |
|
344 else |
|
345 return KErrNone; |
|
346 } |
|
347 |
|
348 // ----------------------------------------------------------------------------- |
|
349 // Cmoduletestprovisioning::ItemCountL |
|
350 // Example test method function. |
|
351 // (other items were commented in a header). |
|
352 // ----------------------------------------------------------------------------- |
|
353 // |
|
354 |
|
355 TInt Cmoduletestprovisioning::ItemCountL(CStifItemParser& aItem) |
|
356 { |
|
357 TInt err = ImportL(aItem); |
|
358 |
|
359 TRAPD(err1, iEngine->PopulateL()); |
|
360 |
|
361 if (err1 != KErrNone || err != KErrNone) |
|
362 return err1; |
|
363 |
|
364 TInt count = iEngine->ItemCount(); |
|
365 |
|
366 if (count == 0) |
|
367 { |
|
368 |
|
369 return KErrGeneral; |
|
370 } |
|
371 else |
|
372 { |
|
373 return KErrNone; |
|
374 } |
|
375 } |
|
376 |
|
377 // ----------------------------------------------------------------------------- |
|
378 // Cmoduletestprovisioning::SaveL |
|
379 // Example test method function. |
|
380 // (other items were commented in a header). |
|
381 // ----------------------------------------------------------------------------- |
|
382 // |
|
383 |
|
384 TInt Cmoduletestprovisioning::SaveL(CStifItemParser& aItem) |
|
385 { |
|
386 |
|
387 TInt err = ImportL(aItem); |
|
388 TBool flag = ETrue; |
|
389 TInt errSave = KErrNone; |
|
390 |
|
391 TRAPD(err1, iEngine->PopulateL()); |
|
392 |
|
393 if (err1 != KErrNone || err != KErrNone) |
|
394 { |
|
395 return err1; |
|
396 } |
|
397 |
|
398 TInt count = iEngine->ItemCount(); |
|
399 |
|
400 for (TInt i = 0; i < count; i++) |
|
401 { |
|
402 TRAP(errSave, iEngine->SaveL(i)); |
|
403 if (errSave != KErrNone) |
|
404 { |
|
405 |
|
406 flag = EFalse; |
|
407 break; |
|
408 } |
|
409 } |
|
410 |
|
411 if (flag == EFalse) |
|
412 { |
|
413 |
|
414 return errSave; |
|
415 } |
|
416 else |
|
417 { |
|
418 return KErrNone; |
|
419 } |
|
420 |
|
421 } |
|
422 |
|
423 // ----------------------------------------------------------------------------- |
|
424 // Cmoduletestprovisioning::SummaryTitleandTextL |
|
425 // Example test method function. |
|
426 // (other items were commented in a header). |
|
427 // ----------------------------------------------------------------------------- |
|
428 // |
|
429 |
|
430 TInt Cmoduletestprovisioning::SummaryTitleandTextL(CStifItemParser& aItem) |
|
431 { |
|
432 TInt err = ImportL(aItem); |
|
433 |
|
434 TRAPD(err1, iEngine->PopulateL()); |
|
435 |
|
436 if (err1 != KErrNone || err != KErrNone) |
|
437 { |
|
438 return err1; |
|
439 } |
|
440 |
|
441 TInt count = iEngine->ItemCount(); |
|
442 |
|
443 for (TInt i = 0; i < count; i++) |
|
444 { |
|
445 TBuf<30> ibuf1(iEngine->SummaryTitle(i)); |
|
446 TBuf<30> ibuf2(iEngine->SummaryText(i)); |
|
447 TestModuleIf().Printf(i, ibuf1, ibuf2); |
|
448 |
|
449 } |
|
450 |
|
451 return KErrNone; |
|
452 } |
|
453 |
|
454 // ----------------------------------------------------------------------------- |
|
455 // Cmoduletestprovisioning::InternAndExternL |
|
456 // Example test method function. |
|
457 // (other items were commented in a header). |
|
458 // ----------------------------------------------------------------------------- |
|
459 // |
|
460 |
|
461 TInt Cmoduletestprovisioning::InternAndExternL(CStifItemParser& aItem) |
|
462 { |
|
463 |
|
464 CStreamStore* store = CBufStore::NewLC(5000); |
|
465 TBuf8<1000> buf1; |
|
466 TInt err = ImportL(aItem); |
|
467 RStoreWriteStream writeStream; |
|
468 TStreamId id(writeStream.CreateLC(*store)); |
|
469 |
|
470 iEngine->ExternalizeL(writeStream); |
|
471 writeStream.CommitL(); |
|
472 CleanupStack::PopAndDestroy(); |
|
473 |
|
474 RStoreReadStream instream; |
|
475 instream.OpenLC(*store, id); |
|
476 |
|
477 iEngine->InternalizeL(instream); |
|
478 |
|
479 CleanupStack::PopAndDestroy();//instream |
|
480 CleanupStack::PopAndDestroy();//store |
|
481 |
|
482 return KErrNone; |
|
483 |
|
484 } |
|
485 |
|
486 // ----------------------------------------------------------------------------- |
|
487 // Cmoduletestprovisioning::SetAsDefaultL |
|
488 // Example test method function. |
|
489 // (other items were commented in a header). |
|
490 // ----------------------------------------------------------------------------- |
|
491 // |
|
492 TInt Cmoduletestprovisioning::SetAsDefaultL(CStifItemParser& aItem) |
|
493 { |
|
494 |
|
495 TInt err = ImportL(aItem); |
|
496 |
|
497 TRAPD(err1, iEngine->PopulateL()); |
|
498 |
|
499 if (err1 != KErrNone || err != KErrNone) |
|
500 { |
|
501 return err1; |
|
502 } |
|
503 |
|
504 TInt count = iEngine->ItemCount(); |
|
505 |
|
506 for (TInt i = 0; i < count; i++) |
|
507 { |
|
508 |
|
509 TRAPD(errSave, iEngine->SaveL(i)); |
|
510 if (errSave == KErrNone) |
|
511 { |
|
512 |
|
513 if (iEngine->CanSetAsDefault(i)) |
|
514 { |
|
515 TRAPD(errdefset, iEngine->SetAsDefaultL(i)); |
|
516 if (errdefset) |
|
517 { |
|
518 return errdefset; |
|
519 } |
|
520 } |
|
521 |
|
522 } |
|
523 |
|
524 else |
|
525 { |
|
526 return errSave; |
|
527 } |
|
528 } |
|
529 |
|
530 return KErrNone; |
|
531 |
|
532 } |
|
533 |
|
534 // ----------------------------------------------------------------------------- |
|
535 // Cmoduletestprovisioning::StoreAndRestoreL |
|
536 // Example test method function. |
|
537 // (other items were commented in a header). |
|
538 // ----------------------------------------------------------------------------- |
|
539 // |
|
540 |
|
541 TInt Cmoduletestprovisioning::StoreAndRestoreL(CStifItemParser& aItem) |
|
542 { |
|
543 |
|
544 TInt err = ImportL(aItem); |
|
545 CStreamStore* store = CBufStore::NewLC(5000); |
|
546 TStreamId id(iEngine->StoreL(*store)); |
|
547 iEngine->RestoreL(*store, id); |
|
548 CleanupStack::PopAndDestroy(); |
|
549 |
|
550 if (err != KErrNone) |
|
551 return err; |
|
552 else |
|
553 return KErrNone; |
|
554 |
|
555 } |
|
556 |
|
557 // ----------------------------------------------------------------------------- |
|
558 // Cmoduletestprovisioning::DetailsL |
|
559 // Example test method function. |
|
560 // (other items were commented in a header). |
|
561 // ----------------------------------------------------------------------------- |
|
562 // |
|
563 |
|
564 TInt Cmoduletestprovisioning::DetailsL(CStifItemParser& aItem) |
|
565 { |
|
566 |
|
567 TInt err = ImportL(aItem); |
|
568 |
|
569 TRAPD(err1, iEngine->PopulateL()); |
|
570 |
|
571 if (err1 != KErrNone || err != KErrNone) |
|
572 { |
|
573 return err1; |
|
574 } |
|
575 |
|
576 MWPPairVisitor *visitor = NULL; |
|
577 |
|
578 TInt error = iEngine->DetailsL(0, *visitor); |
|
579 |
|
580 if (error == KErrNotSupported) |
|
581 return KErrNone; |
|
582 else |
|
583 return KErrNone; |
|
584 |
|
585 } |
|
586 |
|
587 // ----------------------------------------------------------------------------- |
|
588 // Cmoduletestprovisioning::CreateContextL |
|
589 // Example test method function. |
|
590 // (other items were commented in a header). |
|
591 // ----------------------------------------------------------------------------- |
|
592 // |
|
593 |
|
594 TInt Cmoduletestprovisioning::CreateContextL(CStifItemParser& aItem) |
|
595 { |
|
596 |
|
597 TBuf<30> tps; |
|
598 |
|
599 _LIT(KProxy, "PROXY_TEST"); |
|
600 _LIT(KTPS, "TPS"); |
|
601 _LIT(KName, "TEST_CASE_CONTEXT"); |
|
602 |
|
603 TBuf<256> proxies(KProxy); |
|
604 TBuf<256> Names(KName); |
|
605 TBuf<256> Tps(KTPS); |
|
606 |
|
607 iProxies->InsertL(0, proxies); |
|
608 |
|
609 iEngine = CWPEngine::NewL(); |
|
610 |
|
611 TUint32 origUid1 = iEngine -> ContextExistsL(Tps); |
|
612 //TRAPD(err,iEngine -> ContextExistsL(Tps)); |
|
613 |
|
614 if (origUid1) |
|
615 { |
|
616 TUint32 contextuid = iEngine -> ContextL(Tps); |
|
617 iEngine -> DeleteContextL(contextuid); |
|
618 } |
|
619 |
|
620 TUint32 origUid(iEngine -> CreateContextL(Names, Tps, *iProxies)); |
|
621 |
|
622 return KErrNone; |
|
623 } |
|
624 |
|
625 // ----------------------------------------------------------------------------- |
|
626 // Cmoduletestprovisioning::DeleteContextL |
|
627 // Example test method function. |
|
628 // (other items were commented in a header). |
|
629 // ----------------------------------------------------------------------------- |
|
630 // |
|
631 |
|
632 TInt Cmoduletestprovisioning::DeleteContextL(CStifItemParser& aItem) |
|
633 { |
|
634 |
|
635 TUint32 origUid(ContextcreateL()); |
|
636 |
|
637 iEngine -> DeleteContextL(origUid); |
|
638 |
|
639 return KErrNone; |
|
640 |
|
641 } |
|
642 |
|
643 // ----------------------------------------------------------------------------- |
|
644 // Cmoduletestprovisioning::CreateDataCountL |
|
645 // Example test method function. |
|
646 // (other items were commented in a header). |
|
647 // ----------------------------------------------------------------------------- |
|
648 // |
|
649 |
|
650 TInt Cmoduletestprovisioning::ContextDataCountL() |
|
651 { |
|
652 |
|
653 TUint32 origUid(ContextcreateL()); |
|
654 |
|
655 TInt DataCount = iEngine->ContextDataCountL(origUid); |
|
656 |
|
657 iEngine -> DeleteContextL(origUid); |
|
658 |
|
659 if (DataCount == 0) |
|
660 return KErrNone; |
|
661 else |
|
662 return KErrNone; |
|
663 |
|
664 } |
|
665 |
|
666 // ----------------------------------------------------------------------------- |
|
667 // Cmoduletestprovisioning::ContextL |
|
668 // Example test method function. |
|
669 // (other items were commented in a header). |
|
670 // ----------------------------------------------------------------------------- |
|
671 // |
|
672 |
|
673 TInt Cmoduletestprovisioning::ContextL(CStifItemParser& aItem) |
|
674 { |
|
675 TBuf<30> tps; |
|
676 TPtrC string; |
|
677 TUint32 origUid, retUid; |
|
678 TBool Failed = EFalse; |
|
679 _LIT(KProxy, "PROXY_TEST"); |
|
680 _LIT(KTPS, "TPS"); |
|
681 _LIT(KName, "TEST_CASE_CONTEXT"); |
|
682 TBuf<256> proxiesdata(KProxy); |
|
683 TBuf<256> Names(KName); |
|
684 TBuf<256> Tps(KTPS); |
|
685 CDesC16Array* proxies; |
|
686 proxies = new (ELeave) CDesC16ArrayFlat(1); |
|
687 CleanupStack::PushL(proxies); |
|
688 proxies->InsertL(0, proxiesdata); |
|
689 |
|
690 TInt error = aItem.GetNextString(string); |
|
691 if (error != KErrNone) |
|
692 { |
|
693 return error; |
|
694 |
|
695 } |
|
696 |
|
697 iEngine = CWPEngine::NewL(); |
|
698 |
|
699 if (iEngine -> ContextExistsL(string)) |
|
700 { |
|
701 retUid = iEngine -> ContextL(string); |
|
702 if (retUid == 0) |
|
703 Failed = ETrue; |
|
704 } |
|
705 else |
|
706 { |
|
707 origUid = iEngine -> CreateContextL(Names, Tps, *proxies); |
|
708 |
|
709 //origUid = ContextcreateL(); |
|
710 |
|
711 retUid = iEngine -> ContextL(string); |
|
712 if (retUid != origUid) |
|
713 Failed = ETrue; |
|
714 } |
|
715 |
|
716 CleanupStack::PopAndDestroy(); |
|
717 |
|
718 if (Failed) |
|
719 return KErrGeneral; |
|
720 else |
|
721 return KErrNone; |
|
722 |
|
723 } |
|
724 |
|
725 // ----------------------------------------------------------------------------- |
|
726 // Cmoduletestprovisioning::ContextcreateL |
|
727 // Example test method function. |
|
728 // (other items were commented in a header). |
|
729 // ----------------------------------------------------------------------------- |
|
730 // |
|
731 |
|
732 TUint32 Cmoduletestprovisioning::ContextcreateL() |
|
733 { |
|
734 TBuf<30> tps; |
|
735 TPtrC string; |
|
736 |
|
737 TBuf<256> proxies(KProxy); |
|
738 TBuf<256> Names(KName); |
|
739 TBuf<256> Tps(KTPS); |
|
740 |
|
741 iProxies->InsertL(0, proxies); |
|
742 |
|
743 iEngine = CWPEngine::NewL(); |
|
744 if (iEngine -> ContextExistsL(Tps)) |
|
745 return (iEngine -> ContextL(Tps)); |
|
746 |
|
747 TUint32 origUid(iEngine -> CreateContextL(Names, Tps, *iProxies)); |
|
748 |
|
749 return origUid; |
|
750 } |
|
751 |
|
752 // ----------------------------------------------------------------------------- |
|
753 // Cmoduletestprovisioning::CreateDataCountL |
|
754 // Example test method function. |
|
755 // (other items were commented in a header). |
|
756 // ----------------------------------------------------------------------------- |
|
757 // |
|
758 |
|
759 TInt Cmoduletestprovisioning::ContextUidsL() |
|
760 { |
|
761 |
|
762 TUint32 origUid(ContextcreateL()); |
|
763 |
|
764 CArrayFix<TUint32>* array = iEngine->ContextUidsL(); |
|
765 CleanupStack::PushL(array); |
|
766 |
|
767 TUint32 retrUid(array->At(0)); |
|
768 |
|
769 iEngine -> DeleteContextL(origUid); |
|
770 |
|
771 CleanupStack::PopAndDestroy(); // array |
|
772 |
|
773 |
|
774 if (origUid != retrUid) |
|
775 return KErrGeneral; |
|
776 else |
|
777 return KErrNone; |
|
778 } |
|
779 |
|
780 // ----------------------------------------------------------------------------- |
|
781 // Cmoduletestprovisioning::ContextNameL |
|
782 // Example test method function. |
|
783 // (other items were commented in a header). |
|
784 // ----------------------------------------------------------------------------- |
|
785 // |
|
786 |
|
787 TInt Cmoduletestprovisioning::ContextNameL() |
|
788 { |
|
789 |
|
790 TUint32 origUid(ContextcreateL()); |
|
791 TInt ErrorNum; |
|
792 |
|
793 CArrayFix<TUint32>* array = iEngine->ContextUidsL(); |
|
794 CleanupStack::PushL(array); |
|
795 |
|
796 TUint32 retrUid(array->At(0)); |
|
797 |
|
798 HBufC* name = iEngine->ContextNameL(retrUid); |
|
799 CleanupStack::PushL(name); |
|
800 |
|
801 if (*name == KName) |
|
802 ErrorNum = KErrNone; |
|
803 else |
|
804 ErrorNum = KErrGeneral; |
|
805 |
|
806 CleanupStack::PopAndDestroy(); // name |
|
807 |
|
808 iEngine -> DeleteContextL(origUid); |
|
809 |
|
810 CleanupStack::PopAndDestroy(); // array |
|
811 |
|
812 |
|
813 return ErrorNum; |
|
814 } |
|
815 |
|
816 // ----------------------------------------------------------------------------- |
|
817 // Cmoduletestprovisioning::CreateTPSL |
|
818 // Example test method function. |
|
819 // (other items were commented in a header). |
|
820 // ----------------------------------------------------------------------------- |
|
821 // |
|
822 |
|
823 TInt Cmoduletestprovisioning::ContextTPSL() |
|
824 { |
|
825 |
|
826 TUint32 origUid(ContextcreateL()); |
|
827 TInt ErrorNum; |
|
828 |
|
829 CArrayFix<TUint32>* array = iEngine->ContextUidsL(); |
|
830 CleanupStack::PushL(array); |
|
831 |
|
832 TUint32 retrUid(array->At(0)); |
|
833 |
|
834 HBufC* tps = iEngine->ContextTPSL(retrUid); |
|
835 CleanupStack::PushL(tps); |
|
836 |
|
837 if (*tps == KTPS) |
|
838 ErrorNum = KErrNone; |
|
839 else |
|
840 ErrorNum = KErrGeneral; |
|
841 |
|
842 CleanupStack::PopAndDestroy(); // name |
|
843 |
|
844 iEngine -> DeleteContextL(origUid); |
|
845 |
|
846 CleanupStack::PopAndDestroy(); // array |
|
847 |
|
848 |
|
849 return ErrorNum; |
|
850 } |
|
851 |
|
852 // ----------------------------------------------------------------------------- |
|
853 // Cmoduletestprovisioning::ContextProxiesL |
|
854 // Example test method function. |
|
855 // (other items were commented in a header). |
|
856 // ----------------------------------------------------------------------------- |
|
857 // |
|
858 |
|
859 TInt Cmoduletestprovisioning::ContextProxiesL() |
|
860 { |
|
861 |
|
862 TUint32 origUid(ContextcreateL()); |
|
863 TInt ErrorNum; |
|
864 |
|
865 CArrayFix<TUint32>* array = iEngine->ContextUidsL(); |
|
866 CleanupStack::PushL(array); |
|
867 |
|
868 TUint32 retrUid(array->At(0)); |
|
869 |
|
870 CDesCArray *proxies = iEngine->ContextProxiesL(retrUid); |
|
871 CleanupStack::PushL(proxies); |
|
872 |
|
873 if (proxies->MdcaPoint(0) == KProxy) |
|
874 ErrorNum = KErrNone; |
|
875 else |
|
876 ErrorNum = KErrGeneral; |
|
877 |
|
878 CleanupStack::PopAndDestroy(); // name |
|
879 |
|
880 iEngine -> DeleteContextL(origUid); |
|
881 |
|
882 CleanupStack::PopAndDestroy(); // array |
|
883 |
|
884 return ErrorNum; |
|
885 } |
|
886 |
|
887 // ----------------------------------------------------------------------------- |
|
888 // Cmoduletestprovisioning::GetfilecontentsL |
|
889 // Example test method function. |
|
890 // (other items were commented in a header). |
|
891 // ----------------------------------------------------------------------------- |
|
892 // |
|
893 HBufC8* Cmoduletestprovisioning::GetfilecontentsL(TPtrC aString) |
|
894 { |
|
895 RFs fs; |
|
896 User::LeaveIfError(fs.Connect()); |
|
897 CleanupClosePushL(fs); |
|
898 RFile file; |
|
899 |
|
900 TInt err = file.Open(fs, aString, EFileShareAny); |
|
901 if (err != KErrNone) |
|
902 { |
|
903 CleanupStack::PopAndDestroy();//fs |
|
904 User::LeaveIfError(err); |
|
905 } |
|
906 |
|
907 CleanupClosePushL(file); |
|
908 TInt size; |
|
909 file.Size(size); |
|
910 HBufC8 *buf8 = HBufC8::NewLC(size); |
|
911 TPtr8 buf8Ptr = buf8->Des(); |
|
912 file.Read(buf8Ptr); |
|
913 CleanupStack::Pop(buf8); |
|
914 CleanupStack::PopAndDestroy();//file |
|
915 CleanupStack::PopAndDestroy();//fs |
|
916 return buf8; |
|
917 } |
|
918 |
|
919 // ----------------------------------------------------------------------------- |
|
920 // Cmoduletestprovisioning::ExampleL |
|
921 // Example test method function. |
|
922 // (other items were commented in a header). |
|
923 // ----------------------------------------------------------------------------- |
|
924 // |
|
925 TInt Cmoduletestprovisioning::ExampleL(CStifItemParser& aItem) |
|
926 { |
|
927 |
|
928 // Print to UI |
|
929 _LIT(Ktestengineapis, "testengineapis"); |
|
930 _LIT(KExample, "In Example"); |
|
931 TestModuleIf().Printf(0, Ktestengineapis, KExample); |
|
932 // Print to log file |
|
933 iLog->Log(KExample); |
|
934 |
|
935 TInt i = 0; |
|
936 TPtrC string; |
|
937 _LIT(KParam, "Param[%i]: %S"); |
|
938 while (aItem.GetNextString(string) == KErrNone) |
|
939 { |
|
940 TestModuleIf().Printf(i, Ktestengineapis, KParam, i, &string); |
|
941 i++; |
|
942 } |
|
943 |
|
944 return KErrNone; |
|
945 |
|
946 } |
|
947 |
|
948 // ----------------------------------------------------------------------------- |
|
949 // Cmoduletestprovisioning::ExampleL |
|
950 // Example test method function. |
|
951 // (other items were commented in a header). |
|
952 // ----------------------------------------------------------------------------- |
|
953 // |
|
954 TInt Cmoduletestprovisioning::BuilderL() |
|
955 { |
|
956 MWPBuilder* builder; |
|
957 CWPEngine* engine = CWPEngine::NewLC(); |
|
958 *builder = engine -> Builder(); |
|
959 CleanupStack::PopAndDestroy();//fs |
|
960 return KErrNone; |
|
961 |
|
962 } |
|
963 |
|
964 // ----------------------------------------------------------------------------- |
|
965 // Cmoduletestprovisioning::ExampleL |
|
966 // Example test method function. |
|
967 // (other items were commented in a header). |
|
968 // ----------------------------------------------------------------------------- |
|
969 // |
|
970 TInt Cmoduletestprovisioning::CurrentContextL() |
|
971 { |
|
972 TUint32 contextuid = ContextcreateL(); |
|
973 |
|
974 iEngine->SetCurrentContextL(contextuid); |
|
975 |
|
976 TUint32 retUid = iEngine->CurrentContextL(); |
|
977 |
|
978 if (contextuid == retUid) |
|
979 { |
|
980 return KErrNone; |
|
981 } |
|
982 else |
|
983 { |
|
984 return KErrGeneral; |
|
985 } |
|
986 } |
|
987 |
|
988 // ----------------------------------------------------------------------------- |
|
989 // Cmoduletestprovisioning::CreateparameterNewL |
|
990 // Example test method function. |
|
991 // (other items were commented in a header). |
|
992 // ----------------------------------------------------------------------------- |
|
993 // |
|
994 TInt Cmoduletestprovisioning::CreateparameterNewL() |
|
995 { |
|
996 CWPParameter* param = CWPParameter::NewL(); |
|
997 delete param; |
|
998 return KErrNone; |
|
999 } |
|
1000 |
|
1001 // ----------------------------------------------------------------------------- |
|
1002 // Cmoduletestprovisioning::CreateparameterNewL |
|
1003 // Example test method function. |
|
1004 // (other items were commented in a header). |
|
1005 // ----------------------------------------------------------------------------- |
|
1006 // |
|
1007 TInt Cmoduletestprovisioning::CreateparameterNewLC() |
|
1008 { |
|
1009 CWPParameter* param = CWPParameter::NewLC(); |
|
1010 CleanupStack::PopAndDestroy(); |
|
1011 return KErrNone; |
|
1012 |
|
1013 } |
|
1014 |
|
1015 // ----------------------------------------------------------------------------- |
|
1016 // Cmoduletestprovisioning::CSetandGetparamID |
|
1017 // Example test method function. |
|
1018 // (other items were commented in a header). |
|
1019 // ----------------------------------------------------------------------------- |
|
1020 // |
|
1021 TInt Cmoduletestprovisioning::CSetandGetparamIDL() |
|
1022 { |
|
1023 CWPParameter* param = CWPParameter::NewLC(); |
|
1024 TInt aID = 10; |
|
1025 param -> SetID(aID); |
|
1026 TInt getID = param ->ID(); |
|
1027 if (aID != getID) |
|
1028 { |
|
1029 CleanupStack::PopAndDestroy(); |
|
1030 return KErrGeneral; |
|
1031 } |
|
1032 else |
|
1033 { |
|
1034 CleanupStack::PopAndDestroy(); |
|
1035 return KErrNone; |
|
1036 |
|
1037 } |
|
1038 |
|
1039 } |
|
1040 |
|
1041 // ----------------------------------------------------------------------------- |
|
1042 // Cmoduletestprovisioning::CSetandGetparamName |
|
1043 // Example test method function. |
|
1044 // (other items were commented in a header). |
|
1045 // ----------------------------------------------------------------------------- |
|
1046 // |
|
1047 TInt Cmoduletestprovisioning::CSetandGetparamNameL() |
|
1048 { |
|
1049 CWPParameter* param = CWPParameter::NewLC(); |
|
1050 _LIT(KParamName, "name"); |
|
1051 TBufC<10> paramname(KParamName); |
|
1052 param -> SetNameL(paramname); |
|
1053 TBufC<10> getparamname; |
|
1054 getparamname = param -> Name(); |
|
1055 |
|
1056 CWPParameter* param1 = CWPParameter::NewLC(); |
|
1057 |
|
1058 TBufC<10> getparamname1; |
|
1059 getparamname1 = param1 -> Name(); |
|
1060 |
|
1061 if (getparamname.Compare(KParamName) && getparamname1.Compare(KNullDesC)) |
|
1062 { |
|
1063 CleanupStack::PopAndDestroy(); |
|
1064 CleanupStack::PopAndDestroy(); |
|
1065 return KErrGeneral; |
|
1066 } |
|
1067 else |
|
1068 { |
|
1069 CleanupStack::PopAndDestroy(); |
|
1070 CleanupStack::PopAndDestroy(); |
|
1071 return KErrNone; |
|
1072 |
|
1073 } |
|
1074 |
|
1075 } |
|
1076 |
|
1077 // ----------------------------------------------------------------------------- |
|
1078 // Cmoduletestprovisioning::CSetandGetparamName |
|
1079 // Example test method function. |
|
1080 // (other items were commented in a header). |
|
1081 // ----------------------------------------------------------------------------- |
|
1082 // |
|
1083 TInt Cmoduletestprovisioning::CSetandGetparamValueL() |
|
1084 { |
|
1085 CWPParameter* param = CWPParameter::NewLC(); |
|
1086 _LIT(KParamValue, "Value"); |
|
1087 TBufC<10> paramvalue(KParamValue); |
|
1088 param -> SetValueL(paramvalue); |
|
1089 TBufC<10> getparamvalue; |
|
1090 getparamvalue = param -> Value(); |
|
1091 |
|
1092 CWPParameter* param1 = CWPParameter::NewLC(); |
|
1093 |
|
1094 TBufC<10> getparamvalue1; |
|
1095 getparamvalue1 = param1 -> Value(); |
|
1096 |
|
1097 if (getparamvalue.Compare(KParamValue) && getparamvalue1.Compare( |
|
1098 KNullDesC)) |
|
1099 { |
|
1100 CleanupStack::PopAndDestroy(); |
|
1101 CleanupStack::PopAndDestroy(); |
|
1102 return KErrGeneral; |
|
1103 } |
|
1104 else |
|
1105 { |
|
1106 CleanupStack::PopAndDestroy(); |
|
1107 CleanupStack::PopAndDestroy(); |
|
1108 return KErrNone; |
|
1109 |
|
1110 } |
|
1111 |
|
1112 } |
|
1113 |
|
1114 // ----------------------------------------------------------------------------- |
|
1115 // Cmoduletestprovisioning::CSetandGetparamName |
|
1116 // Example test method function. |
|
1117 // (other items were commented in a header). |
|
1118 // ----------------------------------------------------------------------------- |
|
1119 // |
|
1120 TInt Cmoduletestprovisioning::InternAndExternparamL() |
|
1121 { |
|
1122 |
|
1123 CStreamStore* store = CBufStore::NewLC(5000); |
|
1124 RStoreWriteStream aStream; |
|
1125 TStreamId id(aStream.CreateLC(*store)); |
|
1126 |
|
1127 TInt aID = 10; |
|
1128 _LIT(KParamName, "name"); |
|
1129 _LIT(KParamValue, "Value"); |
|
1130 TBufC<10> paramname(KParamName); |
|
1131 TBufC<10> paramvalue(KParamValue); |
|
1132 const TInt KBitsPerWord = 16; |
|
1133 |
|
1134 HBufC* pname = paramname.AllocL(); |
|
1135 HBufC* pvalue = paramvalue.AllocL(); |
|
1136 |
|
1137 //RWriteStream aStream; |
|
1138 |
|
1139 aStream.WriteInt32L(aID); |
|
1140 |
|
1141 // Lengths packed into one 32-bit word for compatibility |
|
1142 TUint length(0); |
|
1143 if (pvalue) |
|
1144 { |
|
1145 length += pvalue->Length(); |
|
1146 } |
|
1147 if (pname) |
|
1148 { |
|
1149 length += pname->Length() << KBitsPerWord; |
|
1150 } |
|
1151 |
|
1152 aStream.WriteUint32L(length); |
|
1153 |
|
1154 aStream << *pvalue; |
|
1155 |
|
1156 if (pname) |
|
1157 { |
|
1158 aStream << *pname; |
|
1159 } |
|
1160 |
|
1161 aStream.CommitL(); |
|
1162 CleanupStack::PopAndDestroy(); |
|
1163 |
|
1164 RStoreReadStream aReadstream; |
|
1165 |
|
1166 aReadstream.OpenLC(*store, id); |
|
1167 CWPParameter* param = CWPParameter::NewLC(); |
|
1168 |
|
1169 //param->ExternalizeL( aStream ); |
|
1170 |
|
1171 //RReadStream aReadstream; |
|
1172 param -> InternalizeL(aReadstream); |
|
1173 |
|
1174 TBufC<10> getparamvalue; |
|
1175 getparamvalue = param -> Value(); |
|
1176 |
|
1177 TBufC<10> getparamname; |
|
1178 getparamname = param -> Name(); |
|
1179 |
|
1180 TInt getID = param ->ID(); |
|
1181 |
|
1182 if (getparamname.Compare(KParamName) |
|
1183 && getparamvalue.Compare(KParamValue) && getID != aID) |
|
1184 { |
|
1185 CleanupStack::PopAndDestroy(); |
|
1186 CleanupStack::PopAndDestroy(); |
|
1187 CleanupStack::PopAndDestroy(); |
|
1188 delete pname; |
|
1189 delete pvalue; |
|
1190 return KErrGeneral; |
|
1191 } |
|
1192 else |
|
1193 { |
|
1194 CleanupStack::PopAndDestroy(); |
|
1195 CleanupStack::PopAndDestroy(); |
|
1196 CleanupStack::PopAndDestroy(); |
|
1197 delete pname; |
|
1198 delete pvalue; |
|
1199 return KErrNone; |
|
1200 } |
|
1201 |
|
1202 } |
|
1203 |
|
1204 // ----------------------------------------------------------------------------- |
|
1205 // Cmoduletestprovisioning::CSetandGetparamName |
|
1206 // Example test method function. |
|
1207 // (other items were commented in a header). |
|
1208 // ----------------------------------------------------------------------------- |
|
1209 // |
|
1210 TInt Cmoduletestprovisioning::GetparamTypeL() |
|
1211 { |
|
1212 CWPParameter* param = CWPParameter::NewLC(); |
|
1213 TInt type = param->Type(); |
|
1214 if (type == 1) |
|
1215 { |
|
1216 CleanupStack::PopAndDestroy(); |
|
1217 return KErrNone; |
|
1218 } |
|
1219 else |
|
1220 { |
|
1221 CleanupStack::PopAndDestroy(); |
|
1222 return KErrGeneral; |
|
1223 } |
|
1224 |
|
1225 } |
|
1226 |
|
1227 // ----------------------------------------------------------------------------- |
|
1228 // Cmoduletestprovisioning::CSetandGetparamName |
|
1229 // Example test method function. |
|
1230 // (other items were commented in a header). |
|
1231 // ----------------------------------------------------------------------------- |
|
1232 // |
|
1233 TInt Cmoduletestprovisioning::InsertCharacteristicL() |
|
1234 { |
|
1235 |
|
1236 CWPCharacteristic* characteristic = CWPCharacteristic::NewLC(KWPNapDef); |
|
1237 CWPParameter* param = CWPParameter::NewL(); |
|
1238 TRAPD(err, characteristic -> InsertL(param)); |
|
1239 if (err) |
|
1240 { |
|
1241 CleanupStack::PopAndDestroy(); |
|
1242 return KErrGeneral; |
|
1243 } |
|
1244 else |
|
1245 { |
|
1246 CleanupStack::PopAndDestroy(); |
|
1247 return KErrNone; |
|
1248 } |
|
1249 } |
|
1250 |
|
1251 // ----------------------------------------------------------------------------- |
|
1252 // Cmoduletestprovisioning::CSetandGetparamName |
|
1253 // Example test method function. |
|
1254 // (other items were commented in a header). |
|
1255 // ----------------------------------------------------------------------------- |
|
1256 // |
|
1257 TInt Cmoduletestprovisioning::InsertLinkCharacteristicL() |
|
1258 { |
|
1259 |
|
1260 CWPCharacteristic* characteristic = CWPCharacteristic::NewLC(KWPNapDef); |
|
1261 CWPCharacteristic* element = CWPCharacteristic::NewL(KWPPxLogical); |
|
1262 TRAPD(err, characteristic -> InsertLinkL(*element)); |
|
1263 if (err) |
|
1264 { |
|
1265 CleanupStack::PopAndDestroy(); |
|
1266 return KErrGeneral; |
|
1267 } |
|
1268 else |
|
1269 { |
|
1270 CleanupStack::PopAndDestroy(); |
|
1271 return KErrNone; |
|
1272 } |
|
1273 } |
|
1274 |
|
1275 // ----------------------------------------------------------------------------- |
|
1276 // Cmoduletestprovisioning::CSetandGetparamName |
|
1277 // Example test method function. |
|
1278 // (other items were commented in a header). |
|
1279 // ----------------------------------------------------------------------------- |
|
1280 // |
|
1281 TInt Cmoduletestprovisioning::SetandGetCharacternameL() |
|
1282 { |
|
1283 |
|
1284 CWPCharacteristic* characteristic = CWPCharacteristic::NewLC(KWPNapDef); |
|
1285 _LIT(KCharacterName, "name"); |
|
1286 TBufC<10> charactername(KCharacterName); |
|
1287 characteristic -> SetNameL(charactername); |
|
1288 TBufC<10> getcharactermname; |
|
1289 getcharactermname = characteristic -> Name(); |
|
1290 |
|
1291 if (getcharactermname.Compare(KCharacterName)) |
|
1292 { |
|
1293 CleanupStack::PopAndDestroy(); |
|
1294 return KErrGeneral; |
|
1295 } |
|
1296 else |
|
1297 { |
|
1298 CleanupStack::PopAndDestroy(); |
|
1299 return KErrNone; |
|
1300 |
|
1301 } |
|
1302 } |
|
1303 |
|
1304 // ----------------------------------------------------------------------------- |
|
1305 // Cmoduletestprovisioning::CSetandGetparamName |
|
1306 // Example test method function. |
|
1307 // (other items were commented in a header). |
|
1308 // ----------------------------------------------------------------------------- |
|
1309 // |
|
1310 TInt Cmoduletestprovisioning::SetDataCharacteristicL() |
|
1311 { |
|
1312 CWPCharacteristic* characteristic = CWPCharacteristic::NewLC(KWPNapDef); |
|
1313 _LIT8(KCharacterdata, "data"); |
|
1314 TBufC8<10> characterdata(KCharacterdata); |
|
1315 characteristic -> SetDataL(characterdata); |
|
1316 TBufC8<10> getcharactermdata; |
|
1317 getcharactermdata = characteristic -> Data(); |
|
1318 |
|
1319 if (getcharactermdata.Compare(KCharacterdata)) |
|
1320 { |
|
1321 CleanupStack::PopAndDestroy(); |
|
1322 return KErrGeneral; |
|
1323 } |
|
1324 else |
|
1325 { |
|
1326 CleanupStack::PopAndDestroy(); |
|
1327 return KErrNone; |
|
1328 |
|
1329 } |
|
1330 } |
|
1331 |
|
1332 // ----------------------------------------------------------------------------- |
|
1333 // Cmoduletestprovisioning::CSetandGetparamName |
|
1334 // Example test method function. |
|
1335 // (other items were commented in a header). |
|
1336 // ----------------------------------------------------------------------------- |
|
1337 // |
|
1338 TInt Cmoduletestprovisioning::SetIndexDataCharacteristicL() |
|
1339 { |
|
1340 |
|
1341 CWPCharacteristic* characteristic = CWPCharacteristic::NewLC(KWPNapDef); |
|
1342 _LIT8(KCharacterdata1, "data"); |
|
1343 _LIT8(KCharacterdata2, "Ashwin"); |
|
1344 _LIT8(KCharacterdata3, "Harsha"); |
|
1345 TBufC8<10> characterdata1(KCharacterdata1); |
|
1346 characteristic -> SetDataL(characterdata1); |
|
1347 |
|
1348 TBufC8<10> characterdata2(KCharacterdata2); |
|
1349 characteristic -> SetDataL(characterdata2, 1); |
|
1350 |
|
1351 TBufC8<10> characterdata3(KCharacterdata3); |
|
1352 characteristic -> SetDataL(characterdata3, 2); |
|
1353 |
|
1354 TBufC8<10> getcharactermdata1; |
|
1355 getcharactermdata1 = characteristic -> Data(); |
|
1356 |
|
1357 TBufC8<10> getcharactermdata2; |
|
1358 getcharactermdata2 = characteristic -> Data(1); |
|
1359 |
|
1360 TBufC8<10> getcharactermdata3; |
|
1361 getcharactermdata3 = characteristic -> Data(2); |
|
1362 |
|
1363 if (getcharactermdata1.Compare(KCharacterdata1) |
|
1364 && getcharactermdata2.Compare(KCharacterdata2) |
|
1365 && getcharactermdata3.Compare(KCharacterdata3)) |
|
1366 { |
|
1367 CleanupStack::PopAndDestroy(); |
|
1368 return KErrGeneral; |
|
1369 } |
|
1370 else |
|
1371 { |
|
1372 CleanupStack::PopAndDestroy(); |
|
1373 return KErrNone; |
|
1374 |
|
1375 } |
|
1376 |
|
1377 } |
|
1378 |
|
1379 // ----------------------------------------------------------------------------- |
|
1380 // Cmoduletestprovisioning::CSetandGetparamName |
|
1381 // Example test method function. |
|
1382 // (other items were commented in a header). |
|
1383 // ----------------------------------------------------------------------------- |
|
1384 // |
|
1385 TInt Cmoduletestprovisioning::DeleteAllDataCharacteristicL() |
|
1386 { |
|
1387 |
|
1388 CWPCharacteristic* characteristic = CWPCharacteristic::NewLC(KWPNapDef); |
|
1389 _LIT8(KCharacterdata1, "data"); |
|
1390 _LIT8(KCharacterdata2, "Ashwin"); |
|
1391 _LIT8(KCharacterdata3, "Harsha"); |
|
1392 TBufC8<10> characterdata1(KCharacterdata1); |
|
1393 characteristic -> SetDataL(characterdata1); |
|
1394 |
|
1395 TBufC8<10> characterdata2(KCharacterdata2); |
|
1396 characteristic -> SetDataL(characterdata2, 1); |
|
1397 |
|
1398 TBufC8<10> characterdata3(KCharacterdata3); |
|
1399 characteristic -> SetDataL(characterdata3, 2); |
|
1400 |
|
1401 characteristic -> DeleteAllData(); |
|
1402 |
|
1403 TBufC8<10> getcharactermdata1; |
|
1404 getcharactermdata1 = characteristic -> Data(); |
|
1405 |
|
1406 TBufC8<10> getcharactermdata2; |
|
1407 getcharactermdata2 = characteristic -> Data(1); |
|
1408 |
|
1409 TBufC8<10> getcharactermdata3; |
|
1410 getcharactermdata3 = characteristic -> Data(2); |
|
1411 |
|
1412 if (getcharactermdata1.Compare(KNullDesC8) && getcharactermdata2.Compare( |
|
1413 KNullDesC8) && getcharactermdata3.Compare(KNullDesC8)) |
|
1414 { |
|
1415 CleanupStack::PopAndDestroy(); |
|
1416 return KErrGeneral; |
|
1417 } |
|
1418 else |
|
1419 { |
|
1420 CleanupStack::PopAndDestroy(); |
|
1421 return KErrNone; |
|
1422 |
|
1423 } |
|
1424 |
|
1425 } |
|
1426 |
|
1427 // ----------------------------------------------------------------------------- |
|
1428 // Cmoduletestprovisioning::CSetandGetparamName |
|
1429 // Example test method function. |
|
1430 // (other items were commented in a header). |
|
1431 // ----------------------------------------------------------------------------- |
|
1432 // |
|
1433 TInt Cmoduletestprovisioning::GetParamValuecharactristicL() |
|
1434 { |
|
1435 CWPCharacteristic* characteristic = CWPCharacteristic::NewLC(KWPNapDef); |
|
1436 |
|
1437 CWPParameter* param = CWPParameter::NewL(); |
|
1438 TInt aID = 10; |
|
1439 param -> SetID(aID); |
|
1440 _LIT(KParamValue, "Value"); |
|
1441 TBufC<10> paramvalue(KParamValue); |
|
1442 param -> SetValueL(paramvalue); |
|
1443 |
|
1444 characteristic -> InsertL(param); |
|
1445 CArrayFix<TPtrC>* aParameters = new (ELeave) CArrayFixFlat<TPtrC> (1); |
|
1446 CleanupStack::PushL(aParameters); |
|
1447 |
|
1448 characteristic->ParameterL(aID, aParameters); |
|
1449 |
|
1450 if (aParameters->At(0) == paramvalue) |
|
1451 { |
|
1452 CleanupStack::PopAndDestroy(); |
|
1453 CleanupStack::PopAndDestroy(); |
|
1454 return KErrNone; |
|
1455 } |
|
1456 else |
|
1457 { |
|
1458 CleanupStack::PopAndDestroy(); |
|
1459 CleanupStack::PopAndDestroy(); |
|
1460 return KErrGeneral; |
|
1461 } |
|
1462 } |
|
1463 |
|
1464 // ----------------------------------------------------------------------------- |
|
1465 // Cmoduletestprovisioning::CSetandGetparamName |
|
1466 // Example test method function. |
|
1467 // (other items were commented in a header). |
|
1468 // ----------------------------------------------------------------------------- |
|
1469 // |
|
1470 TInt Cmoduletestprovisioning::AccesspointL() |
|
1471 { |
|
1472 CWPCharacteristic* characteristic = CWPCharacteristic::NewLC(KWPNapDef); |
|
1473 CWPCharacteristic* characteristic1 = WPAdapterUtil::AccesspointL( |
|
1474 *characteristic); |
|
1475 |
|
1476 CleanupStack::PopAndDestroy(); |
|
1477 return KErrNone; |
|
1478 |
|
1479 } |
|
1480 |
|
1481 // ----------------------------------------------------------------------------- |
|
1482 // Cmoduletestprovisioning::ReadBufC |
|
1483 // Example test method function. |
|
1484 // (other items were commented in a header). |
|
1485 // ----------------------------------------------------------------------------- |
|
1486 // |
|
1487 TInt Cmoduletestprovisioning::ReadHBufCL(CStifItemParser& aItem) |
|
1488 { |
|
1489 |
|
1490 #if ( defined (__WINS__) || defined (__WINSCW) ) // this different on hw |
|
1491 _LIT( KWVAdapterName, "WPWVAdapterResource" ); |
|
1492 #else |
|
1493 _LIT(KWVAdapterName, "WPWVAdapter"); |
|
1494 #endif |
|
1495 |
|
1496 _LIT(KDLLName, "Z:\\sys\\bin\\WPWVAdapter.dll"); |
|
1497 TFileName fileName(KDLLName); |
|
1498 |
|
1499 HBufC* text = WPAdapterUtil::ReadHBufCL(fileName, KWVAdapterName, |
|
1500 R_QTN_SM_IM_SERVER_DNAME); |
|
1501 |
|
1502 if (text == NULL) |
|
1503 return KErrGeneral; |
|
1504 else |
|
1505 return KErrNone; |
|
1506 } |
|
1507 |
|
1508 // ----------------------------------------------------------------------------- |
|
1509 // Cmoduletestprovisioning::CheckURI |
|
1510 // Example test method function. |
|
1511 // (other items were commented in a header). |
|
1512 // ----------------------------------------------------------------------------- |
|
1513 // |
|
1514 TInt Cmoduletestprovisioning::CheckURI(CStifItemParser& aItem) |
|
1515 { |
|
1516 |
|
1517 _LIT(KURI, "http://123.34.56.67/"); |
|
1518 TBuf<30> buf(KURI); |
|
1519 TPtrC string; |
|
1520 TBool ValidURI; |
|
1521 |
|
1522 ValidURI = WPAdapterUtil::CheckURI(buf); |
|
1523 |
|
1524 if (ValidURI) |
|
1525 return KErrNone; |
|
1526 else |
|
1527 return KErrGeneral; |
|
1528 |
|
1529 } |
|
1530 |
|
1531 // ----------------------------------------------------------------------------- |
|
1532 // Cmoduletestprovisioning::CheckIPV6 |
|
1533 // Example test method function. |
|
1534 // (other items were commented in a header). |
|
1535 // ----------------------------------------------------------------------------- |
|
1536 // |
|
1537 |
|
1538 TInt Cmoduletestprovisioning::CheckIPV6(CStifItemParser& aItem) |
|
1539 { |
|
1540 |
|
1541 TPtrC string; |
|
1542 TBool ValidIPV6; |
|
1543 TInt error = aItem.GetNextString(string); |
|
1544 if (error != KErrNone) |
|
1545 { |
|
1546 return error; |
|
1547 } |
|
1548 |
|
1549 ValidIPV6 = WPAdapterUtil::CheckIPv6(string); |
|
1550 |
|
1551 if (ValidIPV6) |
|
1552 return KErrNone; |
|
1553 else |
|
1554 return KErrGeneral; |
|
1555 |
|
1556 } |
|
1557 |
|
1558 // ----------------------------------------------------------------------------- |
|
1559 // Cmoduletestprovisioning::CheckIPV4 |
|
1560 // Example test method function. |
|
1561 // (other items were commented in a header). |
|
1562 // ----------------------------------------------------------------------------- |
|
1563 // |
|
1564 |
|
1565 TInt Cmoduletestprovisioning::CheckIPV4(CStifItemParser& aItem) |
|
1566 { |
|
1567 |
|
1568 TPtrC string; |
|
1569 TBool ValidIPV4; |
|
1570 TInt error = aItem.GetNextString(string); |
|
1571 if (error != KErrNone) |
|
1572 { |
|
1573 return error; |
|
1574 } |
|
1575 |
|
1576 ValidIPV4 = WPAdapterUtil::CheckIPv4(string); |
|
1577 |
|
1578 if (ValidIPV4) |
|
1579 return KErrNone; |
|
1580 else |
|
1581 return KErrGeneral; |
|
1582 |
|
1583 } |
|
1584 |
|
1585 // ----------------------------------------------------------------------------- |
|
1586 // Cmoduletestprovisioning::CWPAdapterL |
|
1587 // Example test method function. |
|
1588 // (other items were commented in a header). |
|
1589 // ----------------------------------------------------------------------------- |
|
1590 // |
|
1591 TInt Cmoduletestprovisioning::CWPAdapterL() |
|
1592 { |
|
1593 TBool Success = ETrue; |
|
1594 |
|
1595 CWPEngine* engine = CWPEngine::NewLC(); |
|
1596 engine->PopulateL(); |
|
1597 CWPAdapter *ladapter = NULL; |
|
1598 |
|
1599 |
|
1600 ladapter = CWPAdapter::NewL(TUid::Uid(0x101F84D9)); |
|
1601 |
|
1602 if(ladapter==NULL) |
|
1603 Success=EFalse; |
|
1604 |
|
1605 delete ladapter; |
|
1606 CleanupStack::PopAndDestroy();//engine |
|
1607 if (Success) |
|
1608 return KErrNone; |
|
1609 else |
|
1610 return KErrGeneral; |
|
1611 |
|
1612 } |
|
1613 |
|
1614 // ----------------------------------------------------------------------------- |
|
1615 // Cmoduletestprovisioning::DeleteContextDataL |
|
1616 // Example test method function. |
|
1617 // (other items were commented in a header). |
|
1618 // ----------------------------------------------------------------------------- |
|
1619 // |
|
1620 |
|
1621 TInt Cmoduletestprovisioning::DeleteContextDataL() |
|
1622 { |
|
1623 |
|
1624 TUint32 origUid(ContextcreateL()); |
|
1625 |
|
1626 TInt Data = iEngine->DeleteContextDataL(origUid); |
|
1627 |
|
1628 iEngine -> DeleteContextL(origUid); |
|
1629 |
|
1630 |
|
1631 |
|
1632 if (Data == 0) |
|
1633 return KErrNone; |
|
1634 else |
|
1635 return KErrNone; |
|
1636 |
|
1637 } |
|
1638 |
|
1639 // ----------------------------------------------------------------------------- |
|
1640 // Cmoduletestprovisioning::ContextExistsForUidL |
|
1641 // Example test method function. |
|
1642 // (other items were commented in a header). |
|
1643 // ----------------------------------------------------------------------------- |
|
1644 // |
|
1645 |
|
1646 TInt Cmoduletestprovisioning::ContextExistsForUidL() |
|
1647 { |
|
1648 |
|
1649 TUint32 origUid(ContextcreateL()); |
|
1650 |
|
1651 TBool Exists = iEngine->ContextExistsL(origUid); |
|
1652 |
|
1653 iEngine -> DeleteContextL(origUid); |
|
1654 |
|
1655 |
|
1656 |
|
1657 if (Exists == EFalse) |
|
1658 return KErrGeneral; |
|
1659 else |
|
1660 return KErrNone; |
|
1661 |
|
1662 } |
|
1663 |
|
1664 // ----------------------------------------------------------------------------- |
|
1665 // Cmoduletestprovisioning::ContextExistsForTPSL |
|
1666 // Example test method function. |
|
1667 // (other items were commented in a header). |
|
1668 // ----------------------------------------------------------------------------- |
|
1669 // |
|
1670 |
|
1671 TInt Cmoduletestprovisioning::ContextExistsForTPSL(CStifItemParser& aItem) |
|
1672 { |
|
1673 |
|
1674 TBuf<45> buf(23); |
|
1675 TPtrC string; |
|
1676 TInt error = aItem.GetNextString(string); |
|
1677 if (error != KErrNone) |
|
1678 { |
|
1679 return error; |
|
1680 |
|
1681 } |
|
1682 |
|
1683 TUint32 origUid(ContextcreateL()); |
|
1684 |
|
1685 TBool Exists = iEngine->ContextExistsL(string); |
|
1686 |
|
1687 iEngine -> DeleteContextL(origUid); |
|
1688 |
|
1689 |
|
1690 |
|
1691 if (Exists == EFalse) |
|
1692 return KErrGeneral; |
|
1693 else |
|
1694 return KErrNone; |
|
1695 |
|
1696 } |
|
1697 |
|
1698 // ----------------------------------------------------------------------------- |
|
1699 // Cmoduletestprovisioning::ExternparamL |
|
1700 // Example test method function. |
|
1701 // (other items were commented in a header). |
|
1702 // ----------------------------------------------------------------------------- |
|
1703 // |
|
1704 |
|
1705 TInt Cmoduletestprovisioning::ExternparamL() |
|
1706 { |
|
1707 |
|
1708 // CONSTANTS |
|
1709 /// Number of bits in half-word |
|
1710 const TInt KBitsPerWord = 16; |
|
1711 /// Mask to extract a half-word |
|
1712 const TInt KWordMask = 0xffff; |
|
1713 CWPParameter* param = CWPParameter::NewLC(); |
|
1714 TInt aID = 10; |
|
1715 param -> SetID(aID); |
|
1716 |
|
1717 _LIT(KParamName, "name"); |
|
1718 TBufC<10> paramname(KParamName); |
|
1719 param -> SetNameL(paramname); |
|
1720 |
|
1721 _LIT(KParamValue, "Value"); |
|
1722 TBufC<10> paramvalue(KParamValue); |
|
1723 param -> SetValueL(paramvalue); |
|
1724 |
|
1725 CStreamStore* store = CBufStore::NewLC(5000); |
|
1726 RStoreWriteStream aStream; |
|
1727 TStreamId id(aStream.CreateLC(*store)); |
|
1728 |
|
1729 param->ExternalizeL(aStream); |
|
1730 |
|
1731 CleanupStack::PopAndDestroy(); |
|
1732 |
|
1733 RStoreReadStream aStream1; |
|
1734 |
|
1735 aStream1.OpenLC(*store, id); |
|
1736 |
|
1737 TInt parameterID(aStream1.ReadInt32L()); |
|
1738 TUint length(aStream1.ReadInt32L()); |
|
1739 // Lengths packed into one 32-bit word for compatibility |
|
1740 TInt valueLength(length & KWordMask); |
|
1741 TInt nameLength((length >> KBitsPerWord) & KWordMask); |
|
1742 HBufC* value = HBufC::NewL(aStream1, valueLength); |
|
1743 TPtr ptrvalue = value->Des(); |
|
1744 |
|
1745 HBufC* name = NULL; |
|
1746 if (nameLength > 0) |
|
1747 { |
|
1748 name = HBufC::NewL(aStream1, nameLength); |
|
1749 } |
|
1750 |
|
1751 TPtr ptrname = name->Des(); |
|
1752 |
|
1753 CleanupStack::PopAndDestroy(); |
|
1754 CleanupStack::PopAndDestroy(); |
|
1755 CleanupStack::PopAndDestroy(); |
|
1756 |
|
1757 if (ptrname.Compare(KParamName) && ptrvalue.Compare(KParamValue) |
|
1758 && parameterID != aID) |
|
1759 { |
|
1760 delete value; |
|
1761 delete name; |
|
1762 return KErrGeneral; |
|
1763 } |
|
1764 else |
|
1765 { |
|
1766 delete value; |
|
1767 delete name; |
|
1768 return KErrNone; |
|
1769 } |
|
1770 |
|
1771 } |
|
1772 |
|
1773 // ----------------------------------------------------------------------------- |
|
1774 // Cmoduletestprovisioning::SetUpContextObserver |
|
1775 // Create an object of Context Observer |
|
1776 // ----------------------------------------------------------------------------- |
|
1777 // |
|
1778 void Cmoduletestprovisioning::SetUpContextObserverL(TInt data) |
|
1779 { |
|
1780 iObserver = CWPContextObserver::NewL(data); |
|
1781 } |
|
1782 |
|
1783 // ----------------------------------------------------------------------------- |
|
1784 // Cmoduletestprovisioning::RegisterContextObserver |
|
1785 // Register Context Observer |
|
1786 // ----------------------------------------------------------------------------- |
|
1787 // |
|
1788 TInt Cmoduletestprovisioning::RegisterContextObserverL() |
|
1789 { |
|
1790 TInt err = KErrNone; |
|
1791 SetUpContextObserverL(1); |
|
1792 SetUpEngineL(); |
|
1793 TRAP(err, iEngine->RegisterContextObserverL(iObserver)); |
|
1794 return err; |
|
1795 } |
|
1796 |
|
1797 // ----------------------------------------------------------------------------- |
|
1798 // Cmoduletestprovisioning::UnRegisterContextObserver |
|
1799 // Unregister Context Observer |
|
1800 // ----------------------------------------------------------------------------- |
|
1801 // |
|
1802 TInt Cmoduletestprovisioning::UnRegisterContextObserverL() |
|
1803 { |
|
1804 TInt err = KErrNone; |
|
1805 |
|
1806 SetUpContextObserverL(1); |
|
1807 SetUpEngineL(); |
|
1808 TRAP(err, iEngine->RegisterContextObserverL(iObserver)); |
|
1809 if (err == KErrNone) |
|
1810 { |
|
1811 err = iEngine->UnregisterContextObserver(iObserver); |
|
1812 } |
|
1813 |
|
1814 return err; |
|
1815 } |
|
1816 |
|
1817 // ----------------------------------------------------------------------------- |
|
1818 // Cmoduletestprovisioning::CreateSetAPL |
|
1819 // Create and Set AP |
|
1820 // ----------------------------------------------------------------------------- |
|
1821 // |
|
1822 TInt Cmoduletestprovisioning::CreateSetAPL(TPtrC& aOrig) |
|
1823 { |
|
1824 TInt err = KErrNone; |
|
1825 CRepository* rep = NULL; |
|
1826 |
|
1827 rep = CRepository::NewL(KCRUidOMAProvisioningLV); |
|
1828 CleanupStack::PushL(rep); |
|
1829 |
|
1830 err = rep->Set(KOMAProvOriginatorContent, aOrig); |
|
1831 |
|
1832 if (err == KErrNone) |
|
1833 { |
|
1834 TInt wapId = 0; |
|
1835 |
|
1836 CApAccessPointItem* newItem = CApAccessPointItem::NewLC(); |
|
1837 |
|
1838 CCommsDatabase* commsDb = CCommsDatabase::NewL(); |
|
1839 CleanupStack::PushL(commsDb); |
|
1840 |
|
1841 CApDataHandler* lAPHandler = CApDataHandler::NewLC(*commsDb); |
|
1842 wapId = lAPHandler->CreateFromDataL(*newItem); |
|
1843 |
|
1844 WPAdapterUtil::SetAPDetailsL(wapId); |
|
1845 CleanupStack::PopAndDestroy(3); // lAPHandler, commsDb, newItem |
|
1846 } |
|
1847 |
|
1848 CleanupStack::PopAndDestroy(); //rep |
|
1849 |
|
1850 return err; |
|
1851 |
|
1852 } |
|
1853 |
|
1854 // ----------------------------------------------------------------------------- |
|
1855 // Cmoduletestprovisioning::SetAPDetails |
|
1856 // Set AP details |
|
1857 // ----------------------------------------------------------------------------- |
|
1858 // |
|
1859 TInt Cmoduletestprovisioning::SetAPDetailsL(CStifItemParser& aItem) |
|
1860 { |
|
1861 TInt err = KErrNone; |
|
1862 TPtrC orig; |
|
1863 |
|
1864 err = aItem.GetNextString(orig); |
|
1865 |
|
1866 if (err == KErrNone) |
|
1867 { |
|
1868 CreateSetAPL(orig); |
|
1869 } |
|
1870 return err; |
|
1871 |
|
1872 } |
|
1873 |
|
1874 // ----------------------------------------------------------------------------- |
|
1875 // Cmoduletestprovisioning::GetAPIDL |
|
1876 // Get AP ID from DB or SNAP |
|
1877 // ----------------------------------------------------------------------------- |
|
1878 // |
|
1879 TInt Cmoduletestprovisioning::GetAPIDL(CStifItemParser& aItem) |
|
1880 { |
|
1881 TInt err = KErrNone; |
|
1882 TPtrC orig; |
|
1883 |
|
1884 err = aItem.GetNextString(orig); |
|
1885 |
|
1886 if (err == KErrNone) |
|
1887 { |
|
1888 CreateSetAPL(orig); |
|
1889 } |
|
1890 |
|
1891 WPAdapterUtil::GetAPIDL(); |
|
1892 |
|
1893 return err; |
|
1894 } |
|
1895 |
|
1896 |
|
1897 // ----------------------------------------------------------------------------- |
|
1898 // Cmoduletestprovisioning::?member_function |
|
1899 // ?implementation_description |
|
1900 // (other items were commented in a header). |
|
1901 // ----------------------------------------------------------------------------- |
|
1902 // |
|
1903 /* |
|
1904 TInt Cmoduletestprovisioning::?member_function( |
|
1905 CItemParser& aItem ) |
|
1906 { |
|
1907 |
|
1908 ?code |
|
1909 |
|
1910 } |
|
1911 */ |
|
1912 |
|
1913 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
1914 // None |
|
1915 |
|
1916 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
1917 // None |
|
1918 |
|
1919 // End of File |