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 (c) 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.AcquisitionClient;
30 import org.collectionspace.services.client.CollectionSpaceClient;
31 import org.collectionspace.services.jaxb.AbstractCommonList;
33 import org.collectionspace.services.acquisition.AcquisitionsCommon;
34 import org.collectionspace.services.acquisition.AcquisitionsCommonList;
35 import org.collectionspace.services.acquisition.AcquisitionSourceList;
36 import org.jboss.resteasy.client.ClientResponse;
38 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
39 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
40 import org.jboss.resteasy.plugins.providers.multipart.OutputPart;
41 import org.testng.Assert;
42 import org.testng.annotations.Test;
44 import org.slf4j.Logger;
45 import org.slf4j.LoggerFactory;
48 * AcquisitionServiceTest, carries out tests against a
49 * deployed and running Acquisition Service.
51 * $LastChangedRevision: 621 $
52 * $LastChangedDate: 2009-09-02 16:49:01 -0700 (Wed, 02 Sep 2009) $
54 public class AcquisitionServiceTest extends AbstractServiceTestImpl {
57 private final Logger logger =
58 LoggerFactory.getLogger(AcquisitionServiceTest.class);
60 // Instance variables specific to this test.
61 /** The known resource id. */
62 private String knownResourceId = null;
65 * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
68 protected CollectionSpaceClient getClientInstance() {
69 return new AcquisitionClient();
73 * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
76 protected AbstractCommonList getAbstractCommonList(
77 ClientResponse<AbstractCommonList> response) {
78 return response.getEntity(AcquisitionsCommonList.class);
81 // ---------------------------------------------------------------
82 // CRUD tests : CREATE tests
83 // ---------------------------------------------------------------
86 * @see org.collectionspace.services.client.test.ServiceTest#create(java.lang.String)
89 @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)
90 public void create(String testName) throws Exception {
92 // Perform setup, such as initializing the type of service request
93 // (e.g. CREATE, DELETE), its valid and expected status codes, and
94 // its associated HTTP method name (e.g. POST, DELETE).
95 setupCreate(testName);
97 // Submit the request to the service and store the response.
98 String identifier = createIdentifier();
100 AcquisitionClient client = new AcquisitionClient();
101 MultipartOutput multipart = createAcquisitionInstance(identifier);
102 ClientResponse<Response> res = client.create(multipart);
104 int statusCode = res.getStatus();
106 // Check the status code of the response: does it match
107 // the expected response(s)?
110 // Does it fall within the set of valid status codes?
111 // Does it exactly match the expected status code?
112 if(logger.isDebugEnabled()){
113 logger.debug(testName + ": status = " + statusCode);
115 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
116 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
117 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
119 // Store the ID returned from the first resource created
120 // for additional tests below.
121 if (knownResourceId == null){
122 knownResourceId = extractId(res);
123 if (logger.isDebugEnabled()) {
124 logger.debug(testName + ": knownResourceId=" + knownResourceId);
128 // Store the IDs from every resource created by tests,
129 // so they can be deleted after tests have been run.
130 allResourceIdsCreated.add(extractId(res));
134 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createList(java.lang.String)
137 @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
138 dependsOnMethods = {"create"})
139 public void createList(String testName) throws Exception {
140 for(int i = 0; i < 3; i++){
146 // Placeholders until the three tests below can be uncommented.
147 // See Issue CSPACE-401.
149 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithEmptyEntityBody(java.lang.String)
152 public void createWithEmptyEntityBody(String testName) throws Exception {
153 //Should this really be empty?
157 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithMalformedXml(java.lang.String)
160 public void createWithMalformedXml(String testName) throws Exception {
161 //Should this really be empty?
165 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithWrongXmlSchema(java.lang.String)
168 public void createWithWrongXmlSchema(String testName) throws Exception {
169 //Should this really be empty?
174 @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
175 dependsOnMethods = {"create", "testSubmitRequest"})
176 public void createWithMalformedXml(String testName) throws Exception {
179 setupCreateWithMalformedXml();
181 // Submit the request to the service and store the response.
182 String method = REQUEST_TYPE.httpMethodName();
183 String url = getServiceRootURL();
184 final String entity = MALFORMED_XML_DATA; // Constant from base class.
185 int statusCode = submitRequest(method, url, entity);
187 // Check the status code of the response: does it match
188 // the expected response(s)?
189 if(logger.isDebugEnabled()){
190 logger.debug(testName + ": url=" + url +
191 " status=" + statusCode);
193 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
194 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
195 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
199 @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
200 dependsOnMethods = {"create", "testSubmitRequest"})
201 public void createWithWrongXmlSchema() throws Exception {
204 setupCreateWithWrongXmlSchema();
206 // Submit the request to the service and store the response.
207 String method = REQUEST_TYPE.httpMethodName();
208 String url = getServiceRootURL();
209 final String entity = WRONG_XML_SCHEMA_DATA;
210 int statusCode = submitRequest(method, url, entity);
212 // Check the status code of the response: does it match
213 // the expected response(s)?
214 if(logger.isDebugEnabled()){
215 logger.debug(testName + ": url=" + url +
216 " status=" + statusCode);
218 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
219 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
220 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
224 // ---------------------------------------------------------------
225 // CRUD tests : READ tests
226 // ---------------------------------------------------------------
229 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#read(java.lang.String)
232 @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
233 dependsOnMethods = {"create"})
234 public void read(String testName) throws Exception {
239 AcquisitionClient client = new AcquisitionClient();
241 // Submit the request to the service and store the response.
242 ClientResponse<MultipartInput> res = client.read(knownResourceId);
243 int statusCode = res.getStatus();
245 // Check the status code of the response: does it match
246 // the expected response(s)?
247 if(logger.isDebugEnabled()){
248 logger.debug(testName + ": status = " + statusCode);
250 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
251 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
252 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
254 MultipartInput input = (MultipartInput) res.getEntity();
255 AcquisitionsCommon acquisitionObject = (AcquisitionsCommon) extractPart(input,
256 client.getCommonPartName(), AcquisitionsCommon.class);
257 Assert.assertNotNull(acquisitionObject);
263 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readNonExistent(java.lang.String)
266 @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
267 dependsOnMethods = {"read"})
268 public void readNonExistent(String testName) throws Exception {
271 setupReadNonExistent(testName);
273 // Submit the request to the service and store the response.
274 AcquisitionClient client = new AcquisitionClient();
275 ClientResponse<MultipartInput> res = client.read(NON_EXISTENT_ID);
276 int statusCode = res.getStatus();
278 // Check the status code of the response: does it match
279 // the expected response(s)?
280 if(logger.isDebugEnabled()){
281 logger.debug(testName + ": status = " + statusCode);
283 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
284 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
285 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
288 // ---------------------------------------------------------------
289 // CRUD tests : READ_LIST tests
290 // ---------------------------------------------------------------
293 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readList(java.lang.String)
296 @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
297 dependsOnMethods = {"createList", "read"})
298 public void readList(String testName) throws Exception {
301 setupReadList(testName);
303 // Submit the request to the service and store the response.
304 AcquisitionClient client = new AcquisitionClient();
305 ClientResponse<AcquisitionsCommonList> res = client.readList();
306 AcquisitionsCommonList list = res.getEntity();
307 int statusCode = res.getStatus();
309 // Check the status code of the response: does it match
310 // the expected response(s)?
311 if(logger.isDebugEnabled()){
312 logger.debug(testName + ": status = " + statusCode);
314 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
315 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
316 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
318 // Optionally output additional data about list members for debugging.
319 boolean iterateThroughList = false;
320 if(iterateThroughList && logger.isDebugEnabled()){
321 List<AcquisitionsCommonList.AcquisitionListItem> items =
322 list.getAcquisitionListItem();
324 for(AcquisitionsCommonList.AcquisitionListItem item : items){
325 logger.debug(testName + ": list-item[" + i + "] csid=" +
327 logger.debug(testName + ": list-item[" + i + "] objectNumber=" +
328 item.getAcquisitionReferenceNumber());
329 logger.debug(testName + ": list-item[" + i + "] acquisitionSources:");
330 AcquisitionSourceList acqSource = item.getAcquisitionSources();
331 for (String acquisitionSource : acqSource.getAcquisitionSource()) {
332 logger.debug("acquisitionSource=" + acquisitionSource);
334 logger.debug(testName + ": list-item[" + i + "] URI=" +
345 // ---------------------------------------------------------------
346 // CRUD tests : UPDATE tests
347 // ---------------------------------------------------------------
351 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#update(java.lang.String)
354 @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
355 dependsOnMethods = {"read"})
356 public void update(String testName) throws Exception {
359 setupUpdate(testName);
361 // Retrieve the contents of a resource to update.
362 AcquisitionClient client = new AcquisitionClient();
363 ClientResponse<MultipartInput> res = client.read(knownResourceId);
364 if(logger.isDebugEnabled()){
365 logger.debug(testName + ": read status = " + res.getStatus());
367 Assert.assertEquals(res.getStatus(), EXPECTED_STATUS_CODE);
369 if(logger.isDebugEnabled()){
370 logger.debug("got object to update with ID: " + knownResourceId);
372 MultipartInput input = (MultipartInput) res.getEntity();
374 AcquisitionsCommon acquisition = (AcquisitionsCommon) extractPart(input,
375 client.getCommonPartName(), AcquisitionsCommon.class);
376 Assert.assertNotNull(acquisition);
378 // Update the content of this resource.
379 acquisition.setAcquisitionReferenceNumber("updated-" + acquisition.getAcquisitionReferenceNumber());
380 if(logger.isDebugEnabled()){
381 logger.debug("updated object");
382 logger.debug(objectAsXmlString(acquisition, AcquisitionsCommon.class));
384 // Submit the request to the service and store the response.
385 MultipartOutput output = new MultipartOutput();
386 OutputPart commonPart = output.addPart(acquisition, MediaType.APPLICATION_XML_TYPE);
387 commonPart.getHeaders().add("label", client.getCommonPartName());
389 res = client.update(knownResourceId, output);
390 int statusCode = res.getStatus();
391 // Check the status code of the response: does it match the expected response(s)?
392 if(logger.isDebugEnabled()){
393 logger.debug(testName + ": status = " + statusCode);
395 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
396 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
397 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
400 input = (MultipartInput) res.getEntity();
401 AcquisitionsCommon updatedAcquisition =
402 (AcquisitionsCommon) extractPart(input,
403 client.getCommonPartName(), AcquisitionsCommon.class);
404 Assert.assertNotNull(updatedAcquisition);
406 Assert.assertEquals(updatedAcquisition.getAcquisitionReferenceNumber(),
407 acquisition.getAcquisitionReferenceNumber(),
408 "Data in updated object did not match submitted data.");
413 // Placeholders until the three tests below can be uncommented.
414 // See Issue CSPACE-401.
416 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithEmptyEntityBody(java.lang.String)
419 public void updateWithEmptyEntityBody(String testName) throws Exception {
420 //Should this really be empty?
424 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithMalformedXml(java.lang.String)
427 public void updateWithMalformedXml(String testName) throws Exception {
428 //Should this really be empty?
432 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithWrongXmlSchema(java.lang.String)
435 public void updateWithWrongXmlSchema(String testName) throws Exception {
436 //Should this really be empty?
441 @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
442 dependsOnMethods = {"create", "update", "testSubmitRequest"})
443 public void updateWithEmptyEntityBody(String testName) throws Exception {
446 setupUpdateWithEmptyEntityBody(testName);
448 // Submit the request to the service and store the response.
449 String method = REQUEST_TYPE.httpMethodName();
450 String url = getResourceURL(knownResourceId);
451 String mediaType = MediaType.APPLICATION_XML;
452 final String entity = "";
453 int statusCode = submitRequest(method, url, mediaType, entity);
455 // Check the status code of the response: does it match
456 // the expected response(s)?
457 if(logger.isDebugEnabled()){
458 (testName + ": url=" + url + " status=" + statusCode);
460 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
461 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
462 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
466 @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
467 dependsOnMethods = {"create", "testSubmitRequest"})
468 public void createWithEmptyEntityBody() throws Exception {
471 setupCreateWithEmptyEntityBody(testName);
473 // Submit the request to the service and store the response.
474 String method = REQUEST_TYPE.httpMethodName();
475 String url = getServiceRootURL();
476 String mediaType = MediaType.APPLICATION_XML;
477 final String entity = "";
478 int statusCode = submitRequest(method, url, mediaType, entity);
480 // Check the status code of the response: does it match
481 // the expected response(s)?
482 if(logger.isDebugEnabled()){
483 logger.debug(testName + ": url=" + url +
484 " status=" + statusCode);
486 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
487 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
488 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
492 @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
493 dependsOnMethods = {"create", "update", "testSubmitRequest"})
494 public void updateWithMalformedXml(String testName) throws Exception {
497 setupUpdateWithMalformedXml(testName);
499 // Submit the request to the service and store the response.
500 String method = REQUEST_TYPE.httpMethodName();
501 String url = getResourceURL(knownResourceId);
502 final String entity = MALFORMED_XML_DATA;
503 int statusCode = submitRequest(method, url, entity);
505 // Check the status code of the response: does it match
506 // the expected response(s)?
507 if(logger.isDebugEnabled()){
508 logger.debug(testName + ": url=" + url +
509 " status=" + statusCode);
511 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
512 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
513 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
517 @Test(dependsOnMethods = {"create", "update", "testSubmitRequest"})
518 public void updateWithWrongXmlSchema(String testName) {
521 setupUpdateWithWrongXmlSchema(testName);
523 // Submit the request to the service and store the response.
524 String method = REQUEST_TYPE.httpMethodName();
525 String url = getResourceURL(knownResourceId);
526 final String entity = WRONG_XML_SCHEMA_DATA;
527 int statusCode = submitRequest(method, url, entity);
529 // Check the status code of the response: does it match
530 // the expected response(s)?
531 if(logger.isDebugEnabled()){
532 logger.debug(testName + ": url=" + url +
533 " status=" + statusCode);
535 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
536 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
537 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
542 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateNonExistent(java.lang.String)
545 @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
546 dependsOnMethods = {"update", "testSubmitRequest"})
547 public void updateNonExistent(String testName) throws Exception {
550 setupUpdateNonExistent(testName);
552 // Submit the request to the service and store the response.
553 // Note: The ID used in this 'create' call may be arbitrary.
554 // The only relevant ID may be the one used in update(), below.
555 AcquisitionClient client = new AcquisitionClient();
556 MultipartOutput multipart = createAcquisitionInstance(NON_EXISTENT_ID);
557 ClientResponse<MultipartInput> res =
558 client.update(NON_EXISTENT_ID, multipart);
559 int statusCode = res.getStatus();
561 // Check the status code of the response: does it match
562 // the expected response(s)?
563 if(logger.isDebugEnabled()){
564 logger.debug(testName + ": status = " + statusCode);
566 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
567 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
568 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
571 // ---------------------------------------------------------------
572 // CRUD tests : DELETE tests
573 // ---------------------------------------------------------------
576 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#delete(java.lang.String)
579 @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
580 dependsOnMethods = {"create", "read", "update"})
581 public void delete(String testName) throws Exception {
584 setupDelete(testName);
586 // Submit the request to the service and store the response.
587 AcquisitionClient client = new AcquisitionClient();
588 ClientResponse<Response> res = client.delete(knownResourceId);
589 int statusCode = res.getStatus();
591 // Check the status code of the response: does it match
592 // the expected response(s)?
593 if(logger.isDebugEnabled()){
594 logger.debug(testName + ": status = " + statusCode);
596 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
597 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
598 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
603 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#deleteNonExistent(java.lang.String)
606 @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
607 dependsOnMethods = {"delete"})
608 public void deleteNonExistent(String testName) throws Exception {
611 setupDeleteNonExistent(testName);
613 // Submit the request to the service and store the response.
614 AcquisitionClient client = new AcquisitionClient();
615 ClientResponse<Response> res = client.delete(NON_EXISTENT_ID);
616 int statusCode = res.getStatus();
618 // Check the status code of the response: does it match
619 // the expected response(s)?
620 if(logger.isDebugEnabled()){
621 logger.debug(testName + ": status = " + statusCode);
623 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
624 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
625 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
628 // ---------------------------------------------------------------
629 // Utility tests : tests of code used in tests above
630 // ---------------------------------------------------------------
632 * Tests the code for manually submitting data that is used by several
633 * of the methods above.
636 @Test(dependsOnMethods = {"create", "read"})
637 public void testSubmitRequest() throws Exception {
639 // Expected status code: 200 OK
640 final int EXPECTED_STATUS = Response.Status.OK.getStatusCode();
642 // Submit the request to the service and store the response.
643 String method = ServiceRequestType.READ.httpMethodName();
644 String url = getResourceURL(knownResourceId);
645 int statusCode = submitRequest(method, url);
647 // Check the status code of the response: does it match
648 // the expected response(s)?
649 if(logger.isDebugEnabled()){
650 logger.debug("testSubmitRequest: url=" + url +
651 " status=" + statusCode);
653 Assert.assertEquals(statusCode, EXPECTED_STATUS);
657 // ---------------------------------------------------------------
658 // Utility methods used by tests above
659 // ---------------------------------------------------------------
661 * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
664 public String getServicePathComponent() {
665 return new AcquisitionClient().getServicePathComponent();
670 * Creates the acquisition instance.
672 * @param identifier the identifier
673 * @return the multipart output
675 private MultipartOutput createAcquisitionInstance(String identifier) {
676 AcquisitionsCommon acquisition = new AcquisitionsCommon();
677 acquisition.setAcquisitionReferenceNumber("acquisitionReferenceNumber-" + identifier);
678 AcquisitionSourceList acqSourcesList = new AcquisitionSourceList();
679 List<String> sources = acqSourcesList.getAcquisitionSource();
680 // @TODO Use properly formatted refNames for representative acquisition
681 // sources in this example test record. The following are mere placeholders.
682 sources.add("Donor Acquisition Source-" + identifier);
683 sources.add("Museum Acquisition Source-" + identifier);
684 acquisition.setAcquisitionSources(acqSourcesList);
685 MultipartOutput multipart = new MultipartOutput();
686 OutputPart commonPart = multipart.addPart(acquisition,
687 MediaType.APPLICATION_XML_TYPE);
688 commonPart.getHeaders().add("label", new AcquisitionClient().getCommonPartName());
690 if(logger.isDebugEnabled()){
691 logger.debug("to be created, acquisition common");
692 logger.debug(objectAsXmlString(acquisition, AcquisitionsCommon.class));