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.List;
26 import javax.ws.rs.core.MediaType;
27 import javax.ws.rs.core.Response;
29 import org.collectionspace.services.client.CollectionSpaceClient;
30 import org.collectionspace.services.client.PayloadInputPart;
31 import org.collectionspace.services.client.PayloadOutputPart;
32 import org.collectionspace.services.client.PoxPayloadIn;
33 import org.collectionspace.services.client.PoxPayloadOut;
34 import org.collectionspace.services.client.ReportClient;
35 import org.collectionspace.services.report.ReportsCommon;
36 import org.collectionspace.services.report.ReportsCommonList;
37 import org.collectionspace.services.jaxb.AbstractCommonList;
39 import org.jboss.resteasy.client.ClientResponse;
40 import org.testng.Assert;
41 //import org.testng.annotations.AfterClass;
42 import org.testng.annotations.Test;
44 import org.slf4j.Logger;
45 import org.slf4j.LoggerFactory;
48 * FIXME: http://issues.collectionspace.org/browse/CSPACE-1685
49 * ReportServiceTest, carries out tests against a
50 * deployed and running Report Service.
52 * $LastChangedRevision: 2261 $
53 * $LastChangedDate: 2010-05-28 16:52:22 -0700 (Fri, 28 May 2010) $
55 public class ReportServiceTest extends AbstractServiceTestImpl {
58 private final String CLASS_NAME = ReportServiceTest.class.getName();
59 private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
60 final String SERVICE_NAME = "reports";
61 final String SERVICE_PATH_COMPONENT = "reports";
62 // Instance variables specific to this test.
63 /** The known resource id. */
64 private String knownResourceId = null;
66 private String testDocType = "Acquisition";
69 * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
72 protected CollectionSpaceClient getClientInstance() {
73 return new ReportClient();
77 * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
80 protected AbstractCommonList getAbstractCommonList(
81 ClientResponse<AbstractCommonList> response) {
82 return response.getEntity(ReportsCommonList.class);
86 // protected PoxPayloadOut createInstance(String identifier) {
87 // PoxPayloadOut multipart = createReportInstance(identifier);
91 // ---------------------------------------------------------------
92 // CRUD tests : CREATE tests
93 // ---------------------------------------------------------------
96 * @see org.collectionspace.services.client.test.ServiceTest#create(java.lang.String)
99 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
100 public void create(String testName) throws Exception {
102 if (logger.isDebugEnabled()) {
103 logger.debug(testBanner(testName, CLASS_NAME));
105 // Perform setup, such as initializing the type of service request
106 // (e.g. CREATE, DELETE), its valid and expected status codes, and
107 // its associated HTTP method name (e.g. POST, DELETE).
110 // Submit the request to the service and store the response.
111 ReportClient client = new ReportClient();
112 String identifier = createIdentifier();
113 PoxPayloadOut multipart = createReportInstance(identifier);
114 ClientResponse<Response> res = client.create(multipart);
116 // Check the status code of the response: does it match
117 // the expected response(s)?
120 // Does it fall within the set of valid status codes?
121 // Does it exactly match the expected status code?
122 int statusCode = res.getStatus();
123 if (logger.isDebugEnabled()) {
124 logger.debug(testName + ": status = " + statusCode);
126 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
127 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
128 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
130 // Store the ID returned from the first resource created
131 // for additional tests below.
132 if (knownResourceId == null) {
133 knownResourceId = extractId(res);
134 if (logger.isDebugEnabled()) {
135 logger.debug(testName + ": knownResourceId=" + knownResourceId);
139 // Store the IDs from every resource created by tests,
140 // so they can be deleted after tests have been run.
141 allResourceIdsCreated.add(extractId(res));
145 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createList(java.lang.String)
148 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
149 dependsOnMethods = {"create"})
150 public void createList(String testName) throws Exception {
151 for (int i = 0; i < 3; i++) {
157 // Placeholders until the three tests below can be uncommented.
158 // See Issue CSPACE-401.
160 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithEmptyEntityBody(java.lang.String)
163 public void createWithEmptyEntityBody(String testName) throws Exception {
164 //Should this really be empty?
168 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithMalformedXml(java.lang.String)
171 public void createWithMalformedXml(String testName) throws Exception {
172 //Should this really be empty?
176 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithWrongXmlSchema(java.lang.String)
179 public void createWithWrongXmlSchema(String testName) throws Exception {
180 //Should this really be empty?
183 // ---------------------------------------------------------------
184 // CRUD tests : READ tests
185 // ---------------------------------------------------------------
188 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#read(java.lang.String)
191 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
192 dependsOnMethods = {"create"})
193 public void read(String testName) throws Exception {
195 if (logger.isDebugEnabled()) {
196 logger.debug(testBanner(testName, CLASS_NAME));
201 // Submit the request to the service and store the response.
202 ReportClient client = new ReportClient();
203 ClientResponse<String> res = client.read(knownResourceId);
205 // Check the status code of the response: does it match
206 // the expected response(s)?
207 int statusCode = res.getStatus();
208 if (logger.isDebugEnabled()) {
209 logger.debug(testName + ": status = " + statusCode);
211 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
212 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
213 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
215 // Get the common part of the response and verify that it is not null.
216 PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
217 PayloadInputPart payloadInputPart = input.getPart(client.getCommonPartName());
218 ReportsCommon reportCommon = null;
219 if (payloadInputPart != null) {
220 reportCommon = (ReportsCommon) payloadInputPart.getBody();
222 Assert.assertNotNull(reportCommon);
224 // Check the values of fields containing Unicode UTF-8 (non-Latin-1) characters.
225 if (logger.isDebugEnabled()) {
226 logger.debug("UTF-8 data sent=" + getUTF8DataFragment() + "\n"
227 + "UTF-8 data received=" + reportCommon.getNotes());
229 Assert.assertEquals(reportCommon.getNotes(), getUTF8DataFragment(),
230 "UTF-8 data retrieved '" + reportCommon.getNotes()
231 + "' does not match expected data '" + getUTF8DataFragment());
236 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readNonExistent(java.lang.String)
239 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
240 dependsOnMethods = {"read"})
241 public void readNonExistent(String testName) throws Exception {
243 if (logger.isDebugEnabled()) {
244 logger.debug(testBanner(testName, CLASS_NAME));
247 setupReadNonExistent();
249 // Submit the request to the service and store the response.
250 ReportClient client = new ReportClient();
251 ClientResponse<String> res = client.read(NON_EXISTENT_ID);
252 int statusCode = res.getStatus();
254 // Check the status code of the response: does it match
255 // the expected response(s)?
256 if (logger.isDebugEnabled()) {
257 logger.debug(testName + ": status = " + statusCode);
259 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
260 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
261 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
264 // ---------------------------------------------------------------
265 // CRUD tests : READ_LIST tests
266 // ---------------------------------------------------------------
269 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readList(java.lang.String)
272 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
273 dependsOnMethods = {"createList", "read"})
274 public void readList(String testName) throws Exception {
276 if (logger.isDebugEnabled()) {
277 logger.debug(testBanner(testName, CLASS_NAME));
282 // Submit the request to the service and store the response.
283 ReportClient client = new ReportClient();
284 ClientResponse<ReportsCommonList> res = client.readList();
285 ReportsCommonList list = res.getEntity();
286 int statusCode = res.getStatus();
288 // Check the status code of the response: does it match
289 // the expected response(s)?
290 if (logger.isDebugEnabled()) {
291 logger.debug(testName + ": status = " + statusCode);
293 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
294 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
295 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
297 List<ReportsCommonList.ReportListItem> items =
298 list.getReportListItem();
299 // Optionally output additional data about list members for debugging.
300 boolean iterateThroughList = false;
301 if (iterateThroughList && logger.isDebugEnabled()) {
303 for (ReportsCommonList.ReportListItem item : items) {
304 logger.debug(testName + ": list-item[" + i + "] csid="
306 logger.debug(testName + ": list-item[" + i + "] name="
308 logger.debug(testName + ": list-item[" + i + "] outputMIME="
309 + item.getOutputMIME());
310 logger.debug(testName + ": list-item[" + i + "] URI="
317 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
318 dependsOnMethods = {"readList"})
319 public void readListFiltered(String testName) throws Exception {
320 if (logger.isDebugEnabled()) {
321 logger.debug(testBanner(testName, CLASS_NAME));
326 // Submit the request to the service and store the response.
327 ReportClient client = new ReportClient();
328 ClientResponse<ReportsCommonList> res = client.readListFiltered(
329 testDocType, "single");
330 ReportsCommonList list = res.getEntity();
331 int statusCode = res.getStatus();
333 // Check the status code of the response: does it match
334 // the expected response(s)?
335 if (logger.isDebugEnabled()) {
336 logger.debug(testName + ": status = " + statusCode);
338 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
339 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
340 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
342 List<ReportsCommonList.ReportListItem> items =
343 list.getReportListItem();
344 // We must find the basic one we created
345 boolean fFoundBaseItem = false;
346 for (ReportsCommonList.ReportListItem item : items) {
347 if(knownResourceId.equalsIgnoreCase(item.getCsid())) {
348 fFoundBaseItem = true;
353 Assert.fail("readListFiltered failed to return base item");
355 // Now filter for something else, and ensure it is NOT returned
356 res = client.readListFiltered("Intake", "single");
357 list = res.getEntity();
358 statusCode = res.getStatus();
360 // Check the status code of the response: does it match
361 // the expected response(s)?
362 if (logger.isDebugEnabled()) {
363 logger.debug(testName + ": status = " + statusCode);
365 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
366 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
367 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
369 items = list.getReportListItem();
370 // We must NOT find the basic one we created
371 for (ReportsCommonList.ReportListItem item : items) {
372 Assert.assertNotSame(item.getCsid(), knownResourceId,
373 "readListFiltered(\"Intake\", \"single\") incorrectly returned base item");
376 // Now filter for something else, and ensure it is NOT returned
377 res = client.readListFiltered(testDocType, "group");
378 list = res.getEntity();
379 statusCode = res.getStatus();
381 // Check the status code of the response: does it match
382 // the expected response(s)?
383 if (logger.isDebugEnabled()) {
384 logger.debug(testName + ": status = " + statusCode);
386 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
387 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
388 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
390 items = list.getReportListItem();
391 // We must NOT find the basic one we created
392 for (ReportsCommonList.ReportListItem item : items) {
393 Assert.assertNotSame(item.getCsid(), knownResourceId,
394 "readListFiltered(\""+testDocType+"\", \"group\") incorrectly returned base item");
398 // ---------------------------------------------------------------
399 // CRUD tests : UPDATE tests
400 // ---------------------------------------------------------------
403 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#update(java.lang.String)
406 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
407 dependsOnMethods = {"read", "readListFiltered"})
408 public void update(String testName) throws Exception {
410 if (logger.isDebugEnabled()) {
411 logger.debug(testBanner(testName, CLASS_NAME));
416 // Retrieve the contents of a resource to update.
417 ReportClient client = new ReportClient();
418 ClientResponse<String> res = client.read(knownResourceId);
419 if (logger.isDebugEnabled()) {
420 logger.debug(testName + ": read status = " + res.getStatus());
422 Assert.assertEquals(res.getStatus(), EXPECTED_STATUS_CODE);
423 if (logger.isDebugEnabled()) {
424 logger.debug("got object to update with ID: " + knownResourceId);
427 // Extract the common part from the response.
428 PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
429 PayloadInputPart payloadInputPart = input.getPart(client.getCommonPartName());
430 ReportsCommon reportCommon = null;
431 if (payloadInputPart != null) {
432 reportCommon = (ReportsCommon) payloadInputPart.getBody();
434 Assert.assertNotNull(reportCommon);
436 // Update its content.
437 reportCommon.setName("updated-" + reportCommon.getName());
438 reportCommon.setOutputMIME("updated-" + reportCommon.getOutputMIME());
439 if (logger.isDebugEnabled()) {
440 logger.debug("to be updated object");
441 logger.debug(objectAsXmlString(reportCommon, ReportsCommon.class));
443 reportCommon.setNotes("updated-" + reportCommon.getNotes());
445 // Submit the updated common part in an update request to the service
446 // and store the response.
447 PoxPayloadOut output = new PoxPayloadOut(this.getServicePathComponent());
448 PayloadOutputPart commonPart = output.addPart(reportCommon, MediaType.APPLICATION_XML_TYPE);
449 commonPart.setLabel(client.getCommonPartName());
450 res = client.update(knownResourceId, output);
452 // Check the status code of the response: does it match the expected response(s)?
453 int statusCode = res.getStatus();
454 if (logger.isDebugEnabled()) {
455 logger.debug(testName + ": status = " + statusCode);
457 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
458 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
459 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
461 // Extract the updated common part from the response.
462 input = new PoxPayloadIn(res.getEntity());
463 payloadInputPart = input.getPart(client.getCommonPartName());
464 ReportsCommon updatedReportCommon = null;
465 if (payloadInputPart != null) {
466 updatedReportCommon = (ReportsCommon) payloadInputPart.getBody();
468 Assert.assertNotNull(updatedReportCommon);
469 if (logger.isDebugEnabled()) {
470 logger.debug("updated object");
471 logger.debug(objectAsXmlString(updatedReportCommon, ReportsCommon.class));
474 // Check selected fields in the updated common part.
475 Assert.assertEquals(updatedReportCommon.getName(),
476 reportCommon.getName(),
477 "Data in updated object did not match submitted data.");
479 // Check the values of fields containing Unicode UTF-8 (non-Latin-1) characters.
480 if (logger.isDebugEnabled()) {
481 logger.debug("UTF-8 data sent=" + reportCommon.getNotes() + "\n"
482 + "UTF-8 data received=" + updatedReportCommon.getNotes());
484 Assert.assertTrue(updatedReportCommon.getNotes().contains(getUTF8DataFragment()),
485 "UTF-8 data retrieved '" + updatedReportCommon.getNotes()
486 + "' does not contain expected data '" + getUTF8DataFragment());
487 Assert.assertEquals(updatedReportCommon.getNotes(),
488 reportCommon.getNotes(),
489 "Data in updated object did not match submitted data.");
493 // Placeholders until the three tests below can be uncommented.
494 // See Issue CSPACE-401.
496 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithEmptyEntityBody(java.lang.String)
499 public void updateWithEmptyEntityBody(String testName) throws Exception {
500 //Should this really be empty?
504 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithMalformedXml(java.lang.String)
507 public void updateWithMalformedXml(String testName) throws Exception {
508 //Should this really be empty?
512 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithWrongXmlSchema(java.lang.String)
515 public void updateWithWrongXmlSchema(String testName) throws Exception {
516 //Should this really be empty?
520 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateNonExistent(java.lang.String)
523 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
524 dependsOnMethods = {"update", "testSubmitRequest"})
525 public void updateNonExistent(String testName) throws Exception {
527 if (logger.isDebugEnabled()) {
528 logger.debug(testBanner(testName, CLASS_NAME));
531 setupUpdateNonExistent();
533 // Submit the request to the service and store the response.
534 // Note: The ID used in this 'create' call may be arbitrary.
535 // The only relevant ID may be the one used in update(), below.
536 ReportClient client = new ReportClient();
537 PoxPayloadOut multipart = createReportInstance(NON_EXISTENT_ID);
538 ClientResponse<String> res = client.update(NON_EXISTENT_ID, multipart);
539 int statusCode = res.getStatus();
541 // Check the status code of the response: does it match
542 // the expected response(s)?
543 if (logger.isDebugEnabled()) {
544 logger.debug(testName + ": status = " + statusCode);
546 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
547 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
548 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
551 // ---------------------------------------------------------------
552 // CRUD tests : DELETE tests
553 // ---------------------------------------------------------------
556 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#delete(java.lang.String)
559 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
560 dependsOnMethods = {"create", "readListFiltered", "testSubmitRequest", "update", "readWorkflow"})
561 public void delete(String testName) throws Exception {
563 if (logger.isDebugEnabled()) {
564 logger.debug(testBanner(testName, CLASS_NAME));
569 // Submit the request to the service and store the response.
570 ReportClient client = new ReportClient();
571 ClientResponse<Response> res = client.delete(knownResourceId);
572 int statusCode = res.getStatus();
574 // Check the status code of the response: does it match
575 // the expected response(s)?
576 if (logger.isDebugEnabled()) {
577 logger.debug(testName + ": status = " + statusCode);
579 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
580 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
581 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
586 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#deleteNonExistent(java.lang.String)
589 @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
590 dependsOnMethods = {"delete"})
591 public void deleteNonExistent(String testName) throws Exception {
593 if (logger.isDebugEnabled()) {
594 logger.debug(testBanner(testName, CLASS_NAME));
597 setupDeleteNonExistent();
599 // Submit the request to the service and store the response.
600 ReportClient client = new ReportClient();
601 ClientResponse<Response> res = client.delete(NON_EXISTENT_ID);
602 int statusCode = res.getStatus();
604 // Check the status code of the response: does it match
605 // the expected response(s)?
606 if (logger.isDebugEnabled()) {
607 logger.debug(testName + ": status = " + statusCode);
609 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
610 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
611 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
614 // ---------------------------------------------------------------
615 // Utility tests : tests of code used in tests above
616 // ---------------------------------------------------------------
618 * Tests the code for manually submitting data that is used by several
619 * of the methods above.
621 @Test(dependsOnMethods = {"create", "read"})
622 public void testSubmitRequest() {
624 // Expected status code: 200 OK
625 final int EXPECTED_STATUS = Response.Status.OK.getStatusCode();
627 // Submit the request to the service and store the response.
628 String method = ServiceRequestType.READ.httpMethodName();
629 String url = getResourceURL(knownResourceId);
630 int statusCode = submitRequest(method, url);
632 // Check the status code of the response: does it match
633 // the expected response(s)?
634 if (logger.isDebugEnabled()) {
635 logger.debug("testSubmitRequest: url=" + url
636 + " status=" + statusCode);
638 Assert.assertEquals(statusCode, EXPECTED_STATUS);
642 // ---------------------------------------------------------------
643 // Utility methods used by tests above
644 // ---------------------------------------------------------------
646 protected String getServiceName() {
651 * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
654 public String getServicePathComponent() {
655 return SERVICE_PATH_COMPONENT;
659 * Creates the report instance.
661 * @param identifier the identifier
662 * @return the multipart output
664 private PoxPayloadOut createReportInstance(String identifier) {
665 return createReportInstance(
666 "Acquisition Summary",
667 testDocType, true, false, false, true,
673 * Creates the report instance.
675 * @param name the report name
676 * @param filename the relative path to the report
677 * @param outputMIME the MIME type we will return for this report
678 * @return the multipart output
680 private PoxPayloadOut createReportInstance(String name,
682 boolean supportsSingle, boolean supportsList,
683 boolean supportsGroup, boolean supportsNoContext,
686 ReportsCommon reportCommon = new ReportsCommon();
687 reportCommon.setName(name);
688 reportCommon.setForDocType(forDocType);
689 reportCommon.setSupportsSingleDoc(supportsSingle);
690 reportCommon.setSupportsDocList(supportsList);
691 reportCommon.setSupportsGroup(supportsGroup);
692 reportCommon.setSupportsNoContext(supportsNoContext);
693 reportCommon.setFilename(filename);
694 reportCommon.setOutputMIME(outputMIME);
695 reportCommon.setNotes(getUTF8DataFragment()); // For UTF-8 tests
697 PoxPayloadOut multipart = new PoxPayloadOut(this.getServicePathComponent());
698 PayloadOutputPart commonPart =
699 multipart.addPart(reportCommon, MediaType.APPLICATION_XML_TYPE);
700 commonPart.setLabel(new ReportClient().getCommonPartName());
702 if (logger.isDebugEnabled()) {
703 logger.debug("to be created, report common");
704 logger.debug(objectAsXmlString(reportCommon, ReportsCommon.class));
705 logger.debug(multipart.toXML());