]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
237e090f0cc6a92511b305369b96622c580e659c
[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.List;
26
27 import javax.ws.rs.core.MediaType;
28 import javax.ws.rs.core.Response;
29
30 import org.dom4j.Element;
31 import org.collectionspace.services.client.CollectionSpaceClient;
32 import org.collectionspace.services.client.IntakeClient;
33 import org.collectionspace.services.client.PayloadInputPart;
34 import org.collectionspace.services.client.PayloadOutputPart;
35 import org.collectionspace.services.client.PoxPayloadIn;
36 import org.collectionspace.services.client.PoxPayloadOut;
37 import org.collectionspace.services.common.api.GregorianCalendarDateTimeUtils;
38 import org.collectionspace.services.intake.EntryMethodList;
39 import org.collectionspace.services.intake.FieldCollectionEventNameList;
40 import org.collectionspace.services.intake.CurrentLocationGroup;
41 import org.collectionspace.services.intake.CurrentLocationGroupList;
42 import org.collectionspace.services.intake.IntakesCommon;
43 import org.collectionspace.services.jaxb.AbstractCommonList;
44 import org.jboss.resteasy.client.ClientResponse;
45 import org.testng.Assert;
46 import org.testng.annotations.Test;
47 import org.slf4j.Logger;
48 import org.slf4j.LoggerFactory;
49
50 // FIXME: http://issues.collectionspace.org/browse/CSPACE-1685
51 /**
52  * IntakeServiceTest, carries out tests against a
53  * deployed and running Intake Service.
54  *
55  * $LastChangedRevision$
56  * $LastChangedDate$
57  */
58 public class IntakeServiceTest extends AbstractPoxServiceTestImpl<AbstractCommonList, IntakesCommon> {
59
60     /** The logger. */
61     private final String CLASS_NAME = IntakeServiceTest.class.getName();
62     private final Logger logger = LoggerFactory.getLogger(IntakeServiceTest.class);
63     private final static String CURRENT_DATE_UTC =
64             GregorianCalendarDateTimeUtils.currentDateUTC();
65
66     @Override
67     protected CollectionSpaceClient getClientInstance() {
68         return new IntakeClient();
69     }
70
71     @Override
72     protected String getServiceName() {
73         return IntakeClient.SERVICE_NAME;
74     }
75
76     // ---------------------------------------------------------------
77     // CRUD tests : CREATE tests
78     // ---------------------------------------------------------------
79     
80     // See Issue CSPACE-401.
81     /* (non-Javadoc)
82      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithEmptyEntityBody(java.lang.String)
83      */
84     @Override
85     public void createWithEmptyEntityBody(String testName) throws Exception {
86         //Should this really be empty?
87     }
88
89     /* (non-Javadoc)
90      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithMalformedXml(java.lang.String)
91      */
92     @Override
93     public void createWithMalformedXml(String testName) throws Exception {
94         //Should this really be empty?
95     }
96
97     /* (non-Javadoc)
98      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createWithWrongXmlSchema(java.lang.String)
99      */
100     @Override
101     public void createWithWrongXmlSchema(String testName) throws Exception {
102         //Should this really be empty?
103     }
104
105     /*
106     @Override
107     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
108     dependsOnMethods = {"create", "testSubmitRequest"})
109     public void createWithEmptyEntityBody(String testName) throws Exception {
110     
111     if (logger.isDebugEnabled()) {
112     logger.debug(testBanner(testName, CLASS_NAME));
113     }
114     // Perform setup.
115     setupCreateWithEmptyEntityBody();
116     
117     // Submit the request to the service and store the response.
118     String method = REQUEST_TYPE.httpMethodName();
119     String url = getServiceRootURL();
120     String mediaType = MediaType.APPLICATION_XML;
121     final String entity = "";
122     int statusCode = submitRequest(method, url, mediaType, entity);
123     
124     // Check the status code of the response: does it match
125     // the expected response(s)?
126     if(logger.isDebugEnabled()){
127     logger.debug("createWithEmptyEntityBody url=" + url +
128     " status=" + statusCode);
129     }
130     Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
131     invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
132     Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
133     }
134     
135     @Override
136     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
137     dependsOnMethods = {"create", "testSubmitRequest"})
138     public void createWithMalformedXml(String testName) throws Exception {
139     
140     if (logger.isDebugEnabled()) {
141     logger.debug(testBanner(testName, CLASS_NAME));
142     }
143     // Perform setup.
144     setupCreateWithMalformedXml();
145     
146     // Submit the request to the service and store the response.
147     String method = REQUEST_TYPE.httpMethodName();
148     String url = getServiceRootURL();
149     String mediaType = MediaType.APPLICATION_XML;
150     final String entity = MALFORMED_XML_DATA; // Constant from base class.
151     int statusCode = submitRequest(method, url, mediaType, entity);
152     
153     // Check the status code of the response: does it match
154     // the expected response(s)?
155     if(logger.isDebugEnabled()){
156     logger.debug(testName + ": url=" + url +
157     " status=" + statusCode);
158     }
159     Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
160     invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
161     Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
162     }
163     
164     @Override
165     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
166     dependsOnMethods = {"create", "testSubmitRequest"})
167     public void createWithWrongXmlSchema(String testName) throws Exception {
168     
169     if (logger.isDebugEnabled()) {
170     logger.debug(testBanner(testName, CLASS_NAME));
171     }
172     // Perform setup.
173     setupCreateWithWrongXmlSchema(testName, logger);
174     
175     // Submit the request to the service and store the response.
176     String method = REQUEST_TYPE.httpMethodName();
177     String url = getServiceRootURL();
178     String mediaType = MediaType.APPLICATION_XML;
179     final String entity = WRONG_XML_SCHEMA_DATA;
180     int statusCode = submitRequest(method, url, mediaType, entity);
181     
182     // Check the status code of the response: does it match
183     // the expected response(s)?
184     if(logger.isDebugEnabled()){
185     logger.debug(testName + ": url=" + url +
186     " status=" + statusCode);
187     }
188     Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
189     invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
190     Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
191     }
192      */
193     
194     // ---------------------------------------------------------------
195     // CRUD tests : READ tests
196     // ---------------------------------------------------------------
197     
198         protected void compareReadInstances(IntakesCommon original, IntakesCommon fromRead) throws Exception {
199         // Verify the number and contents of values in repeatable fields,
200         // as created in the instance record used for testing.
201         List<String> entryMethods =
202                         fromRead.getEntryMethods().getEntryMethod();
203         Assert.assertTrue(entryMethods.size() > 0);
204         Assert.assertNotNull(entryMethods.get(0));
205
206         List<String> fieldCollectionEventNames =
207                         fromRead.getFieldCollectionEventNames().getFieldCollectionEventName();
208         Assert.assertTrue(fieldCollectionEventNames.size() > 0);
209         Assert.assertNotNull(fieldCollectionEventNames.get(0));
210
211         CurrentLocationGroupList currentLocationGroupList = fromRead.getCurrentLocationGroupList();
212         Assert.assertNotNull(currentLocationGroupList);
213         List<CurrentLocationGroup> currentLocationGroups = currentLocationGroupList.getCurrentLocationGroup();
214         Assert.assertNotNull(currentLocationGroups);
215         Assert.assertTrue(currentLocationGroups.size() > 0);
216         CurrentLocationGroup currentLocationGroup = currentLocationGroups.get(0);
217         Assert.assertNotNull(currentLocationGroup);
218         Assert.assertNotNull(currentLocationGroup.getCurrentLocationNote());
219
220         // Check the values of fields containing Unicode UTF-8 (non-Latin-1) characters.
221         if (logger.isDebugEnabled()) {
222             logger.debug("UTF-8 data sent=" + getUTF8DataFragment() + "\n"
223                     + "UTF-8 data received=" + fromRead.getEntryNote());
224         }
225         Assert.assertEquals(fromRead.getEntryNote(), getUTF8DataFragment(),
226                 "UTF-8 data retrieved '" + fromRead.getEntryNote()
227                 + "' does not match expected data '" + getUTF8DataFragment());
228         }
229     
230     // Failure outcomes
231
232     @Override
233     public void delete(String testName) throws Exception {
234         // Do nothing because this test is not ready to delete the "knownResourceId".
235         // Instead, the method localDelete() will get called later in the dependency chain. The
236         // method localDelete() has a dependency on the test "verifyReadOnlyCoreFields".  Once the "verifyReadOnlyCoreFields"
237         // test is run, the localDelete() test/method will get run.  The localDelete() test/method in turn
238         // calls the inherited delete() test/method.
239     }
240     
241     @Test(dataProvider = "testName", dependsOnMethods = {"CRUDTests", "verifyReadOnlyCoreFields"})
242     public void localDelete(String testName) throws Exception {
243         // Because of issues with TestNG not allowing @Test annotations on on override methods,
244         // and because we want the "updateWrongUser" to run before the "delete" test, we need
245         // this method.  This method will call super.delete() after all the dependencies have been
246         // met.
247         super.delete(testName);
248     }
249
250     @Test(dataProvider = "testName", dependsOnMethods = {"CRUDTests"})
251     public void verifyReadOnlyCoreFields(String testName) throws Exception {
252         // TODO These should be in some core client utils
253         final String COLLECTIONSPACE_CORE_SCHEMA = "collectionspace_core";
254         final String COLLECTIONSPACE_CORE_TENANTID = "tenantId";
255         final String COLLECTIONSPACE_CORE_URI = "uri";
256         final String COLLECTIONSPACE_CORE_CREATED_AT = "createdAt";
257         final String COLLECTIONSPACE_CORE_UPDATED_AT = "updatedAt";
258         final String COLLECTIONSPACE_CORE_CREATED_BY = "createdBy";
259         final String COLLECTIONSPACE_CORE_UPDATED_BY = "updatedBy";
260
261         // Perform setup.
262         setupUpdate();
263
264         // Retrieve the contents of a resource to update.
265         IntakeClient client = new IntakeClient();
266         PoxPayloadIn input = null;
267         Response res = client.read(knownResourceId);
268         try {
269                 if (logger.isDebugEnabled()) {
270                     logger.debug(testName + ": read status = " + res.getStatus());
271                 }
272                 Assert.assertEquals(res.getStatus(), testExpectedStatusCode);
273         
274                 input = new PoxPayloadIn((String)res.getEntity());
275         } finally {
276                 res.close();
277         }
278         
279         PayloadInputPart payloadInputPart = input.getPart(COLLECTIONSPACE_CORE_SCHEMA);
280         Element coreAsElement = null;
281         if (payloadInputPart != null) {
282                 coreAsElement = payloadInputPart.getElementBody();
283         }
284         Assert.assertNotNull(coreAsElement);
285         if (logger.isDebugEnabled()) {
286             logger.debug("Core part before update:");
287             logger.debug(coreAsElement.asXML());
288         }
289
290         // Update the read-only elements
291         Element tenantId = coreAsElement.element(COLLECTIONSPACE_CORE_TENANTID);
292         String originalTenantId = tenantId.getText();
293         tenantId.setText("foo");
294         Element uri = coreAsElement.element(COLLECTIONSPACE_CORE_URI);
295         String originalUri = uri.getText();
296         uri.setText("foo");
297         Element createdAt = coreAsElement.element(COLLECTIONSPACE_CORE_CREATED_AT);
298         String originalCreatedAt = createdAt.getText();
299         String now = GregorianCalendarDateTimeUtils.timestampUTC();
300         if(originalCreatedAt.equalsIgnoreCase(now) && logger.isWarnEnabled()) {
301                         logger.warn("Cannot check createdAt read-only; too fast!");
302         }
303         createdAt.setText(now);
304         Element createdBy = coreAsElement.element(COLLECTIONSPACE_CORE_CREATED_BY);
305         String originalCreatedBy = createdBy.getText();
306         createdBy.setText("foo");
307         
308         if (logger.isDebugEnabled()) {
309             logger.debug("Core part to be updated:");
310             logger.debug(coreAsElement.asXML());
311         }
312
313         // Create an output payload to send to the service, and add the common part
314         PoxPayloadOut output = new PoxPayloadOut(this.getServicePathComponent());
315         PayloadOutputPart corePart = output.addPart(COLLECTIONSPACE_CORE_SCHEMA, coreAsElement);
316         
317         // Submit the request to the service and store the response.
318         res = client.update(knownResourceId, output);
319             try {
320                 int statusCode = res.getStatus();
321                 // Check the status code of the response: does it match the expected response(s)?
322                 if (logger.isDebugEnabled()) {
323                     logger.debug(testName + ": status = " + statusCode);
324                 }
325                 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
326                         invalidStatusCodeMessage(testRequestType, statusCode));
327                 Assert.assertEquals(statusCode, testExpectedStatusCode);
328         
329                 input = new PoxPayloadIn((String)res.getEntity());
330             } finally {
331                 res.close();
332             }
333                 
334         PayloadInputPart updatedCorePart = input.getPart(COLLECTIONSPACE_CORE_SCHEMA);
335         Element updatedCoreAsElement = null;
336         if (updatedCorePart != null) {
337                 updatedCoreAsElement = updatedCorePart.getElementBody();
338         }
339         Assert.assertNotNull(updatedCoreAsElement);
340         
341         tenantId = updatedCoreAsElement.element(COLLECTIONSPACE_CORE_TENANTID);
342         String updatedTenantId = tenantId.getText();
343         Assert.assertEquals(updatedTenantId, originalTenantId,
344                                 "CORE part TenantID was able to update!");
345         uri = updatedCoreAsElement.element(COLLECTIONSPACE_CORE_URI);
346         String updatedUri = uri.getText();
347         Assert.assertEquals(updatedUri, originalUri,
348                                 "CORE part URI was able to update!");
349         createdAt = updatedCoreAsElement.element(COLLECTIONSPACE_CORE_CREATED_AT);
350         String updatedCreatedAt = createdAt.getText();
351         Assert.assertEquals(updatedCreatedAt, originalCreatedAt,
352                                 "CORE part CreatedAt was able to update!");
353         createdBy = updatedCoreAsElement.element(COLLECTIONSPACE_CORE_CREATED_BY);
354         String updatedCreatedBy = createdBy.getText();
355         Assert.assertEquals(updatedCreatedBy, originalCreatedBy,
356                                 "CORE part CreatedBy was able to update!");
357
358     }
359
360     // Failure outcomes
361     // Placeholders until the three tests below can be uncommented.
362     
363     // See Issue CSPACE-401.
364     /* (non-Javadoc)
365      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithEmptyEntityBody(java.lang.String)
366      */
367     @Override
368     public void updateWithEmptyEntityBody(String testName) throws Exception {
369         //Should this really be empty?
370     }
371
372     /* (non-Javadoc)
373      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithMalformedXml(java.lang.String)
374      */
375     @Override
376     public void updateWithMalformedXml(String testName) throws Exception {
377         //Should this really be empty?
378     }
379
380     /* (non-Javadoc)
381      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#updateWithWrongXmlSchema(java.lang.String)
382      */
383     @Override
384     public void updateWithWrongXmlSchema(String testName) throws Exception {
385         //Should this really be empty?
386     }
387
388     /*
389     @Override
390     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
391     dependsOnMethods = {"create", "update", "testSubmitRequest"})
392     public void updateWithEmptyEntityBody(String testName) throws Exception {
393     
394     if (logger.isDebugEnabled()) {
395     logger.debug(testBanner(testName, CLASS_NAME));
396     }
397     // Perform setup.
398     setupUpdateWithEmptyEntityBody();
399     
400     // Submit the request to the service and store the response.
401     String method = REQUEST_TYPE.httpMethodName();
402     String url = getResourceURL(knownResourceId);
403     String mediaType = MediaType.APPLICATION_XML;
404     final String entity = "";
405     int statusCode = submitRequest(method, url, mediaType, entity);
406     
407     // Check the status code of the response: does it match
408     // the expected response(s)?
409     if(logger.isDebugEnabled()){
410     logger.debug(testName + ": url=" + url +
411     " status=" + statusCode);
412     }
413     Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
414     invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
415     Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
416     }
417     
418     @Override
419     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
420     dependsOnMethods = {"create", "update", "testSubmitRequest"})
421     public void updateWithMalformedXml(String testName) throws Exception {
422     
423     if (logger.isDebugEnabled()) {
424     logger.debug(testBanner(testName, CLASS_NAME));
425     }
426     // Perform setup.
427     setupUpdateWithMalformedXml();
428     
429     // Submit the request to the service and store the response.
430     String method = REQUEST_TYPE.httpMethodName();
431     String url = getResourceURL(knownResourceId);
432     String mediaType = MediaType.APPLICATION_XML;
433     final String entity = MALFORMED_XML_DATA;
434     int statusCode = submitRequest(method, url, mediaType, entity);
435     
436     // Check the status code of the response: does it match
437     // the expected response(s)?
438     if(logger.isDebugEnabled()){
439     logger.debug(testName + ": url=" + url +
440     " status=" + statusCode);
441     }
442     Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
443     invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
444     Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
445     }
446     
447     @Override
448     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
449     dependsOnMethods = {"create", "update", "testSubmitRequest"})
450     public void updateWithWrongXmlSchema(String testName) throws Exception {
451     
452     if (logger.isDebugEnabled()) {
453     logger.debug(testBanner(testName, CLASS_NAME));
454     }
455     // Perform setup.
456     setupUpdateWithWrongXmlSchema();
457     
458     // Submit the request to the service and store the response.
459     String method = REQUEST_TYPE.httpMethodName();
460     String url = getResourceURL(knownResourceId);
461     String mediaType = MediaType.APPLICATION_XML;
462     final String entity = WRONG_XML_SCHEMA_DATA;
463     int statusCode = submitRequest(method, url, mediaType, entity);
464     
465     // Check the status code of the response: does it match
466     // the expected response(s)?
467     if(logger.isDebugEnabled()){
468     logger.debug(testName + ": url=" + url +
469     " status=" + statusCode);
470     }
471     Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
472     invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
473     Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
474     }
475      */
476
477     // ---------------------------------------------------------------
478     // Utility tests : tests of code used in tests above
479     // ---------------------------------------------------------------
480     
481     /* (non-Javadoc)
482      * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
483      */
484     @Override
485     public String getServicePathComponent() {
486         return IntakeClient.SERVICE_PATH_COMPONENT;
487     }
488
489     /**
490      * Creates the intake instance.
491      *
492      * @param identifier the identifier
493      * @return the multipart output
494      */
495     @Override
496     protected PoxPayloadOut createInstance(String identifier) {
497         return createIntakeInstance(
498                 "entryNumber-" + identifier,
499                 CURRENT_DATE_UTC,
500                 "depositor-" + identifier);
501     }
502
503     /**
504      * Creates the intake instance.
505      *
506      * @param entryNumber the entry number
507      * @param entryDate the entry date
508      * @param depositor the depositor
509      * @return the multipart output
510      */
511     private PoxPayloadOut createIntakeInstance(String entryNumber,
512             String entryDate,
513             String depositor) {
514         IntakesCommon intake = new IntakesCommon();
515         intake.setEntryNumber(entryNumber);
516         intake.setEntryDate(entryDate);
517         intake.setDepositor(depositor);
518
519         EntryMethodList entryMethodsList = new EntryMethodList();
520         List<String> entryMethods = entryMethodsList.getEntryMethod();
521         entryMethods.add("Left at doorstep");
522         entryMethods.add("Received via post");
523         intake.setEntryMethods(entryMethodsList);
524
525         FieldCollectionEventNameList eventNamesList = new FieldCollectionEventNameList();
526         List<String> eventNames = eventNamesList.getFieldCollectionEventName();
527         // FIXME Use properly formatted refNames for representative event names
528         // in this example test record. The following are mere placeholders.
529         eventNames.add("Field Collection Event Name-1");
530         eventNames.add("Field Collection Event Name-2");
531         intake.setFieldCollectionEventNames(eventNamesList);
532
533         CurrentLocationGroupList currentLocationGroupList = new CurrentLocationGroupList();
534         List<CurrentLocationGroup> currentLocationGroups = currentLocationGroupList.getCurrentLocationGroup();
535         CurrentLocationGroup currentLocationGroup = new CurrentLocationGroup();
536         currentLocationGroup.setCurrentLocation("upstairs");
537         currentLocationGroup.setCurrentLocationFitness("suitable");
538         currentLocationGroup.setCurrentLocationNote("A most suitable location.");
539         currentLocationGroups.add(currentLocationGroup);
540         intake.setCurrentLocationGroupList(currentLocationGroupList);
541
542         intake.setEntryNote(getUTF8DataFragment());
543
544         PoxPayloadOut multipart = new PoxPayloadOut(IntakeClient.SERVICE_PAYLOAD_NAME);
545         PayloadOutputPart commonPart =
546                 multipart.addPart(intake, MediaType.APPLICATION_XML_TYPE);
547         commonPart.setLabel(new IntakeClient().getCommonPartName());
548
549         if (logger.isDebugEnabled()) {
550             logger.debug("to be created, intake common");
551             logger.debug(objectAsXmlString(intake, IntakesCommon.class));
552         }
553
554         return multipart;
555     }
556
557         @Override
558         protected PoxPayloadOut createInstance(String commonPartName,
559                         String identifier) {
560                 return this.createInstance(identifier);
561         }
562
563         @Override
564         protected IntakesCommon updateInstance(IntakesCommon intakesCommon) {
565                 IntakesCommon result = new IntakesCommon();
566                 
567                 result.setEntryNumber("updated-" + intakesCommon.getEntryNumber());
568                 result.setEntryNote(intakesCommon.getEntryNote());
569
570         CurrentLocationGroupList currentLocationGroupList = intakesCommon.getCurrentLocationGroupList();
571         Assert.assertNotNull(currentLocationGroupList);
572         List<CurrentLocationGroup> currentLocationGroups = currentLocationGroupList.getCurrentLocationGroup();
573         Assert.assertNotNull(currentLocationGroups);
574         Assert.assertTrue(currentLocationGroups.size() > 0);
575         CurrentLocationGroup currentLocationGroup = currentLocationGroups.get(0);
576         Assert.assertNotNull(currentLocationGroup);
577         String currentLocationNote = currentLocationGroup.getCurrentLocationNote();
578         Assert.assertNotNull(currentLocationNote);
579         String updatedCurrentLocationNote = "updated-" + currentLocationNote;
580         currentLocationGroups.get(0).setCurrentLocationNote(updatedCurrentLocationNote);
581         result.setCurrentLocationGroupList(currentLocationGroupList);
582         
583         return result;
584         }
585
586         @Override
587         protected void compareUpdatedInstances(IntakesCommon original,
588                         IntakesCommon updated) throws Exception {
589         Assert.assertEquals(updated.getEntryNumber(),
590                         original.getEntryNumber(),
591                 "Data in updated object did not match submitted data.");
592         
593         CurrentLocationGroupList currentLocationGroupList = updated.getCurrentLocationGroupList();
594         Assert.assertNotNull(currentLocationGroupList);
595         List<CurrentLocationGroup> currentLocationGroups = currentLocationGroupList.getCurrentLocationGroup();
596         Assert.assertNotNull(currentLocationGroups);
597         Assert.assertTrue(currentLocationGroups.size() > 0);
598         Assert.assertNotNull(currentLocationGroups.get(0));
599         
600         String updatedCurrentLocationNote = original.getCurrentLocationGroupList()
601                         .getCurrentLocationGroup().get(0).getCurrentLocationNote();
602         Assert.assertEquals(updatedCurrentLocationNote,
603                 currentLocationGroups.get(0).getCurrentLocationNote(),
604                 "Data in updated object did not match submitted data.");
605         
606         Assert.assertEquals(updated.getEntryNote(), original.getEntryNote(),
607                 "Data in updated object did not match submitted data.");
608         //
609         // UTF-8 Checks
610         //
611         if (logger.isDebugEnabled()) {
612             logger.debug("UTF-8 data sent=" + original.getEntryNote() + "\n"
613                     + "UTF-8 data received=" + updated.getEntryNote());
614         }
615         Assert.assertTrue(updated.getEntryNote().contains(getUTF8DataFragment()),
616                 "UTF-8 data retrieved '" + updated.getEntryNote()
617                 + "' does not contain expected data '" + getUTF8DataFragment());        
618         }
619
620     /*
621      * For convenience and terseness, this test method is the base of the test execution dependency chain.  Other test methods may
622      * refer to this method in their @Test annotation declarations.
623      */
624     @Override
625     @Test(dataProvider = "testName",
626                 dependsOnMethods = {
627                         "org.collectionspace.services.client.test.AbstractServiceTestImpl.baseCRUDTests"})    
628         public void CRUDTests(String testName) {
629                 // TODO Auto-generated method stub              
630         }
631 }