24
|
1 |
// Copyright (c) 2007-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 |
// Test step definitions for the UssdMessaging functional unit.
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@internalTechnology
|
|
20 |
*/
|
|
21 |
|
|
22 |
#include "cctsyintegrationtestussdmessaging.h"
|
|
23 |
#include "cetelsessionmgr.h"
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
CCTSYIntegrationTestUssdMessagingBase::CCTSYIntegrationTestUssdMessagingBase(CEtelSessionMgr& aEtelSessionMgr)
|
|
28 |
: CCTSYIntegrationTestSuiteStepBase(aEtelSessionMgr), iSmsStoreTsyTestHelper(*this),iNetworkTsyTestHelper(*this)
|
|
29 |
/**
|
|
30 |
* Constructor
|
|
31 |
*/
|
|
32 |
{
|
|
33 |
}
|
|
34 |
|
|
35 |
CCTSYIntegrationTestUssdMessagingBase::~CCTSYIntegrationTestUssdMessagingBase()
|
|
36 |
/*
|
|
37 |
* Destructor
|
|
38 |
*/
|
|
39 |
{
|
|
40 |
}
|
|
41 |
|
|
42 |
|
|
43 |
TInt CCTSYIntegrationTestUssdMessagingBase::SimulateNetworkSendsReleaseCompleteL()
|
|
44 |
/**
|
|
45 |
* Helper function
|
|
46 |
*
|
|
47 |
* Simulate network sends a release complete message. Not implemented!
|
|
48 |
*
|
|
49 |
*
|
|
50 |
* @return KErrNone if everything is OK, the error code in any other case
|
|
51 |
*/
|
|
52 |
{
|
|
53 |
// This function should call whatever APIs are required to tell the simulator to simulate network sends a release complete message
|
|
54 |
DisplayUserInteractionPromptL(_L("Now we should simulate a Request Complete message. Press any key to continue."), ETimeLong);
|
|
55 |
return KErrNone;
|
|
56 |
}
|
|
57 |
|
|
58 |
TInt CCTSYIntegrationTestUssdMessagingBase::SimulateNetworkSendsNotifyMessageL(RMobileUssdMessaging::TMobileUssdMessageType /*aType*/, TInt /*aLength*/)
|
|
59 |
/**
|
|
60 |
* Helper function
|
|
61 |
*
|
|
62 |
* Simulate network sends a USSD notify message. Not implemented!
|
|
63 |
*
|
|
64 |
* @param aType The message type
|
|
65 |
* @param aLength The number of charecters in the messege
|
|
66 |
*
|
|
67 |
* @return KErrNone if everything is OK, the error code in any other case
|
|
68 |
*/
|
|
69 |
{
|
|
70 |
// This function should call whatever APIs are required to tell the simulator to simulate network sends a USSD notify message
|
|
71 |
DisplayUserInteractionPromptL(_L("Now we should simulate a Notify message. Press any key to continue."), ETimeLong);
|
|
72 |
return KErrNone;
|
|
73 |
}
|
|
74 |
|
|
75 |
TInt CCTSYIntegrationTestUssdMessagingBase::SendSimulateCompleteCheckCompleteL(RMobileUssdMessaging &aUssdMessaging, TDes8& aMsg,RMobileUssdMessaging::TMobileUssdMessageType aMessageType)
|
|
76 |
/**
|
|
77 |
* Send a message, Simulate network complete, Check RMobileUssdMessaging::NotifyNetworkRelease completes with aMsgData with length
|
|
78 |
*
|
|
79 |
* @param aUssdMessaging a reference to the USSD Messaging session.
|
|
80 |
* @param aMsg The message USSD string
|
|
81 |
* @param aMessageType The type of message; if type is EUssdMORequest, simulate requestcomplete, otherwise, simulate
|
|
82 |
*
|
|
83 |
* @return KErrNone if everything is OK, the error code in any other case
|
|
84 |
*/
|
|
85 |
{
|
|
86 |
TInt ret=KErrNone;
|
|
87 |
TInt last;
|
|
88 |
|
|
89 |
// start listening for incoming messages
|
|
90 |
TExtEtelRequestStatus recvMsgStatus(aUssdMessaging,EMobileUssdMessagingReceiveMessage);
|
|
91 |
CleanupStack::PushL(recvMsgStatus);
|
|
92 |
RMobileUssdMessaging::TGsmUssdMessageData recvUssdMsg;
|
|
93 |
RMobileUssdMessaging::TMobileUssdAttributesV1 recvAttributes;
|
|
94 |
RMobileUssdMessaging::TMobileUssdAttributesV1Pckg recvAttributesPckg(recvAttributes);
|
|
95 |
aUssdMessaging.ReceiveMessage(recvMsgStatus,recvUssdMsg,recvAttributesPckg);
|
|
96 |
|
|
97 |
// Encode USSD string into a TGsmUssdMessageData buffer.
|
|
98 |
TBuf8<200> sevenBitStr;
|
|
99 |
iSmsStoreTsyTestHelper.GsmLibSmsPackMessage( sevenBitStr, aMsg, aMsg.Length());
|
|
100 |
RMobileUssdMessaging::TGsmUssdMessageData sendUssdMsg = sevenBitStr;
|
|
101 |
|
|
102 |
// Send a USSD message to the network with RMobileUssdMessaging::SendMessage with aMsgData=encoded TGsmUssdMessageData and aMsgAttributes.iDcs= 0x00 (No class, uncompressed) ,aMsgAttributes.iFlags=RMobileUssdMessaging::KUssdMessageType | RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageDcs , aMsgAttributes.iFormat=RMobileUssdMessaging::EFormatPackedString , aMsgAttributes.iType=aMessageType
|
|
103 |
TExtEtelRequestStatus sendMsgStatus(aUssdMessaging,EMobileUssdMessagingSendMessage);
|
|
104 |
CleanupStack::PushL(sendMsgStatus);
|
|
105 |
RMobileUssdMessaging::TMobileUssdAttributesV1 sendAttributes;
|
|
106 |
sendAttributes.iDcs=0x00;
|
|
107 |
sendAttributes.iFlags=RMobileUssdMessaging::KUssdMessageType | RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageDcs;
|
|
108 |
sendAttributes.iFormat=RMobileUssdMessaging::EFormatPackedString;
|
|
109 |
sendAttributes.iType=aMessageType;
|
|
110 |
RMobileUssdMessaging::TMobileUssdAttributesV1Pckg sendAttributesPckg(sendAttributes);
|
|
111 |
aUssdMessaging.SendMessage(sendMsgStatus, sendUssdMsg, sendAttributesPckg);
|
|
112 |
last = WaitForRequestWithTimeOut(sendMsgStatus, ETimeLong);
|
|
113 |
ASSERT_EQUALS(last,
|
|
114 |
KErrNone, _L("RMobileUssdMessaging::SendMessage did not complete."));
|
|
115 |
if(last!=KErrNone)
|
|
116 |
{
|
|
117 |
ret=last;
|
|
118 |
}
|
|
119 |
last = sendMsgStatus.Int();
|
|
120 |
ASSERT_EQUALS(last,KErrNone,
|
|
121 |
_L("RMobileUssdMessaging::SendMessage completed with incorrect error"));
|
|
122 |
if(last!=KErrNone)
|
|
123 |
{
|
|
124 |
ret=last;
|
|
125 |
}
|
|
126 |
|
|
127 |
// Post network release notification
|
|
128 |
TExtEtelRequestStatus releaseMsgStatus(aUssdMessaging,EMobileUssdMessagingNotifyNetworkRelease);
|
|
129 |
CleanupStack::PushL(releaseMsgStatus);
|
|
130 |
RMobilePhone::TMobilePhoneSendSSRequestV3 ssRequest;
|
|
131 |
RMobilePhone::TMobilePhoneSendSSRequestV3Pckg ssRequestPckg(ssRequest);
|
|
132 |
aUssdMessaging.NotifyNetworkRelease(releaseMsgStatus,ssRequestPckg,sendAttributesPckg);
|
|
133 |
|
|
134 |
// Simulated network sends a release complete
|
|
135 |
last = SimulateNetworkSendsReleaseCompleteL();
|
|
136 |
ASSERT_EQUALS(last,KErrNone,_L("CCTSYIntegrationTestUssdMessagingBase::SimulateNetworkSendsReleaseCompleteL returned an error"));
|
|
137 |
if(last!=KErrNone)
|
|
138 |
{
|
|
139 |
ret=last;
|
|
140 |
}
|
|
141 |
|
|
142 |
// Check RMobileUssdMessaging::NotifyNetworkRelease completes with aMsgData with length > 0
|
|
143 |
last = WaitForRequestWithTimeOut(releaseMsgStatus, ETimeLong);
|
|
144 |
ASSERT_EQUALS(last,
|
|
145 |
KErrNone, _L("RMobileUssdMessaging::NotifyNetworkRelease did not complete."));
|
|
146 |
if(last!=KErrNone)
|
|
147 |
{
|
|
148 |
ret=last;
|
|
149 |
}
|
|
150 |
ASSERT_TRUE(recvUssdMsg.Length()>0,_L("RMobileUssdMessaging::NotifyNetworkRelease completed with length 0"));
|
|
151 |
if(recvUssdMsg.Length()==0)
|
|
152 |
{
|
|
153 |
ret = KErrGeneral;
|
|
154 |
}
|
|
155 |
|
|
156 |
// Pop:
|
|
157 |
// releaseMsgStatus
|
|
158 |
// sendMsgStatus
|
|
159 |
// recvMsgStatus
|
|
160 |
CleanupStack::PopAndDestroy(3,&recvMsgStatus);
|
|
161 |
|
|
162 |
return ret;
|
|
163 |
}
|
|
164 |
|
|
165 |
TInt CCTSYIntegrationTestUssdMessagingBase::SendSimulateNotifyCheckCompleteL(RMobileUssdMessaging &aUssdMessaging, TDes8& aMsg,RMobileUssdMessaging::TMobileUssdMessageType aMessageType,RMobileUssdMessaging::TMobileUssdMessageType aSimulateType, TInt aLength)
|
|
166 |
/**
|
|
167 |
* Send a message, Simulate network notify, Check RMobileUssdMessaging::NotifyNetworkRelease completes with aMsgData with length
|
|
168 |
*
|
|
169 |
* @param aUssdMessaging a reference to the USSD Messaging session.
|
|
170 |
* @param aMsg The message USSD string
|
|
171 |
* @param aMessageType The type of message; if type is EUssdMORequest, simulate requestcomplete, otherwise, simulate
|
|
172 |
* @param aSimulateType the simulated message type
|
|
173 |
* @param aLength the length of the simulated message.
|
|
174 |
*
|
|
175 |
* @return KErrNone if everything is OK, the error code in any other case
|
|
176 |
*/
|
|
177 |
{
|
|
178 |
TInt ret=KErrNone;
|
|
179 |
TInt last;
|
|
180 |
|
|
181 |
// start listening for incoming messages
|
|
182 |
TExtEtelRequestStatus recvMsgStatus(aUssdMessaging,EMobileUssdMessagingReceiveMessage);
|
|
183 |
CleanupStack::PushL(recvMsgStatus);
|
|
184 |
RMobileUssdMessaging::TGsmUssdMessageData recvUssdMsg;
|
|
185 |
RMobileUssdMessaging::TMobileUssdAttributesV1 recvAttributes;
|
|
186 |
RMobileUssdMessaging::TMobileUssdAttributesV1Pckg recvAttributesPckg(recvAttributes);
|
|
187 |
aUssdMessaging.ReceiveMessage(recvMsgStatus,recvUssdMsg,recvAttributesPckg);
|
|
188 |
|
|
189 |
// Encode USSD string into a TGsmUssdMessageData buffer.
|
|
190 |
TBuf8<200> sevenBitStr;
|
|
191 |
iSmsStoreTsyTestHelper.GsmLibSmsPackMessage( sevenBitStr, aMsg, aMsg.Length());
|
|
192 |
RMobileUssdMessaging::TGsmUssdMessageData sendUssdMsg = sevenBitStr;
|
|
193 |
|
|
194 |
// Send a USSD message to the network with RMobileUssdMessaging::SendMessage with aMsgData=encoded TGsmUssdMessageData and aMsgAttributes.iDcs=0x00 (No class, uncompressed),aMsgAttributes.iFlags=RMobileUssdMessaging::KUssdMessageType | RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageDcs , aMsgAttributes.iFormat=RMobileUssdMessaging::EFormatPackedString , aMsgAttributes.iType=aMessageType
|
|
195 |
TExtEtelRequestStatus sendMsgStatus(aUssdMessaging,EMobileUssdMessagingSendMessage);
|
|
196 |
CleanupStack::PushL(sendMsgStatus);
|
|
197 |
RMobileUssdMessaging::TMobileUssdAttributesV1 sendAttributes;
|
|
198 |
sendAttributes.iDcs=0x00;
|
|
199 |
sendAttributes.iFlags=RMobileUssdMessaging::KUssdMessageType | RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageDcs;
|
|
200 |
sendAttributes.iFormat=RMobileUssdMessaging::EFormatPackedString;
|
|
201 |
sendAttributes.iType=aMessageType;
|
|
202 |
RMobileUssdMessaging::TMobileUssdAttributesV1Pckg sendAttributesPckg(sendAttributes);
|
|
203 |
aUssdMessaging.SendMessage(sendMsgStatus, sendUssdMsg, sendAttributesPckg);
|
|
204 |
last = WaitForRequestWithTimeOut(sendMsgStatus, ETimeLong);
|
|
205 |
ASSERT_EQUALS(last,
|
|
206 |
KErrNone, _L("RMobileUssdMessaging::SendMessage did not complete."));
|
|
207 |
if(last!=KErrNone)
|
|
208 |
{
|
|
209 |
ret=last;
|
|
210 |
}
|
|
211 |
last = sendMsgStatus.Int();
|
|
212 |
ASSERT_EQUALS(last,KErrNone,
|
|
213 |
_L("RMobileUssdMessaging::SendMessage completed with incorrect error"));
|
|
214 |
if(last!=KErrNone)
|
|
215 |
{
|
|
216 |
ret=last;
|
|
217 |
}
|
|
218 |
|
|
219 |
// Post network release notification
|
|
220 |
TExtEtelRequestStatus releaseMsgStatus(aUssdMessaging,EMobileUssdMessagingNotifyNetworkRelease);
|
|
221 |
CleanupStack::PushL(releaseMsgStatus);
|
|
222 |
RMobilePhone::TMobilePhoneSendSSRequestV3 ssRequest;
|
|
223 |
RMobilePhone::TMobilePhoneSendSSRequestV3Pckg ssRequestPckg(ssRequest);
|
|
224 |
aUssdMessaging.NotifyNetworkRelease(releaseMsgStatus,ssRequestPckg,sendAttributesPckg);
|
|
225 |
|
|
226 |
// Simulated network sends a release complete
|
|
227 |
last = SimulateNetworkSendsNotifyMessageL(aSimulateType,aLength);
|
|
228 |
ASSERT_EQUALS(last,KErrNone,_L("CCTSYIntegrationTestUssdMessagingBase::SimulateNetworkSendsReleaseCompleteL returned an error"));
|
|
229 |
if(last!=KErrNone)
|
|
230 |
{
|
|
231 |
ret=last;
|
|
232 |
}
|
|
233 |
|
|
234 |
// Check RMobileUssdMessaging::NotifyNetworkRelease completes with aMsgData with length > 0
|
|
235 |
last = WaitForRequestWithTimeOut(releaseMsgStatus, ETimeLong);
|
|
236 |
ASSERT_EQUALS(last,
|
|
237 |
KErrNone, _L("RMobileUssdMessaging::NotifyNetworkRelease did not complete."));
|
|
238 |
if(last!=KErrNone)
|
|
239 |
{
|
|
240 |
ret=last;
|
|
241 |
}
|
|
242 |
last = releaseMsgStatus.Int();
|
|
243 |
ASSERT_EQUALS(last,
|
|
244 |
KErrNone, _L("RMobileUssdMessaging::NotifyNetworkRelease returned an error"));
|
|
245 |
if(last!=KErrNone)
|
|
246 |
{
|
|
247 |
ret=last;
|
|
248 |
}
|
|
249 |
ASSERT_EQUALS(recvAttributes.iType,aSimulateType,
|
|
250 |
_L("RMobileUssdMessaging::ReceiveMessage completed with incorrect USSD message type"));
|
|
251 |
ASSERT_TRUE(recvUssdMsg.Length() > 0,
|
|
252 |
_L("RMobileUssdMessaging::ReceiveMessage completed with msglength <=0"));
|
|
253 |
if((recvUssdMsg.Length()==0)||(recvAttributes.iType!=aSimulateType))
|
|
254 |
{
|
|
255 |
ret = KErrGeneral;
|
|
256 |
}
|
|
257 |
|
|
258 |
// Pop:
|
|
259 |
// releaseMsgStatus
|
|
260 |
// sendMsgStatus
|
|
261 |
// recvMsgStatus
|
|
262 |
CleanupStack::PopAndDestroy(3,&recvMsgStatus);
|
|
263 |
|
|
264 |
return ret;
|
|
265 |
|
|
266 |
}
|
|
267 |
|
|
268 |
TInt CCTSYIntegrationTestUssdMessagingBase::SimulateNotifyCheckReceiveL(RMobileUssdMessaging &aUssdMessaging,RMobileUssdMessaging::TMobileUssdMessageType aSimulateType, TInt aLength)
|
|
269 |
/**
|
|
270 |
* Simulated network sends a USSD notify message, Receive MT notify from network, Check received notification
|
|
271 |
*
|
|
272 |
* @param aUssdMessaging a reference to the USSD Messaging session.
|
|
273 |
* @param aSimulateType the simulated message type
|
|
274 |
* @param aLength the length of the simulated message.
|
|
275 |
* @param aCheckType the type of the recived notification
|
|
276 |
* @return KErrNone if everything is OK, the error code in any other case
|
|
277 |
*/
|
|
278 |
{
|
|
279 |
TInt ret=KErrNone;
|
|
280 |
TInt last;
|
|
281 |
|
|
282 |
// start listening for incoming messages
|
|
283 |
TExtEtelRequestStatus recvMsgStatus(aUssdMessaging,EMobileUssdMessagingReceiveMessage);
|
|
284 |
CleanupStack::PushL(recvMsgStatus);
|
|
285 |
RMobileUssdMessaging::TGsmUssdMessageData recvUssdMsg;
|
|
286 |
RMobileUssdMessaging::TMobileUssdAttributesV1 recvAttributes;
|
|
287 |
RMobileUssdMessaging::TMobileUssdAttributesV1Pckg recvAttributesPckg(recvAttributes);
|
|
288 |
aUssdMessaging.ReceiveMessage(recvMsgStatus,recvUssdMsg,recvAttributesPckg);
|
|
289 |
|
|
290 |
// Simulated network sends a USSD notify message.
|
|
291 |
last = SimulateNetworkSendsNotifyMessageL(aSimulateType,aLength);
|
|
292 |
ASSERT_EQUALS(last,KErrNone,_L("CCTSYIntegrationTestUssdMessagingBase::SimulateNetworkSendsNotifyMessageL returned an error"));
|
|
293 |
if(last!=KErrNone)
|
|
294 |
{
|
|
295 |
ret=last;
|
|
296 |
}
|
|
297 |
|
|
298 |
// === Receive MT notify from network ===
|
|
299 |
|
|
300 |
// Check RMobileUssdMessaging::ReceiveMessage completes with aMsgData with length > 0
|
|
301 |
// Check RMobileUssdMessaging::ReceiveMessage completes with aMsgAttributes.iType=aCheckType
|
|
302 |
last = WaitForRequestWithTimeOut(recvMsgStatus, ETimeLong);
|
|
303 |
ASSERT_EQUALS(last,
|
|
304 |
KErrNone, _L("RMobileUssdMessaging::ReceiveMessage did not complete.")) ;
|
|
305 |
if(last!=KErrNone)
|
|
306 |
{
|
|
307 |
ret=last;
|
|
308 |
}
|
|
309 |
last = recvMsgStatus.Int();
|
|
310 |
ASSERT_EQUALS(last,KErrNone,
|
|
311 |
_L("RMobileUssdMessaging::ReceiveMessage completed with incorrect error"));
|
|
312 |
if(last!=KErrNone)
|
|
313 |
{
|
|
314 |
ret=last;
|
|
315 |
}
|
|
316 |
ASSERT_EQUALS(recvAttributes.iType,aSimulateType,
|
|
317 |
_L("RMobileUssdMessaging::ReceiveMessage completed with incorrect USSD message type"));
|
|
318 |
ASSERT_TRUE(recvUssdMsg.Length() > 0,
|
|
319 |
_L("RMobileUssdMessaging::ReceiveMessage completed with msglength <=0"));
|
|
320 |
if((recvUssdMsg.Length()==0)||(recvAttributes.iType!=aSimulateType))
|
|
321 |
{
|
|
322 |
ret = KErrGeneral;
|
|
323 |
}
|
|
324 |
|
|
325 |
// Pop:
|
|
326 |
// recvMsgStatus
|
|
327 |
CleanupStack::PopAndDestroy(1,&recvMsgStatus);
|
|
328 |
|
|
329 |
return ret;
|
|
330 |
|
|
331 |
}
|
|
332 |
CCTSYIntegrationTestUssdMessaging0001::CCTSYIntegrationTestUssdMessaging0001(CEtelSessionMgr& aEtelSessionMgr)
|
|
333 |
: CCTSYIntegrationTestUssdMessagingBase(aEtelSessionMgr)
|
|
334 |
/**
|
|
335 |
* Constructor.
|
|
336 |
*/
|
|
337 |
{
|
|
338 |
SetTestStepName(CCTSYIntegrationTestUssdMessaging0001::GetTestStepName());
|
|
339 |
}
|
|
340 |
|
|
341 |
CCTSYIntegrationTestUssdMessaging0001::~CCTSYIntegrationTestUssdMessaging0001()
|
|
342 |
/**
|
|
343 |
* Destructor.
|
|
344 |
*/
|
|
345 |
{
|
|
346 |
}
|
|
347 |
|
|
348 |
TVerdict CCTSYIntegrationTestUssdMessaging0001::doTestStepL()
|
|
349 |
/**
|
|
350 |
* @SYMTestCaseID BA-CTSY-INT-USSDM-0001
|
|
351 |
* @SYMFssID BA/CTSY/USSDM-0001
|
|
352 |
* @SYMTestCaseDesc Get USSD Caps
|
|
353 |
* @SYMTestPriority High
|
|
354 |
* @SYMTestActions RMobileUssdMessaging::GetCaps
|
|
355 |
* @SYMTestExpectedResults Pass - Correct caps returned.
|
|
356 |
* @SYMTestType CIT
|
|
357 |
* @SYMTestCaseDependencies live/automatic
|
|
358 |
*
|
|
359 |
* Reason for test: Verify correct USSD caps returned.
|
|
360 |
*
|
|
361 |
* @return - TVerdict code
|
|
362 |
*/
|
|
363 |
{
|
|
364 |
|
|
365 |
//Get USSD Caps
|
|
366 |
//Verify correct USSD caps returned.
|
|
367 |
//
|
|
368 |
// SET UP
|
|
369 |
//
|
|
370 |
RMobileUssdMessaging& mobileUssdMessaging = iEtelSessionMgr.GetUssdMessagingL(KMainServer, KMainPhone,KMainUssdMessaging);
|
|
371 |
|
|
372 |
|
|
373 |
//
|
|
374 |
// SET UP END
|
|
375 |
//
|
|
376 |
|
|
377 |
StartTest();
|
|
378 |
|
|
379 |
//
|
|
380 |
// TEST START
|
|
381 |
//
|
|
382 |
|
|
383 |
|
|
384 |
// Check RMobileUssdMessaging::GetCaps returns iUssdFormat of KCapsPackedString
|
|
385 |
// Check RMobileUssdMessaging::GetCaps returns iUssdTypes of KCapsMOUssd | KCapsMTUssd
|
|
386 |
RMobileUssdMessaging::TMobileUssdCapsV1 ussdCaps;
|
|
387 |
RMobileUssdMessaging::TMobileUssdCapsV1Pckg ussdCapsPk(ussdCaps);
|
|
388 |
ASSERT_EQUALS(mobileUssdMessaging.GetCaps(ussdCapsPk), KErrNone, _L("RMobileUssdMessaging::GetCaps returned error"));
|
|
389 |
ASSERT_EQUALS(ussdCaps.iUssdFormat, (TUint32)RMobileUssdMessaging::KCapsPackedString, _L("RMobileUssdMessaging::GetCaps returned incorrect iUssdFormat"));
|
|
390 |
TUint32 expectedCaps = RMobileUssdMessaging::KCapsMOUssd | RMobileUssdMessaging::KCapsMTUssd;
|
|
391 |
TUint32 unwantedCaps = KNoUnwantedBits;
|
|
392 |
ASSERT_BITS_SET(ussdCapsPk().iUssdTypes, expectedCaps, unwantedCaps, _L("RMobileUssdMessaging::GetCaps returned incorrect iUssdTypes"));
|
|
393 |
|
|
394 |
//
|
|
395 |
// TEST END
|
|
396 |
//
|
|
397 |
|
|
398 |
StartCleanup();
|
|
399 |
|
|
400 |
|
|
401 |
return TestStepResult();
|
|
402 |
}
|
|
403 |
|
|
404 |
TPtrC CCTSYIntegrationTestUssdMessaging0001::GetTestStepName()
|
|
405 |
/**
|
|
406 |
* @return The test step name.
|
|
407 |
*/
|
|
408 |
{
|
|
409 |
return _L("CCTSYIntegrationTestUssdMessaging0001");
|
|
410 |
}
|
|
411 |
|
|
412 |
|
|
413 |
|
|
414 |
CCTSYIntegrationTestUssdMessaging0002::CCTSYIntegrationTestUssdMessaging0002(CEtelSessionMgr& aEtelSessionMgr)
|
|
415 |
: CCTSYIntegrationTestUssdMessagingBase(aEtelSessionMgr)
|
|
416 |
/**
|
|
417 |
* Constructor.
|
|
418 |
*/
|
|
419 |
{
|
|
420 |
SetTestStepName(CCTSYIntegrationTestUssdMessaging0002::GetTestStepName());
|
|
421 |
}
|
|
422 |
|
|
423 |
CCTSYIntegrationTestUssdMessaging0002::~CCTSYIntegrationTestUssdMessaging0002()
|
|
424 |
/**
|
|
425 |
* Destructor.
|
|
426 |
*/
|
|
427 |
{
|
|
428 |
}
|
|
429 |
|
|
430 |
|
|
431 |
TVerdict CCTSYIntegrationTestUssdMessaging0002::doTestStepL()
|
|
432 |
/**
|
|
433 |
* @SYMTestCaseID BA-CTSY-INT-USSDM-0002
|
|
434 |
* @SYMFssID BA/CTSY/USSDM-0002
|
|
435 |
* @SYMTestCaseDesc Send a valid USSD request.
|
|
436 |
* @SYMTestPriority High
|
|
437 |
* @SYMTestActions RMobileUssdMessaging::GetCaps, RMobileUssdMessaging::SendMessage, RMobileUssdMessaging::ReceiveMessage
|
|
438 |
* @SYMTestExpectedResults Pass - Message sent and reply received from network.
|
|
439 |
* @SYMTestType CIT
|
|
440 |
* @SYMTestCaseDependencies live/automatic
|
|
441 |
*
|
|
442 |
* Reason for test: Verify message sent and reply received.
|
|
443 |
*
|
|
444 |
* @return - TVerdict code
|
|
445 |
*/
|
|
446 |
{
|
|
447 |
//Send a valid USSD request.
|
|
448 |
//Verify message sent and reply received..
|
|
449 |
//
|
|
450 |
// SET UP
|
|
451 |
//
|
|
452 |
|
|
453 |
RMobileUssdMessaging& mobileUssdMessaging = iEtelSessionMgr.GetUssdMessagingL(KMainServer, KMainPhone,KMainUssdMessaging);
|
|
454 |
// Check RMobileUssdMessaging::GetCaps returns iUssdFormat of KCapsPackedString
|
|
455 |
RMobileUssdMessaging::TMobileUssdCapsV1 ussdCaps;
|
|
456 |
RMobileUssdMessaging::TMobileUssdCapsV1Pckg ussdCapsPk(ussdCaps);
|
|
457 |
CHECK_TRUE_L(mobileUssdMessaging.GetCaps(ussdCapsPk)==KErrNone,
|
|
458 |
_L("RMobileUssdMessaging::GetCaps returned error"));
|
|
459 |
CHECK_TRUE_L(ussdCapsPk().iUssdFormat==RMobileUssdMessaging::KCapsPackedString ,
|
|
460 |
_L("RMobileUssdMessaging::GetCaps returned incorrect iUssdFormat"));
|
|
461 |
|
|
462 |
// Check RMobileUssdMessaging::GetCaps returns iUssdTypes of KCapsMOUssd | KCapsMTUssd
|
|
463 |
TUint32 expectedCaps = RMobileUssdMessaging::KCapsMOUssd | RMobileUssdMessaging::KCapsMTUssd;
|
|
464 |
TUint32 unwantedCaps = KNoUnwantedBits;
|
|
465 |
CHECK_BITS_SET_L(ussdCapsPk().iUssdTypes, expectedCaps, unwantedCaps, _L("RMobileUssdMessaging::GetCaps returned incorrect iUssdTypes"));
|
|
466 |
|
|
467 |
RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
|
|
468 |
TInt ret = iNetworkTsyTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone);
|
|
469 |
CHECK_EQUALS_L(ret, KErrNone,
|
|
470 |
_L("RMobilePhone::NotifyNetworkRegistrationStatusChange network registration failed"));
|
|
471 |
|
|
472 |
//
|
|
473 |
// SET UP END
|
|
474 |
//
|
|
475 |
|
|
476 |
StartTest();
|
|
477 |
|
|
478 |
//
|
|
479 |
// TEST START
|
|
480 |
//
|
|
481 |
|
|
482 |
|
|
483 |
// === Send a valid USSD request ===
|
|
484 |
|
|
485 |
// Encode a the USSD request "*#30#" (Caller ID presentation) into a TGsmUssdMessageData buffer.
|
|
486 |
TBuf8<100> eightBitStr = _L8("*#30#");
|
|
487 |
TBuf8<100> sevenBitStr;
|
|
488 |
iSmsStoreTsyTestHelper.GsmLibSmsPackMessage( sevenBitStr, eightBitStr, eightBitStr.Length());
|
|
489 |
|
|
490 |
RMobileUssdMessaging::TGsmUssdMessageData sendUssdMsg = sevenBitStr;
|
|
491 |
RMobileUssdMessaging::TMobileUssdAttributesV1 sendAttributes;
|
|
492 |
|
|
493 |
// Send a USSD message to the network with RMobileUssdMessaging::SendMessage with
|
|
494 |
// aMsgData=encoded TGsmUssdMessageData and
|
|
495 |
// aMsgAttributes.iDcs=0x00 (No class, uncompressed),
|
|
496 |
// aMsgAttributes.iFlags=RMobileUssdMessaging::KUssdMessageType
|
|
497 |
// | RMobileUssdMessaging::KUssdDataFormat
|
|
498 |
// | RMobileUssdMessaging::KUssdMessageDcs ,
|
|
499 |
// aMsgAttributes.iFormat=RMobileUssdMessaging::EFormatPackedString ,
|
|
500 |
// aMsgAttributes.iType=RMobileUssdMessaging::EUssdMORequest
|
|
501 |
TExtEtelRequestStatus sendMsgStatus(mobileUssdMessaging,EMobileUssdMessagingSendMessage);
|
|
502 |
CleanupStack::PushL(sendMsgStatus);
|
|
503 |
sendAttributes.iDcs = 0x00;
|
|
504 |
sendAttributes.iFlags = RMobileUssdMessaging::KUssdMessageType
|
|
505 |
| RMobileUssdMessaging::KUssdDataFormat
|
|
506 |
| RMobileUssdMessaging::KUssdMessageDcs;
|
|
507 |
sendAttributes.iFormat = RMobileUssdMessaging::EFormatPackedString;
|
|
508 |
sendAttributes.iType = RMobileUssdMessaging::EUssdMORequest;
|
|
509 |
RMobileUssdMessaging::TMobileUssdAttributesV1Pckg sendAttributesPckg(sendAttributes);
|
|
510 |
|
|
511 |
// start listening for incoming messages
|
|
512 |
TExtEtelRequestStatus recvMsgStatus(mobileUssdMessaging,EMobileUssdMessagingReceiveMessage);
|
|
513 |
CleanupStack::PushL(recvMsgStatus);
|
|
514 |
RMobileUssdMessaging::TGsmUssdMessageData recvUssdMsg;
|
|
515 |
RMobileUssdMessaging::TMobileUssdAttributesV1 recvAttributes;
|
|
516 |
RMobileUssdMessaging::TMobileUssdAttributesV1Pckg recvAttributesPckg(recvAttributes);
|
|
517 |
mobileUssdMessaging.ReceiveMessage(recvMsgStatus,recvUssdMsg,recvAttributesPckg);
|
|
518 |
|
|
519 |
// Post network release notification
|
|
520 |
TExtEtelRequestStatus releaseMsgStatus(mobileUssdMessaging,EMobileUssdMessagingNotifyNetworkRelease);
|
|
521 |
CleanupStack::PushL(releaseMsgStatus);
|
|
522 |
RMobilePhone::TMobilePhoneSendSSRequestV3 ssRequest;
|
|
523 |
RMobilePhone::TMobilePhoneSendSSRequestV3Pckg ssRequestPckg(ssRequest);
|
|
524 |
mobileUssdMessaging.NotifyNetworkRelease(releaseMsgStatus,ssRequestPckg,sendAttributesPckg);
|
|
525 |
|
|
526 |
// send message
|
|
527 |
mobileUssdMessaging.SendMessage(sendMsgStatus, sendUssdMsg, sendAttributesPckg);
|
|
528 |
ASSERT_EQUALS(WaitForRequestWithTimeOut(sendMsgStatus, ETimeLong),
|
|
529 |
KErrNone, _L("RMobileUssdMessaging::SendMessage did not complete."));
|
|
530 |
ASSERT_EQUALS(sendMsgStatus.Int(),KErrNone,
|
|
531 |
_L("RMobileUssdMessaging::SendMessage completed with incorrect error"));
|
|
532 |
|
|
533 |
// === Receive network response ===
|
|
534 |
|
|
535 |
// Check RMobileUssdMessaging::ReceiveMessage completes with aMsgData with length > 0
|
|
536 |
// Check RMobileUssdMessaging::ReceiveMessage completes with aMsgAttributes.iType=RMobileUssdMessaging::EUssdMTReply
|
|
537 |
ASSERT_EQUALS(WaitForRequestWithTimeOut(recvMsgStatus, ETimeLong),
|
|
538 |
KErrNone, _L("RMobileUssdMessaging::ReceiveMessage did not complete."));
|
|
539 |
ASSERT_EQUALS(recvMsgStatus.Int(),KErrNone,
|
|
540 |
_L("RMobileUssdMessaging::ReceiveMessage completed with incorrect error"));
|
|
541 |
ASSERT_TRUE(recvUssdMsg.Length() > 0,
|
|
542 |
_L("RMobileUssdMessaging::ReceiveMessage completed with msglength <=0"));
|
|
543 |
ASSERT_EQUALS(recvAttributes.iType,RMobileUssdMessaging::EUssdMTReply,
|
|
544 |
_L("RMobileUssdMessaging::ReceiveMessage completed with incorrect USSD message type"));
|
|
545 |
|
|
546 |
// === Receive network RELEASE COMPLETE message ===
|
|
547 |
|
|
548 |
// Check RMobileUssdMessaging::NotifyNetworkRelease completes with aMsgData with length > 0
|
|
549 |
ASSERT_EQUALS(WaitForRequestWithTimeOut(releaseMsgStatus, ETimeLong),
|
|
550 |
KErrNone, _L("RMobileUssdMessaging::NotifyNetworkRelease did not complete."));
|
|
551 |
ASSERT_EQUALS(releaseMsgStatus.Int(),KErrNone,
|
|
552 |
_L("RMobileUssdMessaging::NotifyNetworkRelease completed with incorrect error"));
|
|
553 |
ASSERT_TRUE(recvUssdMsg.Length() > 0,
|
|
554 |
_L("RMobileUssdMessaging::NotifyNetworkRelease completed with msglength <=0"));
|
|
555 |
|
|
556 |
//
|
|
557 |
// TEST END
|
|
558 |
//
|
|
559 |
|
|
560 |
StartCleanup();
|
|
561 |
|
|
562 |
// Pop:
|
|
563 |
// releaseMsgStatus
|
|
564 |
// recvMsgStatus
|
|
565 |
// sendMsgStatus
|
|
566 |
CleanupStack::PopAndDestroy(3,&sendMsgStatus);
|
|
567 |
|
|
568 |
return TestStepResult();
|
|
569 |
}
|
|
570 |
|
|
571 |
TPtrC CCTSYIntegrationTestUssdMessaging0002::GetTestStepName()
|
|
572 |
/**
|
|
573 |
* @return The test step name.
|
|
574 |
*/
|
|
575 |
{
|
|
576 |
return _L("CCTSYIntegrationTestUssdMessaging0002");
|
|
577 |
}
|
|
578 |
|
|
579 |
|
|
580 |
|
|
581 |
CCTSYIntegrationTestUssdMessaging0003::CCTSYIntegrationTestUssdMessaging0003(CEtelSessionMgr& aEtelSessionMgr)
|
|
582 |
: CCTSYIntegrationTestUssdMessagingBase(aEtelSessionMgr)
|
|
583 |
/**
|
|
584 |
* Constructor.
|
|
585 |
*/
|
|
586 |
{
|
|
587 |
SetTestStepName(CCTSYIntegrationTestUssdMessaging0003::GetTestStepName());
|
|
588 |
}
|
|
589 |
|
|
590 |
CCTSYIntegrationTestUssdMessaging0003::~CCTSYIntegrationTestUssdMessaging0003()
|
|
591 |
/**
|
|
592 |
* Destructor.
|
|
593 |
*/
|
|
594 |
{
|
|
595 |
}
|
|
596 |
|
|
597 |
TVerdict CCTSYIntegrationTestUssdMessaging0003::doTestStepL()
|
|
598 |
/**
|
|
599 |
* @SYMTestCaseID BA-CTSY-INT-USSDM-0003
|
|
600 |
* @SYMFssID BA/CTSY/USSDM-0003
|
|
601 |
* @SYMTestCaseDesc Send an empty USSD request.
|
|
602 |
* @SYMTestPriority High
|
|
603 |
* @SYMTestActions RMobileUssdMessaging::NotifyNetworkRelease
|
|
604 |
* @SYMTestExpectedResults Pass - Message sent and reply received from network.
|
|
605 |
* @SYMTestType CIT
|
|
606 |
* @SYMTestCaseDependencies simulated/manual
|
|
607 |
*
|
|
608 |
* Reason for test: Verify message sent and reply received.
|
|
609 |
*
|
|
610 |
* @return - TVerdict code
|
|
611 |
*/
|
|
612 |
{
|
|
613 |
|
|
614 |
//
|
|
615 |
// SET UP
|
|
616 |
//
|
|
617 |
|
|
618 |
//
|
|
619 |
|
|
620 |
ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10068);
|
|
621 |
User::Leave(KErrNone);
|
|
622 |
|
|
623 |
// Check RMobileUssdMessaging::GetCaps returns iUssdFormat of KCapsPackedString
|
|
624 |
// Check RMobileUssdMessaging::GetCaps returns iUssdTypes of KCapsMOUssd | KCapsMTUssd
|
|
625 |
RMobileUssdMessaging& mobileUssdMessaging = iEtelSessionMgr.GetUssdMessagingL(KMainServer, KMainPhone,KMainUssdMessaging);
|
|
626 |
RMobileUssdMessaging::TMobileUssdCapsV1 ussdCaps;
|
|
627 |
RMobileUssdMessaging::TMobileUssdCapsV1Pckg ussdCapsPk(ussdCaps);
|
|
628 |
CHECK_EQUALS_L(mobileUssdMessaging.GetCaps(ussdCapsPk), KErrNone,
|
|
629 |
_L("RMobileUssdMessaging::GetCaps returned error"));
|
|
630 |
CHECK_EQUALS_L(ussdCaps.iUssdFormat, (TUint32)RMobileUssdMessaging::KCapsPackedString,
|
|
631 |
_L("RMobileUssdMessaging::GetCaps returned incorrect iUssdFormat"));
|
|
632 |
TUint32 expectedCaps = RMobileUssdMessaging::KCapsMOUssd | RMobileUssdMessaging::KCapsMTUssd;
|
|
633 |
CHECK_BITS_SET_L(ussdCaps.iUssdTypes, expectedCaps, KNoUnwantedBits, _L("RMobileUssdMessaging::GetCaps returned incorrect iUssdTypes"));
|
|
634 |
|
|
635 |
|
|
636 |
//
|
|
637 |
// SET UP END
|
|
638 |
//
|
|
639 |
|
|
640 |
StartTest();
|
|
641 |
|
|
642 |
//
|
|
643 |
// TEST START
|
|
644 |
//
|
|
645 |
|
|
646 |
|
|
647 |
// === Send a an empty USSD request ===
|
|
648 |
|
|
649 |
// Send a USSD message to the network with RMobileUssdMessaging::SendMessage with aMsgData=empty buffer and aMsgAttributes.iDcs=0x00 (No class, uncompressed),aMsgAttributes.iFlags=RMobileUssdMessaging::KUssdMessageType | RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageDcs , aMsgAttributes.iFormat=RMobileUssdMessaging::EFormatPackedString , aMsgAttributes.iType=RMobileUssdMessaging::EUssdMORequest
|
|
650 |
|
|
651 |
// === Receive network RELEASE COMPLETE message ===
|
|
652 |
// Simulated network sends a release complete
|
|
653 |
// Check RMobileUssdMessaging::NotifyNetworkRelease completes with aMsgData with length > 0
|
|
654 |
TBuf8<100> eightBitStr = _L8("");
|
|
655 |
ASSERT_EQUALS(SendSimulateCompleteCheckCompleteL(mobileUssdMessaging,eightBitStr,RMobileUssdMessaging::EUssdMORequest),KErrNone,_L("CCTSYIntegrationTestUssdMessagingBase::SendSimulateCompleteCheckCompleteL returned an error"));
|
|
656 |
|
|
657 |
//
|
|
658 |
// TEST END
|
|
659 |
//
|
|
660 |
|
|
661 |
StartCleanup();
|
|
662 |
|
|
663 |
return TestStepResult();
|
|
664 |
}
|
|
665 |
|
|
666 |
TPtrC CCTSYIntegrationTestUssdMessaging0003::GetTestStepName()
|
|
667 |
/**
|
|
668 |
* @return The test step name.
|
|
669 |
*/
|
|
670 |
{
|
|
671 |
return _L("CCTSYIntegrationTestUssdMessaging0003");
|
|
672 |
}
|
|
673 |
|
|
674 |
|
|
675 |
|
|
676 |
CCTSYIntegrationTestUssdMessaging0004::CCTSYIntegrationTestUssdMessaging0004(CEtelSessionMgr& aEtelSessionMgr)
|
|
677 |
: CCTSYIntegrationTestUssdMessagingBase(aEtelSessionMgr)
|
|
678 |
/**
|
|
679 |
* Constructor.
|
|
680 |
*/
|
|
681 |
{
|
|
682 |
SetTestStepName(CCTSYIntegrationTestUssdMessaging0004::GetTestStepName());
|
|
683 |
}
|
|
684 |
|
|
685 |
CCTSYIntegrationTestUssdMessaging0004::~CCTSYIntegrationTestUssdMessaging0004()
|
|
686 |
/**
|
|
687 |
* Destructor.
|
|
688 |
*/
|
|
689 |
{
|
|
690 |
}
|
|
691 |
|
|
692 |
TVerdict CCTSYIntegrationTestUssdMessaging0004::doTestStepL()
|
|
693 |
/**
|
|
694 |
* @SYMTestCaseID BA-CTSY-INT-USSDM-0004
|
|
695 |
* @SYMFssID BA/CTSY/USSDM-0004
|
|
696 |
* @SYMTestCaseDesc Send a 24 character USSD request.
|
|
697 |
* @SYMTestPriority High
|
|
698 |
* @SYMTestActions RMobileUssdMessaging::NotifyNetworkRelease
|
|
699 |
* @SYMTestExpectedResults Pass - Message sent and reply received from network.
|
|
700 |
* @SYMTestType CIT
|
|
701 |
* @SYMTestCaseDependencies simulated/manual
|
|
702 |
*
|
|
703 |
* Reason for test: Verify message sent and reply received.
|
|
704 |
*
|
|
705 |
* @return - TVerdict code
|
|
706 |
*/
|
|
707 |
{
|
|
708 |
|
|
709 |
//
|
|
710 |
// SET UP
|
|
711 |
//
|
|
712 |
|
|
713 |
ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10069);
|
|
714 |
User::Leave(KErrNone);
|
|
715 |
|
|
716 |
|
|
717 |
// Check RMobileUssdMessaging::GetCaps returns iUssdFormat of KCapsPackedString
|
|
718 |
// Check RMobileUssdMessaging::GetCaps returns iUssdTypes of KCapsMOUssd | KCapsMTUssd
|
|
719 |
RMobileUssdMessaging& mobileUssdMessaging = iEtelSessionMgr.GetUssdMessagingL(KMainServer, KMainPhone,KMainUssdMessaging);
|
|
720 |
RMobileUssdMessaging::TMobileUssdCapsV1 ussdCaps;
|
|
721 |
RMobileUssdMessaging::TMobileUssdCapsV1Pckg ussdCapsPk(ussdCaps);
|
|
722 |
CHECK_TRUE_L(mobileUssdMessaging.GetCaps(ussdCapsPk)==KErrNone,_L("RMobileUssdMessaging::GetCaps returned error"));
|
|
723 |
CHECK_TRUE_L(ussdCapsPk().iUssdFormat==RMobileUssdMessaging::KCapsPackedString ,_L("RMobileUssdMessaging::GetCaps returned incorrect iUssdFormat"));
|
|
724 |
TUint32 expectedCaps = RMobileUssdMessaging::KCapsMOUssd | RMobileUssdMessaging::KCapsMTUssd;
|
|
725 |
CHECK_BITS_SET_L(ussdCaps.iUssdTypes, expectedCaps, KNoUnwantedBits, _L("RMobileUssdMessaging::GetCaps returned incorrect iUssdTypes"));
|
|
726 |
|
|
727 |
|
|
728 |
//
|
|
729 |
// SET UP END
|
|
730 |
//
|
|
731 |
|
|
732 |
StartTest();
|
|
733 |
|
|
734 |
//
|
|
735 |
// TEST START
|
|
736 |
//
|
|
737 |
|
|
738 |
|
|
739 |
// === Send a valid USSD request ===
|
|
740 |
|
|
741 |
// Encode 24 character USSD string (consisting of 24 "*") into a TGsmUssdMessageData buffer.
|
|
742 |
TBuf8<100> eightBitStr = _L8("");
|
|
743 |
for(TInt i=0;i<23;++i)
|
|
744 |
{
|
|
745 |
eightBitStr.Append('*');
|
|
746 |
}
|
|
747 |
eightBitStr.Append('#');
|
|
748 |
|
|
749 |
// Send a USSD message to the network with RMobileUssdMessaging::SendMessage with aMsgData=encoded TGsmUssdMessageData and aMsgAttributes.iDcs=0x00 (No class, uncompressed),aMsgAttributes.iFlags=RMobileUssdMessaging::KUssdMessageType | RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageDcs , aMsgAttributes.iFormat=RMobileUssdMessaging::EFormatPackedString , aMsgAttributes.iType=RMobileUssdMessaging::EUssdMORequest
|
|
750 |
// === Receive network RELEASE COMPLETE message ===
|
|
751 |
// Simulated network sends a release complete
|
|
752 |
// Check RMobileUssdMessaging::NotifyNetworkRelease completes with aMsgData with length > 0
|
|
753 |
ASSERT_EQUALS(SendSimulateCompleteCheckCompleteL(mobileUssdMessaging,eightBitStr,RMobileUssdMessaging::EUssdMORequest),KErrNone,_L("CCTSYIntegrationTestUssdMessagingBase::SendSimulateCompleteCheckCompleteL returned an error"));
|
|
754 |
|
|
755 |
//
|
|
756 |
// TEST END
|
|
757 |
//
|
|
758 |
|
|
759 |
StartCleanup();
|
|
760 |
|
|
761 |
|
|
762 |
return TestStepResult();
|
|
763 |
}
|
|
764 |
|
|
765 |
TPtrC CCTSYIntegrationTestUssdMessaging0004::GetTestStepName()
|
|
766 |
/**
|
|
767 |
* @return The test step name.
|
|
768 |
*/
|
|
769 |
{
|
|
770 |
return _L("CCTSYIntegrationTestUssdMessaging0004");
|
|
771 |
}
|
|
772 |
|
|
773 |
|
|
774 |
|
|
775 |
CCTSYIntegrationTestUssdMessaging0005::CCTSYIntegrationTestUssdMessaging0005(CEtelSessionMgr& aEtelSessionMgr)
|
|
776 |
: CCTSYIntegrationTestUssdMessagingBase(aEtelSessionMgr)
|
|
777 |
/**
|
|
778 |
* Constructor.
|
|
779 |
*/
|
|
780 |
{
|
|
781 |
SetTestStepName(CCTSYIntegrationTestUssdMessaging0005::GetTestStepName());
|
|
782 |
}
|
|
783 |
|
|
784 |
CCTSYIntegrationTestUssdMessaging0005::~CCTSYIntegrationTestUssdMessaging0005()
|
|
785 |
/**
|
|
786 |
* Destructor.
|
|
787 |
*/
|
|
788 |
{
|
|
789 |
}
|
|
790 |
|
|
791 |
TVerdict CCTSYIntegrationTestUssdMessaging0005::doTestStepL()
|
|
792 |
/**
|
|
793 |
* @SYMTestCaseID BA-CTSY-INT-USSDM-0005
|
|
794 |
* @SYMFssID BA/CTSY/USSDM-0005
|
|
795 |
* @SYMTestCaseDesc Send a USSD request of length KGsmUssdDataSize
|
|
796 |
* @SYMTestPriority High
|
|
797 |
* @SYMTestActions RMobileUssdMessaging::NotifyNetworkRelease
|
|
798 |
* @SYMTestExpectedResults Pass - Message sent and reply received from network.
|
|
799 |
* @SYMTestType CIT
|
|
800 |
* @SYMTestCaseDependencies simulated/manual
|
|
801 |
*
|
|
802 |
* Reason for test: Verify message sent and reply received.
|
|
803 |
*
|
|
804 |
* @return - TVerdict code
|
|
805 |
*/
|
|
806 |
{
|
|
807 |
|
|
808 |
//
|
|
809 |
// SET UP
|
|
810 |
//
|
|
811 |
|
|
812 |
ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id = %d</font>"), 10070);
|
|
813 |
User::Leave(KErrNone);
|
|
814 |
|
|
815 |
|
|
816 |
// Check RMobileUssdMessaging::GetCaps returns iUssdFormat of KCapsPackedString
|
|
817 |
// Check RMobileUssdMessaging::GetCaps returns iUssdTypes of KCapsMOUssd | KCapsMTUssd
|
|
818 |
RMobileUssdMessaging& mobileUssdMessaging = iEtelSessionMgr.GetUssdMessagingL(KMainServer, KMainPhone,KMainUssdMessaging);
|
|
819 |
RMobileUssdMessaging::TMobileUssdCapsV1 ussdCaps;
|
|
820 |
RMobileUssdMessaging::TMobileUssdCapsV1Pckg ussdCapsPk(ussdCaps);
|
|
821 |
CHECK_EQUALS_L(mobileUssdMessaging.GetCaps(ussdCapsPk), KErrNone,
|
|
822 |
_L("RMobileUssdMessaging::GetCaps returned error"));
|
|
823 |
CHECK_EQUALS_L(ussdCaps.iUssdFormat, (TUint32)RMobileUssdMessaging::KCapsPackedString,
|
|
824 |
_L("RMobileUssdMessaging::GetCaps returned incorrect iUssdFormat"));
|
|
825 |
TUint32 expectedCaps = RMobileUssdMessaging::KCapsMOUssd | RMobileUssdMessaging::KCapsMTUssd;
|
|
826 |
CHECK_BITS_SET_L(ussdCaps.iUssdTypes, expectedCaps, KNoUnwantedBits, _L("RMobileUssdMessaging::GetCaps returned incorrect iUssdTypes"));
|
|
827 |
|
|
828 |
|
|
829 |
//
|
|
830 |
// SET UP END
|
|
831 |
//
|
|
832 |
|
|
833 |
StartTest();
|
|
834 |
|
|
835 |
//
|
|
836 |
// TEST START
|
|
837 |
//
|
|
838 |
|
|
839 |
|
|
840 |
// === Send a valid USSD request ===
|
|
841 |
|
|
842 |
// Encode and fill a TGsmUssdMessageData buffer with "*" characters.
|
|
843 |
// $CTSYProblem This test cannot be run since LTSY crash when the message size is 50 character or more
|
|
844 |
CHECK_TRUE_L(EFalse,_L("$CTSYProblem This test cannot be run since LTSY crash when the message size is 50 character or more"));
|
|
845 |
TBuf8<200> eightBitStr = _L8("");
|
|
846 |
for(TInt i=0;i<181;++i)
|
|
847 |
{
|
|
848 |
eightBitStr.Append('*');
|
|
849 |
}
|
|
850 |
eightBitStr.Append('#');
|
|
851 |
|
|
852 |
// Send a USSD message to the network with RMobileUssdMessaging::SendMessage with aMsgData=encoded TGsmUssdMessageData and aMsgAttributes.iDcs=0x00 (No class, uncompressed),aMsgAttributes.iFlags=RMobileUssdMessaging::KUssdMessageType | RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageDcs , aMsgAttributes.iFormat=RMobileUssdMessaging::EFormatPackedString , aMsgAttributes.iType=RMobileUssdMessaging::EUssdMORequest
|
|
853 |
// === Receive network RELEASE COMPLETE message ===
|
|
854 |
// Simulated network sends a release complete
|
|
855 |
// Check RMobileUssdMessaging::NotifyNetworkRelease completes with aMsgData with length > 0
|
|
856 |
ASSERT_EQUALS(SendSimulateCompleteCheckCompleteL(mobileUssdMessaging,eightBitStr,RMobileUssdMessaging::EUssdMORequest),KErrNone,_L("CCTSYIntegrationTestUssdMessagingBase::SendSimulateCompleteCheckCompleteL returned an error"));
|
|
857 |
|
|
858 |
//
|
|
859 |
// TEST END
|
|
860 |
//
|
|
861 |
|
|
862 |
StartCleanup();
|
|
863 |
|
|
864 |
|
|
865 |
return TestStepResult();
|
|
866 |
}
|
|
867 |
|
|
868 |
TPtrC CCTSYIntegrationTestUssdMessaging0005::GetTestStepName()
|
|
869 |
/**
|
|
870 |
* @return The test step name.
|
|
871 |
*/
|
|
872 |
{
|
|
873 |
return _L("CCTSYIntegrationTestUssdMessaging0005");
|
|
874 |
}
|
|
875 |
|
|
876 |
|
|
877 |
|
|
878 |
CCTSYIntegrationTestUssdMessaging0006::CCTSYIntegrationTestUssdMessaging0006(CEtelSessionMgr& aEtelSessionMgr)
|
|
879 |
: CCTSYIntegrationTestUssdMessagingBase(aEtelSessionMgr)
|
|
880 |
/**
|
|
881 |
* Constructor.
|
|
882 |
*/
|
|
883 |
{
|
|
884 |
SetTestStepName(CCTSYIntegrationTestUssdMessaging0006::GetTestStepName());
|
|
885 |
}
|
|
886 |
|
|
887 |
CCTSYIntegrationTestUssdMessaging0006::~CCTSYIntegrationTestUssdMessaging0006()
|
|
888 |
/**
|
|
889 |
* Destructor.
|
|
890 |
*/
|
|
891 |
{
|
|
892 |
}
|
|
893 |
|
|
894 |
TVerdict CCTSYIntegrationTestUssdMessaging0006::doTestStepL()
|
|
895 |
/**
|
|
896 |
* @SYMTestCaseID BA-CTSY-INT-USSDM-0006
|
|
897 |
* @SYMFssID BA/CTSY/USSDM-0006
|
|
898 |
* @SYMTestCaseDesc Receive a USSD notify from network
|
|
899 |
* @SYMTestPriority High
|
|
900 |
* @SYMTestActions RMobileUssdMessaging::NotifyNetworkRelease, RMobileUssdMessaging::SendMessage
|
|
901 |
* @SYMTestExpectedResults Pass - Network USSD message received correctly.
|
|
902 |
* @SYMTestType CIT
|
|
903 |
* @SYMTestCaseDependencies simulated/manual
|
|
904 |
*
|
|
905 |
* Reason for test: Verify message sent and reply received.
|
|
906 |
*
|
|
907 |
* @return - TVerdict code
|
|
908 |
*/
|
|
909 |
{
|
|
910 |
|
|
911 |
//
|
|
912 |
// SET UP
|
|
913 |
//
|
|
914 |
|
|
915 |
|
|
916 |
// Check RMobileUssdMessaging::GetCaps returns iUssdFormat of KCapsPackedString
|
|
917 |
// Check RMobileUssdMessaging::GetCaps returns iUssdTypes of KCapsMOUssd | KCapsMTUssd
|
|
918 |
RMobileUssdMessaging& mobileUssdMessaging = iEtelSessionMgr.GetUssdMessagingL(KMainServer, KMainPhone,KMainUssdMessaging);
|
|
919 |
RMobileUssdMessaging::TMobileUssdCapsV1 ussdCaps;
|
|
920 |
RMobileUssdMessaging::TMobileUssdCapsV1Pckg ussdCapsPk(ussdCaps);
|
|
921 |
CHECK_EQUALS_L(mobileUssdMessaging.GetCaps(ussdCapsPk), KErrNone,
|
|
922 |
_L("RMobileUssdMessaging::GetCaps returned error"));
|
|
923 |
CHECK_EQUALS_L(ussdCaps.iUssdFormat, (TUint32)RMobileUssdMessaging::KCapsPackedString,
|
|
924 |
_L("RMobileUssdMessaging::GetCaps returned incorrect iUssdFormat"));
|
|
925 |
TUint32 expectedCaps = RMobileUssdMessaging::KCapsMOUssd | RMobileUssdMessaging::KCapsMTUssd;
|
|
926 |
CHECK_BITS_SET_L(ussdCaps.iUssdTypes, expectedCaps, KNoUnwantedBits, _L("RMobileUssdMessaging::GetCaps returned incorrect iUssdTypes"));
|
|
927 |
|
|
928 |
|
|
929 |
//
|
|
930 |
// SET UP END
|
|
931 |
//
|
|
932 |
|
|
933 |
StartTest();
|
|
934 |
|
|
935 |
//
|
|
936 |
// TEST START
|
|
937 |
//
|
|
938 |
|
|
939 |
|
|
940 |
// === Part 1 - Network sends a USSD notify then release complete when acknowledgement received from phone ===
|
|
941 |
|
|
942 |
// Simulated network sends a USSD notify message (message type EUssdMTNotify).
|
|
943 |
|
|
944 |
// === Receive MT notify from network ===
|
|
945 |
|
|
946 |
// Check RMobileUssdMessaging::ReceiveMessage completes with aMsgData with length > 0
|
|
947 |
// Check RMobileUssdMessaging::ReceiveMessage completes with aMsgAttributes.iType=RMobileUssdMessaging::EUssdMTNotify
|
|
948 |
ASSERT_EQUALS(SimulateNotifyCheckReceiveL(mobileUssdMessaging,RMobileUssdMessaging::EUssdMTNotify),KErrNone,_L("CCTSYIntegrationTestUssdMessagingBase::SimulateNotifyCheckReceiveL returned an error"));
|
|
949 |
|
|
950 |
// === Reply to network with MO acknowledgement ===
|
|
951 |
|
|
952 |
// Send a USSD message to the network with RMobileUssdMessaging::SendMessage with aMsgData=empty TGsmUssdMessageData and aMsgAttributes.iDcs=0x00 (No class, uncompressed),aMsgAttributes.iFlags=RMobileUssdMessaging::KUssdMessageType | RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageDcs , aMsgAttributes.iFormat=RMobileUssdMessaging::EFormatPackedString , aMsgAttributes.iType=RMobileUssdMessaging::EUssdMOAcknowledgement
|
|
953 |
|
|
954 |
// === Receive network RELEASE COMPLETE message ===
|
|
955 |
// Simulated network sends a release complete
|
|
956 |
// Check RMobileUssdMessaging::NotifyNetworkRelease completes with aMsgData with length > 0
|
|
957 |
TBuf8<100> eightBitStr = _L8("");
|
|
958 |
ASSERT_EQUALS(SendSimulateCompleteCheckCompleteL(mobileUssdMessaging,eightBitStr,RMobileUssdMessaging::EUssdMOAcknowledgement),KErrNone,_L("CCTSYIntegrationTestUssdMessagingBase::SendSimulateCompleteCheckCompleteL returned an error"));
|
|
959 |
|
|
960 |
// === Part 2 - Network sends a USSD notify then release complete when acknowledgement received from phone ===
|
|
961 |
|
|
962 |
// Simulated network sends a USSD notify message (message type EUssdMTNotify).
|
|
963 |
|
|
964 |
// === Receive MT notify from network ===
|
|
965 |
|
|
966 |
// Check RMobileUssdMessaging::ReceiveMessage completes with aMsgData with length > 0
|
|
967 |
// Check RMobileUssdMessaging::ReceiveMessage completes with aMsgAttributes.iType=RMobileUssdMessaging::EUssdMTNotify
|
|
968 |
ASSERT_EQUALS(SimulateNotifyCheckReceiveL(mobileUssdMessaging,RMobileUssdMessaging::EUssdMTNotify),KErrNone,_L("CCTSYIntegrationTestUssdMessagingBase::SimulateNotifyCheckReceiveL returned an error"));
|
|
969 |
|
|
970 |
// === Reply to network with MO acknowledgement ===
|
|
971 |
|
|
972 |
// Send a USSD message to the network with RMobileUssdMessaging::SendMessage with aMsgData=empty TGsmUssdMessageData and aMsgAttributes.iDcs=0x00 (No class, uncompressed),aMsgAttributes.iFlags=RMobileUssdMessaging::KUssdMessageType | RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageDcs , aMsgAttributes.iFormat=RMobileUssdMessaging::EFormatPackedString , aMsgAttributes.iType=RMobileUssdMessaging::EUssdMOAcknowledgement
|
|
973 |
|
|
974 |
// Simulated network sends a USSD notify message (message type EUssdMTNotify).
|
|
975 |
|
|
976 |
// === Receive MT notify from network ===
|
|
977 |
|
|
978 |
// Check RMobileUssdMessaging::ReceiveMessage completes with aMsgData with length > 0
|
|
979 |
// Check RMobileUssdMessaging::ReceiveMessage completes with aMsgAttributes.iType=RMobileUssdMessaging::EUssdMTNotify
|
|
980 |
ASSERT_EQUALS(SendSimulateNotifyCheckCompleteL(mobileUssdMessaging,eightBitStr,RMobileUssdMessaging::EUssdMOAcknowledgement,RMobileUssdMessaging::EUssdMTNotify),KErrNone,_L("CCTSYIntegrationTestUssdMessagingBase::SendSimulateNotifyCheckCompleteL returned an error"));
|
|
981 |
|
|
982 |
// === Reply to network with MO acknowledgement ===
|
|
983 |
|
|
984 |
// Send a USSD message to the network with RMobileUssdMessaging::SendMessage with aMsgData=empty TGsmUssdMessageData and aMsgAttributes.iDcs=0x00 (No class, uncompressed),aMsgAttributes.iFlags=RMobileUssdMessaging::KUssdMessageType | RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageDcs , aMsgAttributes.iFormat=RMobileUssdMessaging::EFormatPackedString , aMsgAttributes.iType=RMobileUssdMessaging::EUssdMOAcknowledgement
|
|
985 |
|
|
986 |
// === Receive network RELEASE COMPLETE message ===
|
|
987 |
// Simulated network sends a release complete
|
|
988 |
// Check RMobileUssdMessaging::NotifyNetworkRelease completes with aMsgData with length > 0
|
|
989 |
ASSERT_EQUALS(SendSimulateCompleteCheckCompleteL(mobileUssdMessaging,eightBitStr,RMobileUssdMessaging::RMobileUssdMessaging::EUssdMOAcknowledgement),KErrNone,_L("CCTSYIntegrationTestUssdMessagingBase::SendSimulateCompleteCheckCompleteL returned an error"));
|
|
990 |
|
|
991 |
|
|
992 |
//
|
|
993 |
// TEST END
|
|
994 |
//
|
|
995 |
|
|
996 |
StartCleanup();
|
|
997 |
|
|
998 |
|
|
999 |
return TestStepResult();
|
|
1000 |
}
|
|
1001 |
|
|
1002 |
TPtrC CCTSYIntegrationTestUssdMessaging0006::GetTestStepName()
|
|
1003 |
/**
|
|
1004 |
* @return The test step name.
|
|
1005 |
*/
|
|
1006 |
{
|
|
1007 |
return _L("CCTSYIntegrationTestUssdMessaging0006");
|
|
1008 |
}
|
|
1009 |
|
|
1010 |
|
|
1011 |
|
|
1012 |
CCTSYIntegrationTestUssdMessaging0007::CCTSYIntegrationTestUssdMessaging0007(CEtelSessionMgr& aEtelSessionMgr)
|
|
1013 |
: CCTSYIntegrationTestUssdMessagingBase(aEtelSessionMgr)
|
|
1014 |
/**
|
|
1015 |
* Constructor.
|
|
1016 |
*/
|
|
1017 |
{
|
|
1018 |
SetTestStepName(CCTSYIntegrationTestUssdMessaging0007::GetTestStepName());
|
|
1019 |
}
|
|
1020 |
|
|
1021 |
CCTSYIntegrationTestUssdMessaging0007::~CCTSYIntegrationTestUssdMessaging0007()
|
|
1022 |
/**
|
|
1023 |
* Destructor.
|
|
1024 |
*/
|
|
1025 |
{
|
|
1026 |
}
|
|
1027 |
|
|
1028 |
TVerdict CCTSYIntegrationTestUssdMessaging0007::doTestStepL()
|
|
1029 |
/**
|
|
1030 |
* @SYMTestCaseID BA-CTSY-INT-USSDM-0007
|
|
1031 |
* @SYMFssID BA/CTSY/USSDM-0007
|
|
1032 |
* @SYMTestCaseDesc Receive a USSD notify from network of 182 characters
|
|
1033 |
* @SYMTestPriority High
|
|
1034 |
* @SYMTestActions RMobileUssdMessaging::SendRelease, RMobileUssdMessaging::SendMessage
|
|
1035 |
* @SYMTestExpectedResults Pass - Network USSD message received correctly.
|
|
1036 |
* @SYMTestType CIT
|
|
1037 |
* @SYMTestCaseDependencies simulated/manual
|
|
1038 |
*
|
|
1039 |
* Reason for test: Verify message sent and reply received.
|
|
1040 |
*
|
|
1041 |
* @return - TVerdict code
|
|
1042 |
*/
|
|
1043 |
{
|
|
1044 |
|
|
1045 |
//
|
|
1046 |
// SET UP
|
|
1047 |
//
|
|
1048 |
|
|
1049 |
|
|
1050 |
// Check RMobileUssdMessaging::GetCaps returns iUssdFormat of KCapsPackedString
|
|
1051 |
// Check RMobileUssdMessaging::GetCaps returns iUssdTypes of KCapsMOUssd | KCapsMTUssd
|
|
1052 |
RMobileUssdMessaging& mobileUssdMessaging = iEtelSessionMgr.GetUssdMessagingL(KMainServer, KMainPhone,KMainUssdMessaging);
|
|
1053 |
RMobileUssdMessaging::TMobileUssdCapsV1 ussdCaps;
|
|
1054 |
RMobileUssdMessaging::TMobileUssdCapsV1Pckg ussdCapsPk(ussdCaps);
|
|
1055 |
CHECK_EQUALS_L(mobileUssdMessaging.GetCaps(ussdCapsPk), KErrNone,
|
|
1056 |
_L("RMobileUssdMessaging::GetCaps returned error"));
|
|
1057 |
CHECK_EQUALS_L(ussdCaps.iUssdFormat, (TUint32)RMobileUssdMessaging::KCapsPackedString,
|
|
1058 |
_L("RMobileUssdMessaging::GetCaps returned incorrect iUssdFormat"));
|
|
1059 |
TUint32 expectedCaps = RMobileUssdMessaging::KCapsMOUssd | RMobileUssdMessaging::KCapsMTUssd;
|
|
1060 |
CHECK_BITS_SET_L(ussdCaps.iUssdTypes, expectedCaps, KNoUnwantedBits, _L("RMobileUssdMessaging::GetCaps returned incorrect iUssdTypes"));
|
|
1061 |
|
|
1062 |
|
|
1063 |
|
|
1064 |
//
|
|
1065 |
// SET UP END
|
|
1066 |
//
|
|
1067 |
|
|
1068 |
StartTest();
|
|
1069 |
|
|
1070 |
//
|
|
1071 |
// TEST START
|
|
1072 |
//
|
|
1073 |
|
|
1074 |
// Simulated network sends a USSD notify message (message type EUssdMTNotify) of 182 characters.
|
|
1075 |
|
|
1076 |
// === Receive MT notify from network ===
|
|
1077 |
|
|
1078 |
// Check RMobileUssdMessaging::ReceiveMessage completes with aMsgData with length > 0
|
|
1079 |
// Check RMobileUssdMessaging::ReceiveMessage completes with aMsgAttributes.iType=RMobileUssdMessaging::EUssdMTNotify
|
|
1080 |
ASSERT_EQUALS(SimulateNotifyCheckReceiveL(mobileUssdMessaging,RMobileUssdMessaging::EUssdMTNotify,182),KErrNone,_L("CCTSYIntegrationTestUssdMessagingBase::SimulateNotifyCheckReceiveL returned an error"));
|
|
1081 |
|
|
1082 |
// === Reply to network with MO acknowledgement ===
|
|
1083 |
|
|
1084 |
// Send a USSD message to the network with RMobileUssdMessaging::SendMessage with aMsgData=empty TGsmUssdMessageData and aMsgAttributes.iDcs=0x00 (No class, uncompressed),aMsgAttributes.iFlags=RMobileUssdMessaging::KUssdMessageType | RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageDcs , aMsgAttributes.iFormat=RMobileUssdMessaging::EFormatPackedString , aMsgAttributes.iType=RMobileUssdMessaging::EUssdMOAcknowledgement
|
|
1085 |
TExtEtelRequestStatus sendMsgStatus(mobileUssdMessaging,EMobileUssdMessagingSendMessage);
|
|
1086 |
CleanupStack::PushL(sendMsgStatus);
|
|
1087 |
RMobileUssdMessaging::TGsmUssdMessageData sendUssdMsg = _L8("");
|
|
1088 |
RMobileUssdMessaging::TMobileUssdAttributesV1 sendAttributes;
|
|
1089 |
sendAttributes.iDcs=0x00;
|
|
1090 |
sendAttributes.iFlags=RMobileUssdMessaging::KUssdMessageType | RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageDcs;
|
|
1091 |
sendAttributes.iFormat=RMobileUssdMessaging::EFormatPackedString;
|
|
1092 |
sendAttributes.iType=RMobileUssdMessaging::EUssdMOAcknowledgement;
|
|
1093 |
RMobileUssdMessaging::TMobileUssdAttributesV1Pckg sendAttributesPckg(sendAttributes);
|
|
1094 |
mobileUssdMessaging.SendMessage(sendMsgStatus, sendUssdMsg, sendAttributesPckg);
|
|
1095 |
ASSERT_EQUALS(WaitForRequestWithTimeOut(sendMsgStatus, ETimeLong),
|
|
1096 |
KErrNone, _L("RMobileUssdMessaging::SendMessage did not complete."));
|
|
1097 |
ASSERT_EQUALS(sendMsgStatus.Int(),KErrNone,
|
|
1098 |
_L("RMobileUssdMessaging::SendMessage completed with incorrect error"));
|
|
1099 |
|
|
1100 |
// === Send a release complete to the network ===
|
|
1101 |
|
|
1102 |
// Check RMobileUssdMessaging::SendRelease completes with KErrNone
|
|
1103 |
TExtEtelRequestStatus sendReleaseStatus(mobileUssdMessaging,EMobileUssdMessagingSendRelease);
|
|
1104 |
CleanupStack::PushL(sendReleaseStatus);
|
|
1105 |
RMobilePhone::TMobilePhoneSendSSRequestV3 requestInfo;
|
|
1106 |
RMobilePhone::TMobilePhoneSendSSRequestV3Pckg requestInfoPckg(requestInfo);
|
|
1107 |
mobileUssdMessaging.SendRelease(sendReleaseStatus,requestInfoPckg);
|
|
1108 |
ASSERT_EQUALS(WaitForRequestWithTimeOut(sendReleaseStatus, ETimeLong),
|
|
1109 |
KErrNone, _L("RMobileUssdMessaging::SendRelease did not complete."));
|
|
1110 |
ASSERT_EQUALS(sendReleaseStatus.Int(),KErrNone,
|
|
1111 |
_L("RMobileUssdMessaging::SendRelease completed with incorrect error"));
|
|
1112 |
|
|
1113 |
|
|
1114 |
//
|
|
1115 |
// TEST END
|
|
1116 |
//
|
|
1117 |
|
|
1118 |
StartCleanup();
|
|
1119 |
|
|
1120 |
// Pop:
|
|
1121 |
// sendReleaseStatus
|
|
1122 |
// sendMsgStatus
|
|
1123 |
CleanupStack::PopAndDestroy(2,&sendMsgStatus);
|
|
1124 |
|
|
1125 |
return TestStepResult();
|
|
1126 |
}
|
|
1127 |
|
|
1128 |
TPtrC CCTSYIntegrationTestUssdMessaging0007::GetTestStepName()
|
|
1129 |
/**
|
|
1130 |
* @return The test step name.
|
|
1131 |
*/
|
|
1132 |
{
|
|
1133 |
return _L("CCTSYIntegrationTestUssdMessaging0007");
|
|
1134 |
}
|
|
1135 |
|
|
1136 |
|
|
1137 |
|
|
1138 |
CCTSYIntegrationTestUssdMessaging0008::CCTSYIntegrationTestUssdMessaging0008(CEtelSessionMgr& aEtelSessionMgr)
|
|
1139 |
: CCTSYIntegrationTestUssdMessagingBase(aEtelSessionMgr)
|
|
1140 |
/**
|
|
1141 |
* Constructor.
|
|
1142 |
*/
|
|
1143 |
{
|
|
1144 |
SetTestStepName(CCTSYIntegrationTestUssdMessaging0008::GetTestStepName());
|
|
1145 |
}
|
|
1146 |
|
|
1147 |
CCTSYIntegrationTestUssdMessaging0008::~CCTSYIntegrationTestUssdMessaging0008()
|
|
1148 |
/**
|
|
1149 |
* Destructor.
|
|
1150 |
*/
|
|
1151 |
{
|
|
1152 |
}
|
|
1153 |
|
|
1154 |
TVerdict CCTSYIntegrationTestUssdMessaging0008::doTestStepL()
|
|
1155 |
/**
|
|
1156 |
* @SYMTestCaseID BA-CTSY-INT-USSDM-0008
|
|
1157 |
* @SYMFssID BA/CTSY/USSDM-0008
|
|
1158 |
* @SYMTestCaseDesc Receive a USSD request from the network.
|
|
1159 |
* @SYMTestPriority High
|
|
1160 |
* @SYMTestActions RMobileUssdMessaging::NotifyNetworkRelease, RMobileUssdMessaging::SendMessage
|
|
1161 |
* @SYMTestExpectedResults Pass - Network USSD message received correctly.
|
|
1162 |
* @SYMTestType CIT
|
|
1163 |
* @SYMTestCaseDependencies simulated/manual
|
|
1164 |
*
|
|
1165 |
* Reason for test: Verify messages received and replies can be sent.
|
|
1166 |
*
|
|
1167 |
* @return - TVerdict code
|
|
1168 |
*/
|
|
1169 |
{
|
|
1170 |
|
|
1171 |
//
|
|
1172 |
// SET UP
|
|
1173 |
//
|
|
1174 |
|
|
1175 |
|
|
1176 |
// Check RMobileUssdMessaging::GetCaps returns iUssdFormat of KCapsPackedString
|
|
1177 |
// Check RMobileUssdMessaging::GetCaps returns iUssdTypes of KCapsMOUssd | KCapsMTUssd
|
|
1178 |
RMobileUssdMessaging& mobileUssdMessaging = iEtelSessionMgr.GetUssdMessagingL(KMainServer, KMainPhone,KMainUssdMessaging);
|
|
1179 |
RMobileUssdMessaging::TMobileUssdCapsV1 ussdCaps;
|
|
1180 |
RMobileUssdMessaging::TMobileUssdCapsV1Pckg ussdCapsPk(ussdCaps);
|
|
1181 |
CHECK_EQUALS_L(mobileUssdMessaging.GetCaps(ussdCapsPk), KErrNone,
|
|
1182 |
_L("RMobileUssdMessaging::GetCaps returned error"));
|
|
1183 |
CHECK_EQUALS_L(ussdCaps.iUssdFormat, (TUint32)RMobileUssdMessaging::KCapsPackedString,
|
|
1184 |
_L("RMobileUssdMessaging::GetCaps returned incorrect iUssdFormat"));
|
|
1185 |
TUint32 expectedCaps = RMobileUssdMessaging::KCapsMOUssd | RMobileUssdMessaging::KCapsMTUssd;
|
|
1186 |
CHECK_BITS_SET_L(ussdCaps.iUssdTypes, expectedCaps, KNoUnwantedBits, _L("RMobileUssdMessaging::GetCaps returned incorrect iUssdTypes"));
|
|
1187 |
|
|
1188 |
|
|
1189 |
//
|
|
1190 |
// SET UP END
|
|
1191 |
//
|
|
1192 |
|
|
1193 |
StartTest();
|
|
1194 |
//
|
|
1195 |
// TEST START
|
|
1196 |
//
|
|
1197 |
|
|
1198 |
|
|
1199 |
// === Part 1 - network sends USSD request, phone replies and network releases ===
|
|
1200 |
|
|
1201 |
// Simulated network sends a USSD notify message (message type EUssdMTRequest)
|
|
1202 |
|
|
1203 |
// === Receive MT request from network ===
|
|
1204 |
|
|
1205 |
// Check RMobileUssdMessaging::ReceiveMessage completes with aMsgData with length > 0
|
|
1206 |
// Check RMobileUssdMessaging::ReceiveMessage completes with aMsgAttributes.iType=RMobileUssdMessaging::EUssdMTRequest
|
|
1207 |
ASSERT_EQUALS(SimulateNotifyCheckReceiveL(mobileUssdMessaging,RMobileUssdMessaging::EUssdMTRequest),KErrNone,_L("CCTSYIntegrationTestUssdMessagingBase::SimulateNotifyCheckReceiveL returned an error"));
|
|
1208 |
|
|
1209 |
// === Send a USSD reply ===
|
|
1210 |
|
|
1211 |
// Send a USSD message to the network with RMobileUssdMessaging::SendMessage with aMsgData=a valid encoded string and aMsgAttributes.iDcs=0x00 (No class, uncompressed),aMsgAttributes.iFlags=RMobileUssdMessaging::KUssdMessageType | RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageDcs , aMsgAttributes.iFormat=RMobileUssdMessaging::EFormatPackedString , aMsgAttributes.iType=RMobileUssdMessaging::EUssdMTReply
|
|
1212 |
TBuf8<100> eightBitStr = _L8("*#30#");
|
|
1213 |
|
|
1214 |
// === Receive network RELEASE COMPLETE message ===
|
|
1215 |
// Simulated network sends a release complete
|
|
1216 |
// Check RMobileUssdMessaging::NotifyNetworkRelease completes with aMsgData with length > 0
|
|
1217 |
ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id2 = %d</font>"), 10035);
|
|
1218 |
CHECK_TRUE_L(EFalse, _L("This test has been made to leave intentially - ***Send message fail, and ctsy cancel it later****"));
|
|
1219 |
ASSERT_EQUALS(SendSimulateCompleteCheckCompleteL(mobileUssdMessaging,eightBitStr,RMobileUssdMessaging::EUssdMTReply),KErrNone,_L("CCTSYIntegrationTestUssdMessagingBase::SendSimulateCompleteCheckCompleteL returned an error"));
|
|
1220 |
|
|
1221 |
// === Part 2 - network sends USSD request, phone replies, network sends another request and phone replies again, then network releases ===
|
|
1222 |
|
|
1223 |
// Simulated network sends a USSD notify message (message type EUssdMTRequest)
|
|
1224 |
|
|
1225 |
// === Receive MT request from network ===
|
|
1226 |
|
|
1227 |
// Check RMobileUssdMessaging::ReceiveMessage completes with aMsgData with length > 0
|
|
1228 |
// Check RMobileUssdMessaging::ReceiveMessage completes with aMsgAttributes.iType=RMobileUssdMessaging::EUssdMTRequest
|
|
1229 |
ASSERT_EQUALS(SimulateNotifyCheckReceiveL(mobileUssdMessaging,RMobileUssdMessaging::EUssdMTRequest),KErrNone,_L("CCTSYIntegrationTestUssdMessagingBase::SimulateNotifyCheckReceiveL returned an error"));
|
|
1230 |
|
|
1231 |
// === Send a USSD reply ===
|
|
1232 |
|
|
1233 |
// Send a USSD message to the network with RMobileUssdMessaging::SendMessage with aMsgData=a valid encoded string and aMsgAttributes.iDcs=0x00 (No class, uncompressed),aMsgAttributes.iFlags=RMobileUssdMessaging::KUssdMessageType | RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageDcs , aMsgAttributes.iFormat=RMobileUssdMessaging::EFormatPackedString , aMsgAttributes.iType=RMobileUssdMessaging::EUssdMTReply
|
|
1234 |
eightBitStr = _L8("*#30#");
|
|
1235 |
|
|
1236 |
// Simulated network sends a USSD notify message (message type EUssdMTRequest)
|
|
1237 |
|
|
1238 |
// === Receive MT request from network ===
|
|
1239 |
|
|
1240 |
// Check RMobileUssdMessaging::ReceiveMessage completes with aMsgData with length > 0
|
|
1241 |
// Check RMobileUssdMessaging::ReceiveMessage completes with aMsgAttributes.iType=RMobileUssdMessaging::EUssdMTRequest
|
|
1242 |
ASSERT_EQUALS(SendSimulateNotifyCheckCompleteL(mobileUssdMessaging,eightBitStr,RMobileUssdMessaging::EUssdMTReply ,RMobileUssdMessaging::EUssdMTRequest),KErrNone,_L("CCTSYIntegrationTestUssdMessagingBase::SendSimulateNotifyCheckCompleteL returned an error"));
|
|
1243 |
|
|
1244 |
// === Send a USSD reply ===
|
|
1245 |
|
|
1246 |
// Send a USSD message to the network with RMobileUssdMessaging::SendMessage with aMsgData=a valid encoded string and aMsgAttributes.iDcs=0x00 (No class, uncompressed),aMsgAttributes.iFlags=RMobileUssdMessaging::KUssdMessageType | RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageDcs , aMsgAttributes.iFormat=RMobileUssdMessaging::EFormatPackedString , aMsgAttributes.iType=RMobileUssdMessaging::EUssdMTReply
|
|
1247 |
eightBitStr = _L8("*#30#");
|
|
1248 |
|
|
1249 |
// === Receive network RELEASE COMPLETE message ===
|
|
1250 |
// Simulated network sends a release complete
|
|
1251 |
// Check RMobileUssdMessaging::NotifyNetworkRelease completes with aMsgData with length > 0
|
|
1252 |
ASSERT_EQUALS(SendSimulateCompleteCheckCompleteL(mobileUssdMessaging,eightBitStr,RMobileUssdMessaging::EUssdMTReply ),KErrNone,_L("CCTSYIntegrationTestUssdMessagingBase::SendSimulateCompleteCheckCompleteL returned an error"));
|
|
1253 |
|
|
1254 |
|
|
1255 |
//
|
|
1256 |
// TEST END
|
|
1257 |
//
|
|
1258 |
|
|
1259 |
StartCleanup();
|
|
1260 |
|
|
1261 |
return TestStepResult();
|
|
1262 |
}
|
|
1263 |
|
|
1264 |
TPtrC CCTSYIntegrationTestUssdMessaging0008::GetTestStepName()
|
|
1265 |
/**
|
|
1266 |
* @return The test step name.
|
|
1267 |
*/
|
|
1268 |
{
|
|
1269 |
return _L("CCTSYIntegrationTestUssdMessaging0008");
|
|
1270 |
}
|
|
1271 |
|
|
1272 |
|
|
1273 |
|
|
1274 |
CCTSYIntegrationTestUssdMessaging0009::CCTSYIntegrationTestUssdMessaging0009(CEtelSessionMgr& aEtelSessionMgr)
|
|
1275 |
: CCTSYIntegrationTestUssdMessagingBase(aEtelSessionMgr)
|
|
1276 |
/**
|
|
1277 |
* Constructor.
|
|
1278 |
*/
|
|
1279 |
{
|
|
1280 |
SetTestStepName(CCTSYIntegrationTestUssdMessaging0009::GetTestStepName());
|
|
1281 |
}
|
|
1282 |
|
|
1283 |
CCTSYIntegrationTestUssdMessaging0009::~CCTSYIntegrationTestUssdMessaging0009()
|
|
1284 |
/**
|
|
1285 |
* Destructor.
|
|
1286 |
*/
|
|
1287 |
{
|
|
1288 |
}
|
|
1289 |
|
|
1290 |
TVerdict CCTSYIntegrationTestUssdMessaging0009::doTestStepL()
|
|
1291 |
/**
|
|
1292 |
* @SYMTestCaseID BA-CTSY-INT-USSDM-0009
|
|
1293 |
* @SYMFssID BA/CTSY/USSDM-0009
|
|
1294 |
* @SYMTestCaseDesc Receive a USSD request from the network of 182 characters long.
|
|
1295 |
* @SYMTestPriority High
|
|
1296 |
* @SYMTestActions RMobileUssdMessaging::NotifyNetworkRelease, RMobileUssdMessaging::SendMessage
|
|
1297 |
* @SYMTestExpectedResults Pass - Network USSD message received correctly.
|
|
1298 |
* @SYMTestType CIT
|
|
1299 |
* @SYMTestCaseDependencies simulated/manual
|
|
1300 |
*
|
|
1301 |
* Reason for test: Verify message received.
|
|
1302 |
*
|
|
1303 |
* @return - TVerdict code
|
|
1304 |
*/
|
|
1305 |
{
|
|
1306 |
|
|
1307 |
//
|
|
1308 |
// SET UP
|
|
1309 |
//
|
|
1310 |
|
|
1311 |
|
|
1312 |
// Check RMobileUssdMessaging::GetCaps returns iUssdFormat of KCapsPackedString
|
|
1313 |
// Check RMobileUssdMessaging::GetCaps returns iUssdTypes of KCapsMOUssd | KCapsMTUssd
|
|
1314 |
RMobileUssdMessaging& mobileUssdMessaging = iEtelSessionMgr.GetUssdMessagingL(KMainServer, KMainPhone,KMainUssdMessaging);
|
|
1315 |
RMobileUssdMessaging::TMobileUssdCapsV1 ussdCaps;
|
|
1316 |
RMobileUssdMessaging::TMobileUssdCapsV1Pckg ussdCapsPk(ussdCaps);
|
|
1317 |
CHECK_EQUALS_L(mobileUssdMessaging.GetCaps(ussdCapsPk), KErrNone,
|
|
1318 |
_L("RMobileUssdMessaging::GetCaps returned error"));
|
|
1319 |
CHECK_EQUALS_L(ussdCaps.iUssdFormat, (TUint32)RMobileUssdMessaging::KCapsPackedString,
|
|
1320 |
_L("RMobileUssdMessaging::GetCaps returned incorrect iUssdFormat"));
|
|
1321 |
TUint32 expectedCaps = RMobileUssdMessaging::KCapsMOUssd | RMobileUssdMessaging::KCapsMTUssd;
|
|
1322 |
CHECK_BITS_SET_L(ussdCaps.iUssdTypes, expectedCaps, KNoUnwantedBits, _L("RMobileUssdMessaging::GetCaps returned incorrect iUssdTypes"));
|
|
1323 |
|
|
1324 |
|
|
1325 |
|
|
1326 |
//
|
|
1327 |
// SET UP END
|
|
1328 |
//
|
|
1329 |
|
|
1330 |
StartTest();
|
|
1331 |
|
|
1332 |
//
|
|
1333 |
// TEST START
|
|
1334 |
//
|
|
1335 |
|
|
1336 |
// Simulated network sends a USSD notify message (message type EUssdMTRequest) of 182 characters
|
|
1337 |
|
|
1338 |
// === Receive MT request from network ===
|
|
1339 |
|
|
1340 |
// Check RMobileUssdMessaging::ReceiveMessage completes with aMsgData with length > 0
|
|
1341 |
// Check RMobileUssdMessaging::ReceiveMessage completes with aMsgAttributes.iType=RMobileUssdMessaging::EUssdMTRequest
|
|
1342 |
ASSERT_EQUALS(SimulateNotifyCheckReceiveL(mobileUssdMessaging,RMobileUssdMessaging::EUssdMTRequest,182),KErrNone,_L("CCTSYIntegrationTestUssdMessagingBase::SimulateNotifyCheckReceiveL returned an error"));
|
|
1343 |
|
|
1344 |
|
|
1345 |
// === Send a USSD reply ===
|
|
1346 |
|
|
1347 |
// Send a USSD message to the network with RMobileUssdMessaging::SendMessage with aMsgData=a valid encoded string and aMsgAttributes.iDcs=0x00 (No class, uncompressed),aMsgAttributes.iFlags=RMobileUssdMessaging::KUssdMessageType | RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageDcs , aMsgAttributes.iFormat=RMobileUssdMessaging::EFormatPackedString , aMsgAttributes.iType=RMobileUssdMessaging::EUssdMTReply
|
|
1348 |
TBuf8<100> eightBitStr = _L8("*#30#");
|
|
1349 |
|
|
1350 |
// === Receive network RELEASE COMPLETE message ===
|
|
1351 |
// Simulated network sends a release complete
|
|
1352 |
// Check RMobileUssdMessaging::NotifyNetworkRelease completes with aMsgData with length > 0
|
|
1353 |
ERR_PRINTF2(_L("<font color=Orange>$CTSYKnownFailure: defect id2 = %d</font>"), 10035);
|
|
1354 |
CHECK_TRUE_L(EFalse, _L("This test has been made to leave intentially - ***Send message fail, and ctsy cancel it later****"));
|
|
1355 |
ASSERT_EQUALS(SendSimulateCompleteCheckCompleteL(mobileUssdMessaging,eightBitStr,RMobileUssdMessaging::EUssdMTReply),KErrNone,_L("CCTSYIntegrationTestUssdMessagingBase::SendSimulateCompleteCheckCompleteL returned an error"));
|
|
1356 |
|
|
1357 |
//
|
|
1358 |
// TEST END
|
|
1359 |
//
|
|
1360 |
|
|
1361 |
StartCleanup();
|
|
1362 |
|
|
1363 |
|
|
1364 |
return TestStepResult();
|
|
1365 |
}
|
|
1366 |
|
|
1367 |
TPtrC CCTSYIntegrationTestUssdMessaging0009::GetTestStepName()
|
|
1368 |
/**
|
|
1369 |
* @return The test step name.
|
|
1370 |
*/
|
|
1371 |
{
|
|
1372 |
return _L("CCTSYIntegrationTestUssdMessaging0009");
|
|
1373 |
}
|
|
1374 |
|
|
1375 |
|
|
1376 |
|
|
1377 |
CCTSYIntegrationTestUssdMessaging0010::CCTSYIntegrationTestUssdMessaging0010(CEtelSessionMgr& aEtelSessionMgr)
|
|
1378 |
: CCTSYIntegrationTestUssdMessagingBase(aEtelSessionMgr)
|
|
1379 |
/**
|
|
1380 |
* Constructor.
|
|
1381 |
*/
|
|
1382 |
{
|
|
1383 |
SetTestStepName(CCTSYIntegrationTestUssdMessaging0010::GetTestStepName());
|
|
1384 |
}
|
|
1385 |
|
|
1386 |
CCTSYIntegrationTestUssdMessaging0010::~CCTSYIntegrationTestUssdMessaging0010()
|
|
1387 |
/**
|
|
1388 |
* Destructor.
|
|
1389 |
*/
|
|
1390 |
{
|
|
1391 |
}
|
|
1392 |
|
|
1393 |
TVerdict CCTSYIntegrationTestUssdMessaging0010::doTestStepL()
|
|
1394 |
/**
|
|
1395 |
* @SYMTestCaseID BA-CTSY-INT-USSDM-0010
|
|
1396 |
* @SYMFssID BA/CTSY/USSDM-0010
|
|
1397 |
* @SYMTestCaseDesc Terminate a USSD exchange.
|
|
1398 |
* @SYMTestPriority High
|
|
1399 |
* @SYMTestActions RMobileUssdMessaging::ReceiveMessage, RMobileUssdMessaging::SendRelease
|
|
1400 |
* @SYMTestExpectedResults Pass - KErrNotSupported when sending USSD to unsupported network
|
|
1401 |
* @SYMTestType CIT
|
|
1402 |
* @SYMTestCaseDependencies live/automatic
|
|
1403 |
*
|
|
1404 |
* Reason for test: Verify sending of release complete message is successful.
|
|
1405 |
*
|
|
1406 |
* @return - TVerdict code
|
|
1407 |
*/
|
|
1408 |
{
|
|
1409 |
|
|
1410 |
//
|
|
1411 |
// SET UP
|
|
1412 |
//
|
|
1413 |
|
|
1414 |
|
|
1415 |
// Check RMobileUssdMessaging::GetCaps returns iUssdFormat of KCapsPackedString
|
|
1416 |
// Check RMobileUssdMessaging::GetCaps returns iUssdTypes of KCapsMOUssd | KCapsMTUssd
|
|
1417 |
RMobileUssdMessaging& mobileUssdMessaging = iEtelSessionMgr.GetUssdMessagingL(KMainServer, KMainPhone,KMainUssdMessaging);
|
|
1418 |
RMobileUssdMessaging::TMobileUssdCapsV1 ussdCaps;
|
|
1419 |
RMobileUssdMessaging::TMobileUssdCapsV1Pckg ussdCapsPk(ussdCaps);
|
|
1420 |
CHECK_EQUALS_L(mobileUssdMessaging.GetCaps(ussdCapsPk), KErrNone,
|
|
1421 |
_L("RMobileUssdMessaging::GetCaps returned error"));
|
|
1422 |
CHECK_EQUALS_L(ussdCaps.iUssdFormat, (TUint32)RMobileUssdMessaging::KCapsPackedString,
|
|
1423 |
_L("RMobileUssdMessaging::GetCaps returned incorrect iUssdFormat"));
|
|
1424 |
TUint32 expectedCaps = RMobileUssdMessaging::KCapsMOUssd | RMobileUssdMessaging::KCapsMTUssd;
|
|
1425 |
CHECK_BITS_SET_L(ussdCaps.iUssdTypes, expectedCaps, KNoUnwantedBits, _L("RMobileUssdMessaging::GetCaps returned incorrect iUssdTypes"));
|
|
1426 |
|
|
1427 |
RMobilePhone& mobilePhone = iEtelSessionMgr.GetPhoneL(KMainServer, KMainPhone);
|
|
1428 |
TInt ret = iNetworkTsyTestHelper.WaitForRegisteredOnHomeNetworkL(mobilePhone);
|
|
1429 |
CHECK_EQUALS_L(ret, KErrNone,
|
|
1430 |
_L("RMobilePhone::NotifyNetworkRegistrationStatusChange network registration failed"));
|
|
1431 |
|
|
1432 |
|
|
1433 |
//
|
|
1434 |
// SET UP END
|
|
1435 |
//
|
|
1436 |
|
|
1437 |
StartTest();
|
|
1438 |
|
|
1439 |
//
|
|
1440 |
// TEST START
|
|
1441 |
//
|
|
1442 |
|
|
1443 |
|
|
1444 |
// === Send a valid USSD request ===
|
|
1445 |
|
|
1446 |
// Encode a the USSD request "*#30#" (Caller ID presentation) into a TGsmUssdMessageData buffer.
|
|
1447 |
TBuf8<100> eightBitStr = _L8("*#30#");
|
|
1448 |
TBuf8<100> sevenBitStr;
|
|
1449 |
iSmsStoreTsyTestHelper.GsmLibSmsPackMessage( sevenBitStr, eightBitStr, eightBitStr.Length());
|
|
1450 |
RMobileUssdMessaging::TGsmUssdMessageData sendUssdMsg = sevenBitStr;
|
|
1451 |
|
|
1452 |
// start listening for incoming messages
|
|
1453 |
TExtEtelRequestStatus recvMsgStatus(mobileUssdMessaging,EMobileUssdMessagingReceiveMessage);
|
|
1454 |
CleanupStack::PushL(recvMsgStatus);
|
|
1455 |
RMobileUssdMessaging::TGsmUssdMessageData recvUssdMsg;
|
|
1456 |
RMobileUssdMessaging::TMobileUssdAttributesV1 recvAttributes;
|
|
1457 |
RMobileUssdMessaging::TMobileUssdAttributesV1Pckg recvAttributesPckg(recvAttributes);
|
|
1458 |
mobileUssdMessaging.ReceiveMessage(recvMsgStatus,recvUssdMsg,recvAttributesPckg);
|
|
1459 |
|
|
1460 |
// Send a USSD message to the network with RMobileUssdMessaging::SendMessage with aMsgData=encoded TGsmUssdMessageData and aMsgAttributes.iDcs=0x00 (No class, uncompressed),aMsgAttributes.iFlags=RMobileUssdMessaging::KUssdMessageType | RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageDcs , aMsgAttributes.iFormat=RMobileUssdMessaging::EFormatPackedString , aMsgAttributes.iType=RMobileUssdMessaging::EUssdMORequest
|
|
1461 |
TExtEtelRequestStatus sendMsgStatus(mobileUssdMessaging,EMobileUssdMessagingSendMessage);
|
|
1462 |
CleanupStack::PushL(sendMsgStatus);
|
|
1463 |
RMobileUssdMessaging::TMobileUssdAttributesV1 sendAttributes;
|
|
1464 |
sendAttributes.iDcs=0x00;
|
|
1465 |
sendAttributes.iFlags=RMobileUssdMessaging::KUssdMessageType | RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageDcs;
|
|
1466 |
sendAttributes.iFormat=RMobileUssdMessaging::RMobileUssdMessaging::EFormatPackedString;
|
|
1467 |
sendAttributes.iType=RMobileUssdMessaging::EUssdMORequest;
|
|
1468 |
RMobileUssdMessaging::TMobileUssdAttributesV1Pckg sendAttributesPckg(sendAttributes);
|
|
1469 |
mobileUssdMessaging.SendMessage(sendMsgStatus, sendUssdMsg, sendAttributesPckg);
|
|
1470 |
ASSERT_EQUALS(WaitForRequestWithTimeOut(sendMsgStatus, ETimeLong),
|
|
1471 |
KErrNone, _L("RMobileUssdMessaging::SendMessage did not complete."));
|
|
1472 |
ASSERT_EQUALS(sendMsgStatus.Int(),KErrNone,
|
|
1473 |
_L("RMobileUssdMessaging::SendMessage completed with incorrect error"));
|
|
1474 |
|
|
1475 |
// === Receive network response ===
|
|
1476 |
|
|
1477 |
// Check RMobileUssdMessaging::ReceiveMessage completes with aMsgData with length > 0
|
|
1478 |
// Check RMobileUssdMessaging::ReceiveMessage completes with aMsgAttributes.iType=RMobileUssdMessaging::EUssdMTReply
|
|
1479 |
ASSERT_EQUALS(WaitForRequestWithTimeOut(recvMsgStatus, ETimeLong),
|
|
1480 |
KErrNone, _L("RMobileUssdMessaging::ReceiveMessage did not complete."));
|
|
1481 |
ASSERT_EQUALS(recvMsgStatus.Int(),KErrNone,
|
|
1482 |
_L("RMobileUssdMessaging::ReceiveMessage completed with incorrect error"));
|
|
1483 |
ASSERT_TRUE(recvUssdMsg.Length() > 0,
|
|
1484 |
_L("RMobileUssdMessaging::ReceiveMessage completed with msglength <=0"));
|
|
1485 |
ASSERT_EQUALS(recvAttributes.iType,RMobileUssdMessaging::EUssdMTReply,
|
|
1486 |
_L("RMobileUssdMessaging::ReceiveMessage completed with incorrect USSD message type"));
|
|
1487 |
|
|
1488 |
// === Send release complete ===
|
|
1489 |
|
|
1490 |
// Check RMobileUssdMessaging::SendRelease completes with KErrNone
|
|
1491 |
TExtEtelRequestStatus sendReleaseStatus(mobileUssdMessaging,EMobileUssdMessagingSendRelease);
|
|
1492 |
CleanupStack::PushL(sendReleaseStatus);
|
|
1493 |
RMobilePhone::TMobilePhoneSendSSRequestV3 requestInfo;
|
|
1494 |
RMobilePhone::TMobilePhoneSendSSRequestV3Pckg requestInfoPckg(requestInfo);
|
|
1495 |
mobileUssdMessaging.SendRelease(sendReleaseStatus,requestInfoPckg);
|
|
1496 |
ASSERT_EQUALS(WaitForRequestWithTimeOut(sendReleaseStatus, ETimeLong),
|
|
1497 |
KErrNone, _L("RMobileUssdMessaging::SendRelease did not complete."));
|
|
1498 |
ASSERT_EQUALS(sendReleaseStatus.Int(),KErrNone,
|
|
1499 |
_L("RMobileUssdMessaging::SendRelease completed with incorrect error"));
|
|
1500 |
|
|
1501 |
//
|
|
1502 |
// TEST END
|
|
1503 |
//
|
|
1504 |
|
|
1505 |
StartCleanup();
|
|
1506 |
|
|
1507 |
// Pop:
|
|
1508 |
// sendReleaseStatus
|
|
1509 |
// sendMsgStatus
|
|
1510 |
// recvMsgStatus
|
|
1511 |
CleanupStack::PopAndDestroy(3,&recvMsgStatus);
|
|
1512 |
|
|
1513 |
return TestStepResult();
|
|
1514 |
}
|
|
1515 |
|
|
1516 |
TPtrC CCTSYIntegrationTestUssdMessaging0010::GetTestStepName()
|
|
1517 |
/**
|
|
1518 |
* @return The test step name.
|
|
1519 |
*/
|
|
1520 |
{
|
|
1521 |
return _L("CCTSYIntegrationTestUssdMessaging0010");
|
|
1522 |
}
|
|
1523 |
|
|
1524 |
|
|
1525 |
|
|
1526 |
CCTSYIntegrationTestUssdMessaging0011::CCTSYIntegrationTestUssdMessaging0011(CEtelSessionMgr& aEtelSessionMgr)
|
|
1527 |
: CCTSYIntegrationTestUssdMessagingBase(aEtelSessionMgr)
|
|
1528 |
/**
|
|
1529 |
* Constructor.
|
|
1530 |
*/
|
|
1531 |
{
|
|
1532 |
SetTestStepName(CCTSYIntegrationTestUssdMessaging0011::GetTestStepName());
|
|
1533 |
}
|
|
1534 |
|
|
1535 |
CCTSYIntegrationTestUssdMessaging0011::~CCTSYIntegrationTestUssdMessaging0011()
|
|
1536 |
/**
|
|
1537 |
* Destructor.
|
|
1538 |
*/
|
|
1539 |
{
|
|
1540 |
}
|
|
1541 |
|
|
1542 |
TVerdict CCTSYIntegrationTestUssdMessaging0011::doTestStepL()
|
|
1543 |
/**
|
|
1544 |
* @SYMTestCaseID BA-CTSY-INT-USSDM-0011
|
|
1545 |
* @SYMFssID BA/CTSY/USSDM-0011
|
|
1546 |
* @SYMTestCaseDesc Cancel receiving a USSD message.
|
|
1547 |
* @SYMTestPriority High
|
|
1548 |
* @SYMTestActions
|
|
1549 |
* @SYMTestExpectedResults Pass - KErrCancel returned.
|
|
1550 |
* @SYMTestType CIT
|
|
1551 |
* @SYMTestCaseDependencies live/automatic
|
|
1552 |
*
|
|
1553 |
* Reason for test: Verify KErrCancel returned.
|
|
1554 |
*
|
|
1555 |
* @return - TVerdict code
|
|
1556 |
*/
|
|
1557 |
{
|
|
1558 |
|
|
1559 |
//
|
|
1560 |
// SET UP
|
|
1561 |
//
|
|
1562 |
|
|
1563 |
|
|
1564 |
// Check RMobileUssdMessaging::GetCaps returns iUssdFormat of KCapsPackedString
|
|
1565 |
// Check RMobileUssdMessaging::GetCaps returns iUssdTypes of KCapsMOUssd | KCapsMTUssd
|
|
1566 |
RMobileUssdMessaging& mobileUssdMessaging = iEtelSessionMgr.GetUssdMessagingL(KMainServer, KMainPhone,KMainUssdMessaging);
|
|
1567 |
RMobileUssdMessaging::TMobileUssdCapsV1 ussdCaps;
|
|
1568 |
RMobileUssdMessaging::TMobileUssdCapsV1Pckg ussdCapsPk(ussdCaps);
|
|
1569 |
CHECK_EQUALS_L(mobileUssdMessaging.GetCaps(ussdCapsPk), KErrNone,
|
|
1570 |
_L("RMobileUssdMessaging::GetCaps returned error"));
|
|
1571 |
CHECK_EQUALS_L(ussdCaps.iUssdFormat, (TUint32)RMobileUssdMessaging::KCapsPackedString,
|
|
1572 |
_L("RMobileUssdMessaging::GetCaps returned incorrect iUssdFormat"));
|
|
1573 |
TUint32 expectedCaps = RMobileUssdMessaging::KCapsMOUssd | RMobileUssdMessaging::KCapsMTUssd;
|
|
1574 |
CHECK_BITS_SET_L(ussdCaps.iUssdTypes, expectedCaps, KNoUnwantedBits, _L("RMobileUssdMessaging::GetCaps returned incorrect iUssdTypes"));
|
|
1575 |
|
|
1576 |
|
|
1577 |
//
|
|
1578 |
// SET UP END
|
|
1579 |
//
|
|
1580 |
|
|
1581 |
StartTest();
|
|
1582 |
|
|
1583 |
//
|
|
1584 |
// TEST START
|
|
1585 |
//
|
|
1586 |
|
|
1587 |
|
|
1588 |
// Make an RMobileUssdMessaging::ReceiveMessage request
|
|
1589 |
TExtEtelRequestStatus recvMsgStatus(mobileUssdMessaging,EMobileUssdMessagingReceiveMessage);
|
|
1590 |
CleanupStack::PushL(recvMsgStatus);
|
|
1591 |
RMobileUssdMessaging::TGsmUssdMessageData recvUssdMsg;
|
|
1592 |
RMobileUssdMessaging::TMobileUssdAttributesV1 recvAttributes;
|
|
1593 |
RMobileUssdMessaging::TMobileUssdAttributesV1Pckg recvAttributesPckg(recvAttributes);
|
|
1594 |
mobileUssdMessaging.ReceiveMessage(recvMsgStatus,recvUssdMsg,recvAttributesPckg);
|
|
1595 |
|
|
1596 |
// Cancel the request with RTelSubSession::CancelAsyncRequest(EMobileUssdMessagingReceiveMessage);
|
|
1597 |
mobileUssdMessaging.CancelAsyncRequest(EMobileUssdMessagingReceiveMessage);
|
|
1598 |
|
|
1599 |
// Check receive message request completes with KErrCancel
|
|
1600 |
ASSERT_EQUALS(WaitForRequestWithTimeOut(recvMsgStatus, ETimeLong),
|
|
1601 |
KErrNone, _L("RMobileUssdMessaging::ReceiveMessage did not complete."));
|
|
1602 |
ASSERT_EQUALS(recvMsgStatus.Int(),KErrCancel,
|
|
1603 |
_L("RMobileUssdMessaging::ReceiveMessage did not completed with KErrCancel"));
|
|
1604 |
|
|
1605 |
|
|
1606 |
//
|
|
1607 |
// TEST END
|
|
1608 |
//
|
|
1609 |
|
|
1610 |
StartCleanup();
|
|
1611 |
|
|
1612 |
// Pop:
|
|
1613 |
// recvMsgStatus
|
|
1614 |
CleanupStack::PopAndDestroy(1,&recvMsgStatus);
|
|
1615 |
|
|
1616 |
return TestStepResult();
|
|
1617 |
}
|
|
1618 |
|
|
1619 |
TPtrC CCTSYIntegrationTestUssdMessaging0011::GetTestStepName()
|
|
1620 |
/**
|
|
1621 |
* @return The test step name.
|
|
1622 |
*/
|
|
1623 |
{
|
|
1624 |
return _L("CCTSYIntegrationTestUssdMessaging0011");
|
|
1625 |
}
|
|
1626 |
|
|
1627 |
|
|
1628 |
|