|
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 the License "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: ?Description* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include <e32svr.h> |
|
21 #include <StifParser.h> |
|
22 #include <Stiftestinterface.h> |
|
23 #include "IptvServiceManagementApiTest.h" |
|
24 #include "CIptvServiceManagementSync.h" |
|
25 #include "CIptvTestUtilities.h" |
|
26 #include "VCXTestLog.h" |
|
27 #include "CIptvIapList.h" |
|
28 #include "TIptvIap.h" |
|
29 #include <f32file.h> |
|
30 #include "IptvEngineUids.h" |
|
31 |
|
32 // EXTERNAL DATA STRUCTURES |
|
33 |
|
34 // EXTERNAL FUNCTION PROTOTYPES |
|
35 |
|
36 // CONSTANTS |
|
37 _LIT(KUninitializedService, "UNINITIALIZED"); |
|
38 |
|
39 // MACROS |
|
40 |
|
41 // LOCAL CONSTANTS AND MACROS |
|
42 |
|
43 // MODULE DATA STRUCTURES |
|
44 |
|
45 // LOCAL FUNCTION PROTOTYPES |
|
46 |
|
47 // FORWARD DECLARATIONS |
|
48 |
|
49 |
|
50 // ============================= LOCAL FUNCTIONS =============================== |
|
51 |
|
52 |
|
53 |
|
54 // ============================ MEMBER FUNCTIONS ============================== |
|
55 |
|
56 // ----------------------------------------------------------------------------- |
|
57 // CIptvServiceManagementApiTest::UpdateService |
|
58 // Example test method function. |
|
59 // (other items were commented in a header). |
|
60 // ----------------------------------------------------------------------------- |
|
61 // |
|
62 |
|
63 TInt CIptvServiceManagementApiTest::TestUpdateService(CIptvServiceManagementSync::TIptvSmTestConnection aConn, TInt aIdDestination, TInt aIdSource) |
|
64 { |
|
65 TRespStatus expectedResp = ESucceeded; |
|
66 TRespStatus respStatus = ESucceeded; |
|
67 TInt testCaseStatus = KErrNone; |
|
68 |
|
69 CIptvService* pServiceSource = NULL; |
|
70 CIptvService* pServiceDestination = NULL; |
|
71 |
|
72 pServiceSource = iIptvTestUtilities->GetServiceFromDb(aIdSource); |
|
73 |
|
74 CIptvService* pServiceDest = NULL; |
|
75 pServiceDest = iIptvTestUtilities->GetServiceFromDb(aIdDestination); |
|
76 |
|
77 // if addresses are same then there won't be an event |
|
78 if(pServiceDest && pServiceSource) |
|
79 if(pServiceDest->GetAddress() == pServiceSource->GetAddress()) |
|
80 { |
|
81 iIptvServiceManagementSync->SetSpecialAction(CIptvServiceManagementSync::EIptvSmWaitNoEvents); |
|
82 } |
|
83 |
|
84 delete pServiceDest; |
|
85 pServiceDest = NULL; |
|
86 |
|
87 // update with uninitialized data |
|
88 if(!pServiceSource) |
|
89 { |
|
90 TBuf<256> uninitializedService(KUninitializedService); |
|
91 pServiceSource = GetHardcodedService(uninitializedService, 0); |
|
92 } |
|
93 |
|
94 if(pServiceSource) |
|
95 { |
|
96 pServiceSource->SetId(aIdDestination);//set destination id |
|
97 if(IsServiceInDb(aIdDestination)) |
|
98 { |
|
99 //lets update |
|
100 |
|
101 respStatus = iIptvServiceManagementSync->CallUpdateService(aConn, *pServiceSource, CIptvSmEvent::EServiceModified); |
|
102 if(respStatus != ESucceeded) |
|
103 { |
|
104 testCaseStatus = KErrGeneral; |
|
105 } |
|
106 |
|
107 |
|
108 } |
|
109 else |
|
110 { |
|
111 //try to update non existing service |
|
112 expectedResp = EServiceNotFound; |
|
113 |
|
114 respStatus = iIptvServiceManagementSync->CallUpdateService(aConn, *pServiceSource, CIptvSmEvent::EServiceModified); |
|
115 if(respStatus != expectedResp) |
|
116 { |
|
117 VCXLOGLO2("** FAIL ** Response to service request is not correct: %d", respStatus); |
|
118 iLog->Log(_L("**** Fail *** Response to service request is not correct")); |
|
119 testCaseStatus = KErrGeneral; |
|
120 } |
|
121 |
|
122 } |
|
123 } |
|
124 else |
|
125 { |
|
126 VCXLOGLO1("** FAIL ** Error in testcase, source service not found"); |
|
127 iLog->Log(_L("*** FAIL *** Error in testcase, source service not found")); |
|
128 testCaseStatus = KErrGeneral; |
|
129 } |
|
130 |
|
131 if(pServiceSource) |
|
132 { |
|
133 delete pServiceSource; |
|
134 pServiceSource = NULL; |
|
135 } |
|
136 |
|
137 if(pServiceDestination) |
|
138 { |
|
139 delete pServiceDestination; |
|
140 pServiceDestination = NULL; |
|
141 } |
|
142 |
|
143 return testCaseStatus; |
|
144 } |
|
145 |
|
146 // ----------------------------------------------------------------------------- |
|
147 // CIptvServiceManagementApiTest::IsServiceInDb |
|
148 // Example test method function. |
|
149 // (other items were commented in a header). |
|
150 // ----------------------------------------------------------------------------- |
|
151 // |
|
152 |
|
153 TBool CIptvServiceManagementApiTest::IsServiceInDb(TInt aId) |
|
154 { |
|
155 TBool rv = FALSE; |
|
156 CIptvService* p = NULL; |
|
157 p = iIptvTestUtilities->GetServiceFromDb(aId); |
|
158 |
|
159 if(p) |
|
160 { |
|
161 rv = TRUE; |
|
162 delete p; |
|
163 p = NULL; |
|
164 } |
|
165 |
|
166 return rv; |
|
167 } |
|
168 |
|
169 // ----------------------------------------------------------------------------- |
|
170 // CIptvServiceManagementApiTest::InitHardcodedServicesL |
|
171 // (other items were commented in a header). |
|
172 // ----------------------------------------------------------------------------- |
|
173 // |
|
174 TInt CIptvServiceManagementApiTest::InitHardcodedServicesL() |
|
175 { |
|
176 CIptvServiceInfo* serviceInfo; |
|
177 |
|
178 // |
|
179 // Yle media sali |
|
180 // |
|
181 |
|
182 serviceInfo = CIptvServiceInfo::NewL(); |
|
183 |
|
184 serviceInfo->iId = 3; |
|
185 serviceInfo->iName.Append(_L("YLE Mediasali")); |
|
186 serviceInfo->iAddress.Append(_L("http://193.65.182.78/yle.xml")); |
|
187 serviceInfo->iIconPath.Append(_L("c:\\resource\\apps\\logo_yle_24.mif")); |
|
188 serviceInfo->iEpgPluginUid.iUid = 0x102750E1; |
|
189 serviceInfo->iVodPluginUid.iUid = 0x102750D9; |
|
190 serviceInfo->iIptvPluginUid.iUid = 0x00000000; |
|
191 serviceInfo->iServiceType = CIptvService::EVod; |
|
192 |
|
193 serviceInfo->iUserName.Append(_L("mediacharger")); |
|
194 serviceInfo->iPassWord.Append(_L("Buran_9o")); |
|
195 serviceInfo->iDesc.Append(_L("YLE Mediasali")); |
|
196 |
|
197 serviceInfo->iSelectedFlag = FALSE; |
|
198 serviceInfo->iReadOnlyFlag = FALSE; |
|
199 serviceInfo->iMainServiceFlag = FALSE; |
|
200 serviceInfo->iConnectionApprovedFlag = TRUE; |
|
201 serviceInfo->iApplicationUid = 0x0; |
|
202 serviceInfo->iDisplayOrder = 0x0; |
|
203 serviceInfo->iProviderId.Zero(); |
|
204 serviceInfo->iProviderId.Append(_L("Provider_ylemediasali"));; |
|
205 serviceInfo->iAccountManagementUrl.Append(_L("http://www.nokia.com")); |
|
206 |
|
207 iHardcodedServices.Append(serviceInfo); |
|
208 |
|
209 // |
|
210 // OOPS |
|
211 // |
|
212 serviceInfo = CIptvServiceInfo::NewL(); |
|
213 |
|
214 serviceInfo->iId = 0; |
|
215 serviceInfo->iName.Append(_L("OOPS")); |
|
216 serviceInfo->iAddress.Append(_L("http://193.65.182.78/oops.xml")); |
|
217 serviceInfo->iIconPath.Append(_L("c:\\")); |
|
218 serviceInfo->iEpgPluginUid.iUid = 0x102750E1; |
|
219 serviceInfo->iVodPluginUid.iUid = 0x102750D9; |
|
220 serviceInfo->iIptvPluginUid.iUid = 0x00000000; |
|
221 serviceInfo->iServiceType = CIptvService::EVod; |
|
222 |
|
223 serviceInfo->iUserName.Append(_L("mediacharger")); |
|
224 serviceInfo->iPassWord.Append(_L("Buran_9o")); |
|
225 serviceInfo->iDesc.Append(_L("OOPS")); |
|
226 |
|
227 serviceInfo->iSelectedFlag = TRUE; |
|
228 serviceInfo->iReadOnlyFlag = FALSE; |
|
229 serviceInfo->iMainServiceFlag = TRUE; |
|
230 serviceInfo->iConnectionApprovedFlag = TRUE; |
|
231 serviceInfo->iApplicationUid = 0x0; |
|
232 serviceInfo->iDisplayOrder = 0x1; |
|
233 serviceInfo->iProviderId.Zero(); |
|
234 serviceInfo->iProviderId.Append(_L("Provider_oops"));; |
|
235 serviceInfo->iAccountManagementUrl.Append(_L("http://www.nokia.com")); |
|
236 |
|
237 iHardcodedServices.Append(serviceInfo); |
|
238 |
|
239 |
|
240 // |
|
241 // OOPS6 |
|
242 // |
|
243 serviceInfo = CIptvServiceInfo::NewL(*serviceInfo); |
|
244 serviceInfo->iId = 6; |
|
245 serviceInfo->iName.Zero(); |
|
246 serviceInfo->iName.Append(_L("OOPS6")); |
|
247 iHardcodedServices.Append(serviceInfo); |
|
248 serviceInfo->iProviderId.Zero(); |
|
249 serviceInfo->iProviderId.Append(_L("Provider_oops6"));; |
|
250 |
|
251 // |
|
252 // OOPS9 |
|
253 // |
|
254 serviceInfo = CIptvServiceInfo::NewL(*serviceInfo); |
|
255 serviceInfo->iId = 9; |
|
256 serviceInfo->iName.Zero(); |
|
257 serviceInfo->iName.Append(_L("OOPS9")); |
|
258 iHardcodedServices.Append(serviceInfo); |
|
259 serviceInfo->iProviderId.Zero(); |
|
260 serviceInfo->iProviderId.Append(_L("Provider_oops9"));; |
|
261 |
|
262 |
|
263 // |
|
264 // Service15Iaps |
|
265 // |
|
266 |
|
267 |
|
268 serviceInfo = CIptvServiceInfo::NewL(); |
|
269 |
|
270 serviceInfo->iId = 50; |
|
271 serviceInfo->iName.Append(_L("Service15Iaps")); |
|
272 serviceInfo->iAddress.Append(_L("http://193.65.182.78/oops.xml")); |
|
273 serviceInfo->iIconPath.Append(_L("c:\\")); |
|
274 serviceInfo->iEpgPluginUid.iUid = 0x102750E1; |
|
275 serviceInfo->iVodPluginUid.iUid = 0x102750D9; |
|
276 serviceInfo->iIptvPluginUid.iUid = 0x00000000; |
|
277 serviceInfo->iServiceType = CIptvService::EVod; |
|
278 |
|
279 serviceInfo->iUserName.Append(_L("mediacharger")); |
|
280 serviceInfo->iPassWord.Append(_L("Buran_9o")); |
|
281 serviceInfo->iDesc.Append(_L("OOPS")); |
|
282 |
|
283 serviceInfo->iSelectedFlag = TRUE; |
|
284 serviceInfo->iReadOnlyFlag = FALSE; |
|
285 serviceInfo->iMainServiceFlag = TRUE; |
|
286 serviceInfo->iConnectionApprovedFlag = TRUE; |
|
287 serviceInfo->iApplicationUid = 0x0; |
|
288 serviceInfo->iDisplayOrder = 0x1; |
|
289 serviceInfo->iProviderId.Zero(); |
|
290 serviceInfo->iProviderId.Append(_L("Provider_15iaps"));; |
|
291 serviceInfo->iAccountManagementUrl.Append(_L("http://www.nokia.com")); |
|
292 |
|
293 TInt aIapsToAdd = 15; |
|
294 |
|
295 serviceInfo->iIapList = CIptvIapList::NewL(); |
|
296 |
|
297 TInt index = 0; |
|
298 TIptvIap iap; |
|
299 while(aIapsToAdd--) |
|
300 { |
|
301 |
|
302 if(index > iIapNumList->Count()) |
|
303 { |
|
304 index = 0; |
|
305 } |
|
306 |
|
307 if(KErrNone == GetCommDbIapIdByOrder(index, iap.iId) ) |
|
308 { |
|
309 iap.iPriority = index; |
|
310 serviceInfo->iIapList->AddIap(iap, ETrue); |
|
311 } |
|
312 |
|
313 index++; |
|
314 } |
|
315 |
|
316 iHardcodedServices.Append(serviceInfo); |
|
317 |
|
318 // |
|
319 // NokiaVideos |
|
320 // |
|
321 |
|
322 serviceInfo = CIptvServiceInfo::NewL(); |
|
323 |
|
324 serviceInfo->iId = 1; |
|
325 serviceInfo->iName.Append(_L("NokiaVideos")); |
|
326 serviceInfo->iAddress.Append(_L("http://193.65.182.78/nokia_vod.xml")); |
|
327 serviceInfo->iIconPath.Append(_L("C:\\")); |
|
328 serviceInfo->iEpgPluginUid.iUid = 0x102750E1; |
|
329 serviceInfo->iVodPluginUid.iUid = 0x102750D9; |
|
330 serviceInfo->iIptvPluginUid.iUid = 0x00000000; |
|
331 serviceInfo->iServiceType = CIptvService::EVod; |
|
332 |
|
333 serviceInfo->iUserName.Append(_L("mediacharger")); |
|
334 serviceInfo->iPassWord.Append(_L("Buran_9o")); |
|
335 serviceInfo->iDesc.Append(_L("Own TestService")); |
|
336 |
|
337 serviceInfo->iSelectedFlag = FALSE; |
|
338 serviceInfo->iReadOnlyFlag = FALSE; |
|
339 serviceInfo->iMainServiceFlag = FALSE; |
|
340 serviceInfo->iConnectionApprovedFlag = TRUE; |
|
341 serviceInfo->iApplicationUid = 0x0; |
|
342 serviceInfo->iDisplayOrder = 0x0; |
|
343 serviceInfo->iProviderId.Zero(); |
|
344 serviceInfo->iProviderId.Append(_L("Provider_nokiavideos"));; |
|
345 serviceInfo->iAccountManagementUrl.Append(_L("http://www.nokia.com")); |
|
346 |
|
347 iHardcodedServices.Append(serviceInfo); |
|
348 |
|
349 // |
|
350 // NokiaVideos7 |
|
351 // |
|
352 serviceInfo = CIptvServiceInfo::NewL(); |
|
353 |
|
354 serviceInfo = CIptvServiceInfo::NewL(*serviceInfo); |
|
355 serviceInfo->iId = 7; |
|
356 serviceInfo->iName.Zero(); |
|
357 serviceInfo->iProviderId.Zero(); |
|
358 serviceInfo->iName.Append(_L("NokiaVideos7")); |
|
359 iHardcodedServices.Append(serviceInfo); |
|
360 |
|
361 // |
|
362 // Kärppäkanava |
|
363 // |
|
364 serviceInfo = CIptvServiceInfo::NewL(); |
|
365 |
|
366 serviceInfo->iId = 4; |
|
367 serviceInfo->iName.Append(_L("Kärppäkanava")); |
|
368 serviceInfo->iAddress.Append(_L("http://ws27.oyy.fi/rss/kanava.xml")); |
|
369 serviceInfo->iIconPath.Append(_L("c:\\logo_karpat.mif")); |
|
370 serviceInfo->iEpgPluginUid.iUid = 0x102750E1; |
|
371 serviceInfo->iVodPluginUid.iUid = 0x102750D9; |
|
372 serviceInfo->iIptvPluginUid.iUid = 0x00000000; |
|
373 serviceInfo->iServiceType = CIptvService::EVod; |
|
374 |
|
375 serviceInfo->iUserName.Append(_L("")); |
|
376 serviceInfo->iPassWord.Append(_L("")); |
|
377 serviceInfo->iDesc.Append(_L("Karppakanava video in hw")); |
|
378 |
|
379 serviceInfo->iSelectedFlag = TRUE; |
|
380 serviceInfo->iReadOnlyFlag = FALSE; |
|
381 serviceInfo->iMainServiceFlag = TRUE; |
|
382 serviceInfo->iConnectionApprovedFlag = TRUE; |
|
383 serviceInfo->iApplicationUid = 0x0; |
|
384 serviceInfo->iDisplayOrder = 0x1; |
|
385 serviceInfo->iProviderId.Zero(); |
|
386 serviceInfo->iProviderId.Append(_L("Provider_karppakanava"));; |
|
387 serviceInfo->iAccountManagementUrl.Append(_L("http://www.nokia.com")); |
|
388 |
|
389 iHardcodedServices.Append(serviceInfo); |
|
390 |
|
391 // |
|
392 // Rocketboom |
|
393 // |
|
394 serviceInfo = CIptvServiceInfo::NewL(); |
|
395 |
|
396 serviceInfo->iId = 2; |
|
397 serviceInfo->iName.Append(_L("Rocketboom")); |
|
398 serviceInfo->iAddress.Append(_L("http://193.65.182.78/testingfeed_iptvengine.xml")); |
|
399 serviceInfo->iIconPath.Append(_L("C:\\")); |
|
400 serviceInfo->iEpgPluginUid.iUid = 0x102750E1; |
|
401 serviceInfo->iVodPluginUid.iUid = 0x102750D9; |
|
402 serviceInfo->iIptvPluginUid.iUid = 0x00000000; |
|
403 serviceInfo->iServiceType = CIptvService::EVod; |
|
404 |
|
405 serviceInfo->iUserName.Append(_L("mediacharger")); |
|
406 serviceInfo->iPassWord.Append(_L("Buran_9o")); |
|
407 serviceInfo->iDesc.Append(_L("Rocketboom")); |
|
408 |
|
409 serviceInfo->iSelectedFlag = TRUE; |
|
410 serviceInfo->iReadOnlyFlag = FALSE; |
|
411 serviceInfo->iMainServiceFlag = TRUE; |
|
412 serviceInfo->iConnectionApprovedFlag = TRUE; |
|
413 serviceInfo->iApplicationUid = 0x0; |
|
414 serviceInfo->iDisplayOrder = 0x1; |
|
415 serviceInfo->iProviderId.Zero(); |
|
416 serviceInfo->iProviderId.Append(_L("Provider_rocketboom"));; |
|
417 serviceInfo->iAccountManagementUrl.Append(_L("http://www.nokia.com")); |
|
418 |
|
419 iHardcodedServices.Append(serviceInfo); |
|
420 |
|
421 // |
|
422 // Rocketboom5 |
|
423 // |
|
424 |
|
425 serviceInfo = CIptvServiceInfo::NewL(*serviceInfo); |
|
426 serviceInfo->iId = 5; |
|
427 serviceInfo->iName.Zero(); |
|
428 serviceInfo->iName.Append(_L("Rocketboom5")); |
|
429 serviceInfo->iProviderId.Zero(); |
|
430 serviceInfo->iProviderId.Append(_L("Provider_rocketboom5"));; |
|
431 iHardcodedServices.Append(serviceInfo); |
|
432 |
|
433 // |
|
434 // Rocketboom8 |
|
435 // |
|
436 serviceInfo = CIptvServiceInfo::NewL(*serviceInfo); |
|
437 serviceInfo->iId = 8; |
|
438 serviceInfo->iName.Zero(); |
|
439 serviceInfo->iName.Append(_L("Rocketboom8")); |
|
440 iHardcodedServices.Append(serviceInfo); |
|
441 serviceInfo->iProviderId.Zero(); |
|
442 serviceInfo->iProviderId.Append(_L("Provider_rocketboom8"));; |
|
443 |
|
444 // |
|
445 // NSeries |
|
446 // |
|
447 serviceInfo = CIptvServiceInfo::NewL(); |
|
448 |
|
449 serviceInfo->iId = 10; |
|
450 serviceInfo->iName.Append(_L("NSeries")); |
|
451 serviceInfo->iAddress.Append(_L("http://193.65.182.78/nseries.xml")); |
|
452 serviceInfo->iIconPath.Append(_L("C:\\")); |
|
453 serviceInfo->iEpgPluginUid.iUid = 0x102750E1; |
|
454 serviceInfo->iVodPluginUid.iUid = 0x102750D9; |
|
455 serviceInfo->iIptvPluginUid.iUid = 0x00000000; |
|
456 serviceInfo->iServiceType = CIptvService::EVod; |
|
457 |
|
458 serviceInfo->iUserName.Append(_L("mediacharger")); |
|
459 serviceInfo->iPassWord.Append(_L("Buran_9o")); |
|
460 serviceInfo->iDesc.Append(_L("NSeries")); |
|
461 |
|
462 serviceInfo->iSelectedFlag = TRUE; |
|
463 serviceInfo->iReadOnlyFlag = FALSE; |
|
464 serviceInfo->iMainServiceFlag = TRUE; |
|
465 serviceInfo->iConnectionApprovedFlag = TRUE; |
|
466 serviceInfo->iApplicationUid = 0x0; |
|
467 serviceInfo->iDisplayOrder = 0x1; |
|
468 serviceInfo->iProviderId.Zero(); |
|
469 serviceInfo->iProviderId.Append(_L("Provider_nseries"));; |
|
470 serviceInfo->iAccountManagementUrl.Append(_L("http://www.nokia.com")); |
|
471 |
|
472 iHardcodedServices.Append(serviceInfo); |
|
473 |
|
474 // |
|
475 // InvalidService3 |
|
476 // |
|
477 serviceInfo = CIptvServiceInfo::NewL(); |
|
478 |
|
479 serviceInfo->iId = 15; |
|
480 serviceInfo->iName.Append(_L("InvalidService3")); |
|
481 serviceInfo->iAddress.Append(_L("http://")); |
|
482 serviceInfo->iIconPath.Append(_L("C:\\")); |
|
483 serviceInfo->iEpgPluginUid.iUid = 0x500; |
|
484 serviceInfo->iVodPluginUid.iUid = 0x700; |
|
485 serviceInfo->iIptvPluginUid.iUid = 0x00000000; |
|
486 serviceInfo->iServiceType = CIptvService::EVod; |
|
487 |
|
488 serviceInfo->iUserName.Append(_L("username")); |
|
489 serviceInfo->iPassWord.Append(_L("password")); |
|
490 serviceInfo->iDesc.Append(_L("Invalid testservice2")); |
|
491 |
|
492 serviceInfo->iSelectedFlag = TRUE; |
|
493 serviceInfo->iReadOnlyFlag = FALSE; |
|
494 serviceInfo->iMainServiceFlag = TRUE; |
|
495 serviceInfo->iConnectionApprovedFlag = TRUE; |
|
496 serviceInfo->iApplicationUid = 0x0; |
|
497 serviceInfo->iDisplayOrder = 0x1; |
|
498 serviceInfo->iProviderId.Zero(); |
|
499 serviceInfo->iProviderId.Append(_L("Provider_invalidserv3"));; |
|
500 serviceInfo->iAccountManagementUrl.Append(_L("http://www.nokia.com")); |
|
501 |
|
502 iHardcodedServices.Append(serviceInfo); |
|
503 |
|
504 // |
|
505 // InvalidService4 |
|
506 // |
|
507 serviceInfo = CIptvServiceInfo::NewL(); |
|
508 |
|
509 serviceInfo->iId = 16; |
|
510 serviceInfo->iName.Append(_L("InvalidService4")); |
|
511 serviceInfo->iAddress.Append(_L("http://www.nokia.com")); |
|
512 serviceInfo->iIconPath.Append(_L("C:\\")); |
|
513 serviceInfo->iEpgPluginUid.iUid = 0x102750DF; |
|
514 serviceInfo->iVodPluginUid.iUid = 0x102750D9; |
|
515 serviceInfo->iIptvPluginUid.iUid = 0x00000000; |
|
516 serviceInfo->iServiceType = CIptvService::EVod; |
|
517 |
|
518 serviceInfo->iUserName.Append(_L("username")); |
|
519 serviceInfo->iPassWord.Append(_L("password")); |
|
520 serviceInfo->iDesc.Append(_L("Invalid testservice2")); |
|
521 |
|
522 serviceInfo->iSelectedFlag = TRUE; |
|
523 serviceInfo->iReadOnlyFlag = FALSE; |
|
524 serviceInfo->iMainServiceFlag = FALSE; |
|
525 serviceInfo->iConnectionApprovedFlag = TRUE; |
|
526 serviceInfo->iApplicationUid = 0x0; |
|
527 serviceInfo->iDisplayOrder = 0x1; |
|
528 serviceInfo->iProviderId.Zero(); |
|
529 serviceInfo->iProviderId.Append(_L("Provider_invalidserv4"));; |
|
530 serviceInfo->iAccountManagementUrl.Append(_L("http://www.nokia.com")); |
|
531 |
|
532 iHardcodedServices.Append(serviceInfo); |
|
533 |
|
534 // |
|
535 // ServiceNoIaps |
|
536 // |
|
537 serviceInfo = CIptvServiceInfo::NewL(); |
|
538 |
|
539 serviceInfo->iId = 20; |
|
540 serviceInfo->iName.Append(_L("ServiceNoIaps")); |
|
541 serviceInfo->iAddress.Append(_L("http://www.nokia.com")); |
|
542 serviceInfo->iIconPath.Append(_L("C:\\")); |
|
543 serviceInfo->iEpgPluginUid.iUid = 0x102750DF; |
|
544 serviceInfo->iVodPluginUid.iUid = 0x102750D9; |
|
545 serviceInfo->iIptvPluginUid.iUid = 0x00000000; |
|
546 serviceInfo->iServiceType = CIptvService::EVod; |
|
547 |
|
548 serviceInfo->iUserName.Append(_L("username")); |
|
549 serviceInfo->iPassWord.Append(_L("password")); |
|
550 serviceInfo->iDesc.Append(_L("Invalid testservice2")); |
|
551 |
|
552 serviceInfo->iSelectedFlag = TRUE; |
|
553 serviceInfo->iReadOnlyFlag = FALSE; |
|
554 serviceInfo->iMainServiceFlag = FALSE; |
|
555 serviceInfo->iConnectionApprovedFlag = TRUE; |
|
556 serviceInfo->iApplicationUid = 0x0; |
|
557 serviceInfo->iDisplayOrder = 0x1; |
|
558 serviceInfo->iProviderId.Zero(); |
|
559 serviceInfo->iProviderId.Append(_L("Provider_servicenoiaps"));; |
|
560 serviceInfo->iAccountManagementUrl.Append(_L("http://www.nokia.com")); |
|
561 |
|
562 iHardcodedServices.Append(serviceInfo); |
|
563 |
|
564 |
|
565 // |
|
566 // UNINITIALIZED |
|
567 // |
|
568 serviceInfo = CIptvServiceInfo::NewL(); |
|
569 |
|
570 serviceInfo->iId = 30; |
|
571 |
|
572 iHardcodedServices.Append(serviceInfo); |
|
573 |
|
574 // |
|
575 // Live TV XMLTV |
|
576 // |
|
577 serviceInfo = CIptvServiceInfo::NewL(); |
|
578 |
|
579 serviceInfo->iId = 51; |
|
580 serviceInfo->iName.Append(_L("XmlTvTestService")); |
|
581 serviceInfo->iAddress.Append(_L("http://193.65.182.78/dvbtest/xmltv/xmltv_1day.xml")); |
|
582 serviceInfo->iIconPath.Append(_L("C:\\")); |
|
583 |
|
584 serviceInfo->iEpgPluginUid.iUid = KIptvLiveTvXmlTvPluginUid; |
|
585 serviceInfo->iIptvPluginUid.iUid = KIptvLiveTvXmlTvPluginUid; |
|
586 serviceInfo->iVodPluginUid.iUid = IPTV_HTTP_VOD_DOWNLOAD_PLUGIN_IMPLEMENTATION_UID; |
|
587 |
|
588 serviceInfo->iServiceType = CIptvService::ELiveTv; |
|
589 |
|
590 serviceInfo->iUserName.Append(_L("mediacharger")); |
|
591 serviceInfo->iPassWord.Append(_L("Buran_9o")); |
|
592 serviceInfo->iDesc.Append(_L("XmlTvTestService")); |
|
593 |
|
594 serviceInfo->iSelectedFlag = TRUE; |
|
595 serviceInfo->iReadOnlyFlag = FALSE; |
|
596 serviceInfo->iMainServiceFlag = FALSE; |
|
597 serviceInfo->iConnectionApprovedFlag = TRUE; |
|
598 serviceInfo->iApplicationUid = 0x0; |
|
599 serviceInfo->iDisplayOrder = 0x1; |
|
600 serviceInfo->iProviderId.Zero(); |
|
601 serviceInfo->iProviderId.Append(_L("Provider_enginetesting_livetv_xmltv"));; |
|
602 serviceInfo->iAccountManagementUrl.Append(_L("http://www.nokia.com")); |
|
603 |
|
604 iHardcodedServices.Append(serviceInfo); |
|
605 |
|
606 |
|
607 // |
|
608 // Live TV Thomson |
|
609 // |
|
610 serviceInfo = CIptvServiceInfo::NewL(); |
|
611 |
|
612 serviceInfo->iId = 50; |
|
613 serviceInfo->iName.Append(_L("ThomsonTestService")); |
|
614 serviceInfo->iAddress.Append(_L("http://193.65.64.241/dvb/sdns/service_discovery")); |
|
615 serviceInfo->iIconPath.Append(_L("C:\\")); |
|
616 |
|
617 serviceInfo->iEpgPluginUid.iUid = KIptvSmartvisionPluginUid; |
|
618 serviceInfo->iIptvPluginUid.iUid = KIptvSmartvisionPluginUid; |
|
619 serviceInfo->iVodPluginUid.iUid = IPTV_HTTP_VOD_DOWNLOAD_PLUGIN_IMPLEMENTATION_UID; |
|
620 |
|
621 serviceInfo->iServiceType = CIptvService::ELiveTv; |
|
622 |
|
623 serviceInfo->iUserName.Append(_L("aca")); |
|
624 serviceInfo->iPassWord.Append(_L("aca")); |
|
625 serviceInfo->iDesc.Append(_L("ThomsonTestService")); |
|
626 |
|
627 serviceInfo->iSelectedFlag = TRUE; |
|
628 serviceInfo->iReadOnlyFlag = FALSE; |
|
629 serviceInfo->iMainServiceFlag = FALSE; |
|
630 serviceInfo->iConnectionApprovedFlag = TRUE; |
|
631 serviceInfo->iApplicationUid = 0x0; |
|
632 serviceInfo->iDisplayOrder = 0x1; |
|
633 serviceInfo->iProviderId.Zero(); |
|
634 serviceInfo->iProviderId.Append(_L("Provider_enginetesting_livetv_thomsonsmartvision"));; |
|
635 serviceInfo->iAccountManagementUrl.Append(_L("http://www.nokia.com")); |
|
636 |
|
637 iHardcodedServices.Append(serviceInfo); |
|
638 |
|
639 |
|
640 return KErrNone; |
|
641 } |
|
642 |
|
643 // ----------------------------------------------------------------------------- |
|
644 // CIptvServiceManagementApiTest::GetHardcodedService |
|
645 // (other items were commented in a header). |
|
646 // ----------------------------------------------------------------------------- |
|
647 // |
|
648 CIptvService* CIptvServiceManagementApiTest::GetHardcodedService(TDesC& aHardcodedServiceNameOrID, TDesC& aIapName) |
|
649 { |
|
650 VCXLOGLO1(">>>CIptvServiceManagementApiTest::GetHardCodedServiceL - iapname"); |
|
651 |
|
652 CIptvService* service = GetHardcodedService(aHardcodedServiceNameOrID, 0); |
|
653 |
|
654 CleanupStack::PushL(service); |
|
655 |
|
656 TUint32 iapId; |
|
657 |
|
658 if(!iIptvTestUtilities->GetIapIdL(aIapName, iapId) ) |
|
659 { |
|
660 VCXLOGLO2("** FAIL ** Did not find iap with name %S", &aIapName); |
|
661 CleanupStack::PopAndDestroy(service); |
|
662 return NULL; |
|
663 } |
|
664 |
|
665 CIptvIapList* iapList = CIptvIapList::NewL(); |
|
666 CleanupStack::PushL(iapList); |
|
667 |
|
668 TIptvIap iap; |
|
669 iap.iPriority = 0; |
|
670 iap.iId = iapId; |
|
671 |
|
672 iapList->AddIap(iap); |
|
673 |
|
674 service->SetIapListL(*iapList); |
|
675 |
|
676 CleanupStack::PopAndDestroy(iapList); |
|
677 CleanupStack::Pop(service); |
|
678 |
|
679 VCXLOGLO1("<<<CIptvServiceManagementApiTest::GetHardCodedServiceL - iapname"); |
|
680 |
|
681 return service; |
|
682 } |
|
683 |
|
684 // ----------------------------------------------------------------------------- |
|
685 // CIptvServiceManagementApiTest::GetHardcodedService |
|
686 // Example test method function. |
|
687 // (other items were commented in a header). |
|
688 // ----------------------------------------------------------------------------- |
|
689 // |
|
690 CIptvService* CIptvServiceManagementApiTest::GetHardcodedService(TDesC& aHardcodedServiceNameOrID, TInt aIapsToAdd) |
|
691 { |
|
692 VCXLOGLO1(">>>CIptvServiceManagementApiTest::GetHardCodedServiceL"); |
|
693 |
|
694 if(iHardcodedServices.Count() <= 0) |
|
695 { |
|
696 InitHardcodedServicesL(); |
|
697 } |
|
698 |
|
699 CIptvServiceInfo* serviceInfo = NULL; |
|
700 |
|
701 TBool hardcodedServiceId = -1; |
|
702 |
|
703 TInt serviceIdSpecified = CIptvTestUtilities::ParseIntFromString(hardcodedServiceId, aHardcodedServiceNameOrID); |
|
704 |
|
705 if(aHardcodedServiceNameOrID.Compare(_L("UNINITIALIZED")) == 0) |
|
706 { |
|
707 serviceIdSpecified = KErrNone; |
|
708 hardcodedServiceId = 30; |
|
709 } |
|
710 |
|
711 if(serviceIdSpecified == KErrNone) |
|
712 { |
|
713 |
|
714 // |
|
715 // Hardcoded service ID |
|
716 // |
|
717 |
|
718 if(hardcodedServiceId == 40) |
|
719 { |
|
720 if(++iHardCodedServiceCounter > 10) iHardCodedServiceCounter = 0; |
|
721 hardcodedServiceId = iHardCodedServiceCounter; |
|
722 } |
|
723 |
|
724 for(TInt i = 0; i < iHardcodedServices.Count(); i++) |
|
725 { |
|
726 if(hardcodedServiceId == iHardcodedServices[i]->iId) |
|
727 { |
|
728 serviceInfo = iHardcodedServices[i]; |
|
729 break; |
|
730 } |
|
731 |
|
732 } |
|
733 |
|
734 } |
|
735 else |
|
736 { |
|
737 |
|
738 // |
|
739 // Hardcoded service name |
|
740 // |
|
741 |
|
742 for(TInt i = 0; i < iHardcodedServices.Count(); i++) |
|
743 { |
|
744 if(aHardcodedServiceNameOrID.Compare(iHardcodedServices[i]->iName) == 0) |
|
745 { |
|
746 |
|
747 serviceInfo = iHardcodedServices[i]; |
|
748 break; |
|
749 } |
|
750 |
|
751 } |
|
752 } |
|
753 |
|
754 if(serviceInfo == NULL) |
|
755 { |
|
756 VCXLOGLO2("No hardcoded service found with: %S", &aHardcodedServiceNameOrID); |
|
757 return NULL; |
|
758 } |
|
759 |
|
760 |
|
761 CIptvService* iptvService = NULL; |
|
762 TRAPD( err, iptvService = iIptvTestUtilities->CreateIptvServiceInstanceL(*serviceInfo) ); |
|
763 if(err != KErrNone) |
|
764 { |
|
765 VCXLOGLO1("CreateIptvServiceInstanceL caused a leave"); |
|
766 iLog->Log(_L("CreateIptvServiceInstanceL caused a leave")); |
|
767 VCXLOGLO1("<<<CIptvServiceManagementApiTest::GetHardCodedServiceL"); |
|
768 return NULL; |
|
769 } |
|
770 |
|
771 if(serviceInfo->iId == 30) // uninitialized |
|
772 { |
|
773 return iptvService; |
|
774 } |
|
775 |
|
776 if(serviceInfo->iIapList == NULL) |
|
777 { |
|
778 TIptvIap iap; |
|
779 |
|
780 CIptvIapList* iapList = CIptvIapList::NewL(); |
|
781 CleanupStack::PushL(iapList); |
|
782 |
|
783 if(aIapsToAdd > 0) |
|
784 { |
|
785 if(aIapsToAdd > iIapNumList->Count()) |
|
786 { |
|
787 aIapsToAdd = iIapNumList->Count(); |
|
788 VCXLOGLO2("Not enough iaps, adding only: %d.", aIapsToAdd); |
|
789 } |
|
790 |
|
791 for(TInt index = 0; index < aIapsToAdd; index++) |
|
792 { |
|
793 if(!KErrNone == GetCommDbIapIdByOrder(index, iap.iId) ) |
|
794 { |
|
795 iap.iPriority = index; |
|
796 iapList->AddIap(iap, ETrue); |
|
797 } |
|
798 } |
|
799 } |
|
800 // add invalid iaps |
|
801 else |
|
802 if(aIapsToAdd < 0) |
|
803 { |
|
804 VCXLOGLO1("Adding invalid iaps."); |
|
805 aIapsToAdd *= -1; |
|
806 |
|
807 for(TInt index = 0; index < aIapsToAdd; index++) |
|
808 { |
|
809 iap.iId = 100 + index; |
|
810 iap.iPriority = index; |
|
811 iapList->AddIap(iap, ETrue); |
|
812 } |
|
813 } |
|
814 |
|
815 iptvService->SetIapListL(*iapList); |
|
816 |
|
817 CleanupStack::PopAndDestroy(iapList); |
|
818 } |
|
819 else |
|
820 { |
|
821 iptvService->SetIapListL(*serviceInfo->iIapList); |
|
822 } |
|
823 |
|
824 VCXLOGLO1("<<<CIptvServiceManagementApiTest::GetHardCodedServiceL"); |
|
825 return iptvService; |
|
826 } |
|
827 |
|
828 //EOF |