|
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include <push/sislpushmsgutils.h> |
|
17 |
|
18 #include "pushtests.h" |
|
19 #include "dummywapstack.h" |
|
20 #include "wappushmsggen.h" |
|
21 #include <caf/rightsinfo.h> |
|
22 |
|
23 _LIT(KTestAgent, "Reference Test Agent"); |
|
24 _LIT(KTestPassed,"DRM Test passed.Number of rights stored :\t%d expected rights : %d"); |
|
25 _LIT(KTestFailed, "DRM Test failed.Number of rights stored :\t%d expected rights : %d "); |
|
26 |
|
27 _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" ); |
|
28 |
|
29 //The rights element attribute is invalid. |
|
30 _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" ); |
|
31 |
|
32 //Xml RO Response message with Rights Object. |
|
33 _LIT8 ( KXmlROMessage, "<roap:roResponse xmlns:roap=\"urn:oma:bac:dldrm:roap-1.0\" status=\"Success\"><deviceId><keyIdentifier xsi:type=\"roap:X509SPKIHash\"><hash>vXENc+Um/9/NvmYKiHDLaErK0gk=</hash></keyIdentifier></deviceId><riID><keyIdentifier xsi:type=\"roap:X509SPKIHash\"><hash>vXENc+Um/9/NvmYKiHDLaErK0gk=</hash></keyIdentifier></riID><nonce>32efd34de39sdwefqwer</nonce><roap:protectedRO><roap:ro id=\"n8yu98hy0e2109eu09ewf09u\" stateful=\"true\" version=\"1.0\"><o-ex:rights o-ex=\"http://odrl.net/1.1/ODRL-EX\" o-dd=\"http://odrl.net/1.1/ODRL-DD\" ds=\"http://www.w3.org/2000/09/xmldsig#/\"><o-ex:context><o-dd:version>1.0</o-dd:version></o-ex:context><o-ex:agreement><o-ex:asset><o-ex:context><o-dd:uid>cid:4567829547@foo.com</o-dd:uid></o-ex:context><ds:KeyInfo><ds:KeyValue>vUEwR8LzEJoeiC+dgT1mgg==</ds:KeyValue></ds:KeyInfo></o-ex:asset><o-ex:permission><o-dd:play/></o-ex:permission></o-ex:agreement></o-ex:rights></roap:ro></roap:protectedRO><signature>d93e5fue3susdskjhkjedkjrewh53209efoihfdse10ue2109ue1</signature></roap:roResponse>"); |
|
34 |
|
35 //</o-ex:context> is not present in the message after </uid> |
|
36 _LIT8 ( KInValidXmlROMessage, "<roap:roResponse xmlns:roap=\"urn:oma:bac:dldrm:roap-1.0\" status=\"Success\"><deviceId><keyIdentifier xsi:type=\"roap:X509SPKIHash\"><hash>vXENc+Um/9/NvmYKiHDLaErK0gk=</hash></keyIdentifier></deviceId><riID><keyIdentifier xsi:type=\"roap:X509SPKIHash\"><hash>vXENc+Um/9/NvmYKiHDLaErK0gk=</hash></keyIdentifier></riID><nonce>32efd34de39sdwefqwer</nonce><roap:protectedRO><roap:ro id=\"n8yu98hy0e2109eu09ewf09u\" stateful=\"true\" version=\"1.0\"><o-ex:rights o-ex=\"http://odrl.net/1.1/ODRL-EX\" o-dd=\"http://odrl.net/1.1/ODRL-DD\" ds=\"http://www.w3.org/2000/09/xmldsig#/\"><o-ex:context><o-dd:version>1.0</o-dd:version></o-ex:context><o-ex:agreement><o-ex:asset><o-ex:context><o-dd:uid>cid:4567829547@foo.com</o-dd:uid><ds:KeyInfo><ds:KeyValue>vUEwR8LzEJoeiC+dgT1mgg==</ds:KeyValue></ds:KeyInfo></o-ex:asset><o-ex:permission><o-dd:play/></o-ex:permission></o-ex:agreement></o-ex:rights></roap:ro></roap:protectedRO><signature>d93e5fue3susdskjhkjedkjrewh53209efoihfdse10ue2109ue1</signature></roap:roResponse>" ); |
|
37 |
|
38 //Trigger message for registration request. |
|
39 _LIT8 ( KXmlRegReqTriggerMessage, "<roap:roapTrigger xmlns:roap=\"urn:oma:bac:dldrm:roap-1.0\" version=\"1.0\"><registrationRequest id=\"id1\"><riID><keyIdentifier xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\" xsi:type=\"roap:X509SPKIHash\"><hash>I94/ovDhizE5m/K6t5f1holSdLM=</hash></keyIdentifier></riID><riAlias>CoreMedia IOPServer</riAlias><nonce>FL2MM70k5OthJZrMte6r</nonce><roapURL>http://192.116.217.184:8080/iop-server/roap.cm;jsessionid=88C45AEB82C2755A641526A19B9050A7</roapURL></registrationRequest></roap:roapTrigger>"); |
|
40 |
|
41 //Trigger message for RO Aquisation. |
|
42 _LIT8 ( KXmlROAquisationTriggerMessage, "<roap:roapTrigger xmlns:roap=\"urn:oma:bac:dldrm:roap-1.0\" version=\"1.0\"><roAcquisition id=\"id1\"><riID><keyIdentifier xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\" xsi:type=\"roap:X509SPKIHash\"><hash>I94/ovDhizE5m/K6t5f1holSdLM=</hash></keyIdentifier></riID><riAlias>CoreMedia IOP Test Server</riAlias><nonce>g5VsnV4L7qZzBMnH0idD</nonce><roapURL>http://192.116.217.184:8080/iop-server/roap.cm</roapURL><roID>offer6165.1.PphdCI0gysdL58zb_mid</roID><contentID>cid:cid6165_mid</contentID></roAcquisition></roap:roapTrigger>"); |
|
43 |
|
44 //Trigger message for Join Domain. |
|
45 _LIT8 ( KXmlJoinDomainTriggerMessage, "<roap:roapTrigger xmlns:roap=\"urn:oma:bac:dldrm:roap-1.0\" xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" version=\"1.0\"><joinDomain id=\"de32r23r4\"><riID><keyIdentifier xsi:type=\"roap:X509SPKIHash\"><hash>aXENc+Um/9/NvmYKiHDLaErK0fk=</hash></keyIdentifier></riID><nonce>sdfknjvfda438790fdjkl4rq</nonce><roapURL>http://ri.example.com/ro.cgi?tid=qw683hgew7d</roapURL><domainID>Domain-XYZ-001</domainID></joinDomain><signature>SomeSignature</signature></roap:roapTrigger>"); |
|
46 |
|
47 //Trigger message for Leave Domain. |
|
48 _LIT8 ( KXmlLeaveDomainTriggerMessage, "<roap:roapTrigger xmlns:roap=\"urn:oma:bac:dldrm:roap-1.0\" xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" version=\"1.0\"><leaveDomain id=\"de32r23r4\"><riID><keyIdentifier xsi:type=\"roap:X509SPKIHash\"><hash>aXENc+Um/9/NvmYKiHDLaErK0fk=</hash></keyIdentifier></riID><nonce>sdfknjvfda438790fdjkl4rq</nonce><roapURL>http://ri.example.com/ro.cgi?tid=qw683hgew7d</roapURL><domainID>Domain-XYZ-001</domainID></leaveDomain><signature>SomeSignature</signature></roap:roapTrigger>"); |
|
49 |
|
50 //Invalid Trigger message for registration request. </hash> is absent. |
|
51 _LIT8 ( KInvalidXmlRegReqTriggerMessage, "<roap:roapTrigger xmlns:roap=\"urn:oma:bac:dldrm:roap-1.0\" version=\"1.0\"><registrationRequest id=\"id1\"><riID><keyIdentifier xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\" xsi:type=\"roap:X509SPKIHash\"><hash>I94/ovDhizE5m/K6t5f1holSdLM=</keyIdentifier></riID><riAlias>CoreMedia IOPServer</riAlias><nonce>FL2MM70k5OthJZrMte6r</nonce><roapURL>http://192.116.217.184:8080/iop-server/roap.cm;jsessionid=88C45AEB82C2755A641526A19B9050A7</roapURL></registrationRequest></roap:roapTrigger>"); |
|
52 |
|
53 //Invalid Trigger message for RO Aquisation. </hash> is called after </KeyIdentifier>. |
|
54 _LIT8 ( KInvalidXmlROAquisationTriggerMessage, "<roap:roapTrigger xmlns:roap=\"urn:oma:bac:dldrm:roap-1.0\" version=\"1.0\"><roAcquisition id=\"id1\"><riID><keyIdentifier xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\" xsi:type=\"roap:X509SPKIHash\"><hash>I94/ovDhizE5m/K6t5f1holSdLM=</keyIdentifier></hash></riID><riAlias>CoreMedia IOP Test Server</riAlias><nonce>g5VsnV4L7qZzBMnH0idD</nonce><roapURL>http://192.116.217.184:8080/iop-server/roap.cm</roapURL><roID>offer6165.1.PphdCI0gysdL58zb_mid</roID><contentID>cid:cid6165_mid</contentID></roAcquisition></roap:roapTrigger>"); |
|
55 |
|
56 //Invalid Trigger message for Join Domain. </riID> is Absent. |
|
57 _LIT8 ( KInvalidXmlJoinDomainTriggerMessage, "<roap:roapTrigger xmlns:roap=\"urn:oma:bac:dldrm:roap-1.0\" xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" version=\"1.0\"><joinDomain id=\"de32r23r4\"><riID><keyIdentifier xsi:type=\"roap:X509SPKIHash\"><hash>aXENc+Um/9/NvmYKiHDLaErK0fk=</hash></keyIdentifier><nonce>sdfknjvfda438790fdjkl4rq</nonce><roapURL>http://ri.example.com/ro.cgi?tid=qw683hgew7d</roapURL><domainID>Domain-XYZ-001</domainID></joinDomain><signature>SomeSignature</signature></roap:roapTrigger>"); |
|
58 |
|
59 //Invalid Trigger message for Leave Domain.</leaveDomain> is absent. |
|
60 _LIT8 ( KInvalidXmlLeaveDomainTriggerMessage, "<roap:roapTrigger xmlns:roap=\"urn:oma:bac:dldrm:roap-1.0\" xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" version=\"1.0\"><leaveDomain id=\"de32r23r4\"><riID><keyIdentifier xsi:type=\"roap:X509SPKIHash\"><hash>aXENc+Um/9/NvmYKiHDLaErK0fk=</hash></keyIdentifier></riID><nonce>sdfknjvfda438790fdjkl4rq</nonce><roapURL>http://ri.example.com/ro.cgi?tid=qw683hgew7d</roapURL><domainID>Domain-XYZ-001</domainID><signature>SomeSignature</signature></roap:roapTrigger>"); |
|
61 |
|
62 //The CID of this message is more than 128 characters. |
|
63 _LIT8 ( KLargeXmlROMessage, "<roap:roResponse xmlns:roap=\"urn:oma:bac:dldrm:roap-1.0\" status=\"Success\"><deviceId><keyIdentifier xsi:type=\"roap:X509SPKIHash\"><hash>vXENc+Um/9/NvmYKiHDLaErK0gk=</hash></keyIdentifier></deviceId><riID><keyIdentifier xsi:type=\"roap:X509SPKIHash\"><hash>vXENc+Um/9/NvmYKiHDLaErK0gk=</hash></keyIdentifier></riID><nonce>32efd34de39sdwefqwer</nonce><roap:protectedRO><roap:ro id=\"n8yu98hy0e2109eu09ewf09u\" stateful=\"true\" version=\"1.0\"><o-ex:rights o-ex=\"http://odrl.net/1.1/ODRL-EX\" o-dd=\"http://odrl.net/1.1/ODRL-DD\" ds=\"http://www.w3.org/2000/09/xmldsig#/\"><o-ex:context><o-dd:version>1.0</o-dd:version></o-ex:context><o-ex:agreement><o-ex:asset><o-ex:context><o-dd:uid>cid:TheMissionOfTheOpenMobileAllianceIsToFacilitateGlobalUserAdoptionOfMobileDataServicesBySpecifyingMarketDrivenMobileServiceEnablersThatEnsureServiceInteroperabilityAcrossDevicesGeographiesServiceProvidersOperatorsAndNetwork</o-dd:uid></o-ex:context><ds:KeyInfo><ds:KeyValue>vUEwR8LzEJoeiC+dgT1mgg==</ds:KeyValue></ds:KeyInfo></o-ex:asset><o-ex:permission><o-dd:play/></o-ex:permission></o-ex:agreement></o-ex:rights></roap:ro></roap:protectedRO><signature>d93e5fue3susdskjhkjedkjrewh53209efoihfdse10ue2109ue1</signature></roap:roResponse>" ); |
|
64 |
|
65 //The CID of this message is more than 128 characters. |
|
66 _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" ); |
|
67 |
|
68 const TInt KTotalRights=4; //Change it when rights written to rights.db changes from the test code. |
|
69 const TUint8 KWbXmlROMessageHeader[] = |
|
70 { |
|
71 0xCB, //Content type "application/vnd.oma.drm.rights+wbxml" |
|
72 0xAF, //X-Wap-Application-ID |
|
73 0x88 // App type x-wap-application:drm.ua //0x08 |
|
74 }; |
|
75 |
|
76 const TUint8 KXmlROMessageHeader[] = |
|
77 { |
|
78 0xCA, //Content type "application/vnd.oma.drm.rights+xml" |
|
79 0xAF, //X-Wap-Application-ID |
|
80 0x88 // App type x-wap-application:drm.ua //0x08 |
|
81 }; |
|
82 |
|
83 //Commented as WbXml trigger messages are not supported currently. |
|
84 /*const TUint8 KWbXmlTriggerMessageHeader[] = |
|
85 { |
|
86 0xCD, //application/vnd.oma.drm.roap-trigger+wbxml" |
|
87 0xAF, //X-Wap-Application-ID |
|
88 0x88 // App type x-wap-application:drm.ua //0x08 |
|
89 };*/ |
|
90 |
|
91 const TUint8 KXmlTriggerMessageHeader[] = |
|
92 { |
|
93 0xCC, //Content type "application/vnd.oma.drm.roap-trigger+xml" |
|
94 0xAF, //X-Wap-Application-ID |
|
95 0x88 // App type x-wap-application:drm.ua //0x08 |
|
96 }; |
|
97 |
|
98 /** set the test name for this test case |
|
99 @param void |
|
100 @return string |
|
101 returns test name |
|
102 */ |
|
103 const TDesC& CWapPushDRMMessageTest::TestName() |
|
104 { |
|
105 _LIT(KTextDRMMessageTest,"DRM Test"); |
|
106 return KTextDRMMessageTest; |
|
107 } |
|
108 |
|
109 /** specify the number of test messages to use */ |
|
110 void CWapPushDRMMessageTest::NumberTestCasesToRun() |
|
111 { |
|
112 iNumberOfTestCases = 14; |
|
113 } |
|
114 |
|
115 |
|
116 /** create test messages to use where aTestCase represents the |
|
117 message index for multiple messages. |
|
118 |
|
119 @param aTestCase message index value for selecting a test message |
|
120 @return void |
|
121 */ |
|
122 void CWapPushDRMMessageTest::PrepareTestMessageL(TInt aTestCase) |
|
123 { |
|
124 // create hardcoded DRM test message. |
|
125 iMsg = NULL; |
|
126 switch ( aTestCase ) |
|
127 { |
|
128 case 0 : |
|
129 //Pass WBXml RO message. |
|
130 WbXmlROMessageL(); |
|
131 break; |
|
132 case 1: |
|
133 //Pass invalid WBXML RO message |
|
134 InvalidWbXmlROMessageL(); |
|
135 break; |
|
136 case 2 : |
|
137 //Pass XML RO message. |
|
138 XmlROMessageL(); |
|
139 break; |
|
140 case 3 : |
|
141 //Pass invalid XML RO message. |
|
142 InvalidXmlROMessageL(); |
|
143 break; |
|
144 case 4: |
|
145 //Pass XML Registration request Trigger message. |
|
146 RegRequesttriggerMessageL(); |
|
147 break; |
|
148 case 5: |
|
149 //Pass XML RO Aquisation Trigger message. |
|
150 ROAquisationTriggerMessageL(); |
|
151 break; |
|
152 case 6: |
|
153 //Pass XML Join Domain Trigger message. |
|
154 JoinDomaintriggerMessageL(); |
|
155 break; |
|
156 case 7: |
|
157 //Pass XML Leave Domain Trigger message. |
|
158 LeaveDomainTriggerMessageL(); |
|
159 break; |
|
160 case 8: |
|
161 //Pass invalid XML Registration Request Trigger message. |
|
162 InvalidRegRequesttriggerMessageL(); |
|
163 break; |
|
164 case 9 : |
|
165 //Pass invalid XML RO Aquisation Trigger message. |
|
166 InvalidROAquisationTriggerMessageL(); |
|
167 break; |
|
168 case 10 : |
|
169 //Pass invalid XML Join Domain Trigger message. |
|
170 InvalidJoinDomaintriggerMessageL(); |
|
171 break; |
|
172 case 11 : |
|
173 //Pass invalid XML Leave Domain Trigger message. |
|
174 InvalidLeaveDomainTriggerMessageL(); |
|
175 break; |
|
176 case 12 : |
|
177 //Pass Large XML RO message. Cid>128 |
|
178 LargeXmlROMessageL(); |
|
179 break; |
|
180 case 13: |
|
181 //Pass Large WBXML RO message. Cid>128 |
|
182 LargeWbXmlROMessageL(); |
|
183 break; |
|
184 default : |
|
185 return; |
|
186 } |
|
187 |
|
188 // copy data to iBodyBuf |
|
189 iBodyBuf.Delete(0,KBufferSize); |
|
190 iBodyBuf = iMsg->Des(); |
|
191 delete iMsg; |
|
192 } |
|
193 |
|
194 /* @SYMTestCaseID WP-CIT-BV-0001 |
|
195 @SYMTestCaseDesc Test the DRM ROAP ROResponse push message delivery (XML format) |
|
196 to test agent. |
|
197 @SYMTestStatus Implemented |
|
198 @SYMTestPriority 1 |
|
199 @SYMTestActions Send a XML Push Message using the Dummy stack, and see that |
|
200 the CDRMAppHandler and CROContentHandler are able to correctly store |
|
201 the Rights in rights.db using test agent. |
|
202 @SYMTestExpectedResults Test agent should write the rights data to rights.db. |
|
203 @SYMPREQ PREQ GT257-CR763 |
|
204 @SYMTestType CIT |
|
205 */ |
|
206 void CWapPushDRMMessageTest::XmlROMessageL() |
|
207 { |
|
208 iMsg = KXmlROMessage().AllocL (); |
|
209 iHeadersBuf.Delete(0,KBufferSize); |
|
210 iHeadersBuf.Append(KXmlROMessageHeader, sizeof(KXmlROMessageHeader)); |
|
211 } |
|
212 |
|
213 /* @SYMTestCaseID WP-CIT-BV-0002 |
|
214 @SYMTestCaseDesc Test the DRM push message delivery (WBXML format) to test agent. |
|
215 @SYMTestStatus Implemented |
|
216 @SYMTestPriority 1 |
|
217 @SYMTestActions Send a WBXML DRM Push Message using the Dummy stack, and see that |
|
218 the CDRMAppHandler and CROContentHandler are able to correctly store |
|
219 the Rights in rights.db using test agent. |
|
220 @SYMTestExpectedResults Test agent should add the rights to rights.db. |
|
221 @SYMPREQ PREQ GT257-CR763 |
|
222 @SYMTestType CIT |
|
223 */ |
|
224 void CWapPushDRMMessageTest::WbXmlROMessageL() |
|
225 { |
|
226 iMsg = KWBXmlROMessage().AllocL (); |
|
227 iHeadersBuf.Delete(0,KBufferSize); |
|
228 iHeadersBuf.Append(KWbXmlROMessageHeader, sizeof(KWbXmlROMessageHeader)); |
|
229 } |
|
230 |
|
231 /* @SYMTestCaseID WP-CIT-BV-0003 |
|
232 @SYMTestCaseDesc Test the DRM Trigger message delivery to test agent. |
|
233 @SYMTestStatus Implemented |
|
234 @SYMTestPriority 1 |
|
235 @SYMTestActions Send a valid DRM Push Message containing Registration Request trigger |
|
236 using the Dummy stack, and see that the CDRMAppHandler and |
|
237 CROAPTContentHandler are able to correctly parse the message using test agent. |
|
238 @SYMTestExpectedResults Test agent should parse the message without any error. |
|
239 @SYMPREQ PREQ GT257-CR763 |
|
240 @SYMTestType CIT |
|
241 */ |
|
242 void CWapPushDRMMessageTest::RegRequesttriggerMessageL() |
|
243 { |
|
244 iMsg = KXmlRegReqTriggerMessage().AllocL (); |
|
245 iHeadersBuf.Delete(0,KBufferSize); |
|
246 iHeadersBuf.Append(KXmlTriggerMessageHeader, sizeof(KXmlTriggerMessageHeader)); |
|
247 } |
|
248 |
|
249 /* @SYMTestCaseID WP-CIT-BV-0004 |
|
250 @SYMTestCaseDesc Test the DRM Trigger message delivery to test agent. |
|
251 @SYMTestStatus Implemented |
|
252 @SYMTestPriority 1 |
|
253 @SYMTestActions Send a valid DRM Push Message containing RO acquisition trigger |
|
254 using the Dummy stack, and see that the CDRMAppHandler and |
|
255 CROAPTContentHandler are able to correctly parse the message using test agent. |
|
256 @SYMTestExpectedResults Test agent should parse the message without any error. |
|
257 @SYMPREQ PREQ GT257-CR763 |
|
258 @SYMTestType CIT |
|
259 */ |
|
260 void CWapPushDRMMessageTest::ROAquisationTriggerMessageL() |
|
261 { |
|
262 iMsg = KXmlROAquisationTriggerMessage().AllocL (); |
|
263 iHeadersBuf.Delete(0,KBufferSize); |
|
264 iHeadersBuf.Append(KXmlTriggerMessageHeader, sizeof(KXmlTriggerMessageHeader)); |
|
265 } |
|
266 |
|
267 /* @SYMTestCaseID WP-CIT-BV-0005 |
|
268 @SYMTestCaseDesc Test the DRM Trigger message delivery to test agent. |
|
269 @SYMTestStatus Implemented |
|
270 @SYMTestPriority 1 |
|
271 @SYMTestActions Send a valid DRM Push Message containing Join Domain trigger using |
|
272 the Dummy stack, and see that the CDRMAppHandler and CROAPTContentHandler |
|
273 are able to correctly parse the message using test agent. |
|
274 @SYMTestExpectedResults Test agent should parse the message without any error. |
|
275 @SYMPREQ PREQ GT257-CR763 |
|
276 @SYMTestType CIT |
|
277 */ |
|
278 void CWapPushDRMMessageTest::JoinDomaintriggerMessageL() |
|
279 { |
|
280 iMsg = KXmlJoinDomainTriggerMessage().AllocL (); |
|
281 iHeadersBuf.Delete(0,KBufferSize); |
|
282 iHeadersBuf.Append(KXmlTriggerMessageHeader, sizeof(KXmlTriggerMessageHeader)); |
|
283 } |
|
284 |
|
285 /* @SYMTestCaseID WP-CIT-BV-0006 |
|
286 @SYMTestCaseDesc Test the DRM Trigger message delivery to test agent. |
|
287 @SYMTestStatus Implemented |
|
288 @SYMTestPriority 1 |
|
289 @SYMTestActions Send a valid DRM Push Message containing Leave Domain trigger using |
|
290 the Dummy stack, and see that the CDRMAppHandler and CROAPTContentHandler |
|
291 are able to correctly parse the message using test agent. |
|
292 @SYMTestExpectedResults Test agent should parse the message without any error. |
|
293 @SYMPREQ PREQ GT257-CR763 |
|
294 @SYMTestType CIT |
|
295 */ |
|
296 void CWapPushDRMMessageTest::LeaveDomainTriggerMessageL() |
|
297 { |
|
298 iMsg = KXmlLeaveDomainTriggerMessage().AllocL (); |
|
299 iHeadersBuf.Delete(0,KBufferSize); |
|
300 iHeadersBuf.Append(KXmlTriggerMessageHeader, sizeof(KXmlTriggerMessageHeader)); |
|
301 } |
|
302 |
|
303 /* @SYMTestCaseID WP-CIT-BV-0007 |
|
304 @SYMTestCaseDesc Test the Large DRM push message delivery (WBXML format) to test agent. |
|
305 @SYMTestStatus Implemented |
|
306 @SYMTestPriority 1 |
|
307 @SYMTestActions Send a large WBXML DRM Push Message with CID >128 using the Dummy stack, |
|
308 and see that the CDRMAppHandler and CROContentHandler are able to correctly |
|
309 store the Rights Object in the rights.db file using test agent |
|
310 @SYMTestExpectedResults Test agent should add the large rights to rights.db. |
|
311 @SYMPREQ PREQ GT257-CR763 |
|
312 @SYMTestType CIT |
|
313 */ |
|
314 void CWapPushDRMMessageTest::LargeWbXmlROMessageL() |
|
315 { |
|
316 iMsg = KLargeWBXmlROMessage().AllocL (); |
|
317 iHeadersBuf.Delete(0,KBufferSize); |
|
318 iHeadersBuf.Append(KWbXmlROMessageHeader, sizeof(KWbXmlROMessageHeader)); |
|
319 } |
|
320 |
|
321 /* @SYMTestCaseID WP-CIT-BV-0008 |
|
322 @SYMTestCaseDesc Test the Large DRM push message delivery (XML format) to test agent. |
|
323 @SYMTestStatus Implemented |
|
324 @SYMTestPriority 1 |
|
325 @SYMTestActions Send a large XML DRM Push Message with CID >128 using the Dummy stack, |
|
326 and see that the CDRMAppHandler and CROContentHandler are able to correctly |
|
327 store the Rights Object in the rights.db file using test agent |
|
328 @SYMTestExpectedResults Test agent should add the large rights to rights.db. |
|
329 @SYMPREQ PREQ GT257-CR763 |
|
330 @SYMTestType CIT |
|
331 */ |
|
332 void CWapPushDRMMessageTest::LargeXmlROMessageL() |
|
333 { |
|
334 iMsg = KLargeXmlROMessage().AllocL (); |
|
335 iHeadersBuf.Delete(0,KBufferSize); |
|
336 iHeadersBuf.Append(KXmlROMessageHeader, sizeof(KXmlROMessageHeader)); |
|
337 } |
|
338 |
|
339 /* @SYMTestCaseID WP-CIT-BI-0009 |
|
340 @SYMTestCaseDesc Test content handler reports appropriate error if WBXML tag's received |
|
341 are not found in string table. |
|
342 @SYMTestStatus Implemented |
|
343 @SYMTestPriority 1 |
|
344 @SYMTestActions Send invalid DRM RO Message to test agent in WBXML format using dummy stack. |
|
345 @SYMTestExpectedResults The ROContentHandler should report KErrCorrupt error. |
|
346 @SYMPREQ PREQ GT257-CR763 |
|
347 @SYMTestType CIT |
|
348 */ |
|
349 void CWapPushDRMMessageTest::InvalidWbXmlROMessageL() |
|
350 { |
|
351 iMsg = KInvalidWBXmlROMessage().AllocL(); |
|
352 iHeadersBuf.Delete(0,KBufferSize); |
|
353 iHeadersBuf.Append(KWbXmlROMessageHeader, sizeof(KWbXmlROMessageHeader)); |
|
354 } |
|
355 |
|
356 /* @SYMTestCaseID WP-CIT-BI-0010 |
|
357 @SYMTestCaseDesc Test content handler reports appropriate error if the agent cannot |
|
358 Parse/Validate the XML message. |
|
359 @SYMTestStatus Implemented |
|
360 @SYMTestPriority 1 |
|
361 @SYMTestActions Send invalid DRM RO Message to test agent in XML format using dummy stack. |
|
362 @SYMTestExpectedResults The ROContentHandler should report KErrCorrupt error. |
|
363 @SYMPREQ PREQ GT257-CR763 |
|
364 @SYMTestType CIT |
|
365 */ |
|
366 void CWapPushDRMMessageTest::InvalidXmlROMessageL() |
|
367 { |
|
368 iMsg = KInValidXmlROMessage().AllocL (); |
|
369 iHeadersBuf.Delete(0,KBufferSize); |
|
370 iHeadersBuf.Append(KXmlROMessageHeader, sizeof(KXmlROMessageHeader)); |
|
371 } |
|
372 |
|
373 /* @SYMTestCaseID WP-CIT-BI-0011 |
|
374 @SYMTestCaseDesc Test content handler reports appropriate error if the agent cannot |
|
375 Parse/Validate the XML message. |
|
376 @SYMTestStatus Implemented |
|
377 @SYMTestPriority 1 |
|
378 @SYMTestActions Send invalid DRM Registration Request Trigger Message in XML format |
|
379 using dummy stack. |
|
380 @SYMTestExpectedResults The ROAPTContentHandler should report KErrCorrupt error. |
|
381 @SYMPREQ PREQ GT257-CR763 |
|
382 @SYMTestType CIT |
|
383 */ |
|
384 void CWapPushDRMMessageTest::InvalidRegRequesttriggerMessageL() |
|
385 { |
|
386 iMsg = KInvalidXmlRegReqTriggerMessage().AllocL (); |
|
387 iHeadersBuf.Delete(0,KBufferSize); |
|
388 iHeadersBuf.Append(KXmlTriggerMessageHeader, sizeof(KXmlTriggerMessageHeader)); |
|
389 } |
|
390 |
|
391 /* @SYMTestCaseID WP-CIT-BI-0012 |
|
392 @SYMTestCaseDesc Test content handler reports appropriate error if the agent cannot |
|
393 Parse/Validate the XML message. |
|
394 @SYMTestStatus Implemented |
|
395 @SYMTestPriority 1 |
|
396 @SYMTestActions Send invalid DRM RO Acquisition Trigger Message in XML format |
|
397 using dummy stack. |
|
398 @SYMTestExpectedResults The ROAPTContentHandler should report KErrCorrupt error. |
|
399 @SYMPREQ PREQ GT257-CR763 |
|
400 @SYMTestType CIT |
|
401 */ |
|
402 void CWapPushDRMMessageTest::InvalidROAquisationTriggerMessageL() |
|
403 { |
|
404 iMsg = KInvalidXmlROAquisationTriggerMessage().AllocL (); |
|
405 iHeadersBuf.Delete(0,KBufferSize); |
|
406 iHeadersBuf.Append(KXmlTriggerMessageHeader, sizeof(KXmlTriggerMessageHeader)); |
|
407 } |
|
408 |
|
409 /* @SYMTestCaseID WP-CIT-BI-0013 |
|
410 @SYMTestCaseDesc Test content handler reports appropriate error if the agent cannot |
|
411 Parse/Validate the XML message. |
|
412 @SYMTestStatus Implemented |
|
413 @SYMTestPriority 1 |
|
414 @SYMTestActions Send invalid DRM Join Domain Trigger Message in XML format using dummy stack. |
|
415 @SYMTestExpectedResults The ROAPTContentHandler should report KErrCorrupt error. |
|
416 @SYMPREQ PREQ GT257-CR763 |
|
417 @SYMTestType CIT |
|
418 */ |
|
419 void CWapPushDRMMessageTest::InvalidJoinDomaintriggerMessageL() |
|
420 { |
|
421 iMsg = KInvalidXmlJoinDomainTriggerMessage().AllocL (); |
|
422 iHeadersBuf.Delete(0,KBufferSize); |
|
423 iHeadersBuf.Append(KXmlTriggerMessageHeader, sizeof(KXmlTriggerMessageHeader)); |
|
424 } |
|
425 |
|
426 /* @SYMTestCaseID WP-CIT-BI-0014 |
|
427 @SYMTestCaseDesc Test content handler reports appropriate error if the agent cannot |
|
428 Parse/Validate the XML message. |
|
429 @SYMTestStatus Implemented |
|
430 @SYMTestPriority 1 |
|
431 @SYMTestActions Send invalid DRM Leave Domain Trigger Message in XML format using dummy stack. |
|
432 @SYMTestExpectedResults The ROAPTContentHandler should report KErrCorrupt error. |
|
433 @SYMPREQ PREQ GT257-CR763 |
|
434 @SYMTestType CIT |
|
435 */ |
|
436 void CWapPushDRMMessageTest::InvalidLeaveDomainTriggerMessageL() |
|
437 { |
|
438 iMsg = KInvalidXmlLeaveDomainTriggerMessage().AllocL (); |
|
439 iHeadersBuf.Delete(0,KBufferSize); |
|
440 iHeadersBuf.Append(KXmlTriggerMessageHeader, sizeof(KXmlTriggerMessageHeader)); |
|
441 } |
|
442 |
|
443 TBool CWapPushDRMMessageTest::ConfirmMessagesSavedL() |
|
444 { |
|
445 using namespace ContentAccess; |
|
446 CRightsManager *rightsManager=NULL; |
|
447 RStreamablePtrArray <CRightsInfo> rights; |
|
448 //Create the manager object. |
|
449 CManager *manager = CManager::NewL(); |
|
450 CleanupStack::PushL(manager); |
|
451 //Now list out all registered agents |
|
452 RArray <TAgent> agents; |
|
453 TRAPD(err, manager->ListAgentsL(agents)); |
|
454 if(err==KErrNoMemory) |
|
455 { |
|
456 User::LeaveNoMemory(); |
|
457 } |
|
458 CleanupClosePushL(agents); |
|
459 if(err==KErrNone && agents.Count()>0) |
|
460 { |
|
461 for(TInt cnt=0; cnt<agents.Count(); cnt++) |
|
462 { |
|
463 if(agents[cnt].Name().CompareF(KTestAgent)==0) |
|
464 { |
|
465 TRAP(err, rightsManager = manager->CreateRightsManagerL(agents[0])); |
|
466 CleanupStack::PushL(rightsManager); |
|
467 rightsManager->ListAllRightsL(rights); |
|
468 TInt rightsCount = rights[0]->RightsType(); |
|
469 TBuf<KPushLogBuffer> buf; |
|
470 if(rightsCount==KTotalRights) |
|
471 { |
|
472 buf.Format(KTestPassed,rightsCount,KTotalRights); |
|
473 WPLPrintf(buf); |
|
474 } |
|
475 else |
|
476 { |
|
477 buf.Format(KTestFailed,rightsCount,KTotalRights); |
|
478 WPLPrintf(buf); |
|
479 } |
|
480 rights.Close(); |
|
481 CleanupStack::PopAndDestroy(1); //rightsManager |
|
482 } |
|
483 } |
|
484 } |
|
485 CleanupStack::PopAndDestroy(2); //agents, manager |
|
486 return ETrue; |
|
487 } |
|
488 |