]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
7186f79bafea77ad4915491f8afe1ed83b5305c0
[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 (c)) 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.HashMap;
26 import java.util.List;
27 import java.util.Map;
28
29 import org.collectionspace.services.PlaceJAXBSchema;
30 import org.collectionspace.services.client.AbstractCommonListUtils;
31 import org.collectionspace.services.client.AuthorityClient;
32 import org.collectionspace.services.client.CollectionSpaceClient;
33 import org.collectionspace.services.client.PayloadOutputPart;
34 import org.collectionspace.services.client.PoxPayloadIn;
35 import org.collectionspace.services.client.PoxPayloadOut;
36 import org.collectionspace.services.client.PlaceAuthorityClient;
37 import org.collectionspace.services.client.PlaceAuthorityClientUtils;
38 import org.collectionspace.services.jaxb.AbstractCommonList;
39 import org.collectionspace.services.place.PlaceauthoritiesCommon;
40 import org.collectionspace.services.place.PlacesCommon;
41 import org.collectionspace.services.place.PlaceNameGroup;
42 import org.collectionspace.services.place.PlaceNameGroupList;
43
44 import org.jboss.resteasy.client.ClientResponse;
45
46 import org.slf4j.Logger;
47 import org.slf4j.LoggerFactory;
48
49 import org.testng.Assert;
50 import org.testng.annotations.AfterClass;
51 import org.testng.annotations.Test;
52
53 /**
54  * PlaceAuthorityServiceTest, carries out tests against a
55  * deployed and running PlaceAuthority Service.
56  *
57  * $LastChangedRevision: 753 $
58  * $LastChangedDate: 2009-09-23 11:03:36 -0700 (Wed, 23 Sep 2009) $
59  */
60 public class PlaceAuthorityServiceTest extends AbstractAuthorityServiceTest<PlaceauthoritiesCommon, PlacesCommon> {
61
62     /** The logger. */
63     private final String CLASS_NAME = PlaceAuthorityServiceTest.class.getName();
64     private final Logger logger = LoggerFactory.getLogger(PlaceAuthorityServiceTest.class);
65     private final String REFNAME = "refName";
66     private final static String EMPTY_REFNAME = "";
67     private final String DISPLAYNAME = "displayName";
68
69         @Override
70         public String getServicePathComponent() {
71                 return PlaceAuthorityClient.SERVICE_PATH_COMPONENT;
72         }
73
74         @Override
75         protected String getServiceName() {
76                 return PlaceAuthorityClient.SERVICE_NAME;
77         }
78     
79     public String getItemServicePathComponent() {
80         return AuthorityClient.ITEMS;
81     }   
82     
83     // Instance variables specific to this test.
84     
85 //    /** The SERVICE path component. */
86 //    final String SERVICE_PATH_COMPONENT = "placeauthorities";
87 //    
88 //    /** The ITEM service path component. */
89 //    final String ITEM_SERVICE_PATH_COMPONENT = "items";
90 //    
91     
92     final String TEST_DNAME = "San Jose, CA";
93     final String TEST_NAME = "San Jose";
94     final String TEST_SHORTID = "sanjose";
95     // TODO Make place type be a controlled vocab term.
96     final String TEST_PLACE_TYPE = "City";
97     // TODO Make status type be a controlled vocab term.
98     final String TEST_STATUS = "Approved";
99     final String TEST_NOTE = "My hometown";
100     final String TEST_SOURCE = "Peralta's Places of California";
101     final String TEST_SOURCE_PAGE = "p.21";
102     final String TEST_DISPLAY_DATE = "This year";
103     final String TEST_EARLIEST_SINGLE_YEAR = "2012";
104     
105     /** The known resource id. */
106     private String knownResourceShortIdentifer = null;
107     private String knownResourceRefName = null;
108     
109     private String knownPlaceTypeRefName = null;
110     
111     /* (non-Javadoc)
112      * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
113      */
114     @Override
115     protected CollectionSpaceClient getClientInstance() {
116         return new PlaceAuthorityClient();
117     }
118
119     /**
120      * Creates the item in authority.
121      *
122      * @param vcsid the vcsid
123      * @param authRefName the auth ref name
124      * @return the string
125      */
126     private String createItemInAuthority(String vcsid, String authRefName) {
127         final String testName = "createItemInAuthority("+vcsid+","+authRefName+")"; 
128     
129         // Submit the request to the service and store the response.
130         PlaceAuthorityClient client = new PlaceAuthorityClient();
131         Map<String, String> sanjoseMap = new HashMap<String,String>();
132         // TODO Make place type and status be controlled vocabs.
133         sanjoseMap.put(PlaceJAXBSchema.DISPLAY_NAME, TEST_DNAME);
134         sanjoseMap.put(PlaceJAXBSchema.SHORT_IDENTIFIER, TEST_SHORTID);
135         sanjoseMap.put(PlaceJAXBSchema.NAME, TEST_NAME);
136         sanjoseMap.put(PlaceJAXBSchema.NOTE, TEST_NOTE);
137         sanjoseMap.put(PlaceJAXBSchema.SOURCE, TEST_SOURCE);
138         sanjoseMap.put(PlaceJAXBSchema.SOURCE_PAGE, TEST_SOURCE_PAGE);
139         sanjoseMap.put(PlaceJAXBSchema.PLACE_TYPE, TEST_PLACE_TYPE);
140         sanjoseMap.put(PlaceJAXBSchema.TERM_STATUS, TEST_STATUS);
141         
142         String newID = PlaceAuthorityClientUtils.createItemInAuthority(vcsid,
143                         authRefName, sanjoseMap, client );    
144
145         // Store the ID returned from the first item resource created
146         // for additional tests below.
147         if (knownItemResourceId == null){
148                 setKnownItemResource(newID, TEST_SHORTID);
149             if (logger.isDebugEnabled()) {
150                 logger.debug(testName + ": knownItemResourceId=" + newID);
151             }
152         }
153         
154         // Store the IDs from any item resources created
155         // by tests, along with the IDs of their parents, so these items
156         // can be deleted after all tests have been run.
157         allResourceItemIdsCreated.put(newID, vcsid);
158
159         return newID;
160     }
161
162     /**
163      * Verify item display name.
164      *
165      * @param testName the test name
166      * @throws Exception the exception
167      */
168     @Test(dataProvider="testName", 
169         dependsOnMethods = {"readItem", "updateItem"})
170     public void verifyItemDisplayName(String testName) throws Exception {
171         // Perform setup.
172         setupRead();
173         //
174         // First, read our known item resource
175         //
176         PlaceAuthorityClient client = new PlaceAuthorityClient();
177         ClientResponse<String> res = client.readItem(knownResourceId, knownItemResourceId);
178         PlacesCommon place = null;
179         try {
180             assertStatusCode(res, testName);
181                 // Check whether place has expected displayName.
182                 PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
183                 place = (PlacesCommon) extractPart(input,
184                         client.getItemCommonPartName(), PlacesCommon.class);
185                 Assert.assertNotNull(place);
186         } finally {
187                 if (res != null) {
188                 res.releaseConnection();
189             }
190         }
191         //
192         // Now prepare an updated payload.
193         //
194         String displayName = place.getDisplayName();
195         // Make sure displayName matches computed form
196         String expectedDisplayName = 
197             PlaceAuthorityClientUtils.prepareDefaultDisplayName(TEST_NAME);
198         Assert.assertNotNull(displayName, expectedDisplayName);
199         
200         // Update the shortName and verify the computed name is updated.
201         place.setCsid(null);
202         place.setDisplayNameComputed(true);
203         
204          // Verify the contents of this resource
205         PlaceNameGroupList placeNameGroupList = place.getPlaceNameGroupList();
206         Assert.assertNotNull(placeNameGroupList);
207         List<PlaceNameGroup> placeNameGroups = placeNameGroupList.getPlaceNameGroup();
208         Assert.assertNotNull(placeNameGroups);
209         Assert.assertTrue(placeNameGroups.size() > 0);
210         String name = placeNameGroups.get(0).getName();
211         Assert.assertNotNull(name);
212
213         // Update the contents of this resource.
214         final String PLACE_NAME_ADDITION = "verify-item-place-name-updated";
215         placeNameGroups.get(0).setName(PLACE_NAME_ADDITION + TEST_NAME);
216         place.setPlaceNameGroupList(placeNameGroupList);
217         if (logger.isDebugEnabled()) {
218             logger.debug("to be updated Place");
219             logger.debug(objectAsXmlString(place,
220                     PlacesCommon.class));
221         }
222         expectedDisplayName = 
223             PlaceAuthorityClientUtils.prepareDefaultDisplayName(PLACE_NAME_ADDITION + TEST_NAME);
224
225         // Submit the updated resource to the service and store the response.
226         PoxPayloadOut output = new PoxPayloadOut(PlaceAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
227         PayloadOutputPart commonPart = output.addPart(client.getItemCommonPartName(), place);
228
229         setupUpdate();        
230         res = client.updateItem(knownResourceId, knownItemResourceId, output);
231         PlacesCommon updatedPlace = null;
232         try {
233                 assertStatusCode(res, testName);
234                 // Retrieve the updated resource and verify that its contents exist.
235                 PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
236                 updatedPlace = (PlacesCommon) extractPart(input,
237                                 client.getItemCommonPartName(), PlacesCommon.class);
238                 Assert.assertNotNull(updatedPlace);
239         } finally {
240                 if (res != null) {
241                 res.releaseConnection();
242             }
243         }
244
245         // Verify that the updated resource computes the right displayName.
246         Assert.assertEquals(updatedPlace.getDisplayName(), expectedDisplayName,
247             "Updated DisplayName in Place not reflected in computed DisplayName.");
248         //
249         // Now Update the displayName, not computed and verify the computed name is overriden.
250         //
251         place.setDisplayNameComputed(false);
252         expectedDisplayName = "TestName";
253         place.setDisplayName(expectedDisplayName);
254
255         // Submit the updated resource to the service and store the response.
256         output = new PoxPayloadOut(PlaceAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
257         commonPart = output.addPart(client.getItemCommonPartName(), place);
258         setupUpdate();        
259         res = client.updateItem(knownResourceId, knownItemResourceId, output);
260         try {
261                 assertStatusCode(res, testName);
262                 // Retrieve the updated resource and verify that its contents exist.
263                 PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
264                 updatedPlace = (PlacesCommon) extractPart(input,
265                                 client.getItemCommonPartName(), PlacesCommon.class);
266                 Assert.assertNotNull(updatedPlace);
267         } finally {
268                 if (res != null) {
269                 res.releaseConnection();
270             }
271         }
272
273         // Verify that the updated resource received the correct data.
274         Assert.assertEquals(updatedPlace.isDisplayNameComputed(), false,
275                 "Updated displayNameComputed in Place did not match submitted data.");
276         // Verify that the updated resource computes the right displayName.
277         Assert.assertEquals(updatedPlace.getDisplayName(),
278                         expectedDisplayName,
279                 "Updated DisplayName (not computed) in Place not stored.");
280     }
281
282     /**
283      * Verify illegal item display name.
284      *
285      * @param testName the test name
286      * @throws Exception the exception
287      */
288     @Test(dataProvider="testName",
289             dependsOnMethods = {"verifyItemDisplayName"})
290     public void verifyIllegalItemDisplayName(String testName) throws Exception {
291         // Perform setup for read.
292         setupRead();
293
294         // Submit the request to the service and store the response.
295         PlaceAuthorityClient client = new PlaceAuthorityClient();
296         ClientResponse<String> res = client.readItem(knownResourceId, knownItemResourceId);
297         PlacesCommon place= null;
298         try {
299             assertStatusCode(res, testName);        
300                 PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
301                 place = (PlacesCommon) extractPart(input,
302                         client.getItemCommonPartName(), PlacesCommon.class);
303                 Assert.assertNotNull(place);
304             } finally {
305                 if (res != null) {
306                 res.releaseConnection();
307             }
308         }
309
310     // Try to Update with computed false and no displayName
311         place.setDisplayNameComputed(false);
312         place.setDisplayName(null);
313         
314         // Submit the updated resource to the service and store the response.
315         PoxPayloadOut output = new PoxPayloadOut(PlaceAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
316         PayloadOutputPart commonPart = output.addPart(client.getItemCommonPartName(), place);
317         setupUpdateWithInvalidBody(); // we expected a failure here.
318         res = client.updateItem(knownResourceId, knownItemResourceId, output);
319         try {
320                 assertStatusCode(res, testName);
321         } finally {
322                 if (res != null) {
323                 res.releaseConnection();
324             }
325         }
326     }
327
328     /**
329      * Read item list.
330      */
331     @Test(dataProvider = "testName", groups = {"readList"},
332                dependsOnMethods = {"readList"})
333     public void readItemList(String testName) {
334         readItemList(knownAuthorityWithItems, null);
335     }
336
337     /**
338      * Read item list by authority name.
339      */
340     @Test(dataProvider = "testName", groups = {"readList"},
341                 dependsOnMethods = {"readItemList"})
342     public void readItemListByAuthorityName(String testName) {
343         readItemList(null, READITEMS_SHORT_IDENTIFIER);
344     }
345     
346         /**
347          * Read item list.
348          * 
349          * @param vcsid
350          *            the vcsid
351          * @param name
352          *            the name
353          */
354         private void readItemList(String vcsid, String shortId) {
355                 String testName = "readItemList";
356
357                 // Perform setup.
358                 setupReadList();
359
360                 // Submit the request to the service and store the response.
361                 PlaceAuthorityClient client = new PlaceAuthorityClient();
362                 ClientResponse<AbstractCommonList> res = null;
363                 if (vcsid != null) {
364                         res = client.readItemList(vcsid, null, null);
365                 } else if (shortId != null) {
366                         res = client.readItemListForNamedAuthority(shortId, null, null);
367                 } else {
368                         Assert.fail("readItemList passed null csid and name!");
369                 }
370                 
371                 AbstractCommonList list = null;
372                 try {
373                         assertStatusCode(res, testName);
374                         list = res.getEntity();
375                 } finally {
376                         if (res != null) {
377                 res.releaseConnection();
378             }
379                 }
380                 
381                 List<AbstractCommonList.ListItem> items = list.getListItem();
382                 int nItemsReturned = items.size();
383                 // There will be 'nItemsToCreateInList'
384                 // items created by the createItemList test,
385                 // all associated with the same parent resource.
386                 int nExpectedItems = nItemsToCreateInList;
387                 if (logger.isDebugEnabled()) {
388                         logger.debug(testName + ": Expected " + nExpectedItems
389                                         + " items; got: " + nItemsReturned);
390                 }
391                 Assert.assertEquals(nItemsReturned, nExpectedItems);
392
393                 for (AbstractCommonList.ListItem item : items) {
394                         String value = AbstractCommonListUtils.ListItemGetElementValue(
395                                         item, REFNAME);
396                         Assert.assertTrue((null != value), "Item refName is null!");
397                         value = AbstractCommonListUtils.ListItemGetElementValue(item,
398                                         DISPLAYNAME);
399                         Assert.assertTrue((null != value), "Item displayName is null!");
400                 }
401                 if (logger.isTraceEnabled()) {
402                         AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger,
403                                         testName);
404                 }
405         }
406
407     @Override
408     public void delete(String testName) throws Exception {
409         // Do nothing.  See localDelete().  This ensure proper test order.
410     }
411     
412     @Test(dataProvider = "testName", dependsOnMethods = {"localDeleteItem"})    
413     public void localDelete(String testName) throws Exception {
414         super.delete(testName);
415     }
416
417     @Override
418     public void deleteItem(String testName) throws Exception {
419         // Do nothing.  We need to wait until after the test "localDelete" gets run.  When it does,
420         // its dependencies will get run first and then we can call the base class' delete method.
421     }
422     
423     @Test(dataProvider = "testName", groups = {"delete"},
424         dependsOnMethods = {"verifyIllegalItemDisplayName"})
425     public void localDeleteItem(String testName) throws Exception {
426         super.deleteItem(testName);
427     }
428     
429     // ---------------------------------------------------------------
430     // Cleanup of resources created during testing
431     // ---------------------------------------------------------------
432     
433     /**
434      * Deletes all resources created by tests, after all tests have been run.
435      *
436      * This cleanup method will always be run, even if one or more tests fail.
437      * For this reason, it attempts to remove all resources created
438      * at any point during testing, even if some of those resources
439      * may be expected to be deleted by certain tests.
440      */
441
442     @AfterClass(alwaysRun=true)
443     public void cleanUp() {
444         String noTest = System.getProperty("noTestCleanup");
445         if(Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
446             if (logger.isDebugEnabled()) {
447                 logger.debug("Skipping Cleanup phase ...");
448             }
449             return;
450         }
451         if (logger.isDebugEnabled()) {
452             logger.debug("Cleaning up temporary resources created for testing ...");
453         }
454         String parentResourceId;
455         String itemResourceId;
456         // Clean up contact resources.
457         PlaceAuthorityClient client = new PlaceAuthorityClient();
458         parentResourceId = knownResourceId;
459         // Clean up item resources.
460         for (Map.Entry<String, String> entry : allResourceItemIdsCreated.entrySet()) {
461             itemResourceId = entry.getKey();
462             parentResourceId = entry.getValue();
463             // Note: Any non-success responses from the delete operation
464             // below are ignored and not reported.
465             client.deleteItem(parentResourceId, itemResourceId).releaseConnection();
466         }
467         // Clean up parent resources.
468         for (String resourceId : allResourceIdsCreated) {
469             // Note: Any non-success responses from the delete operation
470             // below are ignored and not reported.
471             client.delete(resourceId).releaseConnection();
472         }
473     }
474
475     // ---------------------------------------------------------------
476     // Utility methods used by tests above
477     // ---------------------------------------------------------------
478     /* (non-Javadoc)
479      * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
480      */
481
482     /**
483      * Returns the root URL for the item service.
484      *
485      * This URL consists of a base URL for all services, followed by
486      * a path component for the owning parent, followed by the
487      * path component for the items.
488      *
489      * @param  parentResourceIdentifier  An identifier (such as a UUID) for the
490      * parent authority resource of the relevant item resource.
491      *
492      * @return The root URL for the item service.
493      */
494     protected String getItemServiceRootURL(String parentResourceIdentifier) {
495         return getResourceURL(parentResourceIdentifier) + "/" + getItemServicePathComponent();
496     }
497
498     /**
499      * Returns the URL of a specific item resource managed by a service, and
500      * designated by an identifier (such as a universally unique ID, or UUID).
501      *
502      * @param  parentResourceIdentifier  An identifier (such as a UUID) for the
503      * parent authority resource of the relevant item resource.
504      *
505      * @param  itemResourceIdentifier  An identifier (such as a UUID) for an
506      * item resource.
507      *
508      * @return The URL of a specific item resource managed by a service.
509      */
510     protected String getItemResourceURL(String parentResourceIdentifier, String itemResourceIdentifier) {
511         return getItemServiceRootURL(parentResourceIdentifier) + "/" + itemResourceIdentifier;
512     }
513
514         @Override
515         public void authorityTests(String testName) {
516                 // TODO Auto-generated method stub
517                 
518         }
519
520         //
521         // Place specific overrides
522         //
523         
524         @Override
525         protected PoxPayloadOut createInstance(String commonPartName,
526                         String identifier) {
527         // Submit the request to the service and store the response.
528         String shortId = identifier;
529         String displayName = "displayName-" + shortId;
530         // String baseRefName = PlaceAuthorityClientUtils.createPlaceAuthRefName(shortId, null);        
531         PoxPayloadOut result = 
532             PlaceAuthorityClientUtils.createPlaceAuthorityInstance(
533             displayName, shortId, commonPartName);
534                 return result;
535         }
536         
537         @Override
538     protected PoxPayloadOut createNonExistenceInstance(String commonPartName, String identifier) {
539         String displayName = "displayName-NON_EXISTENT_ID";
540         PoxPayloadOut result = PlaceAuthorityClientUtils.createPlaceAuthorityInstance(
541                                 displayName, "nonEx", commonPartName);
542         return result;
543     }
544
545         @Override
546         protected PlaceauthoritiesCommon updateInstance(PlaceauthoritiesCommon placeauthoritiesCommon) {
547                 PlaceauthoritiesCommon result = new PlaceauthoritiesCommon();
548                 
549                 result.setDisplayName("updated-" + placeauthoritiesCommon.getDisplayName());
550                 result.setVocabType("updated-" + placeauthoritiesCommon.getVocabType());
551                 
552                 return result;
553         }
554
555         @Override
556         protected void compareUpdatedInstances(PlaceauthoritiesCommon original,
557                         PlaceauthoritiesCommon updated) throws Exception {
558         Assert.assertEquals(updated.getDisplayName(),
559                         original.getDisplayName(),
560                 "Display name in updated object did not match submitted data.");
561         }
562
563         protected void compareReadInstances(PlaceauthoritiesCommon original,
564                         PlaceauthoritiesCommon fromRead) throws Exception {
565         Assert.assertNotNull(fromRead.getDisplayName());
566         Assert.assertNotNull(fromRead.getShortIdentifier());
567         Assert.assertNotNull(fromRead.getRefName());
568         }
569         
570         //
571         // Authority item specific overrides
572         //
573         
574         @Override
575         protected String createItemInAuthority(String authorityId) {
576                 return createItemInAuthority(authorityId, null /*refname*/);
577         }
578
579         @Override
580         protected PlacesCommon updateItemInstance(PlacesCommon placesCommon) {
581                 
582                 // Get the Name field from the resource passed in      
583                 PlaceNameGroupList placeNameGroupList = placesCommon.getPlaceNameGroupList();
584                 Assert.assertNotNull(placeNameGroupList);
585                 List<PlaceNameGroup> placeNameGroups = placeNameGroupList.getPlaceNameGroup();
586                 Assert.assertNotNull(placeNameGroups);
587                 Assert.assertTrue(placeNameGroups.size() > 0);
588                 String originalName = placeNameGroups.get(0).getName();
589                 Assert.assertNotNull(originalName);
590                 
591                 // Update the contents of the new resource based on original value
592                 PlaceNameGroupList updatedPlaceNameGroupList = new PlaceNameGroupList();
593                 List<PlaceNameGroup> updatedPlaceNameGroups = updatedPlaceNameGroupList.getPlaceNameGroup();
594                 PlaceNameGroup updatedPlaceNameGroup = new PlaceNameGroup();
595                 updatedPlaceNameGroup.setName("updated-" + originalName);
596                 updatedPlaceNameGroups.add(updatedPlaceNameGroup);
597                 PlacesCommon result = new PlacesCommon();
598                 result.setPlaceNameGroupList(updatedPlaceNameGroupList);
599         
600                 result.setDisplayName("updated-" + placesCommon.getDisplayName());
601                 
602                 return result;
603         }
604
605         @Override
606         protected void compareUpdatedItemInstances(PlacesCommon original,
607                         PlacesCommon updated) throws Exception {
608         
609                 // Get the Name fields each resource passed in      
610                 PlaceNameGroupList placeNameGroupList = original.getPlaceNameGroupList();
611                 Assert.assertNotNull(placeNameGroupList);
612                 List<PlaceNameGroup> placeNameGroups = placeNameGroupList.getPlaceNameGroup();
613                 Assert.assertNotNull(placeNameGroups);
614                 Assert.assertTrue(placeNameGroups.size() > 0);
615                 String originalName = placeNameGroups.get(0).getName();
616                 Assert.assertNotNull(originalName);
617             
618                 PlaceNameGroupList updatedPlaceNameGroupList = updated.getPlaceNameGroupList();
619                 Assert.assertNotNull(updatedPlaceNameGroupList);
620                 List<PlaceNameGroup> updatedPlaceNameGroups = updatedPlaceNameGroupList.getPlaceNameGroup();
621                 Assert.assertNotNull(updatedPlaceNameGroups);
622                 Assert.assertTrue(updatedPlaceNameGroups.size() > 0);
623                 String updatedName = updatedPlaceNameGroups.get(0).getName();
624                 Assert.assertNotNull(updatedName);
625             
626             
627             
628             
629                 Assert.assertEquals(updatedName, originalName,
630                     "Data in updated Place did not match submitted data.");
631         }
632
633         @Override
634         protected void verifyReadItemInstance(PlacesCommon item)
635                         throws Exception {
636                 // TODO Auto-generated method stub
637                 
638         }
639
640         @Override
641         protected PoxPayloadOut createNonExistenceItemInstance(
642                         String commonPartName, String identifier) {
643         Map<String, String> nonexMap = new HashMap<String,String>();
644         nonexMap.put(PlaceJAXBSchema.NAME, TEST_NAME);
645         nonexMap.put(PlaceJAXBSchema.SHORT_IDENTIFIER, "nonEx");
646         nonexMap.put(PlaceJAXBSchema.PLACE_TYPE, TEST_PLACE_TYPE);
647         nonexMap.put(PlaceJAXBSchema.TERM_STATUS, TEST_STATUS);
648         // PoxPayloadOut multipart = 
649         // PlaceAuthorityClientUtils.createPlaceInstance(
650         //              PlaceAuthorityClientUtils.createPlaceRefName(knownResourceRefName, "nonEx", "Non Existent"), 
651         //              nonexMap, client.getItemCommonPartName() );
652         final String EMPTY_REFNAME = "";
653         PoxPayloadOut result = 
654                 PlaceAuthorityClientUtils.createPlaceInstance(EMPTY_REFNAME, 
655                         nonexMap, commonPartName);
656                 return result;
657         }
658 }