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 "cctsyucasembms012.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 |
#define MBMS_MONITORSERVICECOUNTMULTIPLE 3
|
|
37 |
|
|
38 |
CTestSuite* CCTsyUCaseMbms012::CreateSuiteL(const TDesC& aName)
|
|
39 |
{
|
|
40 |
SUB_SUITE;
|
|
41 |
ADD_TEST_STEP_ISO_CPP(CCTsyUCaseMbms012, CCTsyIntegrationTestMbms0001L );
|
|
42 |
END_SUITE;
|
|
43 |
}
|
|
44 |
|
|
45 |
//
|
|
46 |
// Actual test cases
|
|
47 |
//
|
|
48 |
|
|
49 |
/**
|
|
50 |
* @SYMTestCaseID BA-CTSY-INT-MB-0022
|
|
51 |
* @SYMFssID BA/CTSY/PKTS-0022
|
|
52 |
* @SYMTestCaseDesc Support being notified when service availability changes
|
|
53 |
* @SYMTestPriority High
|
|
54 |
* @SYMTestActions RPacketContext::SetConfig, RPacketContext::Activate, RPacketService::NotifyStatusChange, RPacketService::GetStatus, RPacketContext::NotifyStatusChange, RPacketContext::GetStatus, RPacketService::EnumerateNifs, RPacketService::GetContextNameInNif, RPacketService::GetNifInfo, RPacketService::EnumerateContextsInNif, RPacketContext::Deactivate, RPacketService::EnumerateContextsInNif, RPacketContext::Deactivate
|
|
55 |
* @SYMTestExpectedResults Pass - CTSY get new service statuses and informs client.
|
|
56 |
* @SYMTestType CIT
|
|
57 |
* @SYMTestCaseDependencies live/manual
|
|
58 |
*
|
|
59 |
* Reason for test: Verify that NotifyMbmsNetworkServiceStatusChange completes correctly.
|
|
60 |
*
|
|
61 |
* @return - none
|
|
62 |
*/
|
|
63 |
void CCTsyUCaseMbms012::CCTsyIntegrationTestMbms0001L()
|
|
64 |
{
|
|
65 |
|
|
66 |
//
|
|
67 |
// SET UP
|
|
68 |
//
|
|
69 |
|
|
70 |
OpenEtelServerL( EUseExtendedError );
|
|
71 |
CleanupStack::PushL( TCleanupItem( Cleanup, this ) );
|
|
72 |
OpenPhoneL();
|
|
73 |
|
|
74 |
RPacketService packetService;
|
|
75 |
OpenPacketServiceL( packetService );
|
|
76 |
CleanupClosePushL( packetService );
|
|
77 |
|
|
78 |
TInfoName contextId;
|
|
79 |
RPacketMbmsContext packetMbmsContext;
|
|
80 |
packetMbmsContext.OpenNewContext( packetService, contextId );
|
|
81 |
CleanupClosePushL( packetMbmsContext );
|
|
82 |
|
|
83 |
//
|
|
84 |
// SET UP END
|
|
85 |
//
|
|
86 |
|
|
87 |
//
|
|
88 |
// TEST START
|
|
89 |
//
|
|
90 |
|
|
91 |
RBuf8 data;
|
|
92 |
CleanupClosePushL( data );
|
|
93 |
TRequestStatus requestStatus;
|
|
94 |
TRequestStatus mockLtsyStatus;
|
|
95 |
|
|
96 |
TInt maxAllowed( 10 );
|
|
97 |
TInt maxvalue( 10 );
|
|
98 |
|
|
99 |
// check maximum monitored service value.
|
|
100 |
TMockLtsyData1<TInt> ltsyData( maxvalue );
|
|
101 |
data.Close();
|
|
102 |
ltsyData.SerialiseL( data );
|
|
103 |
iMockLTSY.NotifyTerminated( mockLtsyStatus );
|
|
104 |
iMockLTSY.CompleteL( EPacketEnumerateMbmsMonitorServiceList, KErrNone, data );
|
|
105 |
User::WaitForRequest( mockLtsyStatus );
|
|
106 |
ASSERT_EQUALS( KErrNone, mockLtsyStatus.Int() );
|
|
107 |
|
|
108 |
ASSERT_EQUALS( maxvalue, maxAllowed );
|
|
109 |
|
|
110 |
CFilteringActiveScheduler scheduler;
|
|
111 |
CActiveScheduler::Install( &scheduler );
|
|
112 |
|
|
113 |
//List retriever
|
|
114 |
CRetrievePcktMbmsMonitoredServices* monitorList = CRetrievePcktMbmsMonitoredServices::NewL( packetService );
|
|
115 |
CleanupStack::PushL( monitorList );
|
|
116 |
|
|
117 |
CActiveRetriever::ResetRequestsNumber();
|
|
118 |
CActiveRetriever* activeRetriever = CActiveRetriever::NewL( *monitorList );
|
|
119 |
CleanupStack::PushL( activeRetriever );
|
|
120 |
scheduler.AddRetrieverL( *activeRetriever );
|
|
121 |
|
|
122 |
RBuf8 expectData1;
|
|
123 |
CleanupClosePushL( expectData1 );
|
|
124 |
TInt i;
|
|
125 |
TMockLtsyData1<TInt> expExpect1( i );
|
|
126 |
expExpect1.SerialiseL( expectData1 );
|
|
127 |
|
|
128 |
RBuf8 completeData;
|
|
129 |
CleanupClosePushL( completeData );
|
|
130 |
|
|
131 |
TRequestStatus aReqStatus;
|
|
132 |
RPacketService::TMbmsServiceAvailabilityV1 existingParams;
|
|
133 |
|
|
134 |
|
|
135 |
CPcktMbmsMonitoredServiceList* multipleEntries = CPcktMbmsMonitoredServiceList ::NewL();
|
|
136 |
CleanupStack::PushL( multipleEntries );
|
|
137 |
|
|
138 |
for( TInt i = 0; i < MBMS_MONITORSERVICECOUNTMULTIPLE; i++ )
|
|
139 |
{
|
|
140 |
existingParams.iTmgi.SetServiceId( i );
|
|
141 |
existingParams.iTmgi.SetMCC( i );
|
|
142 |
existingParams.iTmgi.SetMNC( i );
|
|
143 |
existingParams.iMbmsServiceMode = KBroadcast;
|
|
144 |
existingParams.iMbmsAccessBearer = E2GBearer;
|
|
145 |
existingParams.iMbmsAvailabilityStatus = EMbmsUnavailable;
|
|
146 |
multipleEntries->AddEntryL( existingParams );
|
|
147 |
}
|
|
148 |
|
|
149 |
iMockLTSY.ExpectL( EPacketUpdateMbmsMonitorServiceList, expectData1 );
|
|
150 |
iMockLTSY.CompleteL( EPacketUpdateMbmsMonitorServiceList, KErrNone, completeData );
|
|
151 |
|
|
152 |
packetService.UpdateMbmsMonitorServiceListL(aReqStatus, EAddEntries, multipleEntries );
|
|
153 |
User::WaitForRequest( aReqStatus );
|
|
154 |
ASSERT_EQUALS( KErrNone, aReqStatus.Int() );
|
|
155 |
|
|
156 |
monitorList->Start( activeRetriever->Status() );
|
|
157 |
activeRetriever->Activate();
|
|
158 |
scheduler.StartScheduler();
|
|
159 |
|
|
160 |
ASSERT_EQUALS( 0, CActiveRetriever::ResetRequestsNumber() );
|
|
161 |
ASSERT_EQUALS( KErrNone, activeRetriever->iStatus.Int() );
|
|
162 |
|
|
163 |
CPcktMbmsMonitoredServiceList* list = monitorList->RetrieveListL();
|
|
164 |
CleanupStack::PushL( list );
|
|
165 |
|
|
166 |
ASSERT_EQUALS(MBMS_MONITORSERVICECOUNTMULTIPLE, list->Enumerate() );
|
|
167 |
|
|
168 |
RBuf8 expectData2;
|
|
169 |
CleanupClosePushL( expectData2 );
|
|
170 |
TInt j;
|
|
171 |
TMockLtsyData1<TInt> expExpect2( j );
|
|
172 |
expExpect2.SerialiseL( expectData2 );
|
|
173 |
|
|
174 |
RBuf8 completeData2;
|
|
175 |
CleanupClosePushL( completeData2 );
|
|
176 |
|
|
177 |
RPacketService::TMbmsServiceAvailabilityV1 updatedParams;
|
|
178 |
|
|
179 |
CPcktMbmsMonitoredServiceList* multipleEntries2 = CPcktMbmsMonitoredServiceList ::NewL();
|
|
180 |
CleanupStack::PushL( multipleEntries2 );
|
|
181 |
|
|
182 |
for( TInt i = 0; i < MBMS_MONITORSERVICECOUNTMULTIPLE; i++ )
|
|
183 |
{
|
|
184 |
updatedParams.iTmgi.SetServiceId( i );
|
|
185 |
updatedParams.iTmgi.SetMCC( i );
|
|
186 |
updatedParams.iTmgi.SetMNC( i );
|
|
187 |
updatedParams.iMbmsServiceMode = KBroadcast;
|
|
188 |
updatedParams.iMbmsAccessBearer = E2GBearer;
|
|
189 |
updatedParams.iMbmsAvailabilityStatus = EMbmsAvailable;
|
|
190 |
multipleEntries2->AddEntryL( updatedParams );
|
|
191 |
}
|
|
192 |
|
|
193 |
|
|
194 |
//-------------------------------------------------------------------------
|
|
195 |
// TEST: Successful completion request of
|
|
196 |
// RPacketService::NotifyMbmsServiceAvailabilityChange.
|
|
197 |
//-------------------------------------------------------------------------
|
|
198 |
|
|
199 |
// RPacketService::NotifyMbmsServiceAvailabilityListChange
|
|
200 |
packetService.NotifyMbmsServiceAvailabilityChange( requestStatus );
|
|
201 |
|
|
202 |
TInt complete2 = 0;
|
|
203 |
TMockLtsyData1< TInt > dataForComplete2( complete2 );
|
|
204 |
dataForComplete2.SerialiseL( completeData2 );
|
|
205 |
|
|
206 |
iMockLTSY.NotifyTerminated( mockLtsyStatus );
|
|
207 |
iMockLTSY.CompleteL( EPacketNotifyMbmsServiceAvailabilityChange, KErrNone, completeData2 );
|
|
208 |
|
|
209 |
User::WaitForRequest( mockLtsyStatus );
|
|
210 |
AssertMockLtsyStatusL();
|
|
211 |
// ensure that RPacketService::NotifyMbmsServiceAvailabilityListChange completes with status KErrNone
|
|
212 |
ASSERT_EQUALS( KErrNone, mockLtsyStatus.Int() );
|
|
213 |
User::WaitForRequest( requestStatus );
|
|
214 |
AssertMockLtsyStatusL();
|
|
215 |
ASSERT_EQUALS( KErrNone, requestStatus.Int() );
|
|
216 |
|
|
217 |
monitorList->Start( activeRetriever->Status() );
|
|
218 |
activeRetriever->Activate();
|
|
219 |
scheduler.StartScheduler();
|
|
220 |
|
|
221 |
ASSERT_EQUALS( 0, CActiveRetriever::ResetRequestsNumber() );
|
|
222 |
ASSERT_EQUALS( KErrNone, activeRetriever->iStatus.Int() );
|
|
223 |
|
|
224 |
list = monitorList->RetrieveListL();
|
|
225 |
CleanupStack::PushL( list );
|
|
226 |
// check that monitored list has been updated correctly.
|
|
227 |
ASSERT_TRUE( TComparator<CPcktMbmsMonitoredServiceList>::IsEqual( *multipleEntries2, *list ) );
|
|
228 |
|
|
229 |
//
|
|
230 |
// TEST END
|
|
231 |
//
|
|
232 |
|
|
233 |
AssertMockLtsyStatusL();
|
|
234 |
CleanupStack::PopAndDestroy( 14, this ); // multipleEntries2, expectData2, list, multipleEntries, completeData, expectData1, activeRetriever, monitorList, data, packetMbmsContext, packetService, this
|
|
235 |
}
|
|
236 |
|