telephonyserverplugins/common_tsy/test/component/src/cctsyussdmessagingfu.cpp
branchopencode
changeset 77 930a53cdc2d3
parent 24 6638e7f4bd8f
child 85 96b4f933d69a
equal deleted inserted replaced
35:6fbc08ed9c42 77:930a53cdc2d3
    30 
    30 
    31 
    31 
    32 CTestSuite* CCTsyUssdMessagingFU::CreateSuiteL(const TDesC& aName)
    32 CTestSuite* CCTsyUssdMessagingFU::CreateSuiteL(const TDesC& aName)
    33 	{
    33 	{
    34 	SUB_SUITE;
    34 	SUB_SUITE;
    35 
       
    36 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessage0001L);
    35 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessage0001L);
    37 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessage0002L);
    36 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessage0002L);
    38 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessage0003L);
    37 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessage0003L);
    39 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessage0004L);
    38 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessage0004L);
    40 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessage0005L);
    39 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessage0005L);
       
    40 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessage0006L);
    41 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0001L);
    41 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0001L);
    42 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0001bL);
    42 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0001bL);
       
    43 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0001cL);
       
    44 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0001dL);
    43 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0002L);
    45 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0002L);
       
    46 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0002bL);
    44 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0003L);
    47 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0003L);
    45 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0004L);
    48 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0004L);
       
    49 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0004bL);
    46 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0005L);
    50 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendRelease0005L);
    47 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0001L);
    51 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0001L);
    48 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002L);
    52 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002L);
    49 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002bL);
    53 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002bL);
    50 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002cL);
    54 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002cL);
    51 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002dL);
    55 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002dL);
    52 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002eL);
    56 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002eL);
    53 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002fL);
    57 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002fL);
    54 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002gL);
    58 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002gL);
    55 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002hL);
    59 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002hL);
       
    60 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0002iL);
    56 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0003L);
    61 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0003L);
    57 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004L);
    62 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004L);
    58 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004bL);
    63 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004bL);	
    59 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004cL);
    64 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004cL);
    60 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004dL);
    65 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004dL);
    61 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004eL);
    66 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004eL);
    62 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004fL);
    67 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessage0004fL);
    63 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0001L);
    68 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0001L);
       
    69 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0001eL);
       
    70 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0001bL);
       
    71 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0001cL);
       
    72 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0001dL);
    64 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0002L);
    73 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0002L);
    65 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0003L);
    74 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0003L);
    66 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0004L);
    75 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0004L);
       
    76 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestNotifyNetworkRelease0004bL);
    67 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageNoFdnCheck0001L);
    77 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageNoFdnCheck0001L);
    68 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageNoFdnCheck0002L);
    78 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageNoFdnCheck0002L);
    69 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageNoFdnCheck0003L);
    79 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageNoFdnCheck0003L);
    70 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageNoFdnCheck0004L);
    80 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageNoFdnCheck0004L);
    71 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageNoFdnCheck0005L);
    81 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageNoFdnCheck0005L);
    87 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessageWithTestClient0016L);
    97 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessageWithTestClient0016L);
    88 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessageWithTestClient0017L);
    98 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestReceiveMessageWithTestClient0017L);
    89 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestAcceptRejectMisuse0001L);
    99 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestAcceptRejectMisuse0001L);
    90 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestAcceptRejectMisuse0002L);
   100 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestAcceptRejectMisuse0002L);
    91 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestMultipleIncomingUssdMessages0001L);
   101 	ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestMultipleIncomingUssdMessages0001L);
    92 
       
    93 	END_SUITE;
   102 	END_SUITE;
       
   103 	
    94 	}
   104 	}
    95 
   105 
    96 
   106 
    97 //
   107 //
    98 // Actual test cases
   108 // Actual test cases
   227 	ASSERT_EQUALS(KErrGsmOfflineOpNotAllowed, requestStatus.Int());	
   237 	ASSERT_EQUALS(KErrGsmOfflineOpNotAllowed, requestStatus.Int());	
   228 
   238 
   229 	CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging
   239 	CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging
   230 
   240 
   231 	}
   241 	}
   232 
       
   233 
   242 
   234 /**
   243 /**
   235 @SYMTestCaseID BA-CTSY-USSDM-USM-0002
   244 @SYMTestCaseID BA-CTSY-USSDM-USM-0002
   236 @SYMComponent  telephony_ctsy
   245 @SYMComponent  telephony_ctsy
   237 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobileUssdMessaging::SendMessage
   246 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobileUssdMessaging::SendMessage
   441 
   450 
   442  	//-------------------------------------------------------------------------
   451  	//-------------------------------------------------------------------------
   443 
   452 
   444 	TMockLtsyData2<TName, RMobileUssdMessaging::TMobileUssdAttributesV1> 
   453 	TMockLtsyData2<TName, RMobileUssdMessaging::TMobileUssdAttributesV1> 
   445 		mockData2(name1, attributes1);
   454 		mockData2(name1, attributes1);
       
   455 	mockData2.SerialiseL(data);
       
   456 
       
   457 	RBuf8 data3;
       
   458 	CleanupClosePushL(data3);
       
   459 
       
   460 	RMobileUssdMessaging::TMobileUssdAttributesV1 attributes;
       
   461 	    TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes);
       
   462 	    
       
   463 	RMobileUssdMessaging::TGsmUssdMessageData name;
       
   464 
       
   465 	//-------------------------------------------------------------------------
       
   466 
       
   467 	RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes;
       
   468 
       
   469 	completeAttributes.iFlags  = flags;
       
   470 	completeAttributes.iFormat = format;
       
   471 	completeAttributes.iType   = type;
       
   472 	completeAttributes.iDcs    = dcs;
       
   473 	
       
   474 	TBuf8<KMaxName> completeName = _L8("Name1");
       
   475 
       
   476 	TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> 
       
   477 		mockData3(completeName, completeAttributes);
       
   478 	mockData3.SerialiseL(data3);
   446 
   479 
   447 	//-------------------------------------------------------------------------
   480 	//-------------------------------------------------------------------------
   448 	// Test A: Test multiple clients requesting RMobileUssdMessaging::SendMessage
   481 	// Test A: Test multiple clients requesting RMobileUssdMessaging::SendMessage
   449  	//-------------------------------------------------------------------------
   482  	//-------------------------------------------------------------------------
   450 
   483 	iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data3);
   451 	mockData2.SerialiseL(data);
   484 
       
   485 	ussdMessaging1.ReceiveMessage(requestStatus1, name, msgAttributes);   
       
   486 	User::WaitForRequest(requestStatus1);        
       
   487 	ret = requestStatus1.Int();
       
   488 	ASSERT_EQUALS(KErrNone, ret);
       
   489 	ussdMessaging1.AcceptIncomingDialogue();
       
   490 	
   452     iMockLTSY.ExpectL(EMobileUssdMessagingSendMessage, data);
   491     iMockLTSY.ExpectL(EMobileUssdMessagingSendMessage, data);
   453     iMockLTSY.CompleteL(EMobileUssdMessagingSendMessage, KErrNone, 10);
   492     iMockLTSY.CompleteL(EMobileUssdMessagingSendMessage, KErrNone, 10);
   454 	ussdMessaging1.SendMessage(requestStatus1, msgData1, msgAttributes1);
   493 	ussdMessaging1.SendMessage(requestStatus1, msgData1, msgAttributes1);
   455 
   494 
   456 	ussdMessaging2.SendMessage(requestStatus2, msgData2, msgAttributes2);
   495 	ussdMessaging2.SendMessage(requestStatus2, msgData2, msgAttributes2);
   460 
   499 
   461     User::WaitForRequest(requestStatus2);        
   500     User::WaitForRequest(requestStatus2);        
   462 	AssertMockLtsyStatusL();
   501 	AssertMockLtsyStatusL();
   463 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());	
   502 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());	
   464 
   503 
   465 	CleanupStack::PopAndDestroy(6, this); // phone2, telServer2, data, this, 
   504 	CleanupStack::PopAndDestroy(7, this); // phone2, telServer2, data, this, 
   466 	                                      // ussdMessaging1, ussdMessaging2
   505 	                                      // ussdMessaging1, ussdMessaging2, data3
   467 
   506 
   468 	}
   507 	}
   469 
   508 
   470 
   509 
   471 /**
   510 /**
   534 
   573 
   535 	CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging
   574 	CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging
   536 
   575 
   537 	}
   576 	}
   538 
   577 
   539 
   578 /**
   540 /**
   579 @SYMTestCaseID BA-CTSY-USSDM-USM-0006
   541 @SYMTestCaseID BA-CTSY-USSDM-USR-0001
       
   542 @SYMComponent  telephony_ctsy
   580 @SYMComponent  telephony_ctsy
   543 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::SendRelease
   581 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::SendMessage DefaultHandler
   544 @SYMTestPriority High
   582 @SYMTestPriority High
   545 @SYMTestActions Invokes RMobileUssdMessaging::SendRelease
   583 @SYMTestActions Invokes RMobileUssdMessaging::SendMessage DefaultHandler
   546 @SYMTestExpectedResults Pass
   584 @SYMTestExpectedResults Pass
   547 @SYMTestType CT
   585 @SYMTestType CT
   548 */
   586 */
   549 void CCTsyUssdMessagingFU::TestSendRelease0001L()
   587 void CCTsyUssdMessagingFU::TestSendMessage0006L()
   550 	{
   588 	{
   551 
   589 
   552 	OpenEtelServerL(EUseExtendedError);
   590 	OpenEtelServerL(EUseExtendedError);
   553 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
   591 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
   554 	OpenPhoneL();
   592 	OpenPhoneL();
   559 	RMobileUssdMessaging ussdMessaging;
   597 	RMobileUssdMessaging ussdMessaging;
   560 	TInt ret = ussdMessaging.Open(iPhone);
   598 	TInt ret = ussdMessaging.Open(iPhone);
   561 	ASSERT_EQUALS(KErrNone, ret);
   599 	ASSERT_EQUALS(KErrNone, ret);
   562 	CleanupClosePushL(ussdMessaging);
   600 	CleanupClosePushL(ussdMessaging);
   563 	
   601 	
       
   602 	TRequestStatus requestStatus;
       
   603 
       
   604 	TUint32 flags = 100;
       
   605 	RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified;
       
   606 	RMobileUssdMessaging::TMobileUssdMessageType type  = RMobileUssdMessaging::EUssdMORequest;
       
   607 	TUint8 dcs = 200;
       
   608 
       
   609  	//-------------------------------------------------------------------------
       
   610 	// function parameters
       
   611 
       
   612 	RMobileUssdMessaging::TMobileUssdAttributesV1 attributes;
       
   613 	TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes);
       
   614 	
       
   615 	attributes.iFlags  = flags;
       
   616 	attributes.iFormat = format;
       
   617 	attributes.iType   = type;
       
   618 	attributes.iDcs   = dcs;
       
   619 	
       
   620 	TName name = _L("Name1");
       
   621 	TPckg<TName> msgData(name);
       
   622 
       
   623  	//-------------------------------------------------------------------------
       
   624 
       
   625 	TMockLtsyData2<TName, RMobileUssdMessaging::TMobileUssdAttributesV1> 
       
   626 		mockData2(name, attributes);
       
   627 	mockData2.SerialiseL(data);
       
   628 	
       
   629  	//-------------------------------------------------------------------------
       
   630 	// TEST A: failure to dispatch request to LTSY
       
   631  	//-------------------------------------------------------------------------
       
   632 	
       
   633 	
       
   634     iMockLTSY.ExpectL(EMobileUssdMessagingSendMessageDefaultHandler, data, KErrNotSupported);
       
   635 
       
   636 	ussdMessaging.SendMessage(requestStatus, msgData, msgAttributes, RMobileUssdMessaging::ETransferToDefaultHandler);
       
   637 	
       
   638     User::WaitForRequest(requestStatus);        
       
   639 	AssertMockLtsyStatusL();
       
   640 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());	
       
   641 	
       
   642 	//-------------------------------------------------------------------------
       
   643 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
   644  	//-------------------------------------------------------------------------
       
   645 
       
   646     iMockLTSY.ExpectL(EMobileUssdMessagingSendMessageDefaultHandler, data);
       
   647     iMockLTSY.CompleteL(EMobileUssdMessagingSendMessageDefaultHandler, KErrGeneral);
       
   648 
       
   649 	ussdMessaging.SendMessage(requestStatus, msgData, msgAttributes, RMobileUssdMessaging::ETransferToDefaultHandler);
       
   650 	
       
   651     User::WaitForRequest(requestStatus);        
       
   652 	AssertMockLtsyStatusL();
       
   653 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());	
       
   654 	
       
   655  	//-------------------------------------------------------------------------
       
   656 	// TEST C: Successful completion request of
       
   657 	// RMobileUssdMessaging::SendMessage when result is not cached.
       
   658  	//-------------------------------------------------------------------------
       
   659 
       
   660     iMockLTSY.ExpectL(EMobileUssdMessagingSendMessageDefaultHandler, data);
       
   661     iMockLTSY.CompleteL(EMobileUssdMessagingSendMessageDefaultHandler, KErrNone);
       
   662 
       
   663 	ussdMessaging.SendMessage(requestStatus, msgData, msgAttributes, RMobileUssdMessaging::ETransferToDefaultHandler);
       
   664 	
       
   665     User::WaitForRequest(requestStatus);        
       
   666 	AssertMockLtsyStatusL();
       
   667 	ASSERT_EQUALS(KErrNone, requestStatus.Int());	
       
   668 	
       
   669  	//-------------------------------------------------------------------------
       
   670 	// TEST E: Unsolicited completion of RMobileUssdMessaging::SendMessage
       
   671 	// from LTSY.
       
   672  	//-------------------------------------------------------------------------
       
   673 
   564     TRequestStatus mockLtsyStatus;
   674     TRequestStatus mockLtsyStatus;
   565 	TRequestStatus requestStatus;
   675 
   566 
   676 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
   677 	iMockLTSY.CompleteL(EMobileUssdMessagingSendMessageDefaultHandler, KErrNone);
       
   678 	User::WaitForRequest(mockLtsyStatus);
       
   679 	AssertMockLtsyStatusL();
       
   680 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
   681 
       
   682  	//-------------------------------------------------------------------------
       
   683 	// TEST : to increase CMmUssdTsy::ExtFunc coverage
       
   684 	// covers "if ( ERfsStateInfoInactive == iMmPhone->GetRfStateInfo() && 
       
   685 	// ( !IsRequestPossibleInOffline( aIpc ) ) )" condition
       
   686  	//-------------------------------------------------------------------------
       
   687 
       
   688 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
       
   689 	TRfStateInfo rfInfo = ERfsStateInfoInactive;
       
   690 	TMockLtsyData1<TRfStateInfo> mockData1(rfInfo);
       
   691 	
       
   692 	data.Close();
       
   693 	mockData1.SerialiseL(data);
       
   694 
       
   695 	iMockLTSY.CompleteL(EMmTsyBootGetRFStatusIPC, KErrNone, data);
       
   696 	User::WaitForRequest(mockLtsyStatus);
       
   697 	AssertMockLtsyStatusL();
       
   698 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
       
   699 
       
   700 	ussdMessaging.SendMessage(requestStatus, msgData, msgAttributes);
       
   701 
       
   702 	User::WaitForRequest(requestStatus);        
       
   703 	AssertMockLtsyStatusL();
       
   704 	ASSERT_EQUALS(KErrGsmOfflineOpNotAllowed, requestStatus.Int());	
       
   705 	
       
   706 	CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging
       
   707 
       
   708 	}
       
   709 
       
   710 /**
       
   711 @SYMTestCaseID BA-CTSY-USSDM-USR-0001
       
   712 @SYMComponent  telephony_ctsy
       
   713 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::SendRelease
       
   714 @SYMTestPriority High
       
   715 @SYMTestActions Invokes RMobileUssdMessaging::SendRelease
       
   716 @SYMTestExpectedResults Pass
       
   717 @SYMTestType CT
       
   718 */
       
   719 void CCTsyUssdMessagingFU::TestSendRelease0001L()
       
   720 	{
       
   721     OpenEtelServerL(EUseExtendedError);
       
   722     CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   723     OpenPhoneL();
       
   724 
       
   725     RBuf8 data;
       
   726     CleanupClosePushL(data);
       
   727 
       
   728     RMobileUssdMessaging ussdMessaging;
       
   729     TInt ret = ussdMessaging.Open(iPhone);
       
   730     ASSERT_EQUALS(KErrNone, ret);
       
   731     CleanupClosePushL(ussdMessaging);
       
   732     
       
   733     //-------------------------------------------------------------------------
       
   734     // Setup: This block is taken from TestReceiveMessage0001L. All we want to
       
   735     // do is to initiate a dialogue and then end it. Once the dialogue has ended
       
   736     // then we can call Accept and Reject.
       
   737     //------------------------------------------------------------------------- 
       
   738     
       
   739     TRequestStatus requestStatus;
       
   740         
       
   741     TRequestStatus mockLtsyStatus;
       
   742 
       
   743     TUint32 flags = 100;
       
   744     RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified;
       
   745     RMobileUssdMessaging::TMobileUssdMessageType type  = RMobileUssdMessaging::EUssdMORequest;
       
   746     TUint8 dcs = 200;
       
   747 
       
   748     //-------------------------------------------------------------------------
       
   749     // function parameters
       
   750 
       
   751     RMobileUssdMessaging::TMobileUssdAttributesV1 attributes;
       
   752     TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes);
       
   753     
       
   754     RMobileUssdMessaging::TGsmUssdMessageData name;
       
   755 
       
   756     //-------------------------------------------------------------------------
       
   757 
       
   758     RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes;
       
   759 
       
   760     completeAttributes.iFlags  = flags;
       
   761     completeAttributes.iFormat = format;
       
   762     completeAttributes.iType   = type;
       
   763     completeAttributes.iDcs    = dcs;
       
   764     
       
   765     TBuf8<KMaxName> completeName = _L8("Name1");
       
   766 
       
   767     TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> 
       
   768         mockData2(completeName, completeAttributes);
       
   769     mockData2.SerialiseL(data);
       
   770     
       
   771     iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data);
       
   772 
       
   773     ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes);   
       
   774     User::WaitForRequest(requestStatus);        
       
   775     ret = requestStatus.Int();
       
   776     ASSERT_EQUALS(KErrNone, ret);
       
   777     ussdMessaging.AcceptIncomingDialogue();
       
   778     
       
   779     AssertMockLtsyStatusL();
       
   780     ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
   781     
       
   782     //-------------------------------------------------------------------------
       
   783     // Release the dialogue
       
   784     //------------------------------------------------------------------------- 
       
   785     
   567  	//-------------------------------------------------------------------------
   786  	//-------------------------------------------------------------------------
   568 	// function parameters
   787 	// function parameters
   569 	
   788 	
   570 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3;
   789 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3;
   571 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3);
   790 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3);
   572 	
   791 		
   573  	//-------------------------------------------------------------------------
   792  	//-------------------------------------------------------------------------
   574 
   793 
   575 	RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3;
   794 	RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3;
   576 
   795 	
   577 	TUint8 opCode = 100;
   796 	TUint8 opCode = 100;
   578 	_LIT(KAdditionalInfo1, "additionalInfo1");
   797 	_LIT(KAdditionalInfo1, "additionalInfo1");
   579 	
   798 		
   580 	completeSendV3.iOpCode         = opCode;
   799 	completeSendV3.iOpCode         = opCode;
   581 	completeSendV3.iAdditionalInfo = KAdditionalInfo1;
   800 	completeSendV3.iAdditionalInfo = KAdditionalInfo1;
   582 
   801 	
   583 	TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3);
   802 	TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3);	
   584 
       
   585 	mockData1.SerialiseL(data);
   803 	mockData1.SerialiseL(data);
   586 
   804 	
   587 	//-------------------------------------------------------------------------
       
   588 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
   589  	//-------------------------------------------------------------------------
       
   590 
       
   591     iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease);
       
   592     iMockLTSY.CompleteL(EMobileUssdMessagingSendRelease, KErrGeneral, data);
       
   593 	ussdMessaging.SendRelease(requestStatus, pckgSendV3);
       
   594 	
       
   595     User::WaitForRequest(requestStatus);        
       
   596 	AssertMockLtsyStatusL();
       
   597 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
       
   598 
       
   599  	//-------------------------------------------------------------------------
   805  	//-------------------------------------------------------------------------
   600 	// TEST C: Successful completion request of
   806 	// TEST C: Successful completion request of
   601 	// RMobileUssdMessaging::SendRelease when result is not cached.
   807 	// RMobileUssdMessaging::SendRelease when result is not cached.
   602  	//-------------------------------------------------------------------------
   808  	//-------------------------------------------------------------------------
   603 
   809 	
   604 	iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease);
   810 	iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease);
   605 	iMockLTSY.CompleteL(EMobileUssdMessagingSendRelease, KErrNone, data);
   811 	iMockLTSY.CompleteL(EMobileUssdMessagingSendRelease, KErrNone, data);
   606 	ussdMessaging.SendRelease(requestStatus, pckgSendV3);
   812 	ussdMessaging.SendRelease(requestStatus, pckgSendV3);
   607 	
   813 	
   608     User::WaitForRequest(requestStatus);        
   814     User::WaitForRequest(requestStatus);        
   609 	AssertMockLtsyStatusL();
   815 	AssertMockLtsyStatusL();
   610 	ASSERT_EQUALS(KErrNone, requestStatus.Int());	
   816 	ASSERT_EQUALS(KErrNone, requestStatus.Int());	
       
   817 	
   611 	ASSERT_EQUALS(opCode, sendV3.iOpCode);	
   818 	ASSERT_EQUALS(opCode, sendV3.iOpCode);	
   612 	ASSERT_EQUALS(0, completeSendV3.iAdditionalInfo.Compare(sendV3.iAdditionalInfo));	
   819 	ASSERT_EQUALS(0, completeSendV3.iAdditionalInfo.Compare(sendV3.iAdditionalInfo));
   613 
   820 	
   614 	//-------------------------------------------------------------------------
   821 	//-------------------------------------------------------------------------
   615 	// TEST E: Unsolicited completion of RMobileUssdMessaging::SendRelease
   822 	// TEST E: Unsolicited completion of RMobileUssdMessaging::SendRelease
   616 	// from LTSY.
   823 	// from LTSY.
   617  	//-------------------------------------------------------------------------
   824  	//-------------------------------------------------------------------------
   618 
   825 
   619 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
   826 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
   620 	iMockLTSY.CompleteL(EMobileUssdMessagingSendRelease, KErrNone, data);
   827 	iMockLTSY.CompleteL(EMobileUssdMessagingSendRelease, KErrNone, data);
   621 	User::WaitForRequest(mockLtsyStatus);
   828 	User::WaitForRequest(mockLtsyStatus);
   622 	AssertMockLtsyStatusL();
   829 	AssertMockLtsyStatusL();
   623 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
   830 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
   624 
   831 	
   625 	CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging
   832     CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging, dataTest
   626 	
       
   627 	}
   833 	}
   628 
   834 
   629 /**
   835 /**
   630 @SYMTestCaseID BA-CTSY-USSDM-USR-0001b
   836 @SYMTestCaseID BA-CTSY-USSDM-USR-0001b
   631 @SYMComponent  telephony_ctsy
   837 @SYMComponent  telephony_ctsy
   635 @SYMTestExpectedResults Pass
   841 @SYMTestExpectedResults Pass
   636 @SYMTestType CT
   842 @SYMTestType CT
   637 */
   843 */
   638 void CCTsyUssdMessagingFU::TestSendRelease0001bL()
   844 void CCTsyUssdMessagingFU::TestSendRelease0001bL()
   639 	{
   845 	{
       
   846     OpenEtelServerL(EUseExtendedError);
       
   847     CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   848     OpenPhoneL();
       
   849 
       
   850     RBuf8 data;
       
   851     CleanupClosePushL(data);
       
   852 
       
   853     RMobileUssdMessaging ussdMessaging;
       
   854     TInt ret = ussdMessaging.Open(iPhone);
       
   855     ASSERT_EQUALS(KErrNone, ret);
       
   856     CleanupClosePushL(ussdMessaging);
       
   857     
       
   858     //-------------------------------------------------------------------------
       
   859     // Setup: This block is taken from TestReceiveMessage0001L. All we want to
       
   860     // do is to initiate a dialogue and then end it. Once the dialogue has ended
       
   861     // then we can call Accept and Reject.
       
   862     //------------------------------------------------------------------------- 
       
   863     
       
   864     TRequestStatus requestStatus;
       
   865     TRequestStatus mockLtsyStatus;
       
   866 
       
   867     TUint32 flags = 100;
       
   868     RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified;
       
   869     RMobileUssdMessaging::TMobileUssdMessageType type  = RMobileUssdMessaging::EUssdMORequest;
       
   870     TUint8 dcs = 200;
       
   871 
       
   872     //-------------------------------------------------------------------------
       
   873     // function parameters
       
   874 
       
   875     RMobileUssdMessaging::TMobileUssdAttributesV1 attributes;
       
   876     TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes);
       
   877     
       
   878     RMobileUssdMessaging::TGsmUssdMessageData name;
       
   879 
       
   880     //-------------------------------------------------------------------------
       
   881 
       
   882     RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes;
       
   883 
       
   884     completeAttributes.iFlags  = flags;
       
   885     completeAttributes.iFormat = format;
       
   886     completeAttributes.iType   = type;
       
   887     completeAttributes.iDcs    = dcs;
       
   888     
       
   889     TBuf8<KMaxName> completeName = _L8("Name1");
       
   890 
       
   891     TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> 
       
   892         mockData2(completeName, completeAttributes);
       
   893     mockData2.SerialiseL(data);
       
   894     
       
   895     iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data);
       
   896 
       
   897     ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes);   
       
   898     User::WaitForRequest(requestStatus);        
       
   899     ret = requestStatus.Int();
       
   900     ASSERT_EQUALS(KErrNone, ret);
       
   901     ussdMessaging.AcceptIncomingDialogue();
       
   902     
       
   903     AssertMockLtsyStatusL();
       
   904     ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
   905     
       
   906     //-------------------------------------------------------------------------
       
   907     // Release the dialogue
       
   908     //------------------------------------------------------------------------- 
       
   909 	
       
   910  	//-------------------------------------------------------------------------
       
   911 	// function parameters
       
   912 	
       
   913 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3;
       
   914 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3);
       
   915 	
       
   916  	//-------------------------------------------------------------------------
       
   917 
       
   918 	RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3;
       
   919 
       
   920 	TUint8 opCode = 100;
       
   921 	_LIT(KAdditionalInfo1, "additionalInfo1");
       
   922 	
       
   923 	completeSendV3.iOpCode         = opCode;
       
   924 	completeSendV3.iAdditionalInfo = KAdditionalInfo1;
       
   925 
       
   926 	TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3);
       
   927 
       
   928 	mockData1.SerialiseL(data);
       
   929 
       
   930  	//-------------------------------------------------------------------------
       
   931 	// TEST A: failure to dispatch request to LTSY
       
   932  	//-------------------------------------------------------------------------
       
   933 
       
   934     iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease, KErrNotSupported);
       
   935 	ussdMessaging.SendRelease(requestStatus, pckgSendV3);
       
   936 	
       
   937     User::WaitForRequest(requestStatus);
       
   938 	AssertMockLtsyStatusL();
       
   939 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
       
   940 
       
   941  	//-------------------------------------------------------------------------
       
   942 
       
   943 	iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease);
       
   944 	iMockLTSY.CompleteL(EMobileUssdMessagingSendRelease, KErrNone, data);
       
   945 	ussdMessaging.SendRelease(requestStatus, pckgSendV3);
       
   946 	
       
   947     User::WaitForRequest(requestStatus);        
       
   948 
       
   949 	ASSERT_EQUALS(KErrNone, requestStatus.Int());	
       
   950 
       
   951 	AssertMockLtsyStatusL();
       
   952 
       
   953 	CleanupStack::PopAndDestroy(3); // data, this, ussdMessaging
       
   954 	}
       
   955 
       
   956 /**
       
   957 @SYMTestCaseID BA-CTSY-USSDM-USR-0006
       
   958 @SYMComponent  telephony_ctsy
       
   959 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::SendRelease without USSD session in progress
       
   960 @SYMTestPriority High
       
   961 @SYMTestActions Invokes RMobileUssdMessaging::SendRelease
       
   962 @SYMTestExpectedResults Pass
       
   963 @SYMTestType CT
       
   964 */
       
   965 void CCTsyUssdMessagingFU::TestSendRelease0001cL()
       
   966 	{
       
   967 		
   640 	OpenEtelServerL(EUseExtendedError);
   968 	OpenEtelServerL(EUseExtendedError);
   641 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
   969 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
   642 	OpenPhoneL();
   970 	OpenPhoneL();
   643 
   971 
   644 	RBuf8 data;
   972 	RBuf8 data;
   645 	CleanupClosePushL(data);
   973 	CleanupClosePushL(data);
   646 
       
   647 	TRequestStatus mockLtsyStatus;
       
   648 	TRequestStatus requestStatus;
       
   649 
   974 
   650 	RMobileUssdMessaging ussdMessaging;
   975 	RMobileUssdMessaging ussdMessaging;
   651 	TInt ret = ussdMessaging.Open(iPhone);
   976 	TInt ret = ussdMessaging.Open(iPhone);
   652 	ASSERT_EQUALS(KErrNone, ret);
   977 	ASSERT_EQUALS(KErrNone, ret);
   653 	CleanupClosePushL(ussdMessaging);
   978 	CleanupClosePushL(ussdMessaging);
   654 
   979 		
       
   980     TRequestStatus mockLtsyStatus;
       
   981 	TRequestStatus requestStatus;
       
   982 		
   655  	//-------------------------------------------------------------------------
   983  	//-------------------------------------------------------------------------
   656 	// function parameters
   984 	// function parameters
   657 	
   985 	
   658 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3;
   986 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3;
   659 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3);
   987 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3);
   660 	
   988 		
   661  	//-------------------------------------------------------------------------
   989  	//-------------------------------------------------------------------------
   662 
   990 
   663 	RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3;
   991 	RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3;
   664 
   992 
   665 	TUint8 opCode = 100;
   993 	TUint8 opCode = 100;
   666 	_LIT(KAdditionalInfo1, "additionalInfo1");
   994 	_LIT(KAdditionalInfo1, "additionalInfo1");
   667 	
   995 		
   668 	completeSendV3.iOpCode         = opCode;
   996 	completeSendV3.iOpCode         = opCode;
   669 	completeSendV3.iAdditionalInfo = KAdditionalInfo1;
   997 	completeSendV3.iAdditionalInfo = KAdditionalInfo1;
   670 
   998 	
   671 	TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3);
   999 	TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3);	
   672 
       
   673 	mockData1.SerialiseL(data);
  1000 	mockData1.SerialiseL(data);
   674 
  1001 		
   675  	//-------------------------------------------------------------------------
  1002 	//-------------------------------------------------------------------------
   676 	// TEST A: failure to dispatch request to LTSY
  1003 	// TEST A: failure because there is no USSD session in progress
   677  	//-------------------------------------------------------------------------
  1004  	//-------------------------------------------------------------------------
   678 
  1005 	
   679     iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease, KErrNotSupported);
       
   680 	ussdMessaging.SendRelease(requestStatus, pckgSendV3);
  1006 	ussdMessaging.SendRelease(requestStatus, pckgSendV3);
   681 	
  1007 		
       
  1008     User::WaitForRequest(requestStatus);
       
  1009 	AssertMockLtsyStatusL();
       
  1010 	ASSERT_EQUALS(KErrDisconnected, requestStatus.Int());
       
  1011 		
       
  1012 	CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging
       
  1013 	
       
  1014 	}
       
  1015 
       
  1016 /**
       
  1017 @SYMTestCaseID BA-CTSY-USSDM-USR-0001d
       
  1018 @SYMComponent  telephony_ctsy
       
  1019 @SYMTestCaseDesc Test support in CTSY for failure on completion of pending comRMobileUssdMessaging::SendRelease request from LTSY->CTSY
       
  1020 @SYMTestPriority High
       
  1021 @SYMTestActions Invokes RMobileUssdMessaging::SendRelease
       
  1022 @SYMTestExpectedResults Pass
       
  1023 @SYMTestType CT
       
  1024 */
       
  1025 void CCTsyUssdMessagingFU::TestSendRelease0001dL()
       
  1026 	{
       
  1027     OpenEtelServerL(EUseExtendedError);
       
  1028     CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1029     OpenPhoneL();
       
  1030 
       
  1031     RBuf8 data;
       
  1032     CleanupClosePushL(data);
       
  1033 
       
  1034     RMobileUssdMessaging ussdMessaging;
       
  1035     TInt ret = ussdMessaging.Open(iPhone);
       
  1036     ASSERT_EQUALS(KErrNone, ret);
       
  1037     CleanupClosePushL(ussdMessaging);
       
  1038     
       
  1039     //-------------------------------------------------------------------------
       
  1040     // Setup: This block is taken from TestReceiveMessage0001L. All we want to
       
  1041     // do is to initiate a dialogue and then end it. Once the dialogue has ended
       
  1042     // then we can call Accept and Reject.
       
  1043     //------------------------------------------------------------------------- 
       
  1044     
       
  1045     TRequestStatus requestStatus;
       
  1046         
       
  1047     TRequestStatus mockLtsyStatus;
       
  1048 
       
  1049     TUint32 flags = 100;
       
  1050     RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified;
       
  1051     RMobileUssdMessaging::TMobileUssdMessageType type  = RMobileUssdMessaging::EUssdMORequest;
       
  1052     TUint8 dcs = 200;
       
  1053 
       
  1054     //-------------------------------------------------------------------------
       
  1055     // function parameters
       
  1056 
       
  1057     RMobileUssdMessaging::TMobileUssdAttributesV1 attributes;
       
  1058     TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes);
       
  1059     
       
  1060     RMobileUssdMessaging::TGsmUssdMessageData name;
       
  1061 
       
  1062     //-------------------------------------------------------------------------
       
  1063 
       
  1064     RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes;
       
  1065 
       
  1066     completeAttributes.iFlags  = flags;
       
  1067     completeAttributes.iFormat = format;
       
  1068     completeAttributes.iType   = type;
       
  1069     completeAttributes.iDcs    = dcs;
       
  1070     
       
  1071     TBuf8<KMaxName> completeName = _L8("Name1");
       
  1072 
       
  1073     TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> 
       
  1074         mockData2(completeName, completeAttributes);
       
  1075     mockData2.SerialiseL(data);
       
  1076     
       
  1077     iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data);
       
  1078 
       
  1079     ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes);   
   682     User::WaitForRequest(requestStatus);        
  1080     User::WaitForRequest(requestStatus);        
       
  1081     ret = requestStatus.Int();
       
  1082     ASSERT_EQUALS(KErrNone, ret);
       
  1083     ussdMessaging.AcceptIncomingDialogue();
       
  1084     
       
  1085     AssertMockLtsyStatusL();
       
  1086     ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  1087     
       
  1088     //-------------------------------------------------------------------------
       
  1089     // Release the dialogue
       
  1090     //------------------------------------------------------------------------- 
       
  1091     
       
  1092  	//-------------------------------------------------------------------------
       
  1093 	// function parameters
       
  1094 	
       
  1095 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3;
       
  1096 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3);
       
  1097 		
       
  1098  	//-------------------------------------------------------------------------
       
  1099 
       
  1100 	RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3;
       
  1101 	
       
  1102 	TUint8 opCode = 100;
       
  1103 	_LIT(KAdditionalInfo1, "additionalInfo1");
       
  1104 		
       
  1105 	completeSendV3.iOpCode         = opCode;
       
  1106 	completeSendV3.iAdditionalInfo = KAdditionalInfo1;
       
  1107 	
       
  1108 	TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3);	
       
  1109 	mockData1.SerialiseL(data);
       
  1110 	
       
  1111 	//-------------------------------------------------------------------------
       
  1112 	// Failure on completion of pending request from LTSY->CTSY
       
  1113  	//-------------------------------------------------------------------------
       
  1114 	
       
  1115     iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease);
       
  1116     iMockLTSY.CompleteL(EMobileUssdMessagingSendRelease, KErrGeneral, data);
       
  1117 	ussdMessaging.SendRelease(requestStatus, pckgSendV3);
       
  1118 		
       
  1119     User::WaitForRequest(requestStatus);
   683 	AssertMockLtsyStatusL();
  1120 	AssertMockLtsyStatusL();
   684 	ASSERT_EQUALS(KErrNotSupported, requestStatus.Int());
  1121 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());
   685 
  1122 	
   686  	//-------------------------------------------------------------------------
  1123     CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging, dataTest
   687 
       
   688 	iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease);
       
   689 	iMockLTSY.CompleteL(EMobileUssdMessagingSendRelease, KErrNone, data);
       
   690 	ussdMessaging.SendRelease(requestStatus, pckgSendV3);
       
   691 	
       
   692     User::WaitForRequest(requestStatus);        
       
   693 
       
   694 	ASSERT_EQUALS(KErrNone, requestStatus.Int());	
       
   695 
       
   696 	AssertMockLtsyStatusL();
       
   697 
       
   698 	CleanupStack::PopAndDestroy(3); // data, this, ussdMessaging
       
   699 
       
   700 	}
  1124 	}
   701 
  1125 
   702 /**
  1126 /**
   703 @SYMTestCaseID BA-CTSY-USSDM-USR-0002
  1127 @SYMTestCaseID BA-CTSY-USSDM-USR-0002
   704 @SYMComponent  telephony_ctsy
  1128 @SYMComponent  telephony_ctsy
   708 @SYMTestExpectedResults Pass
  1132 @SYMTestExpectedResults Pass
   709 @SYMTestType CT
  1133 @SYMTestType CT
   710 */
  1134 */
   711 void CCTsyUssdMessagingFU::TestSendRelease0002L()
  1135 void CCTsyUssdMessagingFU::TestSendRelease0002L()
   712 	{
  1136 	{
   713 
  1137     OpenEtelServerL(EUseExtendedError);
   714 	OpenEtelServerL(EUseExtendedError);
  1138     CleanupStack::PushL(TCleanupItem(Cleanup,this));
   715 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
  1139     OpenPhoneL();
   716 	OpenPhoneL();
  1140 
   717 
  1141     RBuf8 data;
   718 	RBuf8 data;
  1142     CleanupClosePushL(data);
   719 	CleanupClosePushL(data);
  1143 
   720 
  1144     RMobileUssdMessaging ussdMessaging;
   721 	TRequestStatus mockLtsyStatus;
  1145     TInt ret = ussdMessaging.Open(iPhone);
   722 	TRequestStatus requestStatus;
  1146     ASSERT_EQUALS(KErrNone, ret);
   723 
  1147     CleanupClosePushL(ussdMessaging);
   724 	RMobileUssdMessaging ussdMessaging;
  1148     
   725 	TInt ret = ussdMessaging.Open(iPhone);
  1149     //-------------------------------------------------------------------------
   726 	ASSERT_EQUALS(KErrNone, ret);
  1150     // Setup: This block is taken from TestReceiveMessage0001L. All we want to
   727 	CleanupClosePushL(ussdMessaging);
  1151     // do is to initiate a dialogue and then end it. Once the dialogue has ended
   728 
  1152     // then we can call Accept and Reject.
       
  1153     //------------------------------------------------------------------------- 
       
  1154     
       
  1155     TRequestStatus requestStatus;
       
  1156     TRequestStatus mockLtsyStatus;
       
  1157 
       
  1158     TUint32 flags = 100;
       
  1159     RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified;
       
  1160     RMobileUssdMessaging::TMobileUssdMessageType type  = RMobileUssdMessaging::EUssdMORequest;
       
  1161     TUint8 dcs = 200;
       
  1162 
       
  1163     //-------------------------------------------------------------------------
       
  1164     // function parameters
       
  1165 
       
  1166     RMobileUssdMessaging::TMobileUssdAttributesV1 attributes;
       
  1167     TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes);
       
  1168     
       
  1169     RMobileUssdMessaging::TGsmUssdMessageData name;
       
  1170 
       
  1171     //-------------------------------------------------------------------------
       
  1172 
       
  1173     RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes;
       
  1174 
       
  1175     completeAttributes.iFlags  = flags;
       
  1176     completeAttributes.iFormat = format;
       
  1177     completeAttributes.iType   = type;
       
  1178     completeAttributes.iDcs    = dcs;
       
  1179     
       
  1180     TBuf8<KMaxName> completeName = _L8("Name1");
       
  1181 
       
  1182     TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> 
       
  1183         mockData2(completeName, completeAttributes);
       
  1184     mockData2.SerialiseL(data);
       
  1185     
       
  1186     iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data);
       
  1187 
       
  1188     ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes);   
       
  1189     User::WaitForRequest(requestStatus);        
       
  1190     ret = requestStatus.Int();
       
  1191     ASSERT_EQUALS(KErrNone, ret);
       
  1192     ussdMessaging.AcceptIncomingDialogue();
       
  1193     
       
  1194     AssertMockLtsyStatusL();
       
  1195     ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  1196     
       
  1197     //-------------------------------------------------------------------------
       
  1198     // Release the dialogue
       
  1199     //------------------------------------------------------------------------- 
       
  1200 	
   729  	//-------------------------------------------------------------------------
  1201  	//-------------------------------------------------------------------------
   730 	// function parameters
  1202 	// function parameters
   731 	
  1203 	
   732 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3;
  1204 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3;
   733 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3);
  1205 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3);
   769 	
  1241 	
   770 	}
  1242 	}
   771 
  1243 
   772 
  1244 
   773 /**
  1245 /**
   774 @SYMTestCaseID BA-CTSY-USSDM-USR-0003
  1246 @SYMTestCaseID BA-CTSY-USSDM-USR-0002b
   775 @SYMComponent  telephony_ctsy
  1247 @SYMComponent  telephony_ctsy
   776 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::SendRelease with bad parameter data
  1248 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobileUssdMessaging::SendRelease
   777 @SYMTestPriority High
  1249 @SYMTestPriority High
   778 @SYMTestActions Invokes RMobileUssdMessaging::SendRelease with bad parameter data
  1250 @SYMTestActions Invokes cancelling of RMobileUssdMessaging::SendRelease
   779 @SYMTestExpectedResults Pass
  1251 @SYMTestExpectedResults Pass
   780 @SYMTestType CT
  1252 @SYMTestType CT
   781 */
  1253 */
   782 void CCTsyUssdMessagingFU::TestSendRelease0003L()
  1254 void CCTsyUssdMessagingFU::TestSendRelease0002bL()
   783 	{
  1255 	{
   784 
       
   785 	OpenEtelServerL(EUseExtendedError);
  1256 	OpenEtelServerL(EUseExtendedError);
   786 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
  1257 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
   787 	OpenPhoneL();
  1258 	OpenPhoneL();
   788 
  1259 
   789 	RBuf8 data;
  1260 	RBuf8 data;
   790 	CleanupClosePushL(data);
  1261 	CleanupClosePushL(data);
   791 
       
   792 	TRequestStatus requestStatus;
       
   793 
  1262 
   794 	RMobileUssdMessaging ussdMessaging;
  1263 	RMobileUssdMessaging ussdMessaging;
   795 	TInt ret = ussdMessaging.Open(iPhone);
  1264 	TInt ret = ussdMessaging.Open(iPhone);
   796 	ASSERT_EQUALS(KErrNone, ret);
  1265 	ASSERT_EQUALS(KErrNone, ret);
   797 	CleanupClosePushL(ussdMessaging);
  1266 	CleanupClosePushL(ussdMessaging);
   798 
  1267 	
       
  1268 	//-------------------------------------------------------------------------
       
  1269 	// Setup: This block is taken from TestReceiveMessage0001L. All we want to
       
  1270 	// do is to initiate a dialogue and then end it. Once the dialogue has ended
       
  1271 	// then we can call Accept and Reject.
       
  1272 	//------------------------------------------------------------------------- 
       
  1273 	
       
  1274 	TRequestStatus requestStatus;
       
  1275 	TRequestStatus mockLtsyStatus;
       
  1276 
       
  1277 	TUint32 flags = 100;
       
  1278 	RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified;
       
  1279 	RMobileUssdMessaging::TMobileUssdMessageType type  = RMobileUssdMessaging::EUssdMTRequest;
       
  1280 	TUint8 dcs = 200;
       
  1281 
       
  1282 	//-------------------------------------------------------------------------
       
  1283 	// function parameters
       
  1284 
       
  1285 	RMobileUssdMessaging::TMobileUssdAttributesV1 attributes;
       
  1286 	TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes);
       
  1287 	
       
  1288 	RMobileUssdMessaging::TGsmUssdMessageData name;
       
  1289 
       
  1290 	//-------------------------------------------------------------------------
       
  1291 
       
  1292 	RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes;
       
  1293 
       
  1294 	completeAttributes.iFlags  = flags;
       
  1295 	completeAttributes.iFormat = format;
       
  1296 	completeAttributes.iType   = type;
       
  1297 	completeAttributes.iDcs    = dcs;
       
  1298 	
       
  1299 	TBuf8<KMaxName> completeName = _L8("Name1");
       
  1300 
       
  1301 	TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> 
       
  1302 		mockData2(completeName, completeAttributes);
       
  1303 	mockData2.SerialiseL(data);
       
  1304 	
       
  1305 	iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data);
       
  1306 
       
  1307 	ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes);   
       
  1308 	User::WaitForRequest(requestStatus);        
       
  1309 	ret = requestStatus.Int();
       
  1310 	ASSERT_EQUALS(KErrNone, ret);
       
  1311 			
       
  1312 	//-------------------------------------------------------------------------
       
  1313 	// Release the dialogue
       
  1314 	//------------------------------------------------------------------------- 
       
  1315 	
       
  1316 	//-------------------------------------------------------------------------
       
  1317 	// function parameters
       
  1318 	
       
  1319 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3;
       
  1320 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3);
       
  1321 	
       
  1322 	//-------------------------------------------------------------------------
       
  1323 
       
  1324 	RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3;
       
  1325 
       
  1326 	TUint8 opCode = 100;
       
  1327 	_LIT(KAdditionalInfo1, "additionalInfo1");
       
  1328 	
       
  1329 	completeSendV3.iOpCode         = opCode;
       
  1330 	completeSendV3.iAdditionalInfo = KAdditionalInfo1;
       
  1331 
       
  1332 	TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3);
       
  1333 
       
  1334 	mockData1.SerialiseL(data);
       
  1335 	
       
  1336 	//-------------------------------------------------------------------------
       
  1337 
       
  1338 	ussdMessaging.SendRelease(requestStatus, pckgSendV3);
       
  1339 	
       
  1340 	ussdMessaging.AcceptIncomingDialogue();		    
       
  1341 	AssertMockLtsyStatusL();
       
  1342 	ASSERT_EQUALS(KErrDisconnected, requestStatus.Int());
       
  1343 
       
  1344 	CleanupStack::PopAndDestroy(3); // data, this, ussdMessaging
       
  1345 	
       
  1346 	}
       
  1347 
       
  1348 
       
  1349 
       
  1350 /**
       
  1351 @SYMTestCaseID BA-CTSY-USSDM-USR-0003
       
  1352 @SYMComponent  telephony_ctsy
       
  1353 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::SendRelease with bad parameter data
       
  1354 @SYMTestPriority High
       
  1355 @SYMTestActions Invokes RMobileUssdMessaging::SendRelease with bad parameter data
       
  1356 @SYMTestExpectedResults Pass
       
  1357 @SYMTestType CT
       
  1358 */
       
  1359 void CCTsyUssdMessagingFU::TestSendRelease0003L()
       
  1360 	{
       
  1361     OpenEtelServerL(EUseExtendedError);
       
  1362     CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1363     OpenPhoneL();
       
  1364 
       
  1365     RBuf8 data;
       
  1366     CleanupClosePushL(data);
       
  1367 
       
  1368     RMobileUssdMessaging ussdMessaging;
       
  1369     TInt ret = ussdMessaging.Open(iPhone);
       
  1370     ASSERT_EQUALS(KErrNone, ret);
       
  1371     CleanupClosePushL(ussdMessaging);
       
  1372     
       
  1373     //-------------------------------------------------------------------------
       
  1374     // Setup: This block is taken from TestReceiveMessage0001L. All we want to
       
  1375     // do is to initiate a dialogue and then end it. Once the dialogue has ended
       
  1376     // then we can call Accept and Reject.
       
  1377     //------------------------------------------------------------------------- 
       
  1378     
       
  1379     TRequestStatus requestStatus;
       
  1380     TRequestStatus mockLtsyStatus;
       
  1381 
       
  1382     TUint32 flags = 100;
       
  1383     RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified;
       
  1384     RMobileUssdMessaging::TMobileUssdMessageType type  = RMobileUssdMessaging::EUssdMORequest;
       
  1385     TUint8 dcs = 200;
       
  1386 
       
  1387     //-------------------------------------------------------------------------
       
  1388     // function parameters
       
  1389 
       
  1390     RMobileUssdMessaging::TMobileUssdAttributesV1 attributes;
       
  1391     TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes);
       
  1392     
       
  1393     RMobileUssdMessaging::TGsmUssdMessageData name;
       
  1394 
       
  1395     //-------------------------------------------------------------------------
       
  1396 
       
  1397     RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes;
       
  1398 
       
  1399     completeAttributes.iFlags  = flags;
       
  1400     completeAttributes.iFormat = format;
       
  1401     completeAttributes.iType   = type;
       
  1402     completeAttributes.iDcs    = dcs;
       
  1403     
       
  1404     TBuf8<KMaxName> completeName = _L8("Name1");
       
  1405 
       
  1406     TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> 
       
  1407         mockData2(completeName, completeAttributes);
       
  1408     mockData2.SerialiseL(data);
       
  1409     
       
  1410     iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data);
       
  1411 
       
  1412     ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes);   
       
  1413     User::WaitForRequest(requestStatus);        
       
  1414     ret = requestStatus.Int();
       
  1415     ASSERT_EQUALS(KErrNone, ret);
       
  1416     ussdMessaging.AcceptIncomingDialogue();
       
  1417     
       
  1418     AssertMockLtsyStatusL();
       
  1419     ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  1420     
       
  1421     //-------------------------------------------------------------------------
       
  1422     // Release the dialogue
       
  1423     //------------------------------------------------------------------------- 
       
  1424     
   799  	//-------------------------------------------------------------------------
  1425  	//-------------------------------------------------------------------------
   800 
  1426 
   801 	RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3;
  1427 	RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3;
   802 
  1428 
   803 	TUint8 opCode = 100;
  1429 	TUint8 opCode = 100;
   820 	User::WaitForRequest(requestStatus);
  1446 	User::WaitForRequest(requestStatus);
   821 	AssertMockLtsyStatusL();
  1447 	AssertMockLtsyStatusL();
   822 	ASSERT_EQUALS(KErrArgument, requestStatus.Int());
  1448 	ASSERT_EQUALS(KErrArgument, requestStatus.Int());
   823 	
  1449 	
   824 	CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging
  1450 	CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging
   825 
  1451 	
   826 	}
  1452 	}
   827 
  1453 
   828 
  1454 
   829 /**
  1455 /**
   830 @SYMTestCaseID BA-CTSY-USSDM-USR-0004
  1456 @SYMTestCaseID BA-CTSY-USSDM-USR-0004
   835 @SYMTestExpectedResults Pass
  1461 @SYMTestExpectedResults Pass
   836 @SYMTestType CT
  1462 @SYMTestType CT
   837 */
  1463 */
   838 void CCTsyUssdMessagingFU::TestSendRelease0004L()
  1464 void CCTsyUssdMessagingFU::TestSendRelease0004L()
   839 	{
  1465 	{
   840 
  1466     OpenEtelServerL(EUseExtendedError);
       
  1467     CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  1468     OpenPhoneL();
       
  1469 
       
  1470     RBuf8 data;
       
  1471     CleanupClosePushL(data);
       
  1472 
       
  1473     RMobileUssdMessaging ussdMessaging;
       
  1474     TInt ret = ussdMessaging.Open(iPhone);
       
  1475     ASSERT_EQUALS(KErrNone, ret);
       
  1476     CleanupClosePushL(ussdMessaging);
       
  1477     
       
  1478     //-------------------------------------------------------------------------
       
  1479     // Setup: This block is taken from TestReceiveMessage0001L. All we want to
       
  1480     // do is to initiate a dialogue and then end it. Once the dialogue has ended
       
  1481     // then we can call Accept and Reject.
       
  1482     //------------------------------------------------------------------------- 
       
  1483     
       
  1484     TRequestStatus requestStatus;
       
  1485     TRequestStatus mockLtsyStatus;
       
  1486 
       
  1487     TUint32 flags = 100;
       
  1488     RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified;
       
  1489     RMobileUssdMessaging::TMobileUssdMessageType type  = RMobileUssdMessaging::EUssdMORequest;
       
  1490     TUint8 dcs = 200;
       
  1491 
       
  1492     //-------------------------------------------------------------------------
       
  1493     // function parameters
       
  1494 
       
  1495     RMobileUssdMessaging::TMobileUssdAttributesV1 attributes;
       
  1496     TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes);
       
  1497     
       
  1498     RMobileUssdMessaging::TGsmUssdMessageData name;
       
  1499 
       
  1500     //-------------------------------------------------------------------------
       
  1501 
       
  1502     RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes;
       
  1503 
       
  1504     completeAttributes.iFlags  = flags;
       
  1505     completeAttributes.iFormat = format;
       
  1506     completeAttributes.iType   = type;
       
  1507     completeAttributes.iDcs    = dcs;
       
  1508     
       
  1509     TBuf8<KMaxName> completeName = _L8("Name1");
       
  1510 
       
  1511     TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> 
       
  1512         mockData2(completeName, completeAttributes);
       
  1513     mockData2.SerialiseL(data);
       
  1514     
       
  1515     iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data);
       
  1516 
       
  1517     ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes);   
       
  1518     User::WaitForRequest(requestStatus);        
       
  1519     ret = requestStatus.Int();
       
  1520     ASSERT_EQUALS(KErrNone, ret);
       
  1521     ussdMessaging.AcceptIncomingDialogue();
       
  1522     
       
  1523     AssertMockLtsyStatusL();
       
  1524     ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  1525     
       
  1526     //-------------------------------------------------------------------------
       
  1527     // Release the dialogue
       
  1528     //------------------------------------------------------------------------- 
       
  1529 
       
  1530     // Open second client
       
  1531     RTelServer telServer2;
       
  1532 	ret = telServer2.Connect();
       
  1533     ASSERT_EQUALS(KErrNone, ret);
       
  1534     CleanupClosePushL(telServer2);
       
  1535 
       
  1536     RMobilePhone phone2;
       
  1537     ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  1538     ASSERT_EQUALS(KErrNone, ret);
       
  1539     CleanupClosePushL(phone2);
       
  1540     
       
  1541 	RMobileUssdMessaging ussdMessaging2;
       
  1542 	ret = ussdMessaging2.Open(phone2);
       
  1543 	ASSERT_EQUALS(KErrNone, ret);
       
  1544 	CleanupClosePushL(ussdMessaging2);
       
  1545 
       
  1546 	TRequestStatus requestStatus1;
       
  1547 	TRequestStatus requestStatus2;
       
  1548 
       
  1549  	//-------------------------------------------------------------------------
       
  1550 	// parameters for first function
       
  1551 	
       
  1552 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV31;
       
  1553 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV31(sendV31);
       
  1554 	
       
  1555  	//-------------------------------------------------------------------------
       
  1556 
       
  1557 	RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV31;
       
  1558 
       
  1559 	TUint8 opCode = 100;
       
  1560 	_LIT(KAdditionalInfo1, "additionalInfo1");
       
  1561 	
       
  1562 	completeSendV31.iOpCode         = opCode;
       
  1563 	completeSendV31.iAdditionalInfo = KAdditionalInfo1;
       
  1564 
       
  1565 	TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData11(completeSendV31);
       
  1566 
       
  1567  	//-------------------------------------------------------------------------
       
  1568 	// parameters for second function
       
  1569 	
       
  1570 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV32;
       
  1571 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV32(sendV32);
       
  1572 	
       
  1573 	//-------------------------------------------------------------------------
       
  1574 	// Test A: Test multiple clients requesting RMobileUssdMessaging::SendRelease
       
  1575  	//-------------------------------------------------------------------------
       
  1576 	
       
  1577 	mockData11.SerialiseL(data);
       
  1578 	iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease);
       
  1579 	iMockLTSY.CompleteL(EMobileUssdMessagingSendRelease, KErrNone, data, 10);
       
  1580 	ussdMessaging.SendRelease(requestStatus, pckgSendV31);
       
  1581 
       
  1582 	ussdMessaging2.SendRelease(requestStatus2, pckgSendV32);
       
  1583 	
       
  1584     User::WaitForRequest(requestStatus);        
       
  1585 	ASSERT_EQUALS(KErrNone, requestStatus.Int());	
       
  1586 
       
  1587     User::WaitForRequest(requestStatus2);  
       
  1588 	ASSERT_EQUALS(KErrAccessDenied, requestStatus2.Int());	
       
  1589 	ASSERT_EQUALS(opCode, sendV31.iOpCode);	
       
  1590 	ASSERT_EQUALS(0, sendV31.iAdditionalInfo.Compare(KAdditionalInfo1));	
       
  1591 	 
       
  1592 	AssertMockLtsyStatusL();
       
  1593 	CleanupStack::PopAndDestroy(6, this); // data, ussdMessaging2, ussdMessaging,
       
  1594 										  // phone2, telServer2, this
       
  1595 	}
       
  1596 
       
  1597 /**
       
  1598 @SYMTestCaseID BA-CTSY-USSDM-USR-0004a
       
  1599 @SYMComponent  telephony_ctsy
       
  1600 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobileUssdMessaging::SendRelease
       
  1601 @SYMTestPriority High
       
  1602 @SYMTestActions Invokes multiple client requests to RMobileUssdMessaging::SendRelease
       
  1603 @SYMTestExpectedResults Pass
       
  1604 @SYMTestType CT
       
  1605 */
       
  1606 void CCTsyUssdMessagingFU::TestSendRelease0004bL()
       
  1607 	{
   841 	OpenEtelServerL(EUseExtendedError);
  1608 	OpenEtelServerL(EUseExtendedError);
   842 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
  1609 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
   843 	OpenPhoneL();
  1610 	OpenPhoneL();
   844 
  1611 	
       
  1612 	RBuf8 data;
       
  1613 	CleanupClosePushL(data);
       
  1614 	
       
  1615 	RMobileUssdMessaging ussdMessaging;
       
  1616 	TInt ret = ussdMessaging.Open(iPhone);
       
  1617 	ASSERT_EQUALS(KErrNone, ret);
       
  1618 	CleanupClosePushL(ussdMessaging);
       
  1619 	
       
  1620 	//-------------------------------------------------------------------------
       
  1621 	// Setup: This block is taken from TestReceiveMessage0001L. All we want to
       
  1622 	// do is to initiate a dialogue and then end it. Once the dialogue has ended
       
  1623 	// then we can call Accept and Reject.
       
  1624 	//------------------------------------------------------------------------- 
       
  1625 	
       
  1626 	TRequestStatus requestStatus;
       
  1627 	TRequestStatus mockLtsyStatus;
       
  1628 	
       
  1629 	TUint32 flags = 100;
       
  1630 	RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified;
       
  1631 	RMobileUssdMessaging::TMobileUssdMessageType type  = RMobileUssdMessaging::EUssdMTRequest;
       
  1632 	TUint8 dcs = 200;
       
  1633 	
       
  1634 	//-------------------------------------------------------------------------
       
  1635 	// function parameters
       
  1636 	
       
  1637 	RMobileUssdMessaging::TMobileUssdAttributesV1 attributes;
       
  1638 	TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes);
       
  1639 	
       
  1640 	RMobileUssdMessaging::TGsmUssdMessageData name;
       
  1641 	
       
  1642 	//-------------------------------------------------------------------------
       
  1643 	
       
  1644 	RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes;
       
  1645 	
       
  1646 	completeAttributes.iFlags  = flags;
       
  1647 	completeAttributes.iFormat = format;
       
  1648 	completeAttributes.iType   = type;
       
  1649 	completeAttributes.iDcs    = dcs;
       
  1650 	
       
  1651 	TBuf8<KMaxName> completeName = _L8("Name1");
       
  1652 	
       
  1653 	TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> 
       
  1654 		mockData2(completeName, completeAttributes);
       
  1655 	mockData2.SerialiseL(data);
       
  1656 	
       
  1657 	iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data);
       
  1658 	
       
  1659 	ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes);   
       
  1660 	User::WaitForRequest(requestStatus);        
       
  1661 	ret = requestStatus.Int();
       
  1662 	ASSERT_EQUALS(KErrNone, ret);
       
  1663 	ussdMessaging.AcceptIncomingDialogue();
       
  1664 	
       
  1665 	AssertMockLtsyStatusL();
       
  1666 	
       
  1667 	//-------------------------------------------------------------------------
       
  1668 	// Try to release the dialogue
       
  1669 	//------------------------------------------------------------------------- 
       
  1670 	
   845 	// Open second client
  1671 	// Open second client
   846 	RTelServer telServer2;
  1672 	RTelServer telServer2;
   847 	TInt ret = telServer2.Connect();
  1673 	ret = telServer2.Connect();
   848 	ASSERT_EQUALS(KErrNone, ret);
  1674 	ASSERT_EQUALS(KErrNone, ret);
   849 	CleanupClosePushL(telServer2);
  1675 	CleanupClosePushL(telServer2);
   850 
  1676 	
   851 	RMobilePhone phone2;
  1677 	RMobilePhone phone2;
   852 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
  1678 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
   853 	ASSERT_EQUALS(KErrNone, ret);
  1679 	ASSERT_EQUALS(KErrNone, ret);
   854 	CleanupClosePushL(phone2);
  1680 	CleanupClosePushL(phone2);
   855 
  1681 	
   856 	RMobileUssdMessaging ussdMessaging1;
       
   857 	ret = ussdMessaging1.Open(iPhone);
       
   858 	ASSERT_EQUALS(KErrNone, ret);
       
   859 	CleanupClosePushL(ussdMessaging1);
       
   860 
       
   861 	RMobileUssdMessaging ussdMessaging2;
  1682 	RMobileUssdMessaging ussdMessaging2;
   862 	ret = ussdMessaging2.Open(phone2);
  1683 	ret = ussdMessaging2.Open(phone2);
   863 	ASSERT_EQUALS(KErrNone, ret);
  1684 	ASSERT_EQUALS(KErrNone, ret);
   864 	CleanupClosePushL(ussdMessaging2);
  1685 	CleanupClosePushL(ussdMessaging2);
   865 
  1686 	
   866 	TRequestStatus requestStatus1;
  1687 	//-------------------------------------------------------------------------
   867 	TRequestStatus requestStatus2;
  1688 	// function parameters
   868 
  1689 	
   869  	//-------------------------------------------------------------------------
  1690 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3;
   870 	// parameters for first function
  1691 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3);
   871 	
  1692 		
   872 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV31;
  1693 	//-------------------------------------------------------------------------
   873 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV31(sendV31);
  1694 	
   874 	
  1695 	RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3;
   875  	//-------------------------------------------------------------------------
  1696 	
   876 
       
   877 	RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV31;
       
   878 
       
   879 	TUint8 opCode = 100;
  1697 	TUint8 opCode = 100;
   880 	_LIT(KAdditionalInfo1, "additionalInfo1");
  1698 	_LIT(KAdditionalInfo1, "additionalInfo1");
   881 	
  1699 		
   882 	completeSendV31.iOpCode         = opCode;
  1700 	completeSendV3.iOpCode         = opCode;
   883 	completeSendV31.iAdditionalInfo = KAdditionalInfo1;
  1701 	completeSendV3.iAdditionalInfo = KAdditionalInfo1;
   884 
  1702 	
   885 	TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData11(completeSendV31);
  1703 	TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3);	
   886 
  1704 	mockData1.SerialiseL(data);
   887  	//-------------------------------------------------------------------------
  1705 	
   888 	// parameters for second function
  1706 	//-------------------------------------------------------------------------
   889 	
  1707 	// Test: The second client requests RMobileUssdMessaging::SendRelease
   890 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV32;
  1708 	//-------------------------------------------------------------------------
   891 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV32(sendV32);
  1709 	
   892 	
       
   893 	//-------------------------------------------------------------------------
       
   894 	// Test A: Test multiple clients requesting RMobileUssdMessaging::SendRelease
       
   895  	//-------------------------------------------------------------------------
       
   896 	
       
   897 	RBuf8 data;
       
   898 	CleanupClosePushL(data); // PUSH
       
   899 	mockData11.SerialiseL(data);
       
   900 	iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease);
  1710 	iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease);
   901 	iMockLTSY.CompleteL(EMobileUssdMessagingSendRelease, KErrNone, data, 10);
  1711 	iMockLTSY.CompleteL(EMobileUssdMessagingSendRelease, KErrDisconnected, data, 10);
   902 	ussdMessaging1.SendRelease(requestStatus1, pckgSendV31);
  1712 	
   903 
  1713 	TRequestStatus requestStatus2;
   904 	ussdMessaging2.SendRelease(requestStatus2, pckgSendV32);
  1714 	ussdMessaging2.SendRelease(requestStatus2, pckgSendV3);
   905 	
  1715 	
   906     User::WaitForRequest(requestStatus1);        
  1716 	User::WaitForRequest(requestStatus2);  
   907 	ASSERT_EQUALS(KErrNone, requestStatus1.Int());	
       
   908 
       
   909     User::WaitForRequest(requestStatus2);        
       
   910 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());	
       
   911 	ASSERT_EQUALS(opCode, sendV31.iOpCode);	
       
   912 	ASSERT_EQUALS(0, sendV31.iAdditionalInfo.Compare(KAdditionalInfo1));	
       
   913 
       
   914 	AssertMockLtsyStatusL();
  1717 	AssertMockLtsyStatusL();
   915 	CleanupStack::PopAndDestroy(6, this); // data, ussdMessaging2, ussdMessaging1,
  1718 	ASSERT_EQUALS(KErrDisconnected, requestStatus2.Int());	
   916 										  // phone2, telServer2, this                                   
  1719 		 
       
  1720 	CleanupStack::PopAndDestroy(6, this); // data, ussdMessaging2, ussdMessaging,
       
  1721 										  // phone2, telServer2, this
   917 	}
  1722 	}
   918 
       
   919 
  1723 
   920 /**
  1724 /**
   921 @SYMTestCaseID BA-CTSY-USSDM-USR-0005
  1725 @SYMTestCaseID BA-CTSY-USSDM-USR-0005
   922 @SYMComponent  telephony_ctsy
  1726 @SYMComponent  telephony_ctsy
   923 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::SendRelease with timeout
  1727 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::SendRelease with timeout
   926 @SYMTestExpectedResults Pass
  1730 @SYMTestExpectedResults Pass
   927 @SYMTestType CT
  1731 @SYMTestType CT
   928 */
  1732 */
   929 void CCTsyUssdMessagingFU::TestSendRelease0005L()
  1733 void CCTsyUssdMessagingFU::TestSendRelease0005L()
   930 	{
  1734 	{
   931 
  1735     OpenEtelServerL(EUseExtendedError);
   932 	OpenEtelServerL(EUseExtendedError);
  1736     CleanupStack::PushL(TCleanupItem(Cleanup,this));
   933 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
  1737     OpenPhoneL();
   934 	OpenPhoneL();
  1738 
   935 
  1739     RBuf8 data;
   936 	RBuf8 data;
  1740     CleanupClosePushL(data);
   937 	CleanupClosePushL(data);
  1741 
   938 
  1742     RMobileUssdMessaging ussdMessaging;
   939 	RMobileUssdMessaging ussdMessaging;
  1743     TInt ret = ussdMessaging.Open(iPhone);
   940 	TInt ret = ussdMessaging.Open(iPhone);
  1744     ASSERT_EQUALS(KErrNone, ret);
   941 	ASSERT_EQUALS(KErrNone, ret);
  1745     CleanupClosePushL(ussdMessaging);
   942 	CleanupClosePushL(ussdMessaging);
  1746     
   943 	
  1747     //-------------------------------------------------------------------------
   944 	TRequestStatus requestStatus;
  1748     // Setup: This block is taken from TestReceiveMessage0001L. All we want to
       
  1749     // do is to initiate a dialogue and then end it. Once the dialogue has ended
       
  1750     // then we can call Accept and Reject.
       
  1751     //------------------------------------------------------------------------- 
       
  1752     
       
  1753     TRequestStatus requestStatus;
       
  1754     TRequestStatus mockLtsyStatus;
       
  1755 
       
  1756     TUint32 flags = 100;
       
  1757     RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified;
       
  1758     RMobileUssdMessaging::TMobileUssdMessageType type  = RMobileUssdMessaging::EUssdMORequest;
       
  1759     TUint8 dcs = 200;
       
  1760 
       
  1761     //-------------------------------------------------------------------------
       
  1762     // function parameters
       
  1763 
       
  1764     RMobileUssdMessaging::TMobileUssdAttributesV1 attributes;
       
  1765     TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes);
       
  1766     
       
  1767     RMobileUssdMessaging::TGsmUssdMessageData name;
       
  1768 
       
  1769     //-------------------------------------------------------------------------
       
  1770 
       
  1771     RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes;
       
  1772 
       
  1773     completeAttributes.iFlags  = flags;
       
  1774     completeAttributes.iFormat = format;
       
  1775     completeAttributes.iType   = type;
       
  1776     completeAttributes.iDcs    = dcs;
       
  1777     
       
  1778     TBuf8<KMaxName> completeName = _L8("Name1");
       
  1779 
       
  1780     TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> 
       
  1781         mockData2(completeName, completeAttributes);
       
  1782     mockData2.SerialiseL(data);
       
  1783     
       
  1784     iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data);
       
  1785 
       
  1786     ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes);   
       
  1787     User::WaitForRequest(requestStatus);        
       
  1788     ret = requestStatus.Int();
       
  1789     ASSERT_EQUALS(KErrNone, ret);
       
  1790     ussdMessaging.AcceptIncomingDialogue();
       
  1791     
       
  1792     AssertMockLtsyStatusL();
       
  1793     ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  1794     
       
  1795     //-------------------------------------------------------------------------
       
  1796     // Release the dialogue
       
  1797     //------------------------------------------------------------------------- 
   945 
  1798 
   946  	//-------------------------------------------------------------------------
  1799  	//-------------------------------------------------------------------------
   947 	// function parameters
  1800 	// function parameters
   948 	
  1801 	
   949 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3;
  1802 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3;
   954  	//-------------------------------------------------------------------------
  1807  	//-------------------------------------------------------------------------
   955 
  1808 
   956 	iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease);
  1809 	iMockLTSY.ExpectL(EMobileUssdMessagingSendRelease);
   957 	ussdMessaging.SendRelease(requestStatus, pckgSendV3);
  1810 	ussdMessaging.SendRelease(requestStatus, pckgSendV3);
   958 	
  1811 	
   959     User::WaitForRequest(requestStatus);        
  1812     User::WaitForRequest(requestStatus); 
   960 	AssertMockLtsyStatusL();
  1813 	AssertMockLtsyStatusL();
   961 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());	
  1814 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());
   962 
  1815 
   963 	CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging
  1816 	CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging
   964 
       
   965 	}
  1817 	}
   966 
  1818 
   967 
  1819 
   968 /**
  1820 /**
   969 @SYMTestCaseID BA-CTSY-USSDM-URM-0001
  1821 @SYMTestCaseID BA-CTSY-USSDM-URM-0001
  1287     iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data);
  2139     iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data);
  1288     User::WaitForRequest(requestStatus1);
  2140     User::WaitForRequest(requestStatus1);
  1289 	ASSERT_EQUALS(KErrNone, requestStatus1.Int());
  2141 	ASSERT_EQUALS(KErrNone, requestStatus1.Int());
  1290 	ussd1.AcceptIncomingDialogue();
  2142 	ussd1.AcceptIncomingDialogue();
  1291 	User::After(1000000);	
  2143 	User::After(1000000);	
  1292 	ussd1.CancelAsyncRequest(EMobileUssdMessagingReceiveMessage);
  2144 	ussd1.CancelAsyncRequest(EMobileUssdMessagingReceiveMessage);	
  1293 
  2145 	ASSERT_EQUALS(KErrNone, requestStatus1.Int());
       
  2146 	
  1294 	CleanupStack::PopAndDestroy(4, this); //  this, data, ussd1, ussd2
  2147 	CleanupStack::PopAndDestroy(4, this); //  this, data, ussd1, ussd2
  1295 	}
  2148 	}
  1296 	
  2149 	
  1297 /**
  2150 /**
  1298 @SYMTestCaseID BA-CTSY-USSDM-URM-0002d
  2151 @SYMTestCaseID BA-CTSY-USSDM-URM-0002d
  1543 	ussd1.RejectIncomingDialogue();
  2396 	ussd1.RejectIncomingDialogue();
  1544 	User::WaitForRequest(requestStatus2);
  2397 	User::WaitForRequest(requestStatus2);
  1545 	ASSERT_EQUALS(KErrCancel, requestStatus2.Int());
  2398 	ASSERT_EQUALS(KErrCancel, requestStatus2.Int());
  1546 
  2399 
  1547 	// dialogue offered to third client
  2400 	// dialogue offered to third client
       
  2401 	ussd3.AcceptIncomingDialogue();
       
  2402 	User::WaitForRequest(requestStatus3);
  1548 	ASSERT_EQUALS(KErrNone, requestStatus3.Int());
  2403 	ASSERT_EQUALS(KErrNone, requestStatus3.Int());
  1549 
  2404 
  1550 	CleanupStack::PopAndDestroy(5, this); //  this, data, ussd1, ussd2, ussd3
  2405 	CleanupStack::PopAndDestroy(5, this); //  this, data, ussd1, ussd2, ussd3
  1551 	}
  2406 	}
  1552 
  2407 
  1613 
  2468 
  1614 
  2469 
  1615 	//-------------------------------------------------------------------------
  2470 	//-------------------------------------------------------------------------
  1616 	// TEST : Have two clients. 1) Request offered to 1st. 2) 1st client cancels.
  2471 	// TEST : Have two clients. 1) Request offered to 1st. 2) 1st client cancels.
  1617 	// 3) 2nd client should now be offered request.
  2472 	// 3) 2nd client should now be offered request.
  1618 	//-------------------------------------------------------------------------
  2473 	//-------------------------------------------------------------------------	
  1619 	ret1 = ussd1.Open(iPhone);
       
  1620 	ASSERT_EQUALS(KErrNone, ret1);
       
  1621 
       
  1622 	ussd1.ReceiveMessage(requestStatus1 ,name, msgAttributes);
  2474 	ussd1.ReceiveMessage(requestStatus1 ,name, msgAttributes);
  1623 	ussd2.ReceiveMessage(requestStatus2 ,name, msgAttributes);	
  2475 	ussd2.ReceiveMessage(requestStatus2 ,name, msgAttributes);	
  1624     iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data);
  2476     iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data);
  1625 
  2477 
  1626     User::WaitForAnyRequest();
  2478     User::WaitForAnyRequest();
  1627 	AssertMockLtsyStatusL();
  2479 	AssertMockLtsyStatusL();
  1628 
  2480 
  1629 	// Offered to first client
  2481 	// Offered to first client
  1630 	ASSERT_EQUALS(KErrNone, requestStatus1.Int());	
  2482 	ASSERT_EQUALS(KErrNone, requestStatus1.Int());	
  1631 	
  2483 	
  1632 	// Cancel first client
  2484 	// Cancel first client	
  1633 	ussd1.CancelAsyncRequest(EMobileUssdMessagingReceiveMessage);
  2485 	ussd2.CancelAsyncRequest(EMobileUssdMessagingReceiveMessage);
  1634 
  2486 	
       
  2487 	User::WaitForRequest(requestStatus2);
       
  2488 	ASSERT_EQUALS(KErrCancel, requestStatus2.Int());
       
  2489 		
  1635 	// dialogue offered to second client
  2490 	// dialogue offered to second client
  1636 	User::WaitForRequest(requestStatus2);
  2491 	ussd1.RejectIncomingDialogue();	
  1637 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
  2492 	ASSERT_EQUALS(KErrNone, requestStatus1.Int());
  1638 
  2493 	
  1639 
       
  1640 	CleanupStack::PopAndDestroy(4, this); //  this, data, ussd1, ussd2
  2494 	CleanupStack::PopAndDestroy(4, this); //  this, data, ussd1, ussd2
  1641 	}
  2495 	}
  1642 
  2496 
  1643 /**
  2497 /**
  1644 @SYMTestCaseID BA-CTSY-USSDM-URM-0002h
  2498 @SYMTestCaseID BA-CTSY-USSDM-URM-0002h
  1735     User::WaitForAnyRequest();
  2589     User::WaitForAnyRequest();
  1736     ASSERT_EQUALS(KErrNone, requestStatus2.Int());  
  2590     ASSERT_EQUALS(KErrNone, requestStatus2.Int());  
  1737  
  2591  
  1738 	CleanupStack::PopAndDestroy(5, this); //  this, data, ussd1, ussd2, ussd3
  2592 	CleanupStack::PopAndDestroy(5, this); //  this, data, ussd1, ussd2, ussd3
  1739 	}
  2593 	}
  1740 	
  2594 
       
  2595 /**
       
  2596 @SYMTestCaseID BA-CTSY-USSDM-URM-0002i
       
  2597 @SYMComponent  telephony_ctsy
       
  2598 @SYMTestCaseDesc Test support of RMobileUssdMessaging::ReceiveMessage for consecutive reception of two USSD dialogues/messages by two different clients. 
       
  2599 @SYMTestPriority High
       
  2600 @SYMTestActions Two clients present, second client calls Cancel.
       
  2601 @SYMTestExpectedResults Pass
       
  2602 @SYMTestType CT
       
  2603 */
       
  2604 void CCTsyUssdMessagingFU::TestReceiveMessage0002iL()
       
  2605 	{
       
  2606 	OpenEtelServerL(EUseExtendedError);
       
  2607 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  2608 	OpenPhoneL();
       
  2609 
       
  2610 	RBuf8 data;
       
  2611 	CleanupClosePushL(data);
       
  2612 
       
  2613 	RMobileUssdMessaging ussd1;
       
  2614 	RMobileUssdMessaging ussd2;
       
  2615 	TInt ret1 = ussd1.Open(iPhone);
       
  2616 	TInt ret2 = ussd2.Open(iPhone);
       
  2617 	ASSERT_EQUALS(KErrNone, ret1);
       
  2618 	ASSERT_EQUALS(KErrNone, ret2);
       
  2619 	CleanupClosePushL(ussd1);
       
  2620 	CleanupClosePushL(ussd2);
       
  2621 
       
  2622 	TRequestStatus requestStatus1;
       
  2623 	TRequestStatus requestStatus2;
       
  2624 
       
  2625  	//-------------------------------------------------------------------------
       
  2626 	TUint32 flags = 100;
       
  2627 	RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified;
       
  2628 	RMobileUssdMessaging::TMobileUssdMessageType type  = RMobileUssdMessaging::EUssdMTNotify;
       
  2629 	TUint8 dcs = 200;
       
  2630 
       
  2631 	// function parameters
       
  2632 
       
  2633 	RMobileUssdMessaging::TMobileUssdAttributesV1 attributes;
       
  2634 	TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes);
       
  2635 	
       
  2636 	RMobileUssdMessaging::TGsmUssdMessageData name;
       
  2637 
       
  2638  	//-------------------------------------------------------------------------
       
  2639 
       
  2640 	RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes;
       
  2641 
       
  2642 	completeAttributes.iFlags  = flags;
       
  2643 	completeAttributes.iFormat = format;
       
  2644 	completeAttributes.iType   = type;
       
  2645 	completeAttributes.iDcs    = dcs;
       
  2646 	
       
  2647 	TBuf8<KMaxName> completeName = _L8("Name1");
       
  2648 
       
  2649 	TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> 
       
  2650 		mockData2(completeName, completeAttributes);
       
  2651 
       
  2652 	mockData2.SerialiseL(data);	
       
  2653 
       
  2654 	//-------------------------------------------------------------------------
       
  2655 	// TEST: The first client accepts the first USSD notification.
       
  2656 	// The SECOND client accepts the second USSD notification.
       
  2657 	//-------------------------------------------------------------------------
       
  2658 	
       
  2659 	//first notification
       
  2660 	ussd1.ReceiveMessage(requestStatus1, name, msgAttributes);
       
  2661     iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data);
       
  2662 
       
  2663     User::WaitForRequest(requestStatus1);
       
  2664 	AssertMockLtsyStatusL();
       
  2665 
       
  2666 	ASSERT_EQUALS(KErrNone, requestStatus1.Int());	
       
  2667 	ussd1.AcceptIncomingDialogue();
       
  2668 	
       
  2669 	//second notification
       
  2670 	ussd2.ReceiveMessage(requestStatus2, name, msgAttributes);	
       
  2671     iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data);
       
  2672 
       
  2673     User::WaitForRequest(requestStatus2);
       
  2674 	AssertMockLtsyStatusL();
       
  2675 
       
  2676 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());
       
  2677 	ussd2.AcceptIncomingDialogue();
       
  2678 	
       
  2679 	CleanupStack::PopAndDestroy(4, this); //  this, data, ussd1, ussd2
       
  2680 	}
       
  2681 
       
  2682 
  1741 /**
  2683 /**
  1742 @SYMTestCaseID BA-CTSY-USSDM-URM-0003
  2684 @SYMTestCaseID BA-CTSY-USSDM-URM-0003
  1743 @SYMComponent  telephony_ctsy
  2685 @SYMComponent  telephony_ctsy
  1744 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::ReceiveMessage with bad parameter data
  2686 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::ReceiveMessage with bad parameter data
  1745 @SYMTestPriority High
  2687 @SYMTestPriority High
  1947 @SYMTestExpectedResults Pass
  2889 @SYMTestExpectedResults Pass
  1948 @SYMTestType CT
  2890 @SYMTestType CT
  1949 */
  2891 */
  1950 void CCTsyUssdMessagingFU::TestReceiveMessage0004cL()
  2892 void CCTsyUssdMessagingFU::TestReceiveMessage0004cL()
  1951 	{
  2893 	{
  1952 
       
  1953     OpenEtelServerL(EUseExtendedError);
  2894     OpenEtelServerL(EUseExtendedError);
  1954     CleanupStack::PushL(TCleanupItem(Cleanup,this));
  2895     CleanupStack::PushL(TCleanupItem(Cleanup,this));
  1955     OpenPhoneL();
  2896     OpenPhoneL();
  1956 	
  2897 	
  1957     RThread thread1;
  2898     RThread thread1;
  1993     MultipleClientRequestsL(thread1, thread2);
  2934     MultipleClientRequestsL(thread1, thread2);
  1994 
  2935 
  1995 	thread1.Close();
  2936 	thread1.Close();
  1996 	thread2.Close();
  2937 	thread2.Close();
  1997 	CleanupStack::PopAndDestroy(this); // this
  2938 	CleanupStack::PopAndDestroy(this); // this
       
  2939 	
  1998 	}
  2940 	}
  1999 
  2941 
  2000 /**
  2942 /**
  2001 @SYMTestCaseID BA-CTSY-USSDM-URM-0004d
  2943 @SYMTestCaseID BA-CTSY-USSDM-URM-0004d
  2002 @SYMComponent  telephony_ctsy
  2944 @SYMComponent  telephony_ctsy
  2006 @SYMTestExpectedResults Pass
  2948 @SYMTestExpectedResults Pass
  2007 @SYMTestType CT
  2949 @SYMTestType CT
  2008 */
  2950 */
  2009 void CCTsyUssdMessagingFU::TestReceiveMessage0004dL()
  2951 void CCTsyUssdMessagingFU::TestReceiveMessage0004dL()
  2010 	{
  2952 	{
  2011 
       
  2012     OpenEtelServerL(EUseExtendedError);
  2953     OpenEtelServerL(EUseExtendedError);
  2013     CleanupStack::PushL(TCleanupItem(Cleanup,this));
  2954     CleanupStack::PushL(TCleanupItem(Cleanup,this));
  2014     OpenPhoneL();
  2955     OpenPhoneL();
  2015 	
  2956 	
  2016     RThread thread1;
  2957     RThread thread1;
  2064 @SYMTestExpectedResults Pass
  3005 @SYMTestExpectedResults Pass
  2065 @SYMTestType CT
  3006 @SYMTestType CT
  2066 */
  3007 */
  2067 void CCTsyUssdMessagingFU::TestReceiveMessage0004eL()
  3008 void CCTsyUssdMessagingFU::TestReceiveMessage0004eL()
  2068 	{
  3009 	{
  2069 
       
  2070     OpenEtelServerL(EUseExtendedError);
  3010     OpenEtelServerL(EUseExtendedError);
  2071     CleanupStack::PushL(TCleanupItem(Cleanup,this));
  3011     CleanupStack::PushL(TCleanupItem(Cleanup,this));
  2072     OpenPhoneL();
  3012     OpenPhoneL();
  2073 	
  3013 	
  2074     RThread thread1;
  3014     RThread thread1;
  2121 @SYMTestExpectedResults Pass
  3061 @SYMTestExpectedResults Pass
  2122 @SYMTestType CT
  3062 @SYMTestType CT
  2123 */
  3063 */
  2124 void CCTsyUssdMessagingFU::TestReceiveMessage0004fL()
  3064 void CCTsyUssdMessagingFU::TestReceiveMessage0004fL()
  2125 	{
  3065 	{
  2126 
       
  2127     OpenEtelServerL(EUseExtendedError);
  3066     OpenEtelServerL(EUseExtendedError);
  2128     CleanupStack::PushL(TCleanupItem(Cleanup,this));
  3067     CleanupStack::PushL(TCleanupItem(Cleanup,this));
  2129     OpenPhoneL();
  3068     OpenPhoneL();
  2130 	
  3069 	
  2131     RThread thread1;
  3070     RThread thread1;
  2212 @SYMTestExpectedResults Pass
  3151 @SYMTestExpectedResults Pass
  2213 @SYMTestType CT
  3152 @SYMTestType CT
  2214 */
  3153 */
  2215 void CCTsyUssdMessagingFU::TestNotifyNetworkRelease0001L()
  3154 void CCTsyUssdMessagingFU::TestNotifyNetworkRelease0001L()
  2216 	{
  3155 	{
  2217 
  3156     OpenEtelServerL(EUseExtendedError);
  2218 	OpenEtelServerL(EUseExtendedError);
  3157     CleanupStack::PushL(TCleanupItem(Cleanup,this));
  2219 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
  3158     OpenPhoneL();
  2220 	OpenPhoneL();
  3159 
  2221 
  3160     RBuf8 data;
  2222 	TRequestStatus requestStatus;
  3161     CleanupClosePushL(data);
       
  3162 
       
  3163     RMobileUssdMessaging ussdMessaging;
       
  3164     TInt ret = ussdMessaging.Open(iPhone);
       
  3165     ASSERT_EQUALS(KErrNone, ret);
       
  3166     CleanupClosePushL(ussdMessaging);
       
  3167     
       
  3168     //-------------------------------------------------------------------------
       
  3169     // Setup: This block is taken from TestReceiveMessage0001L. All we want to
       
  3170     // do is to initiate a dialogue and then end it. Once the dialogue has ended
       
  3171     // then we can call Accept and Reject.
       
  3172     //------------------------------------------------------------------------- 
       
  3173     
       
  3174     TRequestStatus requestStatus;
       
  3175         
  2223     TRequestStatus mockLtsyStatus;
  3176     TRequestStatus mockLtsyStatus;
  2224 
  3177 
  2225 	RBuf8 data;
  3178     TUint32 flags = 100;
  2226 	CleanupClosePushL(data);
  3179     RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified;
  2227 
  3180     RMobileUssdMessaging::TMobileUssdMessageType type  = RMobileUssdMessaging::EUssdMORequest;
  2228 	RMobileUssdMessaging ussdMessaging;
  3181     TUint8 dcs = 200;
  2229 	TInt ret = ussdMessaging.Open(iPhone);
  3182 
  2230 	ASSERT_EQUALS(KErrNone, ret);
  3183     //-------------------------------------------------------------------------
  2231 	CleanupClosePushL(ussdMessaging);
  3184     // function parameters
  2232 
  3185 
       
  3186     RMobileUssdMessaging::TMobileUssdAttributesV1 attributes;
       
  3187     TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes);
       
  3188     
       
  3189     RMobileUssdMessaging::TGsmUssdMessageData name;
       
  3190 
       
  3191     //-------------------------------------------------------------------------
       
  3192 
       
  3193     RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes;
       
  3194 
       
  3195     completeAttributes.iFlags  = flags;
       
  3196     completeAttributes.iFormat = format;
       
  3197     completeAttributes.iType   = type;
       
  3198     completeAttributes.iDcs    = dcs;
       
  3199     
       
  3200     TBuf8<KMaxName> completeName = _L8("Name1");
       
  3201 
       
  3202     TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> 
       
  3203         mockData2(completeName, completeAttributes);
       
  3204     mockData2.SerialiseL(data);
       
  3205     
       
  3206     iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data);
       
  3207 
       
  3208     ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes);   
       
  3209     User::WaitForRequest(requestStatus);        
       
  3210     ret = requestStatus.Int();
       
  3211     ASSERT_EQUALS(KErrNone, ret);
       
  3212     ussdMessaging.AcceptIncomingDialogue();
       
  3213     
       
  3214     AssertMockLtsyStatusL();
       
  3215     ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  3216     
       
  3217     //-------------------------------------------------------------------------
       
  3218     // Terminate the dialogue
       
  3219     //------------------------------------------------------------------------- 
       
  3220     
  2233  	//-------------------------------------------------------------------------
  3221  	//-------------------------------------------------------------------------
  2234 	// function parameters
  3222 	// function parameters
  2235 	
  3223 	
  2236 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3;
  3224 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3;
  2237 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3);
  3225 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3);
  2258 	completeAttrV1.iFormat = RMobileUssdMessaging::EFormatPackedString;
  3246 	completeAttrV1.iFormat = RMobileUssdMessaging::EFormatPackedString;
  2259 	completeAttrV1.iType = RMobileUssdMessaging::EUssdMOAcknowledgement;
  3247 	completeAttrV1.iType = RMobileUssdMessaging::EUssdMOAcknowledgement;
  2260 	
  3248 	
  2261 	TMockLtsyData2< RMobilePhone::TMobilePhoneSendSSRequestV3, 
  3249 	TMockLtsyData2< RMobilePhone::TMobilePhoneSendSSRequestV3, 
  2262 					RMobileUssdMessaging::TMobileUssdAttributesV1 > 
  3250 					RMobileUssdMessaging::TMobileUssdAttributesV1 > 
  2263 					mockData2(completeSendV3,completeAttrV1);
  3251 					mockData2Release(completeSendV3,completeAttrV1);
  2264 	
  3252 	
  2265 	RBuf8 data2;
  3253 	RBuf8 data2;
  2266 	CleanupClosePushL(data2);
  3254 	CleanupClosePushL(data2);
  2267 	mockData2.SerialiseL(data2);
  3255 	mockData2Release.SerialiseL(data2);
  2268 	
  3256 		
  2269 	//-------------------------------------------------------------------------
  3257  	//-------------------------------------------------------------------------
  2270 	// TEST B: failure on completion of pending request from LTSY->CTSY
  3258 	// TEST C: Successful completion request of
  2271  	//-------------------------------------------------------------------------
  3259 	// RMobileUssdMessaging::NotifyNetworkRelease when result is not cached.
  2272 	iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrGeneral, data);
  3260  	//-------------------------------------------------------------------------
       
  3261 	iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNone, data);
  2273 	ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3);
  3262 	ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3);
  2274 
  3263 
  2275     User::WaitForRequest(requestStatus);        
  3264 	
       
  3265     User::WaitForRequest(requestStatus); 
  2276 	AssertMockLtsyStatusL();
  3266 	AssertMockLtsyStatusL();
  2277 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());	
  3267 	ASSERT_EQUALS(KErrNone, requestStatus.Int());
  2278 
  3268 	
  2279 	
  3269 	ASSERT_EQUALS(opCode, sendV3.iOpCode);	
  2280 	// other version of API (with optional TMobileUssdAttributesV1 parameter)
  3270 	ASSERT_EQUALS(0, sendV3.iAdditionalInfo.Compare(KAdditionalInfo1));	
  2281 	
  3271 
  2282 	iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNotReady, data2);
  3272 	//-------------------------------------------------------------------------
  2283 	ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3, pckgAttrV1);
       
  2284 
       
  2285     User::WaitForRequest(requestStatus);
       
  2286 	AssertMockLtsyStatusL();
       
  2287 	ASSERT_EQUALS(KErrNotReady, requestStatus.Int());	
       
  2288 
       
  2289  	//-------------------------------------------------------------------------
       
  2290 	// TEST E: Unsolicited completion of RMobileUssdMessaging::NotifyNetworkRelease
  3273 	// TEST E: Unsolicited completion of RMobileUssdMessaging::NotifyNetworkRelease
  2291 	// from LTSY.
  3274 	// from LTSY.
  2292  	//-------------------------------------------------------------------------
  3275  	//-------------------------------------------------------------------------
  2293 
  3276 	
  2294 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
  3277 	iMockLTSY.NotifyTerminated(mockLtsyStatus);
  2295 	iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNone, data);
  3278 	iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNone, data);
  2296 	
  3279 	
  2297 	// other version of API (with optional TMobileUssdAttributesV1 parameter)
  3280 	// other version of API (with optional TMobileUssdAttributesV1 parameter)
  2298 	
  3281 	
  2299 	iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNone, data2);
  3282 	iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNone, data2);
  2300 	User::WaitForRequest(mockLtsyStatus);
  3283 	User::WaitForRequest(mockLtsyStatus);
  2301 	AssertMockLtsyStatusL();
  3284 	AssertMockLtsyStatusL();
  2302 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
  3285 	ASSERT_EQUALS(KErrNone, mockLtsyStatus.Int());
  2303 
  3286 	
       
  3287 	CleanupStack::PopAndDestroy(4, this); // data2, ussdMessaging, data, this,
       
  3288 	
       
  3289 	}
       
  3290 
       
  3291 /**
       
  3292 @SYMTestCaseID BA-CTSY-USSDM-UNNR-0001a
       
  3293 @SYMComponent  telephony_ctsy
       
  3294 @SYMTestCaseDesc Test support in CTSY for failure on completion of pending comRMobileUssdMessaging::SendRelease request from LTSY->CTSY
       
  3295 @SYMTestPriority High
       
  3296 @SYMTestActions Invokes RMobileUssdMessaging::NotifyNetworkRelease
       
  3297 @SYMTestExpectedResults Pass
       
  3298 @SYMTestType CT
       
  3299 */
       
  3300 void CCTsyUssdMessagingFU::TestNotifyNetworkRelease0001eL()
       
  3301 	{
       
  3302     OpenEtelServerL(EUseExtendedError);
       
  3303     CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3304     OpenPhoneL();
       
  3305 
       
  3306     RBuf8 data;
       
  3307     CleanupClosePushL(data);
       
  3308 
       
  3309     RMobileUssdMessaging ussdMessaging;
       
  3310     TInt ret = ussdMessaging.Open(iPhone);
       
  3311     ASSERT_EQUALS(KErrNone, ret);
       
  3312     CleanupClosePushL(ussdMessaging);
       
  3313     
       
  3314     //-------------------------------------------------------------------------
       
  3315     // Setup: This block is taken from TestReceiveMessage0001L. All we want to
       
  3316     // do is to initiate a dialogue and then end it. Once the dialogue has ended
       
  3317     // then we can call Accept and Reject.
       
  3318     //------------------------------------------------------------------------- 
       
  3319     
       
  3320     TRequestStatus requestStatus;
       
  3321         
       
  3322     TRequestStatus mockLtsyStatus;
       
  3323 
       
  3324     TUint32 flags = 100;
       
  3325     RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified;
       
  3326     RMobileUssdMessaging::TMobileUssdMessageType type  = RMobileUssdMessaging::EUssdMORequest;
       
  3327     TUint8 dcs = 200;
       
  3328 
       
  3329     //-------------------------------------------------------------------------
       
  3330     // function parameters
       
  3331 
       
  3332     RMobileUssdMessaging::TMobileUssdAttributesV1 attributes;
       
  3333     TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes);
       
  3334     
       
  3335     RMobileUssdMessaging::TGsmUssdMessageData name;
       
  3336 
       
  3337     //-------------------------------------------------------------------------
       
  3338 
       
  3339     RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes;
       
  3340 
       
  3341     completeAttributes.iFlags  = flags;
       
  3342     completeAttributes.iFormat = format;
       
  3343     completeAttributes.iType   = type;
       
  3344     completeAttributes.iDcs    = dcs;
       
  3345     
       
  3346     TBuf8<KMaxName> completeName = _L8("Name1");
       
  3347 
       
  3348     TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> 
       
  3349         mockData2(completeName, completeAttributes);
       
  3350     mockData2.SerialiseL(data);
       
  3351     
       
  3352     iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data);
       
  3353 
       
  3354     ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes);   
       
  3355     User::WaitForRequest(requestStatus);        
       
  3356     ret = requestStatus.Int();
       
  3357     ASSERT_EQUALS(KErrNone, ret);
       
  3358     ussdMessaging.AcceptIncomingDialogue();
       
  3359     
       
  3360     AssertMockLtsyStatusL();
       
  3361     ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  3362     
       
  3363     //-------------------------------------------------------------------------
       
  3364     // Terminate the dialogue
       
  3365     //------------------------------------------------------------------------- 
       
  3366     
       
  3367  	//-------------------------------------------------------------------------
       
  3368 	// function parameters
       
  3369 	
       
  3370 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3;
       
  3371 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3);
       
  3372 	
       
  3373 	// optional parameter
       
  3374 	RMobileUssdMessaging::TMobileUssdAttributesV1 attrV1;
       
  3375 	RMobileUssdMessaging::TMobileUssdAttributesV1Pckg pckgAttrV1(attrV1);
       
  3376  	//-------------------------------------------------------------------------
       
  3377 
       
  3378 	RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3;
       
  3379 	
       
  3380 	TUint8 opCode = 100;
       
  3381 	_LIT(KAdditionalInfo1, "additionalInfo1");
       
  3382 	
       
  3383 	completeSendV3.iOpCode         = opCode;
       
  3384 	completeSendV3.iAdditionalInfo = KAdditionalInfo1;
       
  3385 
       
  3386 	TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3);
       
  3387 	mockData1.SerialiseL(data);
       
  3388 
       
  3389 	// optional parameter
       
  3390 	RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttrV1;
       
  3391 	completeAttrV1.iFlags = RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageType;
       
  3392 	completeAttrV1.iFormat = RMobileUssdMessaging::EFormatPackedString;
       
  3393 	completeAttrV1.iType = RMobileUssdMessaging::EUssdMOAcknowledgement;
       
  3394 	
       
  3395 	TMockLtsyData2< RMobilePhone::TMobilePhoneSendSSRequestV3, 
       
  3396 					RMobileUssdMessaging::TMobileUssdAttributesV1 > 
       
  3397 					mockData2Release(completeSendV3,completeAttrV1);
       
  3398 	
       
  3399 	RBuf8 data2;
       
  3400 	CleanupClosePushL(data2);
       
  3401 	mockData2Release.SerialiseL(data2);
       
  3402 	
       
  3403 	//-------------------------------------------------------------------------
       
  3404 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  3405  	//-------------------------------------------------------------------------
       
  3406 		
       
  3407 	iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrGeneral, data);
       
  3408 	ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3);
       
  3409 
       
  3410 	User::WaitForRequest(requestStatus);   
       
  3411 	AssertMockLtsyStatusL();
       
  3412 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());	
       
  3413 	
       
  3414 	CleanupStack::PopAndDestroy(4, this); // data2, ussdMessaging, data, this
       
  3415 	
       
  3416 	}
       
  3417 
       
  3418 /**
       
  3419 @SYMTestCaseID BA-CTSY-USSDM-UNNR-0001b
       
  3420 @SYMComponent  telephony_ctsy
       
  3421 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::NotifyNetworkRelease  with optional paramter
       
  3422 @SYMTestPriority High
       
  3423 @SYMTestActions Invokes RMobileUssdMessaging::NotifyNetworkRelease
       
  3424 @SYMTestExpectedResults Pass
       
  3425 @SYMTestType CT
       
  3426 */
       
  3427 void CCTsyUssdMessagingFU::TestNotifyNetworkRelease0001bL()
       
  3428 	{
       
  3429     OpenEtelServerL(EUseExtendedError);
       
  3430     CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3431     OpenPhoneL();
       
  3432 
       
  3433     RBuf8 data;
       
  3434     CleanupClosePushL(data);
       
  3435 
       
  3436     RMobileUssdMessaging ussdMessaging;
       
  3437     TInt ret = ussdMessaging.Open(iPhone);
       
  3438     ASSERT_EQUALS(KErrNone, ret);
       
  3439     CleanupClosePushL(ussdMessaging);
       
  3440     
       
  3441     //-------------------------------------------------------------------------
       
  3442     // Setup: This block is taken from TestReceiveMessage0001L. All we want to
       
  3443     // do is to initiate a dialogue and then end it. Once the dialogue has ended
       
  3444     // then we can call Accept and Reject.
       
  3445     //------------------------------------------------------------------------- 
       
  3446     
       
  3447     TRequestStatus requestStatus;
       
  3448         
       
  3449     TRequestStatus mockLtsyStatus;
       
  3450 
       
  3451     TUint32 flags = 100;
       
  3452     RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified;
       
  3453     RMobileUssdMessaging::TMobileUssdMessageType type  = RMobileUssdMessaging::EUssdMORequest;
       
  3454     TUint8 dcs = 200;
       
  3455 
       
  3456     //-------------------------------------------------------------------------
       
  3457     // function parameters
       
  3458 
       
  3459     RMobileUssdMessaging::TMobileUssdAttributesV1 attributes;
       
  3460     TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes);
       
  3461     
       
  3462     RMobileUssdMessaging::TGsmUssdMessageData name;
       
  3463 
       
  3464     //-------------------------------------------------------------------------
       
  3465 
       
  3466     RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes;
       
  3467 
       
  3468     completeAttributes.iFlags  = flags;
       
  3469     completeAttributes.iFormat = format;
       
  3470     completeAttributes.iType   = type;
       
  3471     completeAttributes.iDcs    = dcs;
       
  3472     
       
  3473     TBuf8<KMaxName> completeName = _L8("Name1");
       
  3474 
       
  3475     TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> 
       
  3476         mockData2(completeName, completeAttributes);
       
  3477     mockData2.SerialiseL(data);
       
  3478     
       
  3479     iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data);
       
  3480 
       
  3481     ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes);   
       
  3482     User::WaitForRequest(requestStatus);        
       
  3483     ret = requestStatus.Int();
       
  3484     ASSERT_EQUALS(KErrNone, ret);
       
  3485     ussdMessaging.AcceptIncomingDialogue();
       
  3486     
       
  3487     AssertMockLtsyStatusL();
       
  3488     ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  3489     
       
  3490     //-------------------------------------------------------------------------
       
  3491     // Terminate the dialogue
       
  3492     //------------------------------------------------------------------------- 
       
  3493     
       
  3494  	//-------------------------------------------------------------------------
       
  3495 	// function parameters
       
  3496 	
       
  3497 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3;
       
  3498 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3);
       
  3499 	
       
  3500 	// optional parameter
       
  3501 	RMobileUssdMessaging::TMobileUssdAttributesV1 attrV1;
       
  3502 	RMobileUssdMessaging::TMobileUssdAttributesV1Pckg pckgAttrV1(attrV1);
       
  3503  	//-------------------------------------------------------------------------
       
  3504 
       
  3505 	RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3;
       
  3506 	
       
  3507 	TUint8 opCode = 100;
       
  3508 	_LIT(KAdditionalInfo1, "additionalInfo1");
       
  3509 	
       
  3510 	completeSendV3.iOpCode         = opCode;
       
  3511 	completeSendV3.iAdditionalInfo = KAdditionalInfo1;
       
  3512 
       
  3513 	TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3);
       
  3514 	mockData1.SerialiseL(data);
       
  3515 
       
  3516 	// optional parameter
       
  3517 	RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttrV1;
       
  3518 	completeAttrV1.iFlags = RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageType;
       
  3519 	completeAttrV1.iFormat = RMobileUssdMessaging::EFormatPackedString;
       
  3520 	completeAttrV1.iType = RMobileUssdMessaging::EUssdMOAcknowledgement;
       
  3521 	
       
  3522 	TMockLtsyData2< RMobilePhone::TMobilePhoneSendSSRequestV3, 
       
  3523 					RMobileUssdMessaging::TMobileUssdAttributesV1 > 
       
  3524 					mockData2Release(completeSendV3,completeAttrV1);
       
  3525 	
       
  3526 	RBuf8 data2;
       
  3527 	CleanupClosePushL(data2);
       
  3528 	mockData2Release.SerialiseL(data2);
       
  3529 	
  2304  	//-------------------------------------------------------------------------
  3530  	//-------------------------------------------------------------------------
  2305 	// TEST C: Successful completion request of
  3531 	// TEST C: Successful completion request of
  2306 	// RMobileUssdMessaging::NotifyNetworkRelease when result is not cached.
  3532 	// RMobileUssdMessaging::NotifyNetworkRelease when result is not cached.
  2307  	//-------------------------------------------------------------------------
       
  2308 
       
  2309 	iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNone, data);
       
  2310 	ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3);
       
  2311 
       
  2312     User::WaitForRequest(requestStatus);        
       
  2313 	AssertMockLtsyStatusL();
       
  2314 	ASSERT_EQUALS(KErrNone, requestStatus.Int());	
       
  2315 	
       
  2316 	ASSERT_EQUALS(opCode, sendV3.iOpCode);	
       
  2317 	ASSERT_EQUALS(0, sendV3.iAdditionalInfo.Compare(KAdditionalInfo1));	
       
  2318 
       
  2319 	
       
  2320 	// other version of API (with optional TMobileUssdAttributesV1 parameter)
  3533 	// other version of API (with optional TMobileUssdAttributesV1 parameter)
  2321 	
  3534  	//-------------------------------------------------------------------------
  2322 	ussdMessaging.Close();
       
  2323 	ret = ussdMessaging.Open(iPhone);
       
  2324 	ASSERT_EQUALS(KErrNone, ret);
       
  2325 	
  3535 	
  2326 	iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNone, data2);
  3536 	iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNone, data2);
  2327 	ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3, pckgAttrV1);
  3537 	ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3, pckgAttrV1);
  2328 
  3538 
  2329     User::WaitForRequest(requestStatus);        
  3539     User::WaitForRequest(requestStatus);
  2330 	AssertMockLtsyStatusL();
  3540 	AssertMockLtsyStatusL();
  2331 	ASSERT_EQUALS(KErrNone, requestStatus.Int());	
  3541 	ASSERT_EQUALS(KErrNone, requestStatus.Int());	
  2332 	
  3542 	
  2333 	ASSERT_EQUALS(opCode, sendV3.iOpCode);	
  3543 	ASSERT_EQUALS(opCode, sendV3.iOpCode);	
  2334 	ASSERT_EQUALS(0, sendV3.iAdditionalInfo.Compare(KAdditionalInfo1));
  3544 	ASSERT_EQUALS(0, sendV3.iAdditionalInfo.Compare(KAdditionalInfo1));
  2335 	
  3545 	
  2336 	ASSERT_EQUALS(completeAttrV1.iFlags ,attrV1.iFlags);
  3546 	ASSERT_EQUALS(completeAttrV1.iFlags ,attrV1.iFlags);
  2337 	ASSERT_EQUALS(completeAttrV1.iFormat ,attrV1.iFormat);
  3547 	ASSERT_EQUALS(completeAttrV1.iFormat ,attrV1.iFormat);
  2338 	ASSERT_EQUALS(completeAttrV1.iType ,attrV1.iType);
  3548 	ASSERT_EQUALS(completeAttrV1.iType ,attrV1.iType);
  2339 
  3549 		
  2340 	CleanupStack::PopAndDestroy(4, this); // data2, ussdMessaging, data, this, 
  3550 	CleanupStack::PopAndDestroy(4, this); // data2, ussdMessaging, data, this,
  2341 	
  3551 	
  2342 	}
  3552 	}
  2343 
  3553 
       
  3554 /**
       
  3555 @SYMTestCaseID BA-CTSY-USSDM-UNNR-0001c
       
  3556 @SYMComponent  telephony_ctsy
       
  3557 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::NotifyNetworkRelease
       
  3558 @SYMTestPriority High
       
  3559 @SYMTestActions Invokes RMobileUssdMessaging::NotifyNetworkRelease
       
  3560 @SYMTestExpectedResults Pass
       
  3561 @SYMTestType CT
       
  3562 */
       
  3563 void CCTsyUssdMessagingFU::TestNotifyNetworkRelease0001cL()
       
  3564 	{
       
  3565     OpenEtelServerL(EUseExtendedError);
       
  3566     CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3567     OpenPhoneL();
       
  3568 
       
  3569     RBuf8 data;
       
  3570     CleanupClosePushL(data);
       
  3571 
       
  3572     RMobileUssdMessaging ussdMessaging;
       
  3573     TInt ret = ussdMessaging.Open(iPhone);
       
  3574     ASSERT_EQUALS(KErrNone, ret);
       
  3575     CleanupClosePushL(ussdMessaging);
       
  3576     
       
  3577     //-------------------------------------------------------------------------
       
  3578     // Setup: This block is taken from TestReceiveMessage0001L. All we want to
       
  3579     // do is to initiate a dialogue and then end it. Once the dialogue has ended
       
  3580     // then we can call Accept and Reject.
       
  3581     //------------------------------------------------------------------------- 
       
  3582     
       
  3583     TRequestStatus requestStatus;
       
  3584         
       
  3585     TRequestStatus mockLtsyStatus;
       
  3586 
       
  3587     TUint32 flags = 100;
       
  3588     RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified;
       
  3589     RMobileUssdMessaging::TMobileUssdMessageType type  = RMobileUssdMessaging::EUssdMORequest;
       
  3590     TUint8 dcs = 200;
       
  3591 
       
  3592     //-------------------------------------------------------------------------
       
  3593     // function parameters
       
  3594 
       
  3595     RMobileUssdMessaging::TMobileUssdAttributesV1 attributes;
       
  3596     TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes);
       
  3597     
       
  3598     RMobileUssdMessaging::TGsmUssdMessageData name;
       
  3599 
       
  3600     //-------------------------------------------------------------------------
       
  3601 
       
  3602     RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes;
       
  3603 
       
  3604     completeAttributes.iFlags  = flags;
       
  3605     completeAttributes.iFormat = format;
       
  3606     completeAttributes.iType   = type;
       
  3607     completeAttributes.iDcs    = dcs;
       
  3608     
       
  3609     TBuf8<KMaxName> completeName = _L8("Name1");
       
  3610 
       
  3611     TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> 
       
  3612         mockData2(completeName, completeAttributes);
       
  3613     mockData2.SerialiseL(data);
       
  3614     
       
  3615     iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data);
       
  3616 
       
  3617     ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes);   
       
  3618     User::WaitForRequest(requestStatus);        
       
  3619     ret = requestStatus.Int();
       
  3620     ASSERT_EQUALS(KErrNone, ret);
       
  3621     ussdMessaging.AcceptIncomingDialogue();
       
  3622     
       
  3623     AssertMockLtsyStatusL();
       
  3624     ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  3625     
       
  3626     //-------------------------------------------------------------------------
       
  3627     // Terminate the dialogue
       
  3628     //------------------------------------------------------------------------- 
       
  3629     
       
  3630  	//-------------------------------------------------------------------------
       
  3631 	// function parameters
       
  3632 	
       
  3633 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3;
       
  3634 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3);
       
  3635 	
       
  3636 	// optional parameter
       
  3637 	RMobileUssdMessaging::TMobileUssdAttributesV1 attrV1;
       
  3638 	RMobileUssdMessaging::TMobileUssdAttributesV1Pckg pckgAttrV1(attrV1);
       
  3639  	//-------------------------------------------------------------------------
       
  3640 
       
  3641 	RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3;
       
  3642 	
       
  3643 	TUint8 opCode = 100;
       
  3644 	_LIT(KAdditionalInfo1, "additionalInfo1");
       
  3645 	
       
  3646 	completeSendV3.iOpCode         = opCode;
       
  3647 	completeSendV3.iAdditionalInfo = KAdditionalInfo1;
       
  3648 
       
  3649 	TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3);
       
  3650 	mockData1.SerialiseL(data);
       
  3651 
       
  3652 	// optional parameter
       
  3653 	RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttrV1;
       
  3654 	completeAttrV1.iFlags = RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageType;
       
  3655 	completeAttrV1.iFormat = RMobileUssdMessaging::EFormatPackedString;
       
  3656 	completeAttrV1.iType = RMobileUssdMessaging::EUssdMOAcknowledgement;
       
  3657 	
       
  3658 	TMockLtsyData2< RMobilePhone::TMobilePhoneSendSSRequestV3, 
       
  3659 					RMobileUssdMessaging::TMobileUssdAttributesV1 > 
       
  3660 					mockData2Release(completeSendV3,completeAttrV1);
       
  3661 	
       
  3662 	RBuf8 data2;
       
  3663 	CleanupClosePushL(data2);
       
  3664 	mockData2Release.SerialiseL(data2);
       
  3665 	
       
  3666 	//-------------------------------------------------------------------------
       
  3667 	// TEST B: failure on completion of pending request from LTSY->CTSY
       
  3668  	//-------------------------------------------------------------------------
       
  3669 		
       
  3670 	// other version of API (with optional TMobileUssdAttributesV1 parameter)	
       
  3671 	iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNotReady, data2);
       
  3672 	ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3, pckgAttrV1);
       
  3673 
       
  3674     User::WaitForRequest(requestStatus);
       
  3675 	AssertMockLtsyStatusL();
       
  3676 	ASSERT_EQUALS(KErrNotReady, requestStatus.Int());
       
  3677 	
       
  3678 	CleanupStack::PopAndDestroy(4, this); // data2, ussdMessaging, data, this,
       
  3679 	
       
  3680 	}
       
  3681 
       
  3682 /**
       
  3683 @SYMTestCaseID BA-CTSY-USSDM-UNNR-0001d
       
  3684 @SYMComponent  telephony_ctsy
       
  3685 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::NotifyNetworkRelease before accepting a dialogue
       
  3686 @SYMTestPriority High
       
  3687 @SYMTestActions Invokes RMobileUssdMessaging::NotifyNetworkRelease
       
  3688 @SYMTestExpectedResults Pass
       
  3689 @SYMTestType CT
       
  3690 */
       
  3691 void CCTsyUssdMessagingFU::TestNotifyNetworkRelease0001dL()
       
  3692 	{
       
  3693     OpenEtelServerL(EUseExtendedError);
       
  3694     CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  3695     OpenPhoneL();
       
  3696 
       
  3697     RBuf8 data;
       
  3698     CleanupClosePushL(data);
       
  3699 
       
  3700     RMobileUssdMessaging ussdMessaging;
       
  3701     TInt ret = ussdMessaging.Open(iPhone);
       
  3702     ASSERT_EQUALS(KErrNone, ret);
       
  3703     CleanupClosePushL(ussdMessaging);
       
  3704     
       
  3705     //-------------------------------------------------------------------------
       
  3706     // Setup: This block is taken from TestReceiveMessage0001L. All we want to
       
  3707     // do is to initiate a dialogue and then end it. Once the dialogue has ended
       
  3708     // then we can call Accept and Reject.
       
  3709     //------------------------------------------------------------------------- 
       
  3710     
       
  3711     TRequestStatus requestStatus;
       
  3712         
       
  3713     TRequestStatus mockLtsyStatus;
       
  3714 
       
  3715     TUint32 flags = 100;
       
  3716     RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified;
       
  3717     RMobileUssdMessaging::TMobileUssdMessageType type  = RMobileUssdMessaging::EUssdMORequest;
       
  3718     TUint8 dcs = 200;
       
  3719 
       
  3720     //-------------------------------------------------------------------------
       
  3721     // function parameters
       
  3722 
       
  3723     RMobileUssdMessaging::TMobileUssdAttributesV1 attributes;
       
  3724     TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes);
       
  3725     
       
  3726     RMobileUssdMessaging::TGsmUssdMessageData name;
       
  3727 
       
  3728     //-------------------------------------------------------------------------
       
  3729 
       
  3730     RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes;
       
  3731 
       
  3732     completeAttributes.iFlags  = flags;
       
  3733     completeAttributes.iFormat = format;
       
  3734     completeAttributes.iType   = type;
       
  3735     completeAttributes.iDcs    = dcs;
       
  3736     
       
  3737     TBuf8<KMaxName> completeName = _L8("Name1");
       
  3738 
       
  3739     TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> 
       
  3740         mockData2(completeName, completeAttributes);
       
  3741     mockData2.SerialiseL(data);
       
  3742     
       
  3743     iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data);
       
  3744 
       
  3745     ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes);   
       
  3746     User::WaitForRequest(requestStatus);        
       
  3747     ret = requestStatus.Int();
       
  3748     ASSERT_EQUALS(KErrNone, ret);
       
  3749     
       
  3750     AssertMockLtsyStatusL();
       
  3751     ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  3752     
       
  3753     //-------------------------------------------------------------------------
       
  3754     // Terminate the dialogue
       
  3755     //------------------------------------------------------------------------- 
       
  3756     
       
  3757  	//-------------------------------------------------------------------------
       
  3758 	// function parameters
       
  3759 	
       
  3760 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3;
       
  3761 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3);
       
  3762 	
       
  3763 	// optional parameter
       
  3764 	RMobileUssdMessaging::TMobileUssdAttributesV1 attrV1;
       
  3765 	RMobileUssdMessaging::TMobileUssdAttributesV1Pckg pckgAttrV1(attrV1);
       
  3766  	//-------------------------------------------------------------------------
       
  3767 
       
  3768 	RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV3;
       
  3769 	
       
  3770 	TUint8 opCode = 100;
       
  3771 	_LIT(KAdditionalInfo1, "additionalInfo1");
       
  3772 	
       
  3773 	completeSendV3.iOpCode         = opCode;
       
  3774 	completeSendV3.iAdditionalInfo = KAdditionalInfo1;
       
  3775 
       
  3776 	TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData1(completeSendV3);
       
  3777 	mockData1.SerialiseL(data);
       
  3778 
       
  3779 	// optional parameter
       
  3780 	RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttrV1;
       
  3781 	completeAttrV1.iFlags = RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageType;
       
  3782 	completeAttrV1.iFormat = RMobileUssdMessaging::EFormatPackedString;
       
  3783 	completeAttrV1.iType = RMobileUssdMessaging::EUssdMOAcknowledgement;
       
  3784 	
       
  3785 	TMockLtsyData2< RMobilePhone::TMobilePhoneSendSSRequestV3, 
       
  3786 					RMobileUssdMessaging::TMobileUssdAttributesV1 > 
       
  3787 					mockData2Release(completeSendV3,completeAttrV1);
       
  3788 	
       
  3789 	RBuf8 data2;
       
  3790 	CleanupClosePushL(data2);
       
  3791 	mockData2Release.SerialiseL(data2);
       
  3792 	
       
  3793 	//Testing NotifyNetworkRelease() before accepting the dialogue, 
       
  3794 	//so that the requests are not always very sequential
       
  3795 	ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3, pckgAttrV1);
       
  3796 	ussdMessaging.AcceptIncomingDialogue();
       
  3797 
       
  3798     User::WaitForRequest(requestStatus);
       
  3799 	AssertMockLtsyStatusL();
       
  3800 	ASSERT_EQUALS(KErrDisconnected, requestStatus.Int());
       
  3801 	
       
  3802 	CleanupStack::PopAndDestroy(4, this); // data2, ussdMessaging, data, this
       
  3803 	
       
  3804 	}
  2344 
  3805 
  2345 /**
  3806 /**
  2346 @SYMTestCaseID BA-CTSY-USSDM-UNNR-0002
  3807 @SYMTestCaseID BA-CTSY-USSDM-UNNR-0002
  2347 @SYMComponent  telephony_ctsy
  3808 @SYMComponent  telephony_ctsy
  2348 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobileUssdMessaging::NotifyNetworkRelease
  3809 @SYMTestCaseDesc Test support in CTSY for cancelling of RMobileUssdMessaging::NotifyNetworkRelease
  2351 @SYMTestExpectedResults Pass
  3812 @SYMTestExpectedResults Pass
  2352 @SYMTestType CT
  3813 @SYMTestType CT
  2353 */
  3814 */
  2354 void CCTsyUssdMessagingFU::TestNotifyNetworkRelease0002L()
  3815 void CCTsyUssdMessagingFU::TestNotifyNetworkRelease0002L()
  2355 	{
  3816 	{
  2356 	OpenEtelServerL(EUseExtendedError);
  3817     OpenEtelServerL(EUseExtendedError);
  2357 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
  3818     CleanupStack::PushL(TCleanupItem(Cleanup,this));
  2358 	OpenPhoneL();
  3819     OpenPhoneL();
  2359 
  3820 
  2360 	TRequestStatus requestStatus;
  3821     RBuf8 data;
  2361 
  3822     CleanupClosePushL(data);
  2362 	RMobileUssdMessaging ussdMessaging;
  3823 
  2363 	TInt ret = ussdMessaging.Open(iPhone);
  3824     RMobileUssdMessaging ussdMessaging;
  2364 	ASSERT_EQUALS(KErrNone, ret);
  3825     TInt ret = ussdMessaging.Open(iPhone);
  2365 	CleanupClosePushL(ussdMessaging);
  3826     ASSERT_EQUALS(KErrNone, ret);
       
  3827     CleanupClosePushL(ussdMessaging);
       
  3828     
       
  3829     //-------------------------------------------------------------------------
       
  3830     // Setup: This block is taken from TestReceiveMessage0001L. All we want to
       
  3831     // do is to initiate a dialogue and then end it. Once the dialogue has ended
       
  3832     // then we can call Accept and Reject.
       
  3833     //------------------------------------------------------------------------- 
       
  3834     
       
  3835     TRequestStatus requestStatus;
       
  3836         
       
  3837     TRequestStatus mockLtsyStatus;
       
  3838 
       
  3839     TUint32 flags = 100;
       
  3840     RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified;
       
  3841     RMobileUssdMessaging::TMobileUssdMessageType type  = RMobileUssdMessaging::EUssdMORequest;
       
  3842     TUint8 dcs = 200;
       
  3843 
       
  3844     //-------------------------------------------------------------------------
       
  3845     // function parameters
       
  3846 
       
  3847     RMobileUssdMessaging::TMobileUssdAttributesV1 attributes;
       
  3848     TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes);
       
  3849     
       
  3850     RMobileUssdMessaging::TGsmUssdMessageData name;
       
  3851 
       
  3852     //-------------------------------------------------------------------------
       
  3853 
       
  3854     RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes;
       
  3855 
       
  3856     completeAttributes.iFlags  = flags;
       
  3857     completeAttributes.iFormat = format;
       
  3858     completeAttributes.iType   = type;
       
  3859     completeAttributes.iDcs    = dcs;
       
  3860     
       
  3861     TBuf8<KMaxName> completeName = _L8("Name1");
       
  3862 
       
  3863     TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> 
       
  3864         mockData2(completeName, completeAttributes);
       
  3865     mockData2.SerialiseL(data);
       
  3866     
       
  3867     iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data);
       
  3868 
       
  3869     ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes);   
       
  3870     User::WaitForRequest(requestStatus);        
       
  3871     ret = requestStatus.Int();
       
  3872     ASSERT_EQUALS(KErrNone, ret);
       
  3873     ussdMessaging.AcceptIncomingDialogue();
       
  3874     
       
  3875     AssertMockLtsyStatusL();
       
  3876     ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  3877     
       
  3878     //-------------------------------------------------------------------------
       
  3879     // Terminate the dialogue
       
  3880     //------------------------------------------------------------------------- 
  2366 
  3881 
  2367 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3;
  3882 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV3;
  2368 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3);
  3883 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV3(sendV3);
  2369 
  3884 	
  2370  	//-------------------------------------------------------------------------
  3885  	//-------------------------------------------------------------------------
  2371 	// Test cancelling of RMobileUssdMessaging::NotifyNetworkRelease
  3886 	// Test cancelling of RMobileUssdMessaging::NotifyNetworkRelease
  2372  	//-------------------------------------------------------------------------
  3887  	//-------------------------------------------------------------------------
  2373  	
  3888 	
  2374 	ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3);
  3889 	ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3);
  2375 	ussdMessaging.CancelAsyncRequest(EMobileUssdMessagingNotifyNetworkRelease);
  3890 	ussdMessaging.CancelAsyncRequest(EMobileUssdMessagingNotifyNetworkRelease);
  2376 
  3891 
  2377 	User::WaitForRequest(requestStatus);
  3892 	User::WaitForRequest(requestStatus);
  2378 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
  3893 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
  2379 
  3894 
  2380 	AssertMockLtsyStatusL();
  3895 	AssertMockLtsyStatusL();
  2381 	
  3896 	
  2382 	// again with the optional parameter
  3897 	// again with the optional parameter
       
  3898 	
  2383 	RMobileUssdMessaging::TMobileUssdAttributesV1 attrV1;
  3899 	RMobileUssdMessaging::TMobileUssdAttributesV1 attrV1;
  2384 	RMobileUssdMessaging::TMobileUssdAttributesV1Pckg pckgAttrV1(attrV1);
  3900 	RMobileUssdMessaging::TMobileUssdAttributesV1Pckg pckgAttrV1(attrV1);
  2385 	
  3901 	
  2386 	ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3, pckgAttrV1);
  3902 	ussdMessaging.NotifyNetworkRelease(requestStatus, pckgSendV3, pckgAttrV1);
  2387 	ussdMessaging.CancelAsyncRequest(EMobileUssdMessagingNotifyNetworkRelease);
  3903 	ussdMessaging.CancelAsyncRequest(EMobileUssdMessagingNotifyNetworkRelease);
  2388 
  3904 	
  2389 	User::WaitForRequest(requestStatus);
  3905 	User::WaitForRequest(requestStatus);
  2390 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
  3906 	ASSERT_EQUALS(KErrCancel, requestStatus.Int());
  2391 
  3907 
  2392 	AssertMockLtsyStatusL();	
  3908 	AssertMockLtsyStatusL();
  2393 	CleanupStack::PopAndDestroy(2); // this, ussdMessaging
  3909 	
  2394 	
  3910 	CleanupStack::PopAndDestroy(3); // this, ussdMessaging, data
  2395 	}
  3911 	}
  2396 
  3912 
  2397 /**
  3913 /**
  2398 @SYMTestCaseID BA-CTSY-USSDM-UNNR-0003
  3914 @SYMTestCaseID BA-CTSY-USSDM-UNNR-0003
  2399 @SYMComponent  telephony_ctsy
  3915 @SYMComponent  telephony_ctsy
  2403 @SYMTestExpectedResults Pass
  3919 @SYMTestExpectedResults Pass
  2404 @SYMTestType CT
  3920 @SYMTestType CT
  2405 */
  3921 */
  2406 void CCTsyUssdMessagingFU::TestNotifyNetworkRelease0003L()
  3922 void CCTsyUssdMessagingFU::TestNotifyNetworkRelease0003L()
  2407 	{
  3923 	{
  2408 	OpenEtelServerL(EUseExtendedError);
  3924     OpenEtelServerL(EUseExtendedError);
  2409 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
  3925     CleanupStack::PushL(TCleanupItem(Cleanup,this));
  2410 	OpenPhoneL();
  3926     OpenPhoneL();
  2411 
  3927 
  2412 	RBuf8 data;
  3928     RBuf8 data;
  2413 	CleanupClosePushL(data);
  3929     CleanupClosePushL(data);
  2414 
  3930 
  2415 	TRequestStatus requestStatus;
  3931     RMobileUssdMessaging ussdMessaging;
  2416 
  3932     TInt ret = ussdMessaging.Open(iPhone);
  2417 	RMobileUssdMessaging ussdMessaging;
  3933     ASSERT_EQUALS(KErrNone, ret);
  2418 	TInt ret = ussdMessaging.Open(iPhone);
  3934     CleanupClosePushL(ussdMessaging);
  2419 	ASSERT_EQUALS(KErrNone, ret);
  3935     
  2420 	CleanupClosePushL(ussdMessaging);
  3936     //-------------------------------------------------------------------------
       
  3937     // Setup: This block is taken from TestReceiveMessage0001L. All we want to
       
  3938     // do is to initiate a dialogue and then end it. Once the dialogue has ended
       
  3939     // then we can call Accept and Reject.
       
  3940     //------------------------------------------------------------------------- 
       
  3941     
       
  3942     TRequestStatus requestStatus;
       
  3943         
       
  3944     TRequestStatus mockLtsyStatus;
       
  3945 
       
  3946     TUint32 flags = 100;
       
  3947     RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified;
       
  3948     RMobileUssdMessaging::TMobileUssdMessageType type  = RMobileUssdMessaging::EUssdMORequest;
       
  3949     TUint8 dcs = 200;
       
  3950 
       
  3951     //-------------------------------------------------------------------------
       
  3952     // function parameters
       
  3953 
       
  3954     RMobileUssdMessaging::TMobileUssdAttributesV1 attributes;
       
  3955     TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes);
       
  3956     
       
  3957     RMobileUssdMessaging::TGsmUssdMessageData name;
       
  3958 
       
  3959     //-------------------------------------------------------------------------
       
  3960 
       
  3961     RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes;
       
  3962 
       
  3963     completeAttributes.iFlags  = flags;
       
  3964     completeAttributes.iFormat = format;
       
  3965     completeAttributes.iType   = type;
       
  3966     completeAttributes.iDcs    = dcs;
       
  3967     
       
  3968     TBuf8<KMaxName> completeName = _L8("Name1");
       
  3969 
       
  3970     TMockLtsyData2<TBuf8<KMaxName>, RMobileUssdMessaging::TMobileUssdAttributesV1> 
       
  3971         mockData2(completeName, completeAttributes);
       
  3972     mockData2.SerialiseL(data);
       
  3973     
       
  3974     iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data);
       
  3975 
       
  3976     ussdMessaging.ReceiveMessage(requestStatus, name, msgAttributes);   
       
  3977     User::WaitForRequest(requestStatus);        
       
  3978     ret = requestStatus.Int();
       
  3979     ASSERT_EQUALS(KErrNone, ret);
       
  3980     ussdMessaging.AcceptIncomingDialogue();
       
  3981     
       
  3982     AssertMockLtsyStatusL();
       
  3983     ASSERT_EQUALS(KErrNone, requestStatus.Int());
       
  3984     
       
  3985     //-------------------------------------------------------------------------
       
  3986     // Terminate the dialogue
       
  3987     //------------------------------------------------------------------------- 
  2421 
  3988 
  2422 	//-------------------------------------------------------------------------
  3989 	//-------------------------------------------------------------------------
  2423 	// Test B: Test passing wrong descriptor size to parameter in
  3990 	// Test B: Test passing wrong descriptor size to parameter in
  2424 	// RMobileUssdMessaging::NotifyNetworkRelease
  3991 	// RMobileUssdMessaging::NotifyNetworkRelease
  2425  	//-------------------------------------------------------------------------
  3992  	//-------------------------------------------------------------------------
  2440 	User::WaitForRequest(requestStatus);
  4007 	User::WaitForRequest(requestStatus);
  2441 	AssertMockLtsyStatusL();
  4008 	AssertMockLtsyStatusL();
  2442 	ASSERT_EQUALS(KErrArgument, requestStatus.Int());
  4009 	ASSERT_EQUALS(KErrArgument, requestStatus.Int());
  2443 	
  4010 	
  2444 	CleanupStack::PopAndDestroy(3); // this, ussdMessaging, data
  4011 	CleanupStack::PopAndDestroy(3); // this, ussdMessaging, data
       
  4012 	
  2445 	}
  4013 	}
  2446 
  4014 
  2447 /**
  4015 /**
  2448 @SYMTestCaseID BA-CTSY-USSDM-UNNR-0004
  4016 @SYMTestCaseID BA-CTSY-USSDM-UNNR-0004
  2449 @SYMComponent  telephony_ctsy
  4017 @SYMComponent  telephony_ctsy
  2515     ussdMessaging1.SendMessage(requestStatus1, msgData, msgAttributes);
  4083     ussdMessaging1.SendMessage(requestStatus1, msgData, msgAttributes);
  2516     
  4084     
  2517     User::WaitForRequest(requestStatus1);        
  4085     User::WaitForRequest(requestStatus1);        
  2518     AssertMockLtsyStatusL();
  4086     AssertMockLtsyStatusL();
  2519     ASSERT_EQUALS(KErrNone, requestStatus1.Int());
  4087     ASSERT_EQUALS(KErrNone, requestStatus1.Int());
  2520 	
  4088     	
  2521  	//-------------------------------------------------------------------------
  4089  	//-------------------------------------------------------------------------
  2522 	// parameters for first function
  4090 	// parameters for first function
  2523 	
  4091 	
  2524 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV31;
  4092 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV31;
  2525 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV31(sendV31);
  4093 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV31(sendV31);
  2543 	
  4111 	
  2544 	TMockLtsyData2< RMobilePhone::TMobilePhoneSendSSRequestV3, 
  4112 	TMockLtsyData2< RMobilePhone::TMobilePhoneSendSSRequestV3, 
  2545 					RMobileUssdMessaging::TMobileUssdAttributesV1 > 
  4113 					RMobileUssdMessaging::TMobileUssdAttributesV1 > 
  2546 					mockData2(completeSendV31,completeAttrV1);
  4114 					mockData2(completeSendV31,completeAttrV1);
  2547 	
  4115 	
       
  4116 	
  2548 	RBuf8 data2;
  4117 	RBuf8 data2;
  2549 	CleanupClosePushL(data2);
  4118 	CleanupClosePushL(data2);
  2550 	mockData2.SerialiseL(data2);
  4119 	mockData2.SerialiseL(data2);
  2551 		
  4120 		
  2552 	//-------------------------------------------------------------------------
  4121 	//-------------------------------------------------------------------------
  2557 
  4126 
  2558 	//-------------------------------------------------------------------------
  4127 	//-------------------------------------------------------------------------
  2559 	// Test A: Test multiple clients requesting RMobileUssdMessaging::NotifyNetworkRelease
  4128 	// Test A: Test multiple clients requesting RMobileUssdMessaging::NotifyNetworkRelease
  2560  	//-------------------------------------------------------------------------
  4129  	//-------------------------------------------------------------------------
  2561 
  4130 
  2562 	mockData11.SerialiseL(data);
  4131 	mockData11.SerialiseL(data2);
  2563 	iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNone, data, 10);
  4132 	iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNone, data2, 10);
  2564 	ussdMessaging1.NotifyNetworkRelease(requestStatus1, pckgSendV31);
  4133 	ussdMessaging1.NotifyNetworkRelease(requestStatus1, pckgSendV31);
  2565 
  4134 
  2566 	ussdMessaging2.NotifyNetworkRelease(requestStatus2, pckgSendV32);
  4135 	ussdMessaging2.NotifyNetworkRelease(requestStatus2, pckgSendV32);
  2567 
  4136 
  2568     User::WaitForRequest(requestStatus1);        
  4137     User::WaitForRequest(requestStatus1);        
  2574 	ASSERT_EQUALS(opCode1, sendV31.iOpCode);	
  4143 	ASSERT_EQUALS(opCode1, sendV31.iOpCode);	
  2575 	ASSERT_EQUALS(0, sendV31.iAdditionalInfo.Compare(KAdditionalInfo1));	
  4144 	ASSERT_EQUALS(0, sendV31.iAdditionalInfo.Compare(KAdditionalInfo1));	
  2576 
  4145 
  2577 	ASSERT_EQUALS(opCode1, sendV32.iOpCode);	
  4146 	ASSERT_EQUALS(opCode1, sendV32.iOpCode);	
  2578 	ASSERT_EQUALS(0, sendV32.iAdditionalInfo.Compare(KAdditionalInfo1));	
  4147 	ASSERT_EQUALS(0, sendV32.iAdditionalInfo.Compare(KAdditionalInfo1));	
  2579 
       
  2580 
       
  2581 	
  4148 	
  2582 	AssertMockLtsyStatusL();
  4149 	AssertMockLtsyStatusL();
  2583 	
  4150 
  2584 	//
  4151 	CleanupStack::PopAndDestroy(7, this); // phone2, telServer2, data, this
  2585 	// repeat tests with optional second parameter
  4152 	                                      // ussdMessaging1, ussdMessaging2, data2 (inv. order)
  2586 	// 
  4153 	}
       
  4154 
       
  4155 ////
       
  4156 /**
       
  4157 @SYMTestCaseID BA-CTSY-USSDM-UNNR-0004b
       
  4158 @SYMComponent  telephony_ctsy
       
  4159 @SYMTestCaseDesc Test support in CTSY for multiple client requests to RMobileUssdMessaging::NotifyNetworkRelease
       
  4160 @SYMTestPriority High
       
  4161 @SYMTestActions Invokes multiple client requests to RMobileUssdMessaging::NotifyNetworkRelease
       
  4162 @SYMTestExpectedResults Pass
       
  4163 @SYMTestType CT
       
  4164 */
       
  4165 void CCTsyUssdMessagingFU::TestNotifyNetworkRelease0004bL()
       
  4166 	{
       
  4167 	OpenEtelServerL(EUseExtendedError);
       
  4168 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
  4169 	OpenPhoneL();
       
  4170 
       
  4171 	TRequestStatus requestStatus1;
       
  4172 	TRequestStatus requestStatus2;
       
  4173 
       
  4174 	RBuf8 data;
       
  4175 	CleanupClosePushL(data);
       
  4176 
       
  4177 	// Open second client
       
  4178 	RTelServer telServer2;
       
  4179 	TInt ret = telServer2.Connect();
       
  4180 	ASSERT_EQUALS(KErrNone, ret);
       
  4181 	CleanupClosePushL(telServer2);
       
  4182 
       
  4183 	RMobilePhone phone2;
       
  4184 	ret = phone2.Open(telServer2,KMmTsyPhoneName);
       
  4185 	ASSERT_EQUALS(KErrNone, ret);
       
  4186 	CleanupClosePushL(phone2);
       
  4187 
       
  4188 	RMobileUssdMessaging ussdMessaging1;
       
  4189 	ret = ussdMessaging1.Open(iPhone);
       
  4190 	ASSERT_EQUALS(KErrNone, ret);
       
  4191 	CleanupClosePushL(ussdMessaging1);
       
  4192 
       
  4193 	RMobileUssdMessaging ussdMessaging2;
       
  4194 	ret = ussdMessaging2.Open(iPhone);
       
  4195 	ASSERT_EQUALS(KErrNone, ret);
       
  4196 	CleanupClosePushL(ussdMessaging2);
       
  4197 
       
  4198 	//-------------------------------------------------------------------------
       
  4199 	// The first client needs to send a message. This will cause a session to be opened
       
  4200 	// which will be owned by the first client.
       
  4201 	TUint32 flags = 100;
       
  4202     RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified;
       
  4203     RMobileUssdMessaging::TMobileUssdMessageType type  = RMobileUssdMessaging::EUssdMORequest;
       
  4204     TUint8 dcs = 200;
       
  4205 
       
  4206     RMobileUssdMessaging::TMobileUssdAttributesV1 attributes;
       
  4207     TPckg<RMobileUssdMessaging::TMobileUssdAttributesV1> msgAttributes(attributes);
       
  4208     
       
  4209     attributes.iFlags  = flags;
       
  4210     attributes.iFormat = format;
       
  4211     attributes.iType   = type;
       
  4212     attributes.iDcs   = dcs;
       
  4213     
       
  4214     TName name = _L("Name1");
       
  4215     TPckg<TName> msgData(name);
       
  4216 
       
  4217     TMockLtsyData2<TName, RMobileUssdMessaging::TMobileUssdAttributesV1> 
       
  4218         mockSendData2(name, attributes);
       
  4219     mockSendData2.SerialiseL(data);
       
  4220 
       
  4221     iMockLTSY.ExpectL(EMobileUssdMessagingSendMessage, data);
       
  4222     iMockLTSY.CompleteL(EMobileUssdMessagingSendMessage, KErrNone);
       
  4223 
       
  4224     ussdMessaging1.SendMessage(requestStatus1, msgData, msgAttributes);
       
  4225     
       
  4226     User::WaitForRequest(requestStatus1);        
       
  4227     AssertMockLtsyStatusL();
       
  4228     ASSERT_EQUALS(KErrNone, requestStatus1.Int());
       
  4229     	
       
  4230  	//-------------------------------------------------------------------------
       
  4231 	// parameters for first function
       
  4232 	
       
  4233 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV31;
       
  4234 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV31(sendV31);
       
  4235 
       
  4236  	//-------------------------------------------------------------------------
       
  4237 
       
  4238 	RMobilePhone::TMobilePhoneSendSSRequestV3 completeSendV31;
       
  4239 
       
  4240 	TUint8 opCode1 = 100;
       
  4241 	_LIT(KAdditionalInfo1, "additionalInfo1");
       
  4242 	
       
  4243 	completeSendV31.iOpCode         = opCode1;
       
  4244 	completeSendV31.iAdditionalInfo = KAdditionalInfo1;
       
  4245 
       
  4246 	TMockLtsyData1< RMobilePhone::TMobilePhoneSendSSRequestV3 > mockData11(completeSendV31);
       
  4247 
       
  4248 	RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttrV1;
       
  4249 	completeAttrV1.iFlags = RMobileUssdMessaging::KUssdDataFormat | RMobileUssdMessaging::KUssdMessageType;
       
  4250 	completeAttrV1.iFormat = RMobileUssdMessaging::EFormatPackedString;
       
  4251 	completeAttrV1.iType = RMobileUssdMessaging::EUssdMTRequest;
       
  4252 	
       
  4253 	TMockLtsyData2< RMobilePhone::TMobilePhoneSendSSRequestV3, 
       
  4254 					RMobileUssdMessaging::TMobileUssdAttributesV1 > 
       
  4255 					mockData2(completeSendV31,completeAttrV1);
       
  4256 	
       
  4257 	
       
  4258 	RBuf8 data2;
       
  4259 	CleanupClosePushL(data2);
       
  4260 	mockData2.SerialiseL(data2);
       
  4261 		
       
  4262 	//-------------------------------------------------------------------------
       
  4263 	// parameters for second function
       
  4264 	
       
  4265 	RMobilePhone::TMobilePhoneSendSSRequestV3 sendV32;
       
  4266 	TPckg<RMobilePhone::TMobilePhoneSendSSRequestV3> pckgSendV32(sendV32);
       
  4267 
       
  4268 	//-------------------------------------------------------------------------
       
  4269 	// Test B: Test multiple clients requesting RMobileUssdMessaging::NotifyNetworkRelease
       
  4270 	// with optional second parameter
       
  4271  	//-------------------------------------------------------------------------
       
  4272 	 
  2587 	ussdMessaging1.Close();
  4273 	ussdMessaging1.Close();
  2588 	ret = ussdMessaging1.Open(iPhone);
  4274 	ret = ussdMessaging1.Open(iPhone);
  2589 	ASSERT_EQUALS(KErrNone, ret);
  4275 	ASSERT_EQUALS(KErrNone, ret);
  2590 	ussdMessaging2.Close();
  4276 	ussdMessaging2.Close();
  2591 	ret = ussdMessaging2.Open(iPhone);
  4277 	ret = ussdMessaging2.Open(iPhone);
  2599 
  4285 
  2600 	iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNone, data2, 5);
  4286 	iMockLTSY.CompleteL(EMobileUssdMessagingNotifyNetworkRelease, KErrNone, data2, 5);
  2601 	ussdMessaging1.NotifyNetworkRelease(requestStatus1, pckgSendV31, pckgAttrV1);
  4287 	ussdMessaging1.NotifyNetworkRelease(requestStatus1, pckgSendV31, pckgAttrV1);
  2602 	ussdMessaging2.NotifyNetworkRelease(requestStatus2, pckgSendV32, pckgAttrV12);	
  4288 	ussdMessaging2.NotifyNetworkRelease(requestStatus2, pckgSendV32, pckgAttrV12);	
  2603 	
  4289 	
  2604     User::WaitForRequest(requestStatus1);        
  4290     User::WaitForRequest(requestStatus1);  
  2605 	ASSERT_EQUALS(KErrNone, requestStatus1.Int());	
  4291 	ASSERT_EQUALS(KErrNone, requestStatus1.Int());	
  2606 
  4292 
  2607     User::WaitForRequest(requestStatus2);        
  4293     User::WaitForRequest(requestStatus2);  
  2608 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());	
  4294 	ASSERT_EQUALS(KErrNone, requestStatus2.Int());	
  2609 
  4295 	
  2610 	ASSERT_EQUALS(opCode1, sendV31.iOpCode);	
  4296 	ASSERT_EQUALS(opCode1, sendV31.iOpCode);	
  2611 	ASSERT_EQUALS(0, sendV31.iAdditionalInfo.Compare(KAdditionalInfo1));	
  4297 	ASSERT_EQUALS(0, sendV31.iAdditionalInfo.Compare(KAdditionalInfo1));	
  2612 
  4298 
  2613 	ASSERT_EQUALS(opCode1, sendV32.iOpCode);	
  4299 	ASSERT_EQUALS(opCode1, sendV32.iOpCode);	
  2614 	ASSERT_EQUALS(0, sendV32.iAdditionalInfo.Compare(KAdditionalInfo1));		
  4300 	ASSERT_EQUALS(0, sendV32.iAdditionalInfo.Compare(KAdditionalInfo1));	
  2615 	
  4301 	
  2616 	ASSERT_EQUALS(completeAttrV1.iFlags ,attrV1.iFlags);
  4302 	ASSERT_EQUALS(completeAttrV1.iFlags ,attrV1.iFlags);
  2617 	ASSERT_EQUALS(completeAttrV1.iFormat ,attrV1.iFormat);
  4303 	ASSERT_EQUALS(completeAttrV1.iFormat ,attrV1.iFormat);
  2618 	ASSERT_EQUALS(completeAttrV1.iType ,attrV1.iType);	
  4304 	ASSERT_EQUALS(completeAttrV1.iType ,attrV1.iType);	
  2619 	
  4305 	
  2620 	ASSERT_EQUALS(completeAttrV1.iFlags ,attrV12.iFlags);
  4306 	ASSERT_EQUALS(completeAttrV1.iFlags ,attrV12.iFlags);
  2621 	ASSERT_EQUALS(completeAttrV1.iFormat ,attrV12.iFormat);
  4307 	ASSERT_EQUALS(completeAttrV1.iFormat ,attrV12.iFormat);
  2622 	ASSERT_EQUALS(completeAttrV1.iType ,attrV12.iType);		
  4308 	ASSERT_EQUALS(completeAttrV1.iType ,attrV12.iType);		
  2623 	
  4309 		
  2624 	CleanupStack::PopAndDestroy(7, this); // phone2, telServer2, data, this
  4310 	CleanupStack::PopAndDestroy(7, this); // phone2, telServer2, data, this
  2625 	                                      // ussdMessaging1, ussdMessaging2, data2 (inv. order)
  4311 	                                      // ussdMessaging1, ussdMessaging2, data2 (inv. order)
  2626 
       
  2627 	}
  4312 	}
       
  4313 ////
  2628 
  4314 
  2629 /**
  4315 /**
  2630 @SYMTestCaseID BA-CTSY-USSDM-USMNFC-0001
  4316 @SYMTestCaseID BA-CTSY-USSDM-USMNFC-0001
  2631 @SYMComponent  telephony_ctsy
  4317 @SYMComponent  telephony_ctsy
  2632 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::SendMessageNoFdnCheck
  4318 @SYMTestCaseDesc Test support in CTSY for RMobileUssdMessaging::SendMessageNoFdnCheck
  2695 	iMockLTSY.ExpectL(EMobileUssdMessagingSendMessageNoFdnCheck, data);
  4381 	iMockLTSY.ExpectL(EMobileUssdMessagingSendMessageNoFdnCheck, data);
  2696 	iMockLTSY.CompleteL(EMobileUssdMessagingSendMessageNoFdnCheck, KErrGeneral);
  4382 	iMockLTSY.CompleteL(EMobileUssdMessagingSendMessageNoFdnCheck, KErrGeneral);
  2697 
  4383 
  2698 	ussdMessaging.SendMessageNoFdnCheck(requestStatus, msgData, msgAttributes);
  4384 	ussdMessaging.SendMessageNoFdnCheck(requestStatus, msgData, msgAttributes);
  2699 
  4385 
  2700 	/*
  4386 	//Wrong IPC is passed to ResetTsyReqHandle() EMultimodeUssdSendMessage 
  2701 	 * Wrong IPC is passed to ResetTsyReqHandle() EMultimodeUssdSendMessage 
  4387 	//instead of EMultimodeUssdSendMessageNoFdnCheck by call of 
  2702 	 * instead of EMultimodeUssdSendMessageNoFdnCheck by call of 
  4388 	//CMmUssdTsy::CompleteSendMessageNoFdnCheck(). This reduces to panic 
  2703 	 * CMmUssdTsy::CompleteSendMessageNoFdnCheck(). This reduces to panic 
  4389 	//with EEtelFaultNotRecognisedTsyHandle.
  2704 	 * with EEtelFaultNotRecognisedTsyHandle.
       
  2705 	 */
       
  2706 
  4390 
  2707 	User::WaitForRequest(requestStatus);
  4391 	User::WaitForRequest(requestStatus);
  2708 	AssertMockLtsyStatusL();
  4392 	AssertMockLtsyStatusL();
  2709 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());	
  4393 	ASSERT_EQUALS(KErrGeneral, requestStatus.Int());	
  2710 
  4394 
  2748 @SYMTestExpectedResults Pass
  4432 @SYMTestExpectedResults Pass
  2749 @SYMTestType CT
  4433 @SYMTestType CT
  2750 */
  4434 */
  2751 void CCTsyUssdMessagingFU::TestSendMessageNoFdnCheck0002L()
  4435 void CCTsyUssdMessagingFU::TestSendMessageNoFdnCheck0002L()
  2752 	{
  4436 	{
       
  4437 
  2753 	OpenEtelServerL(EUseExtendedError);
  4438 	OpenEtelServerL(EUseExtendedError);
  2754 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
  4439 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
  2755 	OpenPhoneL();
  4440 	OpenPhoneL();
  2756 
  4441 
  2757 	RBuf8 data;
  4442 	RBuf8 data;
  2823 @SYMTestExpectedResults Pass
  4508 @SYMTestExpectedResults Pass
  2824 @SYMTestType CT
  4509 @SYMTestType CT
  2825 */
  4510 */
  2826 void CCTsyUssdMessagingFU::TestSendMessageNoFdnCheck0003L()
  4511 void CCTsyUssdMessagingFU::TestSendMessageNoFdnCheck0003L()
  2827 	{
  4512 	{
  2828 
       
  2829 	OpenEtelServerL(EUseExtendedError);
  4513 	OpenEtelServerL(EUseExtendedError);
  2830 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
  4514 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
  2831 	OpenPhoneL();
  4515 	OpenPhoneL();
  2832 
  4516 
  2833 	RBuf8 data;
  4517 	RBuf8 data;
  2858     User::WaitForRequest(requestStatus);        
  4542     User::WaitForRequest(requestStatus);        
  2859 	AssertMockLtsyStatusL();
  4543 	AssertMockLtsyStatusL();
  2860 	ASSERT_EQUALS(KErrArgument, requestStatus.Int());	
  4544 	ASSERT_EQUALS(KErrArgument, requestStatus.Int());	
  2861 	
  4545 	
  2862 	CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging, ussdMessaging
  4546 	CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging, ussdMessaging
  2863 
       
  2864 	}
  4547 	}
  2865 
  4548 
  2866 /**
  4549 /**
  2867 @SYMTestCaseID BA-CTSY-USSDM-USMNFC-0004
  4550 @SYMTestCaseID BA-CTSY-USSDM-USMNFC-0004
  2868 @SYMComponent  telephony_ctsy
  4551 @SYMComponent  telephony_ctsy
  2872 @SYMTestExpectedResults Pass
  4555 @SYMTestExpectedResults Pass
  2873 @SYMTestType CT
  4556 @SYMTestType CT
  2874 */
  4557 */
  2875 void CCTsyUssdMessagingFU::TestSendMessageNoFdnCheck0004L()
  4558 void CCTsyUssdMessagingFU::TestSendMessageNoFdnCheck0004L()
  2876 	{
  4559 	{
  2877 
       
  2878 					
       
  2879 	OpenEtelServerL(EUseExtendedError);
  4560 	OpenEtelServerL(EUseExtendedError);
  2880 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
  4561 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
  2881 	OpenPhoneL();
  4562 	OpenPhoneL();
  2882 
  4563 
  2883 	RBuf8 data;
  4564 	RBuf8 data;
  2968 	AssertMockLtsyStatusL();
  4649 	AssertMockLtsyStatusL();
  2969 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());	
  4650 	ASSERT_EQUALS(KErrServerBusy, requestStatus2.Int());	
  2970 
  4651 
  2971 	CleanupStack::PopAndDestroy(6, this); // phone2, telServer2, data, this, 
  4652 	CleanupStack::PopAndDestroy(6, this); // phone2, telServer2, data, this, 
  2972 	                                      // ussdMessaging1, ussdMessaging2
  4653 	                                      // ussdMessaging1, ussdMessaging2
  2973 
       
  2974 	}
  4654 	}
  2975 
  4655 
  2976 /**
  4656 /**
  2977 @SYMTestCaseID BA-CTSY-USSDM-USMNFC-0005
  4657 @SYMTestCaseID BA-CTSY-USSDM-USMNFC-0005
  2978 @SYMComponent  telephony_ctsy
  4658 @SYMComponent  telephony_ctsy
  2982 @SYMTestExpectedResults Pass
  4662 @SYMTestExpectedResults Pass
  2983 @SYMTestType CT
  4663 @SYMTestType CT
  2984 */
  4664 */
  2985 void CCTsyUssdMessagingFU::TestSendMessageNoFdnCheck0005L()
  4665 void CCTsyUssdMessagingFU::TestSendMessageNoFdnCheck0005L()
  2986 	{
  4666 	{
  2987 
       
  2988 
       
  2989 	OpenEtelServerL(EUseExtendedError);
  4667 	OpenEtelServerL(EUseExtendedError);
  2990 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
  4668 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
  2991 	OpenPhoneL();
  4669 	OpenPhoneL();
  2992 
  4670 
  2993 	RBuf8 data;
  4671 	RBuf8 data;
  3036 	User::WaitForRequest(requestStatus);        
  4714 	User::WaitForRequest(requestStatus);        
  3037 	AssertMockLtsyStatusL();
  4715 	AssertMockLtsyStatusL();
  3038 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());	
  4716 	ASSERT_EQUALS(KErrTimedOut, requestStatus.Int());	
  3039 
  4717 
  3040 	CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging
  4718 	CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging
  3041 
       
  3042 	}
  4719 	}
  3043 
  4720 
  3044 /**
  4721 /**
  3045 @SYMTestCaseID BA-CTSY-USSDM-UGC-0001
  4722 @SYMTestCaseID BA-CTSY-USSDM-UGC-0001
  3046 @SYMComponent  telephony_ctsy
  4723 @SYMComponent  telephony_ctsy
  3049 @SYMTestActions Invokes RMobileUssdMessaging::GetCaps
  4726 @SYMTestActions Invokes RMobileUssdMessaging::GetCaps
  3050 @SYMTestExpectedResults Pass
  4727 @SYMTestExpectedResults Pass
  3051 @SYMTestType CT
  4728 @SYMTestType CT
  3052 */
  4729 */
  3053 void CCTsyUssdMessagingFU::TestGetCaps0001L()
  4730 void CCTsyUssdMessagingFU::TestGetCaps0001L()
  3054 	{
  4731 	{	
  3055 
       
  3056 	OpenEtelServerL(EUseExtendedError);
  4732 	OpenEtelServerL(EUseExtendedError);
  3057 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
  4733 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
  3058 	OpenPhoneL();
  4734 	OpenPhoneL();
  3059 
  4735 
  3060 	RMobileUssdMessaging ussdMessaging;
  4736 	RMobileUssdMessaging ussdMessaging;
  3061 	TInt ret = ussdMessaging.Open(iPhone);
  4737 	TInt ret = ussdMessaging.Open(iPhone);
  3062 	ASSERT_EQUALS(KErrNone, ret);
  4738 	ASSERT_EQUALS(KErrNone, ret);
  3063 	CleanupClosePushL(ussdMessaging);
  4739 	CleanupClosePushL(ussdMessaging);
  3064 	
  4740 
  3065 	TUint32 format = RMobileUssdMessaging::KCapsPackedString;
  4741 	TUint32 format = RMobileUssdMessaging::KCapsPackedString;
  3066 	TUint32 types  = KUssdTypeCaps;
  4742 	TUint32 types  = KUssdTypeCaps;
  3067 		
  4743 
  3068  	//-------------------------------------------------------------------------
  4744 	//-------------------------------------------------------------------------
  3069 	// TEST C: Successful completion request of
  4745 	// TEST C: Successful completion request of
  3070 	// RMobileUssdMessaging::GetCaps when result is not cached.
  4746 	// RMobileUssdMessaging::GetCaps when result is not cached.
  3071  	//-------------------------------------------------------------------------
  4747  	//-------------------------------------------------------------------------
  3072 
  4748 
  3073 	RMobileUssdMessaging::TMobileUssdCapsV1 capsV1;
  4749 	RMobileUssdMessaging::TMobileUssdCapsV1 capsV1;
  3074 	TPckg<RMobileUssdMessaging::TMobileUssdCapsV1> pckg(capsV1);
  4750 	TPckg<RMobileUssdMessaging::TMobileUssdCapsV1> pckg(capsV1);
  3075 	ret = ussdMessaging.GetCaps(pckg);
  4751 	ret = ussdMessaging.GetCaps(pckg);
  3076 	ASSERT_EQUALS(KErrNone, ret);
  4752 	ASSERT_EQUALS(KErrNone, ret);
  3077 	
       
  3078 	ASSERT_EQUALS(format, capsV1.iUssdFormat); // hard coded value
  4753 	ASSERT_EQUALS(format, capsV1.iUssdFormat); // hard coded value
  3079 	ASSERT_EQUALS(types , capsV1.iUssdTypes ); // hard coded value
  4754 	ASSERT_EQUALS(types , capsV1.iUssdTypes ); // hard coded value
  3080 
  4755 
  3081 	CleanupStack::PopAndDestroy(2, this); // this, ussdMessaging
  4756 	CleanupStack::PopAndDestroy(2, this); // this, ussdMessaging
  3082 	
       
  3083 	}
  4757 	}
  3084 
  4758 
  3085 /**
  4759 /**
  3086 @SYMTestCaseID BA-CTSY-USSDM-UGC-0003
  4760 @SYMTestCaseID BA-CTSY-USSDM-UGC-0003
  3087 @SYMComponent  telephony_ctsy
  4761 @SYMComponent  telephony_ctsy
  3091 @SYMTestExpectedResults Pass
  4765 @SYMTestExpectedResults Pass
  3092 @SYMTestType CT
  4766 @SYMTestType CT
  3093 */
  4767 */
  3094 void CCTsyUssdMessagingFU::TestGetCaps0003L()
  4768 void CCTsyUssdMessagingFU::TestGetCaps0003L()
  3095 	{
  4769 	{
  3096 
  4770 	
  3097 	OpenEtelServerL(EUseExtendedError);
  4771 	OpenEtelServerL(EUseExtendedError);
  3098 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
  4772 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
  3099 	OpenPhoneL();
  4773 	OpenPhoneL();
  3100 
  4774 
  3101 	RMobileUssdMessaging ussdMessaging;
  4775 	RMobileUssdMessaging ussdMessaging;
  3112 	
  4786 	
  3113 	ret = ussdMessaging.GetCaps(badSizeDescriptor);
  4787 	ret = ussdMessaging.GetCaps(badSizeDescriptor);
  3114 	ASSERT_EQUALS(KErrArgument, ret);
  4788 	ASSERT_EQUALS(KErrArgument, ret);
  3115 
  4789 
  3116 	CleanupStack::PopAndDestroy(2, this); // this, ussdMessaging
  4790 	CleanupStack::PopAndDestroy(2, this); // this, ussdMessaging
  3117 
  4791 	
  3118 	}
  4792 	}
  3119 
  4793 
  3120 
  4794 
  3121 TInt CCTsyUssdMessagingFU::CreateClients(RThread& aT1, RThread& aT2, TTestDataWithChunk& aC1,  TTestDataWithChunk& aC2) 
  4795 TInt CCTsyUssdMessagingFU::CreateClients(RThread& aT1, RThread& aT2, TTestDataWithChunk& aC1,  TTestDataWithChunk& aC2) 
  3122 	{
  4796 	{
  3291 	aMockLTSY.CompleteL(aMsgType, KErrNone, aData, 15); 
  4965 	aMockLTSY.CompleteL(aMsgType, KErrNone, aData, 15); 
  3292 	}
  4966 	}
  3293 
  4967 
  3294 void CCTsyUssdMessagingFU::TestReceiveMessageWithTestClientL(RArray<TUssdClientTestData> & aClientTestData, TBool aRandomLoopingTest)
  4968 void CCTsyUssdMessagingFU::TestReceiveMessageWithTestClientL(RArray<TUssdClientTestData> & aClientTestData, TBool aRandomLoopingTest)
  3295     {
  4969     {
       
  4970 	
  3296     OpenEtelServerL(EUseExtendedError);
  4971     OpenEtelServerL(EUseExtendedError);
  3297     CleanupStack::PushL(TCleanupItem(Cleanup,this));
  4972     CleanupStack::PushL(TCleanupItem(Cleanup,this));
  3298     OpenPhoneL();
  4973     OpenPhoneL();
  3299     
  4974     
  3300     RBuf8 data;
  4975     RBuf8 data;
  3335                 }
  5010                 }
  3336             }
  5011             }
  3337         // Fail the test if any client has not been created properly
  5012         // Fail the test if any client has not been created properly
  3338         ASSERT_EQUALS(err, KErrNone);
  5013         ASSERT_EQUALS(err, KErrNone);
  3339         }
  5014         }
  3340 
  5015     
  3341     // All processes created successfully, start their execution
  5016     // All processes created successfully, start their execution
  3342     for (TInt i = 0; i < numClients; i++)
  5017     for (TInt i = 0; i < numClients; i++)
  3343         {
  5018         {
  3344         proc[i].Logon(req[i]);
  5019         proc[i].Logon(req[i]);
  3345         proc[i].Resume();
  5020         proc[i].Resume();
  3346         // Pause here so that clients register in the order specified (i.e. As ordered in the array)
  5021         // Pause here so that clients register in the order specified (i.e. As ordered in the array)
  3347         // Resolves timing issues in WDP/SMP.
  5022         // Resolves timing issues in WDP/SMP.
  3348         User::After(500000);
  5023         User::After(500000);
  3349         }
  5024         }
  3350 
  5025     
  3351     if (aRandomLoopingTest)
  5026     if (aRandomLoopingTest)
  3352         {
  5027         {
  3353         // Special case just for TestReceiveMessageWithTestClient0017L
  5028         // Special case just for TestReceiveMessageWithTestClient0017L
  3354         for (TInt i=0; i<20; ++i)
  5029         for (TInt i=0; i<20; ++i)
  3355             {
  5030             {
  3695     TestReceiveMessageWithTestClientL(data1);
  5370     TestReceiveMessageWithTestClientL(data1);
  3696     data1.Close();
  5371     data1.Close();
  3697     }
  5372     }
  3698 
  5373 
  3699 /*
  5374 /*
  3700 @SYMTestCaseID BA-CTSY-USSDM-URM-0020
  5375 @SYMTestCaseID BA-CTSY-USSDM-URM-0021
  3701 @SYMComponent telephony_ctsy
  5376 @SYMComponent telephony_ctsy
  3702 @SYMTestCaseDesc Test ReceiveMessage with multiple clients.
  5377 @SYMTestCaseDesc Test ReceiveMessage with multiple clients.
  3703 @SYMTestPriority High
  5378 @SYMTestPriority High
  3704 @SYMTestActions Two clients, both call ReceiveMessage. A message is received. First client offered message. Both clients call Close.
  5379 @SYMTestActions Two clients, both call ReceiveMessage. A message is received. First client offered message. Both clients call Close.
  3705 @SYMTestExpectedResults Pass
  5380 @SYMTestExpectedResults Pass
  3726 @SYMTestActions Invokes RMobileUssdMessaging::AcceptIncomingDialogue and RMobileUssdMessaging::RejectIncomingDialogue
  5401 @SYMTestActions Invokes RMobileUssdMessaging::AcceptIncomingDialogue and RMobileUssdMessaging::RejectIncomingDialogue
  3727 @SYMTestExpectedResults Pass
  5402 @SYMTestExpectedResults Pass
  3728 @SYMTestType CT
  5403 @SYMTestType CT
  3729 */
  5404 */
  3730 void CCTsyUssdMessagingFU::TestAcceptRejectMisuse0001L()
  5405 void CCTsyUssdMessagingFU::TestAcceptRejectMisuse0001L()
  3731     {
  5406     {	
  3732 
       
  3733     OpenEtelServerL(EUseExtendedError);
  5407     OpenEtelServerL(EUseExtendedError);
  3734     CleanupStack::PushL(TCleanupItem(Cleanup,this));
  5408     CleanupStack::PushL(TCleanupItem(Cleanup,this));
  3735     OpenPhoneL();
  5409     OpenPhoneL();
  3736 
  5410 
  3737     RMobileUssdMessaging ussdMessaging;
  5411     RMobileUssdMessaging ussdMessaging;
  3748     ASSERT_EQUALS(KErrNotReady , status);
  5422     ASSERT_EQUALS(KErrNotReady , status);
  3749     
  5423     
  3750     AssertMockLtsyStatusL();
  5424     AssertMockLtsyStatusL();
  3751     
  5425     
  3752     CleanupStack::PopAndDestroy(2, this); // this, ussdMessaging
  5426     CleanupStack::PopAndDestroy(2, this); // this, ussdMessaging
       
  5427     
  3753     }
  5428     }
  3754 
  5429 
  3755 /**
  5430 /**
  3756 @SYMTestCaseID BA-CTSY-USSDM-UARM-0002
  5431 @SYMTestCaseID BA-CTSY-USSDM-UARM-0002
  3757 @SYMComponent  telephony_ctsy
  5432 @SYMComponent  telephony_ctsy
  3761 @SYMTestExpectedResults Pass
  5436 @SYMTestExpectedResults Pass
  3762 @SYMTestType CT
  5437 @SYMTestType CT
  3763 */
  5438 */
  3764 void CCTsyUssdMessagingFU::TestAcceptRejectMisuse0002L()
  5439 void CCTsyUssdMessagingFU::TestAcceptRejectMisuse0002L()
  3765     {
  5440     {
  3766 
  5441 	
  3767     OpenEtelServerL(EUseExtendedError);
  5442     OpenEtelServerL(EUseExtendedError);
  3768     CleanupStack::PushL(TCleanupItem(Cleanup,this));
  5443     CleanupStack::PushL(TCleanupItem(Cleanup,this));
  3769     OpenPhoneL();
  5444     OpenPhoneL();
  3770 
  5445 
  3771     RBuf8 data;
  5446     RBuf8 data;
  3860     ASSERT_EQUALS(KErrNone, status);
  5535     ASSERT_EQUALS(KErrNone, status);
  3861     
  5536     
  3862     AssertMockLtsyStatusL();
  5537     AssertMockLtsyStatusL();
  3863     
  5538     
  3864     CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging
  5539     CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging
       
  5540     
  3865     }
  5541     }
  3866 
  5542 
  3867 /**
  5543 /**
  3868 @SYMTestCaseID BA-CTSY-USSDM-MIUM-0001
  5544 @SYMTestCaseID BA-CTSY-USSDM-MIUM-0001
  3869 @SYMComponent  telephony_ctsy
  5545 @SYMComponent  telephony_ctsy
  3870 @SYMTestCaseDesc xxx
  5546 @SYMTestCaseDesc BA-CTSY-USSDM-MIUM-0001
  3871 @SYMTestPriority High
  5547 @SYMTestPriority High
  3872 @SYMTestActions xxx
  5548 @SYMTestActions Client calls ReceiveMessage. First USSD message arrives and is offered to client.
  3873 @SYMTestExpectedResults Pass
  5549 @SYMTestExpectedResults Pass
  3874 @SYMTestType CT
  5550 @SYMTestType CT
  3875 */
  5551 */
  3876 void CCTsyUssdMessagingFU::TestMultipleIncomingUssdMessages0001L()
  5552 void CCTsyUssdMessagingFU::TestMultipleIncomingUssdMessages0001L()
  3877     {
  5553     {
  3936     User::After(5 * 1000000);
  5612     User::After(5 * 1000000);
  3937     
  5613     
  3938     AssertMockLtsyStatusL();
  5614     AssertMockLtsyStatusL();
  3939  
  5615  
  3940 	CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging
  5616 	CleanupStack::PopAndDestroy(3, this); // data, this, ussdMessaging
       
  5617 	
  3941 	}
  5618 	}
  3942 	
  5619