diff -r 7f379d8ed02d -r 96b4f933d69a telephonyserverplugins/common_tsy/test/component/src/cctsyussdmessagingfu.cpp --- a/telephonyserverplugins/common_tsy/test/component/src/cctsyussdmessagingfu.cpp Tue Oct 19 18:11:09 2010 +0300 +++ b/telephonyserverplugins/common_tsy/test/component/src/cctsyussdmessagingfu.cpp Thu Nov 04 20:30:45 2010 +0200 @@ -99,6 +99,10 @@ ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestAcceptRejectMisuse0001L); ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestAcceptRejectMisuse0002L); ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestMultipleIncomingUssdMessages0001L); + ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageDefaultHandlerWithTestClient0001L); + ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageDefaultHandlerWithTestClient0002L); + ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageDefaultHandlerWithTestClient0003L); + ADD_TEST_STEP_ISO_CPP(CCTsyUssdMessagingFU, TestSendMessageDefaultHandlerWithTestClient0004L); END_SUITE; } @@ -5043,8 +5047,7 @@ return; } - iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data, 15); - + iMockLTSY.CompleteL(EMobileUssdMessagingReceiveMessage, KErrNone, data, 15); User::WaitForAnyRequest(); // Wait for any clients given a timeout @@ -5617,3 +5620,616 @@ } + +/** +@SYMTestCaseID BA-CTSY-USSDM-USMDH-0001 +@SYMComponent telephony_ctsy +@SYMTestCaseDesc Test support in CTSY client requests to RMobileUssdMessaging::SendMessage with default handler +@SYMTestPriority High +@SYMTestActions Invokes request to RMobileUssdMessaging::SendMessage with EMobileUssdMessagingSendMessageDefaultHandler option +@SYMTestExpectedResults Pass +@SYMTestType CT +*/ +void CCTsyUssdMessagingFU::TestSendMessageDefaultHandlerWithTestClient0001L() + { + OpenEtelServerL(EUseExtendedError); + CleanupStack::PushL(TCleanupItem(Cleanup,this)); + OpenPhoneL(); + + RBuf8 data; + CleanupClosePushL(data); + + RArray data1; + RMobileUssdMessaging ussdMessaging; + TInt ret = ussdMessaging.Open(iPhone); + ASSERT_EQUALS(KErrNone, ret); + CleanupClosePushL(ussdMessaging); + + TRequestStatus requestStatus; + + TUint32 flags = 100; + RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified; + RMobileUssdMessaging::TMobileUssdMessageType type = RMobileUssdMessaging::EUssdMORequest; + TUint8 dcs = 200; + + //------------------------------------------------------------------------- + // function parameters + + RMobileUssdMessaging::TMobileUssdAttributesV1 attributes; + TPckg msgAttributes(attributes); + + attributes.iFlags = flags; + attributes.iFormat = format; + attributes.iType = type; + attributes.iDcs = dcs; + + TName name = _L("Name1"); + TPckg msgData(name); + + //------------------------------------------------------------------------- + + TMockLtsyData2 + mockData2(name, attributes); + mockData2.SerialiseL(data); + //------------------------------------------------------------------------- + RBuf8 data2; + CleanupClosePushL(data2); + //------------------------------------------------------------------------- + RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes; + completeAttributes.iFlags = flags; + completeAttributes.iFormat = format; + completeAttributes.iType = type; + completeAttributes.iDcs = dcs; + TBuf8 completeName = _L8("Name2"); + TMockLtsyData2, RMobileUssdMessaging::TMobileUssdAttributesV1> + mockData3(completeName, completeAttributes); + mockData3.SerialiseL(data2); + //------------------------------------------------------------------------- + data1.Append(TUssdClientTestData(_L("ussdtestclient_default.exe"), _L("-R -M"), KErrNone, EExitKill, KErrNone)); //Default + const TInt numClients = data1.Count(); + RProcess* proc = new RProcess[numClients]; + TRequestStatus* req = new TRequestStatus[numClients]; + + for (TInt i=0; i data1; + RMobileUssdMessaging ussdMessaging; + TInt ret = ussdMessaging.Open(iPhone); + ASSERT_EQUALS(KErrNone, ret); + CleanupClosePushL(ussdMessaging); + + TRequestStatus requestStatus; + + TUint32 flags = 100; + RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified; + RMobileUssdMessaging::TMobileUssdMessageType type = RMobileUssdMessaging::EUssdMORequest; + TUint8 dcs = 200; + + //------------------------------------------------------------------------- + // function parameters + + RMobileUssdMessaging::TMobileUssdAttributesV1 attributes; + TPckg msgAttributes(attributes); + + attributes.iFlags = flags; + attributes.iFormat = format; + attributes.iType = type; + attributes.iDcs = dcs; + + TName name = _L("Name1"); + TPckg msgData(name); + + //------------------------------------------------------------------------- + + TMockLtsyData2 + mockData2(name, attributes); + mockData2.SerialiseL(data); + //------------------------------------------------------------------------- + RBuf8 data2; + CleanupClosePushL(data2); + //------------------------------------------------------------------------- + RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes; + completeAttributes.iFlags = flags; + completeAttributes.iFormat = format; + completeAttributes.iType = type; + completeAttributes.iDcs = dcs; + TBuf8 completeName = _L8("Name2"); + TMockLtsyData2, RMobileUssdMessaging::TMobileUssdAttributesV1> + mockData3(completeName, completeAttributes); + mockData3.SerialiseL(data2); + //------------------------------------------------------------------------- + data1.Append(TUssdClientTestData(_L("ussdtestclient_default.exe"), _L("-R -M"), KErrNone, EExitKill, KErrNone)); //Default + data1.Append(TUssdClientTestData(_L("ussdtestclient_default.exe"),_L("-R -M"), KRequestPending, EExitPending, KErrNone)); //Second default client + const TInt numClients = data1.Count(); + RProcess* proc = new RProcess[numClients]; + TRequestStatus* req = new TRequestStatus[numClients]; + + for (TInt i=0; i data1; + RMobileUssdMessaging ussdMessaging; + TInt ret = ussdMessaging.Open(iPhone); + ASSERT_EQUALS(KErrNone, ret); + CleanupClosePushL(ussdMessaging); + + TRequestStatus requestStatus; + + TUint32 flags = 100; + RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified; + RMobileUssdMessaging::TMobileUssdMessageType type = RMobileUssdMessaging::EUssdMORequest; + TUint8 dcs = 200; + + //------------------------------------------------------------------------- + // function parameters + + RMobileUssdMessaging::TMobileUssdAttributesV1 attributes; + TPckg msgAttributes(attributes); + + attributes.iFlags = flags; + attributes.iFormat = format; + attributes.iType = type; + attributes.iDcs = dcs; + + TName name = _L("Name1"); + TPckg msgData(name); + + //------------------------------------------------------------------------- + + TMockLtsyData2 + mockData2(name, attributes); + mockData2.SerialiseL(data); + //------------------------------------------------------------------------- + RBuf8 data2; + CleanupClosePushL(data2); + //------------------------------------------------------------------------- + RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes; + completeAttributes.iFlags = flags; + completeAttributes.iFormat = format; + completeAttributes.iType = type; + completeAttributes.iDcs = dcs; + TBuf8 completeName = _L8("Name2"); + TMockLtsyData2, RMobileUssdMessaging::TMobileUssdAttributesV1> + mockData3(completeName, completeAttributes); + mockData3.SerialiseL(data2); + //------------------------------------------------------------------------- + data1.Append(TUssdClientTestData(_L("ussdtestclient_priority.exe"),_L("-R -M"), KRequestPending, EExitPending, KErrNone)); //Priority + data1.Append(TUssdClientTestData(_L("ussdtestclient_default.exe"), _L("-R -M"), KErrNone, EExitKill, KErrNone)); //Default + const TInt numClients = data1.Count(); + RProcess* proc = new RProcess[numClients]; + TRequestStatus* req = new TRequestStatus[numClients]; + + for (TInt i=0; i data1; + RMobileUssdMessaging ussdMessaging; + TInt ret = ussdMessaging.Open(iPhone); + ASSERT_EQUALS(KErrNone, ret); + CleanupClosePushL(ussdMessaging); + + TRequestStatus requestStatus; + + TUint32 flags = 100; + RMobileUssdMessaging::TMobileUssdDataFormat format = RMobileUssdMessaging::EFormatUnspecified; + RMobileUssdMessaging::TMobileUssdMessageType type = RMobileUssdMessaging::EUssdMORequest; + TUint8 dcs = 200; + + //------------------------------------------------------------------------- + // function parameters + + RMobileUssdMessaging::TMobileUssdAttributesV1 attributes; + TPckg msgAttributes(attributes); + + attributes.iFlags = flags; + attributes.iFormat = format; + attributes.iType = type; + attributes.iDcs = dcs; + + TName name = _L("Name1"); + TPckg msgData(name); + + //------------------------------------------------------------------------- + + TMockLtsyData2 + mockData2(name, attributes); + mockData2.SerialiseL(data); + //------------------------------------------------------------------------- + RBuf8 data2; + CleanupClosePushL(data2); + //------------------------------------------------------------------------- + RMobileUssdMessaging::TMobileUssdAttributesV1 completeAttributes; + completeAttributes.iFlags = flags; + completeAttributes.iFormat = format; + completeAttributes.iType = type; + completeAttributes.iDcs = dcs; + TBuf8 completeName = _L8("Name2"); + TMockLtsyData2, RMobileUssdMessaging::TMobileUssdAttributesV1> + mockData3(completeName, completeAttributes); + mockData3.SerialiseL(data2); + //------------------------------------------------------------------------- + data1.Append(TUssdClientTestData(_L("ussdtestclient_priority.exe"),_L("-R -M"), KRequestPending, EExitPending, KErrNone)); //Priority + data1.Append(TUssdClientTestData(_L("ussdtestclient_normal.exe"),_L("-R -M"), KRequestPending, EExitPending, KErrNone)); //Normal + data1.Append(TUssdClientTestData(_L("ussdtestclient_default.exe"), _L("-R -M"), KErrNone, EExitKill, KErrNone)); //Default + const TInt numClients = data1.Count(); + RProcess* proc = new RProcess[numClients]; + TRequestStatus* req = new TRequestStatus[numClients]; + + for (TInt i=0; i