diff -r 9f5ae1728557 -r db3f5fa34ec7 messagingfw/wappushfw/tpush/t_DRMmessage.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingfw/wappushfw/tpush/t_DRMmessage.cpp Wed Nov 03 22:41:46 2010 +0530 @@ -0,0 +1,488 @@ +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#include + +#include "pushtests.h" +#include "dummywapstack.h" +#include "wappushmsggen.h" +#include + +_LIT(KTestAgent, "Reference Test Agent"); +_LIT(KTestPassed,"DRM Test passed.Number of rights stored :\t%d expected rights : %d"); +_LIT(KTestFailed, "DRM Test failed.Number of rights stored :\t%d expected rights : %d "); + +_LIT8 ( KWBXmlROMessage, "\x03\x0E\x6A\x00\xC5\x05\x85\x06\x86\x07\x87\x01\x46\x47\x03\x31\x2E\x30\x00\x01\01\x49\x4A\x46\x48\x03\x63\x69\x64\x3A\x74\x65\x73\x74\x40\x66\x65\x72\x2E\x68\x72\x00\x01\x01\x4B\x4C\xC3\x10\xbd\x41\x30\x47\xc2\xf3\x10\x9a\x1e\x88\x2f\x9d\x81\x3d\x66\x82\x01\x01\x01\x4D\x4E\x52\x53\x03\x31\x00\x01\x01\x52\x54\x55\x03\x32\x30\x30\x36\x2D\x30\x33\x2D\x30\x31\x54\x30\x30\x3A\x30\x30\x3A\x30\x30\x00\x01\x56\x03\x32\x30\x30\x36\x2D\x30\x34\x2D\x33\x30\x54\x30\x30\x3A\x30\x30\x3A\x30\x30\x00\x01\x01\x01\x52\x57\x03\x50\x30\x59\x30\x4D\x33\x30\x44\x54\x31\x30\x48\x33\x30\x4D\x30\x53\x00\x01\x01\x01\x01\x01\x01" ); + +//The rights element attribute is invalid. +_LIT8 ( KInvalidWBXmlROMessage, "\x03\x0E\x6A\x00\xC5\x15\x85\x06\x86\x01\x46\x47\x03\x31\x2E\x30\x00\x01\01\x49\x4A\x46\x48\x01\x01\x01\x4D\x01\x01\x01" ); + +//Xml RO Response message with Rights Object. +_LIT8 ( KXmlROMessage, "vXENc+Um/9/NvmYKiHDLaErK0gk=vXENc+Um/9/NvmYKiHDLaErK0gk=32efd34de39sdwefqwer1.0cid:4567829547@foo.comvUEwR8LzEJoeiC+dgT1mgg==d93e5fue3susdskjhkjedkjrewh53209efoihfdse10ue2109ue1"); + +// is not present in the message after +_LIT8 ( KInValidXmlROMessage, "vXENc+Um/9/NvmYKiHDLaErK0gk=vXENc+Um/9/NvmYKiHDLaErK0gk=32efd34de39sdwefqwer1.0cid:4567829547@foo.comvUEwR8LzEJoeiC+dgT1mgg==d93e5fue3susdskjhkjedkjrewh53209efoihfdse10ue2109ue1" ); + +//Trigger message for registration request. +_LIT8 ( KXmlRegReqTriggerMessage, "I94/ovDhizE5m/K6t5f1holSdLM=CoreMedia IOPServerFL2MM70k5OthJZrMte6rhttp://192.116.217.184:8080/iop-server/roap.cm;jsessionid=88C45AEB82C2755A641526A19B9050A7"); + +//Trigger message for RO Aquisation. +_LIT8 ( KXmlROAquisationTriggerMessage, "I94/ovDhizE5m/K6t5f1holSdLM=CoreMedia IOP Test Serverg5VsnV4L7qZzBMnH0idDhttp://192.116.217.184:8080/iop-server/roap.cmoffer6165.1.PphdCI0gysdL58zb_midcid:cid6165_mid"); + +//Trigger message for Join Domain. +_LIT8 ( KXmlJoinDomainTriggerMessage, "aXENc+Um/9/NvmYKiHDLaErK0fk=sdfknjvfda438790fdjkl4rqhttp://ri.example.com/ro.cgi?tid=qw683hgew7dDomain-XYZ-001SomeSignature"); + +//Trigger message for Leave Domain. +_LIT8 ( KXmlLeaveDomainTriggerMessage, "aXENc+Um/9/NvmYKiHDLaErK0fk=sdfknjvfda438790fdjkl4rqhttp://ri.example.com/ro.cgi?tid=qw683hgew7dDomain-XYZ-001SomeSignature"); + +//Invalid Trigger message for registration request. is absent. +_LIT8 ( KInvalidXmlRegReqTriggerMessage, "I94/ovDhizE5m/K6t5f1holSdLM=CoreMedia IOPServerFL2MM70k5OthJZrMte6rhttp://192.116.217.184:8080/iop-server/roap.cm;jsessionid=88C45AEB82C2755A641526A19B9050A7"); + +//Invalid Trigger message for RO Aquisation. is called after . +_LIT8 ( KInvalidXmlROAquisationTriggerMessage, "I94/ovDhizE5m/K6t5f1holSdLM=CoreMedia IOP Test Serverg5VsnV4L7qZzBMnH0idDhttp://192.116.217.184:8080/iop-server/roap.cmoffer6165.1.PphdCI0gysdL58zb_midcid:cid6165_mid"); + +//Invalid Trigger message for Join Domain. is Absent. +_LIT8 ( KInvalidXmlJoinDomainTriggerMessage, "aXENc+Um/9/NvmYKiHDLaErK0fk=sdfknjvfda438790fdjkl4rqhttp://ri.example.com/ro.cgi?tid=qw683hgew7dDomain-XYZ-001SomeSignature"); + +//Invalid Trigger message for Leave Domain. is absent. +_LIT8 ( KInvalidXmlLeaveDomainTriggerMessage, "aXENc+Um/9/NvmYKiHDLaErK0fk=sdfknjvfda438790fdjkl4rqhttp://ri.example.com/ro.cgi?tid=qw683hgew7dDomain-XYZ-001SomeSignature"); + +//The CID of this message is more than 128 characters. +_LIT8 ( KLargeXmlROMessage, "vXENc+Um/9/NvmYKiHDLaErK0gk=vXENc+Um/9/NvmYKiHDLaErK0gk=32efd34de39sdwefqwer1.0cid:TheMissionOfTheOpenMobileAllianceIsToFacilitateGlobalUserAdoptionOfMobileDataServicesBySpecifyingMarketDrivenMobileServiceEnablersThatEnsureServiceInteroperabilityAcrossDevicesGeographiesServiceProvidersOperatorsAndNetworkvUEwR8LzEJoeiC+dgT1mgg==d93e5fue3susdskjhkjedkjrewh53209efoihfdse10ue2109ue1" ); + +//The CID of this message is more than 128 characters. +_LIT8 ( KLargeWBXmlROMessage, "\x03\x0E\x6A\x00\xC5\x05\x85\x06\x86\x01\x46\x47\x03\x31\x2E\x30\x00\x01\01\x49\x4A\x46\x48\x03\x63\x69\x64\x3A\x73\x6F\x6D\x65\x64\x61\x74\x61\x73\x6F\x6D\x65\x64\x61\x74\x61\x73\x6F\x6D\x65\x64\x61\x74\x61\x73\x6F\x6D\x65\x64\x61\x74\x61\x73\x6F\x6D\x65\x64\x61\x74\x61\x73\x6F\x6D\x65\x64\x61\x74\x61\x73\x6F\x6D\x65\x64\x61\x74\x61\x73\x6F\x6D\x65\x64\x61\x74\x61\x73\x6F\x6D\x65\x64\x61\x74\x61\x73\x6F\x6D\x65\x64\x61\x74\x61\x73\x6F\x6D\x65\x64\x61\x74\x61\x73\x6F\x6D\x65\x64\x61\x74\x61\x73\x6F\x6D\x65\x64\x61\x74\x61\x73\x6F\x6D\x65\x64\x61\x74\x61\x73\x6F\x6D\x65\x64\x61\x74\x61\x73\x6F\x6D\x65\x64\x61\x74\x61\x73\x6F\x6D\x65\x64\x61\x74\x61\x00\x01\x01\x01\x4D\x01\x01\x01" ); + +const TInt KTotalRights=4; //Change it when rights written to rights.db changes from the test code. +const TUint8 KWbXmlROMessageHeader[] = + { + 0xCB, //Content type "application/vnd.oma.drm.rights+wbxml" + 0xAF, //X-Wap-Application-ID + 0x88 // App type x-wap-application:drm.ua //0x08 + }; + +const TUint8 KXmlROMessageHeader[] = + { + 0xCA, //Content type "application/vnd.oma.drm.rights+xml" + 0xAF, //X-Wap-Application-ID + 0x88 // App type x-wap-application:drm.ua //0x08 + }; + +//Commented as WbXml trigger messages are not supported currently. +/*const TUint8 KWbXmlTriggerMessageHeader[] = + { + 0xCD, //application/vnd.oma.drm.roap-trigger+wbxml" + 0xAF, //X-Wap-Application-ID + 0x88 // App type x-wap-application:drm.ua //0x08 + };*/ + +const TUint8 KXmlTriggerMessageHeader[] = + { + 0xCC, //Content type "application/vnd.oma.drm.roap-trigger+xml" + 0xAF, //X-Wap-Application-ID + 0x88 // App type x-wap-application:drm.ua //0x08 + }; + +/** set the test name for this test case + @param void + @return string + returns test name +*/ +const TDesC& CWapPushDRMMessageTest::TestName() + { + _LIT(KTextDRMMessageTest,"DRM Test"); + return KTextDRMMessageTest; + } + +/** specify the number of test messages to use */ +void CWapPushDRMMessageTest::NumberTestCasesToRun() + { + iNumberOfTestCases = 14; + } + + +/** create test messages to use where aTestCase represents the + message index for multiple messages. + + @param aTestCase message index value for selecting a test message + @return void + */ +void CWapPushDRMMessageTest::PrepareTestMessageL(TInt aTestCase) + { + // create hardcoded DRM test message. + iMsg = NULL; + switch ( aTestCase ) + { + case 0 : + //Pass WBXml RO message. + WbXmlROMessageL(); + break; + case 1: + //Pass invalid WBXML RO message + InvalidWbXmlROMessageL(); + break; + case 2 : + //Pass XML RO message. + XmlROMessageL(); + break; + case 3 : + //Pass invalid XML RO message. + InvalidXmlROMessageL(); + break; + case 4: + //Pass XML Registration request Trigger message. + RegRequesttriggerMessageL(); + break; + case 5: + //Pass XML RO Aquisation Trigger message. + ROAquisationTriggerMessageL(); + break; + case 6: + //Pass XML Join Domain Trigger message. + JoinDomaintriggerMessageL(); + break; + case 7: + //Pass XML Leave Domain Trigger message. + LeaveDomainTriggerMessageL(); + break; + case 8: + //Pass invalid XML Registration Request Trigger message. + InvalidRegRequesttriggerMessageL(); + break; + case 9 : + //Pass invalid XML RO Aquisation Trigger message. + InvalidROAquisationTriggerMessageL(); + break; + case 10 : + //Pass invalid XML Join Domain Trigger message. + InvalidJoinDomaintriggerMessageL(); + break; + case 11 : + //Pass invalid XML Leave Domain Trigger message. + InvalidLeaveDomainTriggerMessageL(); + break; + case 12 : + //Pass Large XML RO message. Cid>128 + LargeXmlROMessageL(); + break; + case 13: + //Pass Large WBXML RO message. Cid>128 + LargeWbXmlROMessageL(); + break; + default : + return; + } + + // copy data to iBodyBuf + iBodyBuf.Delete(0,KBufferSize); + iBodyBuf = iMsg->Des(); + delete iMsg; + } + +/* @SYMTestCaseID WP-CIT-BV-0001 + @SYMTestCaseDesc Test the DRM ROAP ROResponse push message delivery (XML format) + to test agent. + @SYMTestStatus Implemented + @SYMTestPriority 1 + @SYMTestActions Send a XML Push Message using the Dummy stack, and see that + the CDRMAppHandler and CROContentHandler are able to correctly store + the Rights in rights.db using test agent. + @SYMTestExpectedResults Test agent should write the rights data to rights.db. + @SYMPREQ PREQ GT257-CR763 + @SYMTestType CIT +*/ +void CWapPushDRMMessageTest::XmlROMessageL() + { + iMsg = KXmlROMessage().AllocL (); + iHeadersBuf.Delete(0,KBufferSize); + iHeadersBuf.Append(KXmlROMessageHeader, sizeof(KXmlROMessageHeader)); + } + +/* @SYMTestCaseID WP-CIT-BV-0002 + @SYMTestCaseDesc Test the DRM push message delivery (WBXML format) to test agent. + @SYMTestStatus Implemented + @SYMTestPriority 1 + @SYMTestActions Send a WBXML DRM Push Message using the Dummy stack, and see that + the CDRMAppHandler and CROContentHandler are able to correctly store + the Rights in rights.db using test agent. + @SYMTestExpectedResults Test agent should add the rights to rights.db. + @SYMPREQ PREQ GT257-CR763 + @SYMTestType CIT +*/ +void CWapPushDRMMessageTest::WbXmlROMessageL() + { + iMsg = KWBXmlROMessage().AllocL (); + iHeadersBuf.Delete(0,KBufferSize); + iHeadersBuf.Append(KWbXmlROMessageHeader, sizeof(KWbXmlROMessageHeader)); + } + +/* @SYMTestCaseID WP-CIT-BV-0003 + @SYMTestCaseDesc Test the DRM Trigger message delivery to test agent. + @SYMTestStatus Implemented + @SYMTestPriority 1 + @SYMTestActions Send a valid DRM Push Message containing Registration Request trigger + using the Dummy stack, and see that the CDRMAppHandler and + CROAPTContentHandler are able to correctly parse the message using test agent. + @SYMTestExpectedResults Test agent should parse the message without any error. + @SYMPREQ PREQ GT257-CR763 + @SYMTestType CIT +*/ +void CWapPushDRMMessageTest::RegRequesttriggerMessageL() + { + iMsg = KXmlRegReqTriggerMessage().AllocL (); + iHeadersBuf.Delete(0,KBufferSize); + iHeadersBuf.Append(KXmlTriggerMessageHeader, sizeof(KXmlTriggerMessageHeader)); + } + +/* @SYMTestCaseID WP-CIT-BV-0004 + @SYMTestCaseDesc Test the DRM Trigger message delivery to test agent. + @SYMTestStatus Implemented + @SYMTestPriority 1 + @SYMTestActions Send a valid DRM Push Message containing RO acquisition trigger + using the Dummy stack, and see that the CDRMAppHandler and + CROAPTContentHandler are able to correctly parse the message using test agent. + @SYMTestExpectedResults Test agent should parse the message without any error. + @SYMPREQ PREQ GT257-CR763 + @SYMTestType CIT +*/ +void CWapPushDRMMessageTest::ROAquisationTriggerMessageL() + { + iMsg = KXmlROAquisationTriggerMessage().AllocL (); + iHeadersBuf.Delete(0,KBufferSize); + iHeadersBuf.Append(KXmlTriggerMessageHeader, sizeof(KXmlTriggerMessageHeader)); + } + +/* @SYMTestCaseID WP-CIT-BV-0005 + @SYMTestCaseDesc Test the DRM Trigger message delivery to test agent. + @SYMTestStatus Implemented + @SYMTestPriority 1 + @SYMTestActions Send a valid DRM Push Message containing Join Domain trigger using + the Dummy stack, and see that the CDRMAppHandler and CROAPTContentHandler + are able to correctly parse the message using test agent. + @SYMTestExpectedResults Test agent should parse the message without any error. + @SYMPREQ PREQ GT257-CR763 + @SYMTestType CIT +*/ +void CWapPushDRMMessageTest::JoinDomaintriggerMessageL() + { + iMsg = KXmlJoinDomainTriggerMessage().AllocL (); + iHeadersBuf.Delete(0,KBufferSize); + iHeadersBuf.Append(KXmlTriggerMessageHeader, sizeof(KXmlTriggerMessageHeader)); + } + +/* @SYMTestCaseID WP-CIT-BV-0006 + @SYMTestCaseDesc Test the DRM Trigger message delivery to test agent. + @SYMTestStatus Implemented + @SYMTestPriority 1 + @SYMTestActions Send a valid DRM Push Message containing Leave Domain trigger using + the Dummy stack, and see that the CDRMAppHandler and CROAPTContentHandler + are able to correctly parse the message using test agent. + @SYMTestExpectedResults Test agent should parse the message without any error. + @SYMPREQ PREQ GT257-CR763 + @SYMTestType CIT +*/ +void CWapPushDRMMessageTest::LeaveDomainTriggerMessageL() + { + iMsg = KXmlLeaveDomainTriggerMessage().AllocL (); + iHeadersBuf.Delete(0,KBufferSize); + iHeadersBuf.Append(KXmlTriggerMessageHeader, sizeof(KXmlTriggerMessageHeader)); + } + +/* @SYMTestCaseID WP-CIT-BV-0007 + @SYMTestCaseDesc Test the Large DRM push message delivery (WBXML format) to test agent. + @SYMTestStatus Implemented + @SYMTestPriority 1 + @SYMTestActions Send a large WBXML DRM Push Message with CID >128 using the Dummy stack, + and see that the CDRMAppHandler and CROContentHandler are able to correctly + store the Rights Object in the rights.db file using test agent + @SYMTestExpectedResults Test agent should add the large rights to rights.db. + @SYMPREQ PREQ GT257-CR763 + @SYMTestType CIT +*/ +void CWapPushDRMMessageTest::LargeWbXmlROMessageL() + { + iMsg = KLargeWBXmlROMessage().AllocL (); + iHeadersBuf.Delete(0,KBufferSize); + iHeadersBuf.Append(KWbXmlROMessageHeader, sizeof(KWbXmlROMessageHeader)); + } + +/* @SYMTestCaseID WP-CIT-BV-0008 + @SYMTestCaseDesc Test the Large DRM push message delivery (XML format) to test agent. + @SYMTestStatus Implemented + @SYMTestPriority 1 + @SYMTestActions Send a large XML DRM Push Message with CID >128 using the Dummy stack, + and see that the CDRMAppHandler and CROContentHandler are able to correctly + store the Rights Object in the rights.db file using test agent + @SYMTestExpectedResults Test agent should add the large rights to rights.db. + @SYMPREQ PREQ GT257-CR763 + @SYMTestType CIT +*/ +void CWapPushDRMMessageTest::LargeXmlROMessageL() + { + iMsg = KLargeXmlROMessage().AllocL (); + iHeadersBuf.Delete(0,KBufferSize); + iHeadersBuf.Append(KXmlROMessageHeader, sizeof(KXmlROMessageHeader)); + } + +/* @SYMTestCaseID WP-CIT-BI-0009 + @SYMTestCaseDesc Test content handler reports appropriate error if WBXML tag's received + are not found in string table. + @SYMTestStatus Implemented + @SYMTestPriority 1 + @SYMTestActions Send invalid DRM RO Message to test agent in WBXML format using dummy stack. + @SYMTestExpectedResults The ROContentHandler should report KErrCorrupt error. + @SYMPREQ PREQ GT257-CR763 + @SYMTestType CIT +*/ +void CWapPushDRMMessageTest::InvalidWbXmlROMessageL() + { + iMsg = KInvalidWBXmlROMessage().AllocL(); + iHeadersBuf.Delete(0,KBufferSize); + iHeadersBuf.Append(KWbXmlROMessageHeader, sizeof(KWbXmlROMessageHeader)); + } + +/* @SYMTestCaseID WP-CIT-BI-0010 + @SYMTestCaseDesc Test content handler reports appropriate error if the agent cannot + Parse/Validate the XML message. + @SYMTestStatus Implemented + @SYMTestPriority 1 + @SYMTestActions Send invalid DRM RO Message to test agent in XML format using dummy stack. + @SYMTestExpectedResults The ROContentHandler should report KErrCorrupt error. + @SYMPREQ PREQ GT257-CR763 + @SYMTestType CIT +*/ +void CWapPushDRMMessageTest::InvalidXmlROMessageL() + { + iMsg = KInValidXmlROMessage().AllocL (); + iHeadersBuf.Delete(0,KBufferSize); + iHeadersBuf.Append(KXmlROMessageHeader, sizeof(KXmlROMessageHeader)); + } + +/* @SYMTestCaseID WP-CIT-BI-0011 + @SYMTestCaseDesc Test content handler reports appropriate error if the agent cannot + Parse/Validate the XML message. + @SYMTestStatus Implemented + @SYMTestPriority 1 + @SYMTestActions Send invalid DRM Registration Request Trigger Message in XML format + using dummy stack. + @SYMTestExpectedResults The ROAPTContentHandler should report KErrCorrupt error. + @SYMPREQ PREQ GT257-CR763 + @SYMTestType CIT +*/ +void CWapPushDRMMessageTest::InvalidRegRequesttriggerMessageL() + { + iMsg = KInvalidXmlRegReqTriggerMessage().AllocL (); + iHeadersBuf.Delete(0,KBufferSize); + iHeadersBuf.Append(KXmlTriggerMessageHeader, sizeof(KXmlTriggerMessageHeader)); + } + +/* @SYMTestCaseID WP-CIT-BI-0012 + @SYMTestCaseDesc Test content handler reports appropriate error if the agent cannot + Parse/Validate the XML message. + @SYMTestStatus Implemented + @SYMTestPriority 1 + @SYMTestActions Send invalid DRM RO Acquisition Trigger Message in XML format + using dummy stack. + @SYMTestExpectedResults The ROAPTContentHandler should report KErrCorrupt error. + @SYMPREQ PREQ GT257-CR763 + @SYMTestType CIT +*/ +void CWapPushDRMMessageTest::InvalidROAquisationTriggerMessageL() + { + iMsg = KInvalidXmlROAquisationTriggerMessage().AllocL (); + iHeadersBuf.Delete(0,KBufferSize); + iHeadersBuf.Append(KXmlTriggerMessageHeader, sizeof(KXmlTriggerMessageHeader)); + } + +/* @SYMTestCaseID WP-CIT-BI-0013 + @SYMTestCaseDesc Test content handler reports appropriate error if the agent cannot + Parse/Validate the XML message. + @SYMTestStatus Implemented + @SYMTestPriority 1 + @SYMTestActions Send invalid DRM Join Domain Trigger Message in XML format using dummy stack. + @SYMTestExpectedResults The ROAPTContentHandler should report KErrCorrupt error. + @SYMPREQ PREQ GT257-CR763 + @SYMTestType CIT +*/ +void CWapPushDRMMessageTest::InvalidJoinDomaintriggerMessageL() + { + iMsg = KInvalidXmlJoinDomainTriggerMessage().AllocL (); + iHeadersBuf.Delete(0,KBufferSize); + iHeadersBuf.Append(KXmlTriggerMessageHeader, sizeof(KXmlTriggerMessageHeader)); + } + +/* @SYMTestCaseID WP-CIT-BI-0014 + @SYMTestCaseDesc Test content handler reports appropriate error if the agent cannot + Parse/Validate the XML message. + @SYMTestStatus Implemented + @SYMTestPriority 1 + @SYMTestActions Send invalid DRM Leave Domain Trigger Message in XML format using dummy stack. + @SYMTestExpectedResults The ROAPTContentHandler should report KErrCorrupt error. + @SYMPREQ PREQ GT257-CR763 + @SYMTestType CIT +*/ +void CWapPushDRMMessageTest::InvalidLeaveDomainTriggerMessageL() + { + iMsg = KInvalidXmlLeaveDomainTriggerMessage().AllocL (); + iHeadersBuf.Delete(0,KBufferSize); + iHeadersBuf.Append(KXmlTriggerMessageHeader, sizeof(KXmlTriggerMessageHeader)); + } + +TBool CWapPushDRMMessageTest::ConfirmMessagesSavedL() + { + using namespace ContentAccess; + CRightsManager *rightsManager=NULL; + RStreamablePtrArray rights; + //Create the manager object. + CManager *manager = CManager::NewL(); + CleanupStack::PushL(manager); + //Now list out all registered agents + RArray agents; + TRAPD(err, manager->ListAgentsL(agents)); + if(err==KErrNoMemory) + { + User::LeaveNoMemory(); + } + CleanupClosePushL(agents); + if(err==KErrNone && agents.Count()>0) + { + for(TInt cnt=0; cntCreateRightsManagerL(agents[0])); + CleanupStack::PushL(rightsManager); + rightsManager->ListAllRightsL(rights); + TInt rightsCount = rights[0]->RightsType(); + TBuf buf; + if(rightsCount==KTotalRights) + { + buf.Format(KTestPassed,rightsCount,KTotalRights); + WPLPrintf(buf); + } + else + { + buf.Format(KTestFailed,rightsCount,KTotalRights); + WPLPrintf(buf); + } + rights.Close(); + CleanupStack::PopAndDestroy(1); //rightsManager + } + } + } + CleanupStack::PopAndDestroy(2); //agents, manager + return ETrue; + } +