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:
6 * http://www.collectionspace.org
7 * http://wiki.collectionspace.org
9 * Copyright © 2009 Regents of the University of California
11 * Licensed under the Educational Community License (ECL), Version 2.0.
12 * You may not use this file except in compliance with this License.
14 * You may obtain a copy of the ECL 2.0 License at
15 * https://source.collectionspace.org/collection-space/LICENSE.txt
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.
23 package org.collectionspace.services.client.test;
25 import java.util.ArrayList;
26 import java.util.List;
27 import javax.ws.rs.core.MediaType;
28 import javax.ws.rs.core.Response;
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.report.ReportsCommon;
37 import org.collectionspace.services.report.ReportsCommonList;
38 import org.collectionspace.services.jaxb.AbstractCommonList;
40 import org.jboss.resteasy.client.ClientResponse;
41 import org.testng.Assert;
42 //import org.testng.annotations.AfterClass;
43 import org.testng.annotations.Test;
45 import org.slf4j.Logger;
46 import org.slf4j.LoggerFactory;
49 * FIXME: http://issues.collectionspace.org/browse/CSPACE-1685
50 * ReportServiceTest, carries out tests against a
51 * deployed and running Report Service.
53 * $LastChangedRevision: 2261 $
54 * $LastChangedDate: 2010-05-28 16:52:22 -0700 (Fri, 28 May 2010) $
56 public class ReportServiceTest extends AbstractServiceTestImpl {
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;
67 private String testDocType = "Acquisition";
70 * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
73 protected CollectionSpaceClient getClientInstance() {
74 return new ReportClient();
78 * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
81 protected AbstractCommonList getAbstractCommonList(
82 ClientResponse<AbstractCommonList> response) {
83 return response.getEntity(ReportsCommonList.class);
87 // protected PoxPayloadOut createInstance(String identifier) {
88 // PoxPayloadOut multipart = createReportInstance(identifier);
92 // ---------------------------------------------------------------
93 // CRUD tests : CREATE tests
94 // ---------------------------------------------------------------
97 * @see org.collectionspace.services.client.test.ServiceTest#create(java.lang.String)
100 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
101 public void create(String testName) throws Exception {
103 if (logger.isDebugEnabled()) {
104 logger.debug(testBanner(testName, CLASS_NAME));
106 // Perform setup, such as initializing the type of service request
107 // (e.g. CREATE, DELETE), its valid and expected status codes, and
108 // its associated HTTP method name (e.g. POST, DELETE).
111 // Submit the request to the service and store the response.
112 ReportClient client = new ReportClient();
113 String identifier = createIdentifier();
114 PoxPayloadOut multipart = createReportInstance(identifier);
115 ClientResponse<Response> res = client.create(multipart);
117 // Check the status code of the response: does it match
118 // the expected response(s)?
121 // Does it fall within the set of valid status codes?
122 // Does it exactly match the expected status code?
123 int statusCode = res.getStatus();
124 if (logger.isDebugEnabled()) {
125 logger.debug(testName + ": status = " + statusCode);
127 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
128 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
129 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
131 // Store the ID returned from the first resource created
132 // for additional tests below.
133 if (knownResourceId == null) {
134 knownResourceId = extractId(res);
135 if (logger.isDebugEnabled()) {
136 logger.debug(testName + ": knownResourceId=" + knownResourceId);
140 // Store the IDs from every resource created by tests,
141 // so they can be deleted after tests have been run.
142 allResourceIdsCreated.add(extractId(res));
146 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createList(java.lang.String)
149 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
150 dependsOnMethods = {"create"})
151 public void createList(String testName) throws Exception {
152 for (int i = 0; i < 3; i++) {
158 // Placeholders until the three tests below can be uncommented.
159 // See Issue CSPACE-401.
161 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithEmptyEntityBody(java.lang.String)
164 public void createWithEmptyEntityBody(String testName) throws Exception {
165 //Should this really be empty?
169 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithMalformedXml(java.lang.String)
172 public void createWithMalformedXml(String testName) throws Exception {
173 //Should this really be empty?
177 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithWrongXmlSchema(java.lang.String)
180 public void createWithWrongXmlSchema(String testName) throws Exception {
181 //Should this really be empty?
184 // ---------------------------------------------------------------
185 // CRUD tests : READ tests
186 // ---------------------------------------------------------------
189 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#read(java.lang.String)
192 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
193 dependsOnMethods = {"create"})
194 public void read(String testName) throws Exception {
196 if (logger.isDebugEnabled()) {
197 logger.debug(testBanner(testName, CLASS_NAME));
202 // Submit the request to the service and store the response.
203 ReportClient client = new ReportClient();
204 ClientResponse<String> res = client.read(knownResourceId);
206 // Check the status code of the response: does it match
207 // the expected response(s)?
208 int statusCode = res.getStatus();
209 if (logger.isDebugEnabled()) {
210 logger.debug(testName + ": status = " + statusCode);
212 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
213 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
214 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
216 // Get the common part of the response and verify that it is not null.
217 PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
218 PayloadInputPart payloadInputPart = input.getPart(client.getCommonPartName());
219 ReportsCommon reportCommon = null;
220 if (payloadInputPart != null) {
221 reportCommon = (ReportsCommon) payloadInputPart.getBody();
223 Assert.assertNotNull(reportCommon);
225 // Check the values of fields containing Unicode UTF-8 (non-Latin-1) characters.
226 if (logger.isDebugEnabled()) {
227 logger.debug("UTF-8 data sent=" + getUTF8DataFragment() + "\n"
228 + "UTF-8 data received=" + reportCommon.getNotes());
230 Assert.assertEquals(reportCommon.getNotes(), getUTF8DataFragment(),
231 "UTF-8 data retrieved '" + reportCommon.getNotes()
232 + "' does not match expected data '" + getUTF8DataFragment());
237 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readNonExistent(java.lang.String)
240 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
241 dependsOnMethods = {"read"})
242 public void readNonExistent(String testName) throws Exception {
244 if (logger.isDebugEnabled()) {
245 logger.debug(testBanner(testName, CLASS_NAME));
248 setupReadNonExistent();
250 // Submit the request to the service and store the response.
251 ReportClient client = new ReportClient();
252 ClientResponse<String> res = client.read(NON_EXISTENT_ID);
253 int statusCode = res.getStatus();
255 // Check the status code of the response: does it match
256 // the expected response(s)?
257 if (logger.isDebugEnabled()) {
258 logger.debug(testName + ": status = " + statusCode);
260 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
261 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
262 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
265 // ---------------------------------------------------------------
266 // CRUD tests : READ_LIST tests
267 // ---------------------------------------------------------------
270 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readList(java.lang.String)
273 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
274 dependsOnMethods = {"createList", "read"})
275 public void readList(String testName) throws Exception {
277 if (logger.isDebugEnabled()) {
278 logger.debug(testBanner(testName, CLASS_NAME));
283 // Submit the request to the service and store the response.
284 ReportClient client = new ReportClient();
285 ClientResponse<ReportsCommonList> res = client.readList();
286 ReportsCommonList list = res.getEntity();
287 int statusCode = res.getStatus();
289 // Check the status code of the response: does it match
290 // the expected response(s)?
291 if (logger.isDebugEnabled()) {
292 logger.debug(testName + ": status = " + statusCode);
294 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
295 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
296 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
298 List<ReportsCommonList.ReportListItem> items =
299 list.getReportListItem();
300 // Optionally output additional data about list members for debugging.
301 boolean iterateThroughList = false;
302 if (iterateThroughList && logger.isDebugEnabled()) {
304 for (ReportsCommonList.ReportListItem item : items) {
305 logger.debug(testName + ": list-item[" + i + "] csid="
307 logger.debug(testName + ": list-item[" + i + "] name="
309 logger.debug(testName + ": list-item[" + i + "] outputMIME="
310 + item.getOutputMIME());
311 logger.debug(testName + ": list-item[" + i + "] URI="
318 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
319 dependsOnMethods = {"readList"})
320 public void readListFiltered(String testName) throws Exception {
321 if (logger.isDebugEnabled()) {
322 logger.debug(testBanner(testName, CLASS_NAME));
327 // Submit the request to the service and store the response.
328 ReportClient client = new ReportClient();
329 ClientResponse<ReportsCommonList> res = client.readListFiltered(
330 testDocType, "single");
331 ReportsCommonList list = res.getEntity();
332 int statusCode = res.getStatus();
334 // Check the status code of the response: does it match
335 // the expected response(s)?
336 if (logger.isDebugEnabled()) {
337 logger.debug(testName + ": status = " + statusCode);
339 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
340 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
341 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
343 List<ReportsCommonList.ReportListItem> items =
344 list.getReportListItem();
345 // We must find the basic one we created
346 boolean fFoundBaseItem = false;
347 for (ReportsCommonList.ReportListItem item : items) {
348 if(knownResourceId.equalsIgnoreCase(item.getCsid())) {
349 fFoundBaseItem = true;
354 Assert.fail("readListFiltered failed to return base item");
356 // Now filter for something else, and ensure it is NOT returned
357 res = client.readListFiltered("Intake", "single");
358 list = res.getEntity();
359 statusCode = res.getStatus();
361 // Check the status code of the response: does it match
362 // the expected response(s)?
363 if (logger.isDebugEnabled()) {
364 logger.debug(testName + ": status = " + statusCode);
366 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
367 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
368 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
370 items = list.getReportListItem();
371 // We must NOT find the basic one we created
372 for (ReportsCommonList.ReportListItem item : items) {
373 Assert.assertNotSame(item.getCsid(), knownResourceId,
374 "readListFiltered(\"Intake\", \"single\") incorrectly returned base item");
377 // Now filter for something else, and ensure it is NOT returned
378 res = client.readListFiltered(testDocType, "group");
379 list = res.getEntity();
380 statusCode = res.getStatus();
382 // Check the status code of the response: does it match
383 // the expected response(s)?
384 if (logger.isDebugEnabled()) {
385 logger.debug(testName + ": status = " + statusCode);
387 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
388 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
389 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
391 items = list.getReportListItem();
392 // We must NOT find the basic one we created
393 for (ReportsCommonList.ReportListItem item : items) {
394 Assert.assertNotSame(item.getCsid(), knownResourceId,
395 "readListFiltered(\""+testDocType+"\", \"group\") incorrectly returned base item");
399 // ---------------------------------------------------------------
400 // CRUD tests : UPDATE tests
401 // ---------------------------------------------------------------
404 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#update(java.lang.String)
407 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
408 dependsOnMethods = {"read", "readListFiltered"})
409 public void update(String testName) throws Exception {
411 if (logger.isDebugEnabled()) {
412 logger.debug(testBanner(testName, CLASS_NAME));
417 // Retrieve the contents of a resource to update.
418 ReportClient client = new ReportClient();
419 ClientResponse<String> res = client.read(knownResourceId);
420 if (logger.isDebugEnabled()) {
421 logger.debug(testName + ": read status = " + res.getStatus());
423 Assert.assertEquals(res.getStatus(), EXPECTED_STATUS_CODE);
424 if (logger.isDebugEnabled()) {
425 logger.debug("got object to update with ID: " + knownResourceId);
428 // Extract the common part from the response.
429 PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
430 PayloadInputPart payloadInputPart = input.getPart(client.getCommonPartName());
431 ReportsCommon reportCommon = null;
432 if (payloadInputPart != null) {
433 reportCommon = (ReportsCommon) payloadInputPart.getBody();
435 Assert.assertNotNull(reportCommon);
437 // Update its content.
438 reportCommon.setName("updated-" + reportCommon.getName());
439 reportCommon.setOutputMIME("updated-" + reportCommon.getOutputMIME());
440 if (logger.isDebugEnabled()) {
441 logger.debug("to be updated object");
442 logger.debug(objectAsXmlString(reportCommon, ReportsCommon.class));
444 reportCommon.setNotes("updated-" + reportCommon.getNotes());
446 // Submit the updated common part in an update request to the service
447 // and store the response.
448 PoxPayloadOut output = new PoxPayloadOut(this.getServicePathComponent());
449 PayloadOutputPart commonPart = output.addPart(reportCommon, MediaType.APPLICATION_XML_TYPE);
450 commonPart.setLabel(client.getCommonPartName());
451 res = client.update(knownResourceId, output);
453 // Check the status code of the response: does it match the expected response(s)?
454 int statusCode = res.getStatus();
455 if (logger.isDebugEnabled()) {
456 logger.debug(testName + ": status = " + statusCode);
458 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
459 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
460 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
462 // Extract the updated common part from the response.
463 input = new PoxPayloadIn(res.getEntity());
464 payloadInputPart = input.getPart(client.getCommonPartName());
465 ReportsCommon updatedReportCommon = null;
466 if (payloadInputPart != null) {
467 updatedReportCommon = (ReportsCommon) payloadInputPart.getBody();
469 Assert.assertNotNull(updatedReportCommon);
470 if (logger.isDebugEnabled()) {
471 logger.debug("updated object");
472 logger.debug(objectAsXmlString(updatedReportCommon, ReportsCommon.class));
475 // Check selected fields in the updated common part.
476 Assert.assertEquals(updatedReportCommon.getName(),
477 reportCommon.getName(),
478 "Data in updated object did not match submitted data.");
480 // Check the values of fields containing Unicode UTF-8 (non-Latin-1) characters.
481 if (logger.isDebugEnabled()) {
482 logger.debug("UTF-8 data sent=" + reportCommon.getNotes() + "\n"
483 + "UTF-8 data received=" + updatedReportCommon.getNotes());
485 Assert.assertTrue(updatedReportCommon.getNotes().contains(getUTF8DataFragment()),
486 "UTF-8 data retrieved '" + updatedReportCommon.getNotes()
487 + "' does not contain expected data '" + getUTF8DataFragment());
488 Assert.assertEquals(updatedReportCommon.getNotes(),
489 reportCommon.getNotes(),
490 "Data in updated object did not match submitted data.");
494 // Placeholders until the three tests below can be uncommented.
495 // See Issue CSPACE-401.
497 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithEmptyEntityBody(java.lang.String)
500 public void updateWithEmptyEntityBody(String testName) throws Exception {
501 //Should this really be empty?
505 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithMalformedXml(java.lang.String)
508 public void updateWithMalformedXml(String testName) throws Exception {
509 //Should this really be empty?
513 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithWrongXmlSchema(java.lang.String)
516 public void updateWithWrongXmlSchema(String testName) throws Exception {
517 //Should this really be empty?
521 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateNonExistent(java.lang.String)
524 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
525 dependsOnMethods = {"update", "testSubmitRequest"})
526 public void updateNonExistent(String testName) throws Exception {
528 if (logger.isDebugEnabled()) {
529 logger.debug(testBanner(testName, CLASS_NAME));
532 setupUpdateNonExistent();
534 // Submit the request to the service and store the response.
535 // Note: The ID used in this 'create' call may be arbitrary.
536 // The only relevant ID may be the one used in update(), below.
537 ReportClient client = new ReportClient();
538 PoxPayloadOut multipart = createReportInstance(NON_EXISTENT_ID);
539 ClientResponse<String> res = client.update(NON_EXISTENT_ID, multipart);
540 int statusCode = res.getStatus();
542 // Check the status code of the response: does it match
543 // the expected response(s)?
544 if (logger.isDebugEnabled()) {
545 logger.debug(testName + ": status = " + statusCode);
547 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
548 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
549 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
552 // ---------------------------------------------------------------
553 // CRUD tests : DELETE tests
554 // ---------------------------------------------------------------
557 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#delete(java.lang.String)
560 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
561 dependsOnMethods = {"create", "readListFiltered", "testSubmitRequest", "update", "readWorkflow"})
562 public void delete(String testName) throws Exception {
564 if (logger.isDebugEnabled()) {
565 logger.debug(testBanner(testName, CLASS_NAME));
570 // Submit the request to the service and store the response.
571 ReportClient client = new ReportClient();
572 ClientResponse<Response> res = client.delete(knownResourceId);
573 int statusCode = res.getStatus();
575 // Check the status code of the response: does it match
576 // the expected response(s)?
577 if (logger.isDebugEnabled()) {
578 logger.debug(testName + ": status = " + statusCode);
580 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
581 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
582 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
587 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#deleteNonExistent(java.lang.String)
590 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
591 dependsOnMethods = {"delete"})
592 public void deleteNonExistent(String testName) throws Exception {
594 if (logger.isDebugEnabled()) {
595 logger.debug(testBanner(testName, CLASS_NAME));
598 setupDeleteNonExistent();
600 // Submit the request to the service and store the response.
601 ReportClient client = new ReportClient();
602 ClientResponse<Response> res = client.delete(NON_EXISTENT_ID);
603 int statusCode = res.getStatus();
605 // Check the status code of the response: does it match
606 // the expected response(s)?
607 if (logger.isDebugEnabled()) {
608 logger.debug(testName + ": status = " + statusCode);
610 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
611 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
612 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
615 // ---------------------------------------------------------------
616 // Utility tests : tests of code used in tests above
617 // ---------------------------------------------------------------
619 * Tests the code for manually submitting data that is used by several
620 * of the methods above.
622 @Test(dependsOnMethods = {"create", "read"})
623 public void testSubmitRequest() {
625 // Expected status code: 200 OK
626 final int EXPECTED_STATUS = Response.Status.OK.getStatusCode();
628 // Submit the request to the service and store the response.
629 String method = ServiceRequestType.READ.httpMethodName();
630 String url = getResourceURL(knownResourceId);
631 int statusCode = submitRequest(method, url);
633 // Check the status code of the response: does it match
634 // the expected response(s)?
635 if (logger.isDebugEnabled()) {
636 logger.debug("testSubmitRequest: url=" + url
637 + " status=" + statusCode);
639 Assert.assertEquals(statusCode, EXPECTED_STATUS);
643 // ---------------------------------------------------------------
644 // Utility methods used by tests above
645 // ---------------------------------------------------------------
647 protected String getServiceName() {
652 * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
655 public String getServicePathComponent() {
656 return SERVICE_PATH_COMPONENT;
660 * Creates the report instance.
662 * @param identifier the identifier
663 * @return the multipart output
665 private PoxPayloadOut createReportInstance(String identifier) {
666 List<String> docTypes = new ArrayList<String>();
667 docTypes.add(testDocType);
668 return createReportInstance(
669 "Acquisition Summary",
670 docTypes, true, false, false, true,
676 * Creates the report instance.
678 * @param name the report name
679 * @param filename the relative path to the report
680 * @param outputMIME the MIME type we will return for this report
681 * @return the multipart output
683 private PoxPayloadOut createReportInstance(String name,
684 List<String> forDocTypeList,
685 boolean supportsSingle, boolean supportsList,
686 boolean supportsGroup, boolean supportsNoContext,
689 ReportsCommon reportCommon = new ReportsCommon();
690 reportCommon.setName(name);
691 ReportsCommon.ForDocTypes forDocTypes = new ReportsCommon.ForDocTypes();
692 List<String> docTypeList = forDocTypes.getForDocType();
693 docTypeList.addAll(forDocTypeList);
694 reportCommon.setForDocTypes(forDocTypes);
695 reportCommon.setSupportsSingleDoc(supportsSingle);
696 reportCommon.setSupportsDocList(supportsList);
697 reportCommon.setSupportsGroup(supportsGroup);
698 reportCommon.setSupportsNoContext(supportsNoContext);
699 reportCommon.setFilename(filename);
700 reportCommon.setOutputMIME(outputMIME);
701 reportCommon.setNotes(getUTF8DataFragment()); // For UTF-8 tests
703 PoxPayloadOut multipart = new PoxPayloadOut(this.getServicePathComponent());
704 PayloadOutputPart commonPart =
705 multipart.addPart(reportCommon, MediaType.APPLICATION_XML_TYPE);
706 commonPart.setLabel(new ReportClient().getCommonPartName());
708 if (logger.isDebugEnabled()) {
709 logger.debug("to be created, report common");
710 logger.debug(objectAsXmlString(reportCommon, ReportsCommon.class));
711 logger.debug(multipart.toXML());