24
|
1 |
// Copyright (c) 2008-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 |
//
|
|
15 |
|
|
16 |
/**
|
|
17 |
@file The TEFUnit integration test suite for MBMS Context support in the Common TSY.
|
|
18 |
*/
|
|
19 |
|
|
20 |
#include "cctsyucasembms002.h"
|
|
21 |
#include "cctsyactiveretriever.h"
|
|
22 |
#include <etel.h>
|
|
23 |
#include <etelmm.h>
|
|
24 |
#include <et_clsvr.h>
|
|
25 |
#include <ctsy/mmtsy_names.h>
|
|
26 |
#include <ctsy/serviceapi/mmtsy_ipcdefs.h>
|
|
27 |
#include "tmockltsydata.h"
|
|
28 |
#include <ctsy/serviceapi/gsmerror.h>
|
|
29 |
|
|
30 |
#include <pcktcs.h>
|
|
31 |
#include <pcktlist.h>
|
|
32 |
#include "pcktretrieve.h"
|
|
33 |
#include "CMmCommonStaticUtility.h"
|
|
34 |
#include <ctsy/serviceapi/mmtsy_defaults.h>
|
|
35 |
|
|
36 |
CTestSuite* CCTsyUCaseMbms002::CreateSuiteL(const TDesC& aName)
|
|
37 |
{
|
|
38 |
SUB_SUITE;
|
|
39 |
ADD_TEST_STEP_ISO_CPP(CCTsyUCaseMbms002, CCtsyIntegrationTestMbms0001L );
|
|
40 |
ADD_TEST_STEP_ISO_CPP(CCTsyUCaseMbms002, CCtsyIntegrationTestMbms0002L );
|
|
41 |
ADD_TEST_STEP_ISO_CPP(CCTsyUCaseMbms002, CCtsyIntegrationTestMbms0003L );
|
|
42 |
END_SUITE;
|
|
43 |
}
|
|
44 |
|
|
45 |
//
|
|
46 |
// Actual test cases
|
|
47 |
//
|
|
48 |
|
|
49 |
/**
|
|
50 |
* @SYMTestCaseID BA-CTSY-INT-MB-0002
|
|
51 |
* @SYMFssID BA/CTSY/PKTS-0002
|
|
52 |
* @SYMTestCaseDesc Support getting current MBMS network availability with attempt to GMM Attach if required.
|
|
53 |
* @SYMTestPriority High
|
|
54 |
* @SYMTestActions RPacketService:: GetMbmsNetworkServiceStatus
|
|
55 |
* @SYMTestExpectedResults Pass - MBMS network availability status is returned correctly. Status can be Supported, Not Supported.or Unknown..
|
|
56 |
* @SYMTestType CIT
|
|
57 |
* @SYMTestCaseDependencies live/manual
|
|
58 |
*
|
|
59 |
* Reason for test: Verify that MBMS network availability status is returned correctly
|
|
60 |
*
|
|
61 |
* @return - none
|
|
62 |
*/
|
|
63 |
void CCTsyUCaseMbms002::CCtsyIntegrationTestMbms0001L()
|
|
64 |
{
|
|
65 |
|
|
66 |
//
|
|
67 |
// SET UP
|
|
68 |
//
|
|
69 |
|
|
70 |
OpenEtelServerL( EUseExtendedError );
|
|
71 |
CleanupStack::PushL( TCleanupItem( Cleanup, this ) );
|
|
72 |
OpenPhoneL();
|
|
73 |
|
|
74 |
RBuf8 data;
|
|
75 |
CleanupClosePushL(data);
|
|
76 |
|
|
77 |
RBuf8 data2;
|
|
78 |
CleanupClosePushL(data2);
|
|
79 |
|
|
80 |
RPacketService packetService;
|
|
81 |
OpenPacketServiceL( packetService );
|
|
82 |
CleanupClosePushL( packetService );
|
|
83 |
|
|
84 |
// Open new context
|
|
85 |
TInfoName contextId;
|
|
86 |
RPacketMbmsContext packetMbmsContext;
|
|
87 |
packetMbmsContext.OpenNewContext( packetService, contextId );
|
|
88 |
CleanupClosePushL( packetMbmsContext );
|
|
89 |
|
|
90 |
//
|
|
91 |
// SET UP END
|
|
92 |
//
|
|
93 |
|
|
94 |
//
|
|
95 |
// TEST START
|
|
96 |
//
|
|
97 |
|
|
98 |
TRequestStatus requestStatus;
|
|
99 |
TBool aAttemptAttach = ETrue;
|
|
100 |
TMbmsNetworkServiceStatus regStatus;
|
|
101 |
|
|
102 |
TMockLtsyData1<TBool> ltsyData2(aAttemptAttach);
|
|
103 |
ltsyData2.SerialiseL(data);
|
|
104 |
iMockLTSY.ExpectL(EPacketGetMbmsNetworkServiceStatus, data);
|
|
105 |
|
|
106 |
TMbmsNetworkServiceStatus regStatusComplete = EMbmsSupported;
|
|
107 |
TMockLtsyData1<TMbmsNetworkServiceStatus> ltsyData3(regStatusComplete);
|
|
108 |
ltsyData3.SerialiseL(data2);
|
|
109 |
|
|
110 |
// Client request PacketService::GetMbmsNetworkServiceStatus
|
|
111 |
packetService.GetMbmsNetworkServiceStatus(requestStatus, aAttemptAttach, regStatus);
|
|
112 |
|
|
113 |
// Ensure packet service status is RPacketService::EStatusAttached.
|
|
114 |
TRequestStatus mockLtsyStatus;
|
|
115 |
RPacketService::TStatus sendStatus = RPacketService::EStatusAttached;
|
|
116 |
TBool isResumed = EFalse;
|
|
117 |
TMockLtsyData2 <RPacketService::TStatus, TBool > ltsyData(sendStatus, isResumed);
|
|
118 |
ltsyData.SerialiseL(data);
|
|
119 |
|
|
120 |
TRequestStatus requestStatus2;
|
|
121 |
RPacketService::TStatus contextStatus;
|
|
122 |
packetService.NotifyStatusChange(requestStatus2, contextStatus);
|
|
123 |
|
|
124 |
iMockLTSY.NotifyTerminated(mockLtsyStatus);
|
|
125 |
iMockLTSY.CompleteL(EPacketNotifyStatusChange, KErrNone, data); //
|
|
126 |
|
|
127 |
User::WaitForRequest(mockLtsyStatus);
|
|
128 |
User::WaitForRequest(requestStatus2);
|
|
129 |
AssertMockLtsyStatusL();
|
|
130 |
ASSERT_EQUALS(KErrNone, requestStatus2.Int());
|
|
131 |
ASSERT_EQUALS(sendStatus, contextStatus);
|
|
132 |
|
|
133 |
// Ensure that PacketService::GetMbmsNetworkServiceStatus returns status EMbmsSupported
|
|
134 |
iMockLTSY.CompleteL(EPacketGetMbmsNetworkServiceStatus, KErrNone, data2);
|
|
135 |
User::WaitForRequest(requestStatus);
|
|
136 |
AssertMockLtsyStatusL();
|
|
137 |
ASSERT_EQUALS( KErrNone, requestStatus.Int() );
|
|
138 |
ASSERT_TRUE(regStatusComplete == regStatus);
|
|
139 |
|
|
140 |
// Ensure packet service status is RPacketService::EStatusUnattached
|
|
141 |
sendStatus = RPacketService::EStatusUnattached;
|
|
142 |
isResumed = EFalse;
|
|
143 |
TMockLtsyData2 <RPacketService::TStatus, TBool > ltsyData4(sendStatus, isResumed);
|
|
144 |
ltsyData4.SerialiseL(data);
|
|
145 |
|
|
146 |
packetService.NotifyStatusChange(requestStatus2, contextStatus);
|
|
147 |
|
|
148 |
iMockLTSY.NotifyTerminated(mockLtsyStatus);
|
|
149 |
iMockLTSY.CompleteL(EPacketNotifyStatusChange, KErrNone, data); //
|
|
150 |
|
|
151 |
User::WaitForRequest(mockLtsyStatus);
|
|
152 |
User::WaitForRequest(requestStatus2);
|
|
153 |
|
|
154 |
AssertMockLtsyStatusL();
|
|
155 |
ASSERT_EQUALS(KErrNone, requestStatus2.Int());
|
|
156 |
ASSERT_EQUALS(sendStatus, contextStatus);
|
|
157 |
//
|
|
158 |
// TEST END
|
|
159 |
//
|
|
160 |
|
|
161 |
AssertMockLtsyStatusL();
|
|
162 |
CleanupStack::PopAndDestroy( 5, this ); // packetMbmsContext, packetService, data, data2, this
|
|
163 |
}
|
|
164 |
|
|
165 |
|
|
166 |
/**
|
|
167 |
* @SYMTestCaseID BA-CTSY-INT-MB-0003
|
|
168 |
* @SYMFssID BA/CTSY/PKTS-0003
|
|
169 |
* @SYMTestCaseDesc Support getting current MBMS network availability with attempt to GMM Attach if required.
|
|
170 |
* @SYMTestPriority High
|
|
171 |
* @SYMTestActions RPacketService:: GetMbmsNetworkServiceStatus
|
|
172 |
* @SYMTestExpectedResults Pass - MBMS network availability status is returned correctly. Status can be Supported, Not Supported.or Unknown..
|
|
173 |
* @SYMTestType CIT
|
|
174 |
* @SYMTestCaseDependencies live/manual
|
|
175 |
*
|
|
176 |
* Reason for test: Verify that MBMS network availability status is returned correctly.
|
|
177 |
*
|
|
178 |
* @return - none
|
|
179 |
*/
|
|
180 |
void CCTsyUCaseMbms002::CCtsyIntegrationTestMbms0002L()
|
|
181 |
{
|
|
182 |
|
|
183 |
//
|
|
184 |
// SET UP
|
|
185 |
//
|
|
186 |
|
|
187 |
OpenEtelServerL( EUseExtendedError );
|
|
188 |
CleanupStack::PushL( TCleanupItem( Cleanup, this ) );
|
|
189 |
OpenPhoneL();
|
|
190 |
|
|
191 |
RBuf8 data;
|
|
192 |
CleanupClosePushL(data);
|
|
193 |
|
|
194 |
RBuf8 data2;
|
|
195 |
CleanupClosePushL(data2);
|
|
196 |
|
|
197 |
RPacketService packetService;
|
|
198 |
OpenPacketServiceL( packetService );
|
|
199 |
CleanupClosePushL( packetService );
|
|
200 |
|
|
201 |
// Open new context
|
|
202 |
TInfoName contextId;
|
|
203 |
RPacketMbmsContext packetMbmsContext;
|
|
204 |
packetMbmsContext.OpenNewContext( packetService, contextId );
|
|
205 |
CleanupClosePushL( packetMbmsContext );
|
|
206 |
|
|
207 |
//
|
|
208 |
// SET UP END
|
|
209 |
//
|
|
210 |
|
|
211 |
//
|
|
212 |
// TEST START
|
|
213 |
//
|
|
214 |
|
|
215 |
|
|
216 |
TRequestStatus requestStatus;
|
|
217 |
TBool aAttemptAttach = ETrue;
|
|
218 |
TMbmsNetworkServiceStatus regStatus;
|
|
219 |
|
|
220 |
TMockLtsyData1<TBool> ltsyData(aAttemptAttach);
|
|
221 |
ltsyData.SerialiseL(data);
|
|
222 |
iMockLTSY.ExpectL(EPacketGetMbmsNetworkServiceStatus, data);
|
|
223 |
|
|
224 |
TMbmsNetworkServiceStatus regStatusComplete = EMbmsSupportUnknown;
|
|
225 |
TMockLtsyData1<TMbmsNetworkServiceStatus> ltsyData2(regStatusComplete);
|
|
226 |
ltsyData2.SerialiseL(data2);
|
|
227 |
|
|
228 |
// Client request PacketService::GetMbmsNetworkServiceStatus
|
|
229 |
// Ensure that PacketService::GetMbmsNetworkServiceStatus returns status EMbmsSupportUnknown because attemp to attach has failed.
|
|
230 |
packetService.GetMbmsNetworkServiceStatus(requestStatus, aAttemptAttach, regStatus);
|
|
231 |
iMockLTSY.CompleteL(EPacketGetMbmsNetworkServiceStatus, KErrNone, data2);
|
|
232 |
|
|
233 |
User::WaitForRequest(requestStatus);
|
|
234 |
AssertMockLtsyStatusL();
|
|
235 |
ASSERT_EQUALS( KErrNone, requestStatus.Int() );
|
|
236 |
ASSERT_TRUE(regStatusComplete == regStatus);
|
|
237 |
|
|
238 |
//
|
|
239 |
// TEST END
|
|
240 |
//
|
|
241 |
|
|
242 |
AssertMockLtsyStatusL();
|
|
243 |
CleanupStack::PopAndDestroy( 5, this ); // packetMbmsContext, packetService, data, data2, this
|
|
244 |
}
|
|
245 |
|
|
246 |
/**
|
|
247 |
* @SYMTestCaseID BA-CTSY-INT-MB-0004
|
|
248 |
* @SYMFssID BA/CTSY/PKTS-0004
|
|
249 |
* @SYMTestCaseDesc Support getting current MBMS network availability with attempt to GMM Attach if required.
|
|
250 |
* @SYMTestPriority High
|
|
251 |
* @SYMTestActions RPacketService:: GetMbmsNetworkServiceStatus
|
|
252 |
* @SYMTestExpectedResults Pass - MBMS network availability status failed with an error and CTSY completes request with an error.
|
|
253 |
* @SYMTestType CIT
|
|
254 |
* @SYMTestCaseDependencies live/manual
|
|
255 |
*
|
|
256 |
* Reason for test: Verify that MBMS network availability status is returned correctly.
|
|
257 |
*
|
|
258 |
* @return - none
|
|
259 |
*/
|
|
260 |
void CCTsyUCaseMbms002::CCtsyIntegrationTestMbms0003L()
|
|
261 |
{
|
|
262 |
|
|
263 |
//
|
|
264 |
// SET UP
|
|
265 |
//
|
|
266 |
|
|
267 |
OpenEtelServerL( EUseExtendedError );
|
|
268 |
CleanupStack::PushL( TCleanupItem( Cleanup, this ) );
|
|
269 |
OpenPhoneL();
|
|
270 |
|
|
271 |
RBuf8 data;
|
|
272 |
CleanupClosePushL(data);
|
|
273 |
|
|
274 |
RBuf8 data2;
|
|
275 |
CleanupClosePushL(data2);
|
|
276 |
|
|
277 |
RPacketService packetService;
|
|
278 |
OpenPacketServiceL( packetService );
|
|
279 |
CleanupClosePushL( packetService );
|
|
280 |
|
|
281 |
// Open new context
|
|
282 |
TInfoName contextId;
|
|
283 |
RPacketMbmsContext packetMbmsContext;
|
|
284 |
packetMbmsContext.OpenNewContext( packetService, contextId );
|
|
285 |
CleanupClosePushL( packetMbmsContext );
|
|
286 |
|
|
287 |
//
|
|
288 |
// SET UP END
|
|
289 |
//
|
|
290 |
|
|
291 |
//
|
|
292 |
// TEST START
|
|
293 |
//
|
|
294 |
|
|
295 |
TRequestStatus requestStatus;
|
|
296 |
TBool aAttemptAttach = ETrue;
|
|
297 |
TMbmsNetworkServiceStatus regStatus;
|
|
298 |
|
|
299 |
TMockLtsyData1<TBool> ltsyData(aAttemptAttach);
|
|
300 |
ltsyData.SerialiseL(data);
|
|
301 |
iMockLTSY.ExpectL(EPacketGetMbmsNetworkServiceStatus, data);
|
|
302 |
|
|
303 |
TMbmsNetworkServiceStatus regStatusComplete = EMbmsSupported;
|
|
304 |
TMockLtsyData1<TMbmsNetworkServiceStatus> ltsyData2(regStatusComplete);
|
|
305 |
ltsyData2.SerialiseL(data2);
|
|
306 |
|
|
307 |
// Client request PacketService::GetMbmsNetworkServiceStatus
|
|
308 |
packetService.GetMbmsNetworkServiceStatus(requestStatus, aAttemptAttach, regStatus);
|
|
309 |
|
|
310 |
// Ensure packet service status is RPacketService::EStatusAttached.
|
|
311 |
TRequestStatus mockLtsyStatus;
|
|
312 |
RPacketService::TStatus sendStatus = RPacketService::EStatusAttached;
|
|
313 |
TBool isResumed = EFalse;
|
|
314 |
TMockLtsyData2 <RPacketService::TStatus, TBool > ltsyData3(sendStatus, isResumed);
|
|
315 |
ltsyData3.SerialiseL(data);
|
|
316 |
|
|
317 |
TRequestStatus requestStatus2;
|
|
318 |
RPacketService::TStatus contextStatus;
|
|
319 |
packetService.NotifyStatusChange(requestStatus2, contextStatus);
|
|
320 |
|
|
321 |
iMockLTSY.NotifyTerminated(mockLtsyStatus);
|
|
322 |
iMockLTSY.CompleteL(EPacketNotifyStatusChange, KErrNone, data);
|
|
323 |
|
|
324 |
User::WaitForRequest(mockLtsyStatus);
|
|
325 |
User::WaitForRequest(requestStatus2);
|
|
326 |
AssertMockLtsyStatusL();
|
|
327 |
ASSERT_EQUALS(KErrNone, requestStatus2.Int());
|
|
328 |
ASSERT_EQUALS(sendStatus, contextStatus);
|
|
329 |
|
|
330 |
// Ensure that PacketService::GetMbmsNetworkServiceStatus returns error
|
|
331 |
iMockLTSY.CompleteL(EPacketGetMbmsNetworkServiceStatus, KErrGeneral);
|
|
332 |
|
|
333 |
User::WaitForRequest(requestStatus);
|
|
334 |
AssertMockLtsyStatusL();
|
|
335 |
ASSERT_EQUALS( KErrGeneral, requestStatus.Int() );
|
|
336 |
|
|
337 |
// Ensure packet service status is RPacketService::EStatusUnattached
|
|
338 |
sendStatus = RPacketService::EStatusUnattached;
|
|
339 |
isResumed = EFalse;
|
|
340 |
TMockLtsyData2 <RPacketService::TStatus, TBool > ltsyData4(sendStatus, isResumed);
|
|
341 |
ltsyData4.SerialiseL(data);
|
|
342 |
|
|
343 |
packetService.NotifyStatusChange(requestStatus2, contextStatus);
|
|
344 |
|
|
345 |
iMockLTSY.NotifyTerminated(mockLtsyStatus);
|
|
346 |
iMockLTSY.CompleteL(EPacketNotifyStatusChange, KErrNone, data); //
|
|
347 |
|
|
348 |
User::WaitForRequest(mockLtsyStatus);
|
|
349 |
User::WaitForRequest(requestStatus2);
|
|
350 |
|
|
351 |
AssertMockLtsyStatusL();
|
|
352 |
ASSERT_EQUALS(KErrNone, requestStatus2.Int());
|
|
353 |
ASSERT_EQUALS(sendStatus, contextStatus);
|
|
354 |
|
|
355 |
|
|
356 |
//
|
|
357 |
// TEST END
|
|
358 |
//
|
|
359 |
|
|
360 |
AssertMockLtsyStatusL();
|
|
361 |
CleanupStack::PopAndDestroy( 5, this ); // packetMbmsContext, packetService, data, data2, this
|
|
362 |
}
|
|
363 |
|