]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
e09fb1903963210cec198b5400645085c45378d4
[tmp/jakarta-migration.git] /
1 /**
2  * This document is a part of the source code and related artifacts
3  * for CollectionSpace, an open source collections management system
4  * for museums and related institutions:
5  *
6  * http://www.collectionspace.org
7  * http://wiki.collectionspace.org
8  *
9  * Copyright © 2009 Regents of the University of California
10  *
11  * Licensed under the Educational Community License (ECL), Version 2.0.
12  * You may not use this file except in compliance with this License.
13  *
14  * You may obtain a copy of the ECL 2.0 License at
15  * https://source.collectionspace.org/collection-space/LICENSE.txt
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  */
23 package org.collectionspace.services.client.test;
24
25 import java.util.ArrayList;
26 import java.util.List;
27 import javax.ws.rs.core.MediaType;
28 import javax.ws.rs.core.Response;
29
30 import org.collectionspace.services.client.CollectionSpaceClient;
31 import org.collectionspace.services.client.PayloadInputPart;
32 import org.collectionspace.services.client.PayloadOutputPart;
33 import org.collectionspace.services.client.PoxPayloadIn;
34 import org.collectionspace.services.client.PoxPayloadOut;
35 import org.collectionspace.services.client.ReportClient;
36 import org.collectionspace.services.common.AbstractCommonListUtils;
37 import org.collectionspace.services.report.ReportsCommon;
38 import org.collectionspace.services.jaxb.AbstractCommonList;
39
40 import org.jboss.resteasy.client.ClientResponse;
41 import org.testng.Assert;
42 //import org.testng.annotations.AfterClass;
43 import org.testng.annotations.Test;
44
45 import org.slf4j.Logger;
46 import org.slf4j.LoggerFactory;
47
48 /**
49  * FIXME: http://issues.collectionspace.org/browse/CSPACE-1685
50  * ReportServiceTest, carries out tests against a
51  * deployed and running Report Service.
52  *
53  * $LastChangedRevision: 2261 $
54  * $LastChangedDate: 2010-05-28 16:52:22 -0700 (Fri, 28 May 2010) $
55  */
56 public class ReportServiceTest extends AbstractServiceTestImpl {
57
58     /** The logger. */
59     private final String CLASS_NAME = ReportServiceTest.class.getName();
60     private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
61     final String SERVICE_NAME = "reports";
62     final String SERVICE_PATH_COMPONENT = "reports";
63     // Instance variables specific to this test.
64     /** The known resource id. */
65     private String knownResourceId = null;
66     
67     private String testDocType = "Acquisition";
68
69     /* (non-Javadoc)
70      * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
71      */
72     @Override
73     protected CollectionSpaceClient getClientInstance() {
74         return new ReportClient();
75     }
76
77 //    @Override
78 //    protected PoxPayloadOut createInstance(String identifier) {
79 //        PoxPayloadOut multipart = createReportInstance(identifier);
80 //        return multipart;
81 //    }
82         
83     // ---------------------------------------------------------------
84     // CRUD tests : CREATE tests
85     // ---------------------------------------------------------------
86     // Success outcomes
87     /* (non-Javadoc)
88      * @see org.collectionspace.services.client.test.ServiceTest#create(java.lang.String)
89      */
90     @Override
91     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
92     public void create(String testName) throws Exception {
93
94         if (logger.isDebugEnabled()) {
95             logger.debug(testBanner(testName, CLASS_NAME));
96         }
97         // Perform setup, such as initializing the type of service request
98         // (e.g. CREATE, DELETE), its valid and expected status codes, and
99         // its associated HTTP method name (e.g. POST, DELETE).
100         setupCreate();
101
102         // Submit the request to the service and store the response.
103         ReportClient client = new ReportClient();
104         String identifier = createIdentifier();
105         PoxPayloadOut multipart = createReportInstance(identifier);
106         ClientResponse<Response> res = client.create(multipart);
107
108         // Check the status code of the response: does it match
109         // the expected response(s)?
110         //
111         // Specifically:
112         // Does it fall within the set of valid status codes?
113         // Does it exactly match the expected status code?
114         int statusCode = res.getStatus();
115         if (logger.isDebugEnabled()) {
116             logger.debug(testName + ": status = " + statusCode);
117         }
118         Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
119                 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
120         Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
121
122         // Store the ID returned from the first resource created
123         // for additional tests below.
124         if (knownResourceId == null) {
125             knownResourceId = extractId(res);
126             if (logger.isDebugEnabled()) {
127                 logger.debug(testName + ": knownResourceId=" + knownResourceId);
128             }
129         }
130
131         // Store the IDs from every resource created by tests,
132         // so they can be deleted after tests have been run.
133         allResourceIdsCreated.add(extractId(res));
134     }
135
136     /* (non-Javadoc)
137      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createList(java.lang.String)
138      */
139     @Override
140     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
141     dependsOnMethods = {"create"})
142     public void createList(String testName) throws Exception {
143         for (int i = 0; i < 3; i++) {
144             create(testName);
145         }
146     }
147
148     // Failure outcomes
149     // Placeholders until the three tests below can be uncommented.
150     // See Issue CSPACE-401.
151     /* (non-Javadoc)
152      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithEmptyEntityBody(java.lang.String)
153      */
154     @Override
155     public void createWithEmptyEntityBody(String testName) throws Exception {
156         //Should this really be empty?
157     }
158
159     /* (non-Javadoc)
160      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithMalformedXml(java.lang.String)
161      */
162     @Override
163     public void createWithMalformedXml(String testName) throws Exception {
164         //Should this really be empty?
165     }
166
167     /* (non-Javadoc)
168      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithWrongXmlSchema(java.lang.String)
169      */
170     @Override
171     public void createWithWrongXmlSchema(String testName) throws Exception {
172         //Should this really be empty?
173     }
174
175     // ---------------------------------------------------------------
176     // CRUD tests : READ tests
177     // ---------------------------------------------------------------
178     // Success outcomes
179     /* (non-Javadoc)
180      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#read(java.lang.String)
181      */
182     @Override
183     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
184     dependsOnMethods = {"create"})
185     public void read(String testName) throws Exception {
186
187         if (logger.isDebugEnabled()) {
188             logger.debug(testBanner(testName, CLASS_NAME));
189         }
190         // Perform setup.
191         setupRead();
192
193         // Submit the request to the service and store the response.
194         ReportClient client = new ReportClient();
195         ClientResponse<String> res = client.read(knownResourceId);
196         assertStatusCode(res, testName);
197
198         // Get the common part of the response and verify that it is not null.
199         PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
200         PayloadInputPart payloadInputPart = input.getPart(client.getCommonPartName());
201         ReportsCommon reportCommon = null;
202         if (payloadInputPart != null) {
203             reportCommon = (ReportsCommon) payloadInputPart.getBody();
204         }
205         Assert.assertNotNull(reportCommon);
206
207         // Check the values of fields containing Unicode UTF-8 (non-Latin-1) characters.
208         if (logger.isDebugEnabled()) {
209             logger.debug("UTF-8 data sent=" + getUTF8DataFragment() + "\n"
210                     + "UTF-8 data received=" + reportCommon.getNotes());
211         }
212         Assert.assertEquals(reportCommon.getNotes(), getUTF8DataFragment(),
213                 "UTF-8 data retrieved '" + reportCommon.getNotes()
214                 + "' does not match expected data '" + getUTF8DataFragment());
215     }
216
217     // Failure outcomes
218     /* (non-Javadoc)
219      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readNonExistent(java.lang.String)
220      */
221     @Override
222     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
223     dependsOnMethods = {"read"})
224     public void readNonExistent(String testName) throws Exception {
225
226         if (logger.isDebugEnabled()) {
227             logger.debug(testBanner(testName, CLASS_NAME));
228         }
229         // Perform setup.
230         setupReadNonExistent();
231
232         // Submit the request to the service and store the response.
233         ReportClient client = new ReportClient();
234         ClientResponse<String> res = client.read(NON_EXISTENT_ID);
235         int statusCode = res.getStatus();
236
237         // Check the status code of the response: does it match
238         // the expected response(s)?
239         if (logger.isDebugEnabled()) {
240             logger.debug(testName + ": status = " + statusCode);
241         }
242         Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
243                 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
244         Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
245     }
246
247     // ---------------------------------------------------------------
248     // CRUD tests : READ_LIST tests
249     // ---------------------------------------------------------------
250     // Success outcomes
251     /* (non-Javadoc)
252      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readList(java.lang.String)
253      */
254     @Override
255     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
256     dependsOnMethods = {"createList", "read"})
257     public void readList(String testName) throws Exception {
258
259         if (logger.isDebugEnabled()) {
260             logger.debug(testBanner(testName, CLASS_NAME));
261         }
262         // Perform setup.
263         setupReadList();
264
265         // Submit the request to the service and store the response.
266         ReportClient client = new ReportClient();
267         ClientResponse<AbstractCommonList> res = client.readList();
268         assertStatusCode(res, testName);
269         AbstractCommonList list = res.getEntity();
270
271         // Optionally output additional data about list members for debugging.
272         if(logger.isTraceEnabled()){
273                 AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger, testName);
274         }
275     }
276
277     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
278                 dependsOnMethods = {"readList"})
279     public void readListFiltered(String testName) throws Exception {
280         if (logger.isDebugEnabled()) {
281                 logger.debug(testBanner(testName, CLASS_NAME));
282         }
283         // Perform setup.
284         setupReadList();
285
286         // Submit the request to the service and store the response.
287         ReportClient client = new ReportClient();
288         ClientResponse<AbstractCommonList> res = client.readListFiltered(
289                         testDocType, "single");
290         assertStatusCode(res, testName);
291         AbstractCommonList list = res.getEntity();
292
293         List<AbstractCommonList.ListItem> items =
294                 list.getListItem();
295         // We must find the basic one we created
296         boolean fFoundBaseItem = false;
297                 for (AbstractCommonList.ListItem item : items) {
298                         if(knownResourceId.equalsIgnoreCase(AbstractCommonListUtils.ListItemGetCSID(item))) {
299                                 fFoundBaseItem = true;
300                                 break;
301                         }
302                 }
303                 if(!fFoundBaseItem)
304                         Assert.fail("readListFiltered failed to return base item");
305                 
306                 // Now filter for something else, and ensure it is NOT returned
307         res = client.readListFiltered("Intake", "single");
308         assertStatusCode(res, testName);
309         list = res.getEntity();
310
311         items = list.getListItem();
312         // We must NOT find the basic one we created
313                 for (AbstractCommonList.ListItem item : items) {
314                         Assert.assertNotSame(AbstractCommonListUtils.ListItemGetCSID(item), knownResourceId, 
315                                 "readListFiltered(\"Intake\", \"single\") incorrectly returned base item");
316                 }
317                 
318                 // Now filter for something else, and ensure it is NOT returned
319         res = client.readListFiltered(testDocType, "group");
320         assertStatusCode(res, testName);
321         list = res.getEntity();
322
323         items = list.getListItem();
324         // We must NOT find the basic one we created
325                 for (AbstractCommonList.ListItem item : items) {
326                         Assert.assertNotSame(AbstractCommonListUtils.ListItemGetCSID(item), knownResourceId, 
327                                 "readListFiltered(\""+testDocType+"\", \"group\") incorrectly returned base item");
328                 }
329     }
330
331     // ---------------------------------------------------------------
332     // CRUD tests : UPDATE tests
333     // ---------------------------------------------------------------
334     // Success outcomes
335     /* (non-Javadoc)
336      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#update(java.lang.String)
337      */
338     @Override
339     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
340     dependsOnMethods = {"read", "readListFiltered"})
341     public void update(String testName) throws Exception {
342
343         if (logger.isDebugEnabled()) {
344             logger.debug(testBanner(testName, CLASS_NAME));
345         }
346         // Perform setup.
347         setupUpdate();
348
349         // Retrieve the contents of a resource to update.
350         ReportClient client = new ReportClient();
351         ClientResponse<String> res = client.read(knownResourceId);
352         assertStatusCode(res, testName);
353         if (logger.isDebugEnabled()) {
354             logger.debug("got object to update with ID: " + knownResourceId);
355         }
356
357         // Extract the common part from the response.
358         PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
359         PayloadInputPart payloadInputPart = input.getPart(client.getCommonPartName());
360         ReportsCommon reportCommon = null;
361         if (payloadInputPart != null) {
362             reportCommon = (ReportsCommon) payloadInputPart.getBody();
363         }
364         Assert.assertNotNull(reportCommon);
365
366         // Update its content.
367         reportCommon.setName("updated-" + reportCommon.getName());
368         reportCommon.setOutputMIME("updated-" + reportCommon.getOutputMIME());
369         if (logger.isDebugEnabled()) {
370             logger.debug("to be updated object");
371             logger.debug(objectAsXmlString(reportCommon, ReportsCommon.class));
372         }
373         reportCommon.setNotes("updated-" + reportCommon.getNotes());
374
375         // Submit the updated common part in an update request to the service
376         // and store the response.
377         PoxPayloadOut output = new PoxPayloadOut(this.getServicePathComponent());
378         PayloadOutputPart commonPart = output.addPart(reportCommon, MediaType.APPLICATION_XML_TYPE);
379         commonPart.setLabel(client.getCommonPartName());
380         res = client.update(knownResourceId, output);
381         assertStatusCode(res, testName);
382
383         // Extract the updated common part from the response.
384         input = new PoxPayloadIn(res.getEntity());
385         payloadInputPart = input.getPart(client.getCommonPartName());
386         ReportsCommon updatedReportCommon = null;
387         if (payloadInputPart != null) {
388             updatedReportCommon = (ReportsCommon) payloadInputPart.getBody();
389         }
390         Assert.assertNotNull(updatedReportCommon);
391         if (logger.isDebugEnabled()) {
392             logger.debug("updated object");
393             logger.debug(objectAsXmlString(updatedReportCommon, ReportsCommon.class));
394         }
395
396         // Check selected fields in the updated common part.
397         Assert.assertEquals(updatedReportCommon.getName(),
398                 reportCommon.getName(),
399                 "Data in updated object did not match submitted data.");
400
401         // Check the values of fields containing Unicode UTF-8 (non-Latin-1) characters.
402         if (logger.isDebugEnabled()) {
403             logger.debug("UTF-8 data sent=" + reportCommon.getNotes() + "\n"
404                     + "UTF-8 data received=" + updatedReportCommon.getNotes());
405         }
406         Assert.assertTrue(updatedReportCommon.getNotes().contains(getUTF8DataFragment()),
407                 "UTF-8 data retrieved '" + updatedReportCommon.getNotes()
408                 + "' does not contain expected data '" + getUTF8DataFragment());
409         Assert.assertEquals(updatedReportCommon.getNotes(),
410                 reportCommon.getNotes(),
411                 "Data in updated object did not match submitted data.");
412     }
413
414     // Failure outcomes
415     // Placeholders until the three tests below can be uncommented.
416     // See Issue CSPACE-401.
417     /* (non-Javadoc)
418      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithEmptyEntityBody(java.lang.String)
419      */
420     @Override
421     public void updateWithEmptyEntityBody(String testName) throws Exception {
422         //Should this really be empty?
423     }
424
425     /* (non-Javadoc)
426      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithMalformedXml(java.lang.String)
427      */
428     @Override
429     public void updateWithMalformedXml(String testName) throws Exception {
430         //Should this really be empty?
431     }
432
433     /* (non-Javadoc)
434      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithWrongXmlSchema(java.lang.String)
435      */
436     @Override
437     public void updateWithWrongXmlSchema(String testName) throws Exception {
438         //Should this really be empty?
439     }
440
441     /* (non-Javadoc)
442      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateNonExistent(java.lang.String)
443      */
444     @Override
445     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
446     dependsOnMethods = {"update", "testSubmitRequest"})
447     public void updateNonExistent(String testName) throws Exception {
448
449         if (logger.isDebugEnabled()) {
450             logger.debug(testBanner(testName, CLASS_NAME));
451         }
452         // Perform setup.
453         setupUpdateNonExistent();
454
455         // Submit the request to the service and store the response.
456         // Note: The ID used in this 'create' call may be arbitrary.
457         // The only relevant ID may be the one used in update(), below.
458         ReportClient client = new ReportClient();
459         PoxPayloadOut multipart = createReportInstance(NON_EXISTENT_ID);
460         ClientResponse<String> res = client.update(NON_EXISTENT_ID, multipart);
461         int statusCode = res.getStatus();
462
463         // Check the status code of the response: does it match
464         // the expected response(s)?
465         if (logger.isDebugEnabled()) {
466             logger.debug(testName + ": status = " + statusCode);
467         }
468         Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
469                 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
470         Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
471     }
472
473     // ---------------------------------------------------------------
474     // CRUD tests : DELETE tests
475     // ---------------------------------------------------------------
476     // Success outcomes
477     /* (non-Javadoc)
478      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#delete(java.lang.String)
479      */
480     @Override
481     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
482     dependsOnMethods = {"create", "readListFiltered", "testSubmitRequest", "update", "readWorkflow"})
483     public void delete(String testName) throws Exception {
484
485         if (logger.isDebugEnabled()) {
486             logger.debug(testBanner(testName, CLASS_NAME));
487         }
488         // Perform setup.
489         setupDelete();
490
491         // Submit the request to the service and store the response.
492         ReportClient client = new ReportClient();
493         ClientResponse<Response> res = client.delete(knownResourceId);
494         int statusCode = res.getStatus();
495
496         // Check the status code of the response: does it match
497         // the expected response(s)?
498         if (logger.isDebugEnabled()) {
499             logger.debug(testName + ": status = " + statusCode);
500         }
501         Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
502                 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
503         Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
504     }
505
506     // Failure outcomes
507     /* (non-Javadoc)
508      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#deleteNonExistent(java.lang.String)
509      */
510     @Override
511     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
512     dependsOnMethods = {"delete"})
513     public void deleteNonExistent(String testName) throws Exception {
514
515         if (logger.isDebugEnabled()) {
516             logger.debug(testBanner(testName, CLASS_NAME));
517         }
518         // Perform setup.
519         setupDeleteNonExistent();
520
521         // Submit the request to the service and store the response.
522         ReportClient client = new ReportClient();
523         ClientResponse<Response> res = client.delete(NON_EXISTENT_ID);
524         int statusCode = res.getStatus();
525
526         // Check the status code of the response: does it match
527         // the expected response(s)?
528         if (logger.isDebugEnabled()) {
529             logger.debug(testName + ": status = " + statusCode);
530         }
531         Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
532                 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
533         Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
534     }
535
536     // ---------------------------------------------------------------
537     // Utility tests : tests of code used in tests above
538     // ---------------------------------------------------------------
539     /**
540      * Tests the code for manually submitting data that is used by several
541      * of the methods above.
542      */
543     @Test(dependsOnMethods = {"create", "read"})
544     public void testSubmitRequest() {
545
546         // Expected status code: 200 OK
547         final int EXPECTED_STATUS = Response.Status.OK.getStatusCode();
548
549         // Submit the request to the service and store the response.
550         String method = ServiceRequestType.READ.httpMethodName();
551         String url = getResourceURL(knownResourceId);
552         int statusCode = submitRequest(method, url);
553
554         // Check the status code of the response: does it match
555         // the expected response(s)?
556         if (logger.isDebugEnabled()) {
557             logger.debug("testSubmitRequest: url=" + url
558                     + " status=" + statusCode);
559         }
560         Assert.assertEquals(statusCode, EXPECTED_STATUS);
561
562     }
563
564     // ---------------------------------------------------------------
565     // Utility methods used by tests above
566     // ---------------------------------------------------------------
567     @Override
568     protected String getServiceName() {
569         return SERVICE_NAME;
570     }
571
572     /* (non-Javadoc)
573      * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
574      */
575     @Override
576     public String getServicePathComponent() {
577         return SERVICE_PATH_COMPONENT;
578     }
579
580     /**
581      * Creates the report instance.
582      *
583      * @param identifier the identifier
584      * @return the multipart output
585      */
586     private PoxPayloadOut createReportInstance(String identifier) {
587         List<String> docTypes = new ArrayList<String>();
588         docTypes.add(testDocType);
589         return createReportInstance(
590                 "Acquisition Summary", 
591                 docTypes, true, false, false, true,
592                 "acq_basic.jasper",
593                 "application/pdf");
594     }
595
596     /**
597      * Creates the report instance.
598      *
599      * @param name the report name
600      * @param filename the relative path to the report
601      * @param outputMIME the MIME type we will return for this report
602      * @return the multipart output
603      */
604     private PoxPayloadOut createReportInstance(String name,
605                 List<String> forDocTypeList,
606                 boolean supportsSingle, boolean supportsList, 
607                 boolean supportsGroup, boolean supportsNoContext, 
608             String filename,
609             String outputMIME) {
610         ReportsCommon reportCommon = new ReportsCommon();
611         reportCommon.setName(name);
612         ReportsCommon.ForDocTypes forDocTypes = new ReportsCommon.ForDocTypes(); 
613         List<String> docTypeList = forDocTypes.getForDocType();
614         docTypeList.addAll(forDocTypeList);
615         reportCommon.setForDocTypes(forDocTypes);
616         reportCommon.setSupportsSingleDoc(supportsSingle);
617         reportCommon.setSupportsDocList(supportsList);
618         reportCommon.setSupportsGroup(supportsGroup);
619         reportCommon.setSupportsNoContext(supportsNoContext);
620         reportCommon.setFilename(filename);
621         reportCommon.setOutputMIME(outputMIME);
622         reportCommon.setNotes(getUTF8DataFragment()); // For UTF-8 tests
623
624         PoxPayloadOut multipart = new PoxPayloadOut(this.getServicePathComponent());
625         PayloadOutputPart commonPart =
626                 multipart.addPart(reportCommon, MediaType.APPLICATION_XML_TYPE);
627         commonPart.setLabel(new ReportClient().getCommonPartName());
628
629         if (logger.isDebugEnabled()) {
630             logger.debug("to be created, report common");
631             logger.debug(objectAsXmlString(reportCommon, ReportsCommon.class));
632             logger.debug(multipart.toXML());
633         }
634
635         return multipart;
636     }
637 }