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.ArrayList;
26 import java.util.HashMap;
27 import java.util.List;
30 import javax.ws.rs.core.Response;
32 import org.collectionspace.services.client.AbstractCommonListUtils;
33 import org.collectionspace.services.client.AuthorityClient;
34 import org.collectionspace.services.client.CollectionSpaceClient;
35 import org.collectionspace.services.client.PayloadOutputPart;
36 import org.collectionspace.services.client.PoxPayloadIn;
37 import org.collectionspace.services.client.PoxPayloadOut;
38 import org.collectionspace.services.client.ContactClient;
39 import org.collectionspace.services.client.ContactClientUtils;
40 import org.collectionspace.services.contact.AddressGroup;
41 import org.collectionspace.services.contact.AddressGroupList;
42 import org.collectionspace.services.contact.ContactsCommon;
43 import org.collectionspace.services.client.PersonAuthorityClient;
44 import org.collectionspace.services.client.PersonAuthorityClientUtils;
45 import org.collectionspace.services.jaxb.AbstractCommonList;
46 import org.collectionspace.services.PersonJAXBSchema;
47 import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;
48 import org.collectionspace.services.person.PersonauthoritiesCommon;
49 import org.collectionspace.services.person.PersonTermGroup;
50 import org.collectionspace.services.person.PersonTermGroupList;
51 import org.collectionspace.services.person.PersonsCommon;
52 import org.slf4j.Logger;
53 import org.slf4j.LoggerFactory;
54 import org.testng.Assert;
55 import org.testng.annotations.AfterClass;
56 import org.testng.annotations.Test;
59 * PersonAuthorityServiceTest, carries out tests against a
60 * deployed and running PersonAuthority Service.
62 * $LastChangedRevision: 753 $
63 * $LastChangedDate: 2009-09-23 11:03:36 -0700 (Wed, 23 Sep 2009) $
65 public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<PersonauthoritiesCommon, PersonsCommon> { //FIXME: Test classes for Vocab, Person, Org, and Location should have a base class!
68 private final String CLASS_NAME = PersonAuthorityServiceTest.class.getName();
69 private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
72 public String getServicePathComponent() {
73 return PersonAuthorityClient.SERVICE_PATH_COMPONENT;
77 protected String getServiceName() {
78 return PersonAuthorityClient.SERVICE_NAME;
81 public String getItemServicePathComponent() {
82 return AuthorityClient.ITEMS;
84 /** The test forename. */
85 final String TEST_FORE_NAME = "John";
86 /** The test middle name. */
87 final String TEST_MIDDLE_NAME = null;
88 /** The test surname. */
89 final String TEST_SUR_NAME = "Wayne";
90 /** The test birthdate. */
91 final String TEST_BIRTH_DATE = "May 26, 1907";
92 /** The test death date. */
93 final String TEST_DEATH_DATE = "June 11, 1979";
94 //private String knownResourceRefName = null;
95 private String knownItemResourceShortIdentifer = null;
96 // The resource ID of an item resource used for partial term matching tests.
97 private String knownItemPartialTermResourceId = null;
98 /** The known contact resource id. */
99 private String knownContactResourceId = null;
100 /** The all contact resource ids created. */
101 private Map<String, String> allContactResourceIdsCreated =
102 new HashMap<String, String>();
104 protected void setKnownResource(String id, String shortIdentifer,
106 knownResourceId = id;
107 knownResourceShortIdentifer = shortIdentifer;
108 //knownResourceRefName = refName;
111 protected void setKnownItemResource(String id, String shortIdentifer) {
112 knownItemResourceId = id;
113 knownItemResourceShortIdentifer = shortIdentifer;
117 * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
120 protected CollectionSpaceClient getClientInstance() {
121 return new PersonAuthorityClient();
125 protected CollectionSpaceClient getClientInstance(String clientPropertiesFilename) {
126 return new PersonAuthorityClient(clientPropertiesFilename);
129 // ---------------------------------------------------------------
130 // CRUD tests : CREATE tests
131 // ---------------------------------------------------------------
134 * @see org.collectionspace.services.client.test.ServiceTest#create(java.lang.String)
137 public void create(String testName) throws Exception {
138 // Perform setup, such as initializing the type of service request
139 // (e.g. CREATE, DELETE), its valid and expected status codes, and
140 // its associated HTTP method name (e.g. POST, DELETE).
143 // Submit the request to the service and store the response.
144 PersonAuthorityClient client = new PersonAuthorityClient();
145 String shortId = createIdentifier();
146 String displayName = "displayName-" + shortId;
147 //String baseRefName = PersonAuthorityClientUtils.createPersonAuthRefName(shortId, null);
148 PoxPayloadOut multipart =
149 PersonAuthorityClientUtils.createPersonAuthorityInstance(
150 displayName, shortId, client.getCommonPartName());
153 Response res = client.create(multipart);
155 assertStatusCode(res, testName);
156 newID = extractId(res);
162 // Save values for additional tests
163 if (knownResourceId == null) {
164 setKnownResource(newID, shortId, null ); //baseRefName);
165 if (logger.isDebugEnabled()) {
166 logger.debug(testName + ": knownResourceId=" + knownResourceId);
169 // Store the IDs from every resource created by tests,
170 // so they can be deleted after tests have been run.
171 allResourceIdsCreated.add(newID);
175 protected PoxPayloadOut createInstance(String identifier) {
176 PersonAuthorityClient client = new PersonAuthorityClient();
177 String displayName = "displayName-" + identifier;
178 PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
179 displayName, identifier, client.getCommonPartName());
184 protected PoxPayloadOut createItemInstance(String parentCsid, String identifier) {
185 String headerLabel = new PersonAuthorityClient().getItemCommonPartName();
187 HashMap<String, String> personInfo = new HashMap<String, String>();
188 String shortId = "MarkTwainAuthor" + identifier;
189 personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId);
191 List<PersonTermGroup> terms = new ArrayList<PersonTermGroup>();
192 PersonTermGroup term = new PersonTermGroup();
193 term.setTermDisplayName("Mark Twain Primary");
194 term.setTermName("MarkTwainPrimary");
197 term = new PersonTermGroup();
198 term.setTermDisplayName("Samuel Langhorne Clemens");
199 term.setTermName("SamuelLanghorneClemens");
202 term = new PersonTermGroup();
203 term.setTermDisplayName("Sam Clemens");
204 term.setTermName("SamClemens");
207 term = new PersonTermGroup();
208 term.setTermDisplayName("Huck Fin");
209 term.setTermName("Huck Fin");
212 return PersonAuthorityClientUtils.createPersonInstance(parentCsid, identifier, personInfo, terms, headerLabel);
216 * Creates an item in an authority, using test data.
218 * @param vcsid the vcsid
219 * @param authRefName the auth ref name
223 protected String createItemInAuthority(AuthorityClient client, String vcsid) {
225 final String testName = "createItemInAuthority";
226 if (logger.isDebugEnabled()) {
227 logger.debug(testName + ":" + vcsid + "...");
230 Map<String, String> johnWayneMap = new HashMap<String, String>();
232 // Fill the property map
234 String shortId = "johnWayneActor" + System.currentTimeMillis(); // short ID needs to be unique
235 johnWayneMap.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId);
236 johnWayneMap.put(PersonJAXBSchema.GENDER, "male");
237 johnWayneMap.put(PersonJAXBSchema.BIRTH_DATE, TEST_BIRTH_DATE);
238 johnWayneMap.put(PersonJAXBSchema.BIRTH_PLACE, "Winterset, Iowa");
239 johnWayneMap.put(PersonJAXBSchema.DEATH_DATE, TEST_DEATH_DATE);
240 johnWayneMap.put(PersonJAXBSchema.BIO_NOTE, "born Marion Robert Morrison and better"
241 + "known by his stage name John Wayne, was an American film actor, director "
242 + "and producer. He epitomized rugged masculinity and has become an enduring "
243 + "American icon. He is famous for his distinctive voice, walk and height. "
244 + "He was also known for his conservative political views and his support in "
245 + "the 1950s for anti-communist positions.");
247 List<PersonTermGroup> johnWayneTerms = new ArrayList<PersonTermGroup>();
248 PersonTermGroup term = new PersonTermGroup();
249 term.setTermDisplayName("John Wayne DisplayName");
250 term.setTermName("John Wayne");
251 term.setForeName(TEST_FORE_NAME);
252 term.setSurName(TEST_SUR_NAME);
253 johnWayneTerms.add(term);
255 Map<String, List<String>> johnWayneRepeatablesMap = new HashMap<String, List<String>>();
256 List<String> johnWayneGroups = new ArrayList<String>();
257 johnWayneGroups.add("Irish");
258 johnWayneGroups.add("Scottish");
259 johnWayneRepeatablesMap.put(PersonJAXBSchema.GROUPS, johnWayneGroups);
261 return createItemInAuthority(client, vcsid, null /*authRefName*/, shortId, johnWayneMap, johnWayneTerms, johnWayneRepeatablesMap);
266 * Creates an item in an authority.
268 * @param vcsid the vcsid
269 * @param authRefName the auth ref name
270 * @param itemFieldProperties a set of properties specifying the values of fields.
271 * @param itemRepeatableFieldProperties a set of properties specifying the values of repeatable fields.
274 private String createItemInAuthority(AuthorityClient client, String vcsid, String authRefName, String shortId,
275 Map itemFieldProperties, List<PersonTermGroup> terms, Map itemRepeatableFieldProperties) {
277 final String testName = "createItemInAuthority";
278 if (logger.isDebugEnabled()) {
279 logger.debug(testName + ":" + vcsid + "...");
282 // Submit the request to the service and store the response.
283 if (client == null) {
284 client = new PersonAuthorityClient();
286 PoxPayloadOut multipart =
287 PersonAuthorityClientUtils.createPersonInstance(vcsid, null /*authRefName*/, itemFieldProperties,
288 terms, itemRepeatableFieldProperties, client.getItemCommonPartName());
290 Response res = client.createItem(vcsid, multipart);
293 assertStatusCode(res, testName);
294 newID = PersonAuthorityClientUtils.extractId(res);
301 // Store the ID returned from the first item resource created
302 // for additional tests below.
303 if (knownItemResourceId == null) {
304 setKnownItemResource(newID, shortId);
305 if (logger.isDebugEnabled()) {
306 logger.debug(testName + ": knownItemResourceId=" + knownItemResourceId);
309 if (logger.isDebugEnabled()) {
310 logger.debug(testName + " (created):" + vcsid + "/(" + newID + "," + shortId + ")");
313 // Store the IDs from any item resources created
314 // by tests, along with the IDs of their parents, so these items
315 // can be deleted after all tests have been run.
316 allResourceItemIdsCreated.put(newID, vcsid);
322 * Creates the contact.
324 * @param testName the test name
326 @Test(dataProvider = "testName", groups = {"create"},
327 dependsOnMethods = {"createItem"})
328 public void createContact(String testName) {
330 String newID = createContactInItem(knownResourceId, knownItemResourceId);
334 * Creates the contact in item.
336 * @param parentcsid the parentcsid
337 * @param itemcsid the itemcsid
340 private String createContactInItem(String parentcsid, String itemcsid) {
342 final String testName = "createContactInItem";
343 if (logger.isDebugEnabled()) {
344 logger.debug(testName + ":...");
346 // Submit the request to the service and store the response.
347 PersonAuthorityClient client = new PersonAuthorityClient();
348 String identifier = createIdentifier();
349 PoxPayloadOut multipart = ContactClientUtils.createContactInstance(parentcsid,
350 itemcsid, identifier, new ContactClient().getCommonPartName());
353 Response res = client.createContact(parentcsid, itemcsid, multipart);
356 assertStatusCode(res, testName);
357 newID = PersonAuthorityClientUtils.extractId(res);
364 // Store the ID returned from the first contact resource created
365 // for additional tests below.
366 if (knownContactResourceId == null) {
367 knownContactResourceId = newID;
368 if (logger.isDebugEnabled()) {
369 logger.debug(testName + ": knownContactResourceId=" + knownContactResourceId);
373 // Store the IDs from any contact resources created
374 // by tests, along with the IDs of their parent items,
375 // so these items can be deleted after all tests have been run.
376 allContactResourceIdsCreated.put(newID, itemcsid);
382 * Attempts to create an authority with an short identifier that contains
383 * non-word characters.
385 * @param testName the test name
387 @Test(dataProvider = "testName", groups = {"create", "nonWordCharsInShortId"})
388 public void createWithShortIdNonWordChars(String testName) throws Exception {
389 testExpectedStatusCode = STATUS_BAD_REQUEST;
390 testRequestType = ServiceRequestType.CREATE;
391 testSetup(testExpectedStatusCode, testRequestType);
393 // Create the payload to be included in the body of the request
394 PersonAuthorityClient client = new PersonAuthorityClient();
395 String shortId = createIdentifier() + "*" + createIdentifier();
396 String displayName = "displayName-" + shortId;
397 PoxPayloadOut multipart =
398 PersonAuthorityClientUtils.createPersonAuthorityInstance(
399 displayName, shortId, client.getCommonPartName());
401 // Submit the request to the service and store the response.
402 Response res = client.create(multipart);
404 // Check the status code of the response: does it match
405 // the expected response(s)? We expect failure here.
407 assertStatusCode(res, testName);
416 * Attempts to create an item with an short identifier that contains
417 * non-word characters.
419 * @param testName the test name
421 @Test(dataProvider = "testName", groups = {"create", "nonWordCharsInShortId"},
422 dependsOnMethods = {"org.collectionspace.services.client.test.AbstractServiceTestImpl.create"})
423 public void createItemWithShortIdNonWordChars(String testName) {
424 testExpectedStatusCode = STATUS_BAD_REQUEST;
425 testRequestType = ServiceRequestType.CREATE;
426 testSetup(testExpectedStatusCode, testRequestType);
428 PersonAuthorityClient client = new PersonAuthorityClient();
429 // Create the payload to be included in the body of the request
430 String shortId = "7-Eleven";
431 Map<String, String> fieldProperties = new HashMap<String, String>();
432 fieldProperties.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId);
434 List<PersonTermGroup> terms = new ArrayList<PersonTermGroup>();
435 PersonTermGroup term = new PersonTermGroup();
436 term.setTermDisplayName(shortId);
437 term.setTermName(shortId);
440 final Map NULL_REPEATABLE_FIELD_PROPERTIES = null;
441 PoxPayloadOut multipart =
442 PersonAuthorityClientUtils.createPersonInstance(knownResourceId,
443 null /*knownResourceRefName*/, fieldProperties, terms,
444 NULL_REPEATABLE_FIELD_PROPERTIES, client.getItemCommonPartName());
446 // Send the request and receive a response
447 Response res = client.createItem(knownResourceId, multipart);
449 // Check the status code of the response: does it match
450 // the expected response(s)? We expect failure here, so there will be no
451 // new ID to keep track of for later cleanup.
453 assertStatusCode(res, testName);
461 // ---------------------------------------------------------------
462 // CRUD tests : CREATE LIST tests
463 // ---------------------------------------------------------------
466 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createList(java.lang.String)
469 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
470 // groups = {"createList"}, dependsOnGroups = {"create"})
471 public void createList(String testName) throws Exception {
472 for (int i = 0; i < nItemsToCreateInList; i++) {
478 * Creates the contact list.
480 * @param testName the test name
481 * @throws Exception the exception
483 @Test(dataProvider = "testName", groups = {"createList"},
484 dependsOnMethods = {"org.collectionspace.services.client.test.AbstractAuthorityServiceTest.createItemList"})
485 public void createContactList(String testName) throws Exception {
486 // Add contacts to the initially-created, known item record.
487 for (int j = 0; j < nItemsToCreateInList; j++) {
488 createContact(testName);
492 // ---------------------------------------------------------------
493 // CRUD tests : READ tests
494 // ---------------------------------------------------------------
497 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#read(java.lang.String)
500 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
501 // groups = {"read"}, dependsOnGroups = {"create"})
502 public void read(String testName) throws Exception {
503 readInternal(testName, knownResourceId, null);
509 * @param testName the test name
510 * @throws Exception the exception
513 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
514 // groups = {"read"}, dependsOnMethods = {"read"})
515 public void readByName(String testName) throws Exception {
516 readInternal(testName, null, knownResourceShortIdentifer);
519 protected void readInternal(String testName, String CSID, String shortId) {
520 // Submit the request to the service and store the response.
521 PersonAuthorityClient client = new PersonAuthorityClient();
525 res = client.read(CSID);
526 } else if (shortId != null) {
527 res = client.readByName(shortId);
529 Assert.fail("readInternal: Internal error. One of CSID or shortId must be non-null");
532 assertStatusCode(res, testName);
533 //FIXME: remove the following try catch once Aron fixes signatures
535 PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
536 PersonauthoritiesCommon personAuthority = (PersonauthoritiesCommon) extractPart(input,
537 client.getCommonPartName(), PersonauthoritiesCommon.class);
538 Assert.assertNotNull(personAuthority);
539 } catch (Exception e) {
540 throw new RuntimeException(e);
552 * @param testName the test name
553 * @throws Exception the exception
555 @Test(dataProvider = "testName", groups = {"readItem", "readNamedItemInNamedAuth"},
556 dependsOnMethods = {"readItemInNamedAuth"})
557 public void readNamedItem(String testName) throws Exception {
558 readItemInternal(testName, knownResourceId, null, null, knownItemResourceShortIdentifer);
562 * Read item in Named Auth.
564 * @param testName the test name
565 * @throws Exception the exception
567 @Test(dataProvider = "testName", groups = {"readItem"},
568 dependsOnMethods = {"readItem"})
569 public void readItemInNamedAuth(String testName) throws Exception {
570 readItemInternal(testName, null, knownResourceShortIdentifer, knownItemResourceId, null);
575 * Read Named item in Named Auth.
577 * @param testName the test name
578 * @throws Exception the exception
580 @Test(dataProvider = "testName", groups = {"readItem"},
581 dependsOnMethods = {"readNamedItem"})
582 public void readNamedItemInNamedAuth(String testName) throws Exception {
583 readItemInternal(testName, null, knownResourceShortIdentifer, null, knownItemResourceShortIdentifer);
586 protected void readItemInternal(String testName,
587 String authCSID, String authShortId, String itemCSID, String itemShortId)
590 if (logger.isDebugEnabled()) {
591 logger.debug("Reading:" + ((authCSID != null) ? authCSID : authShortId) + "/"
592 + ((itemCSID != null) ? authCSID : itemShortId));
595 // Submit the request to the service and store the response.
596 PersonAuthorityClient client = new PersonAuthorityClient();
599 if (authCSID != null) {
600 if (itemCSID != null) {
601 res = client.readItem(authCSID, itemCSID);
602 } else if (itemShortId != null) {
603 res = client.readNamedItem(authCSID, itemShortId);
605 Assert.fail("readInternal: Internal error. One of CSID or shortId must be non-null");
607 } else if (authShortId != null) {
608 if (itemCSID != null) {
609 res = client.readItemInNamedAuthority(authShortId, itemCSID);
610 } else if (itemShortId != null) {
611 res = client.readNamedItemInNamedAuthority(authShortId, itemShortId);
613 Assert.fail("readInternal: Internal error. One of CSID or shortId must be non-null");
616 Assert.fail("readInternal: Internal error. One of authCSID or authShortId must be non-null");
620 assertStatusCode(res, testName);
621 // Check whether we've received a person.
622 PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
623 PersonsCommon person = (PersonsCommon) extractPart(input,
624 client.getItemCommonPartName(), PersonsCommon.class);
625 Assert.assertNotNull(person);
626 boolean showFull = true;
627 if (showFull && logger.isDebugEnabled()) {
628 logger.debug(testName + ": returned payload:");
629 logger.debug(objectAsXmlString(person, PersonsCommon.class));
632 // Check that the person item is within the expected Person Authority.
633 Assert.assertEquals(person.getInAuthority(), knownResourceId);
635 // Verify the number and contents of values in a repeatable field,
636 // as created in the instance record used for testing.
637 List<String> groups = person.getGroups().getGroup();
638 Assert.assertTrue(groups.size() > 0);
639 Assert.assertNotNull(groups.get(0));
647 // Note: This test depends on server-side validation logic to require
648 // a non-null (and potentially, non-empty) displayname for each term,
649 // and will fail if that validation is not present.
652 * Verify illegal item display name.
654 * @param testName the test name
655 * @throws Exception the exception
657 @Test(dataProvider = "testName", groups = {"update"})
658 public void verifyIllegalItemDisplayName(String testName) throws Exception {
659 // Perform setup for read.
662 // Submit the request to the service and store the response.
663 PersonAuthorityClient client = new PersonAuthorityClient();
664 Response res = client.readItem(knownResourceId, knownItemResourceId);
665 PoxPayloadIn input = null;
667 assertStatusCode(res, testName);
668 input = new PoxPayloadIn(res.readEntity(String.class));
675 // Make an invalid UPDATE request, without a display name
677 PersonsCommon person = (PersonsCommon) extractPart(input,
678 client.getItemCommonPartName(), PersonsCommon.class);
679 Assert.assertNotNull(person);
680 // Try to Update with no displayName
681 PersonTermGroupList termList = person.getPersonTermGroupList();
682 Assert.assertNotNull(termList);
683 List<PersonTermGroup> terms = termList.getPersonTermGroup();
684 Assert.assertNotNull(terms);
685 Assert.assertTrue(terms.size() > 0);
686 terms.get(0).setTermDisplayName(null);
687 terms.get(0).setTermName(null);
689 // Submit the updated resource to the service and store the response.
690 PoxPayloadOut output = new PoxPayloadOut(PersonAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
691 PayloadOutputPart commonPart = output.addPart(client.getItemCommonPartName(), person);
692 setupUpdateWithInvalidBody();
693 res = client.updateItem(knownResourceId, knownItemResourceId, output);
695 assertStatusCode(res, testName);
706 * @param testName the test name
707 * @throws Exception the exception
709 @Test(dataProvider = "testName", groups = {"readItem"},
710 dependsOnMethods = {"createContact", "org.collectionspace.services.client.test.AbstractAuthorityServiceTest.readItem"})
711 public void readContact(String testName) throws Exception {
715 // Submit the request to the service and store the response.
716 PersonAuthorityClient client = new PersonAuthorityClient();
717 PoxPayloadIn input = null;
718 Response res = client.readContact(knownResourceId, knownItemResourceId,
719 knownContactResourceId);
721 assertStatusCode(res, testName);
722 // Check whether we've received a contact.
723 input = new PoxPayloadIn(res.readEntity(String.class));
730 ContactsCommon contact = (ContactsCommon) extractPart(input,
731 new ContactClient().getCommonPartName(), ContactsCommon.class);
732 Assert.assertNotNull(contact);
733 boolean showFull = true;
734 if (showFull && logger.isDebugEnabled()) {
735 logger.debug(testName + ": returned payload:");
736 logger.debug(objectAsXmlString(contact, ContactsCommon.class));
738 Assert.assertEquals(contact.getInAuthority(), knownResourceId);
739 Assert.assertEquals(contact.getInItem(), knownItemResourceId);
744 * Read contact non existent.
746 * @param testName the test name
748 @Test(dataProvider = "testName", groups = {"readItem"}, dependsOnMethods = {"readContact"})
749 public void readContactNonExistent(String testName) {
751 setupReadNonExistent();
753 // Submit the request to the service and store the response.
754 PersonAuthorityClient client = new PersonAuthorityClient();
755 Response res = client.readContact(knownResourceId, knownItemResourceId,
758 assertStatusCode(res, testName);
766 // ---------------------------------------------------------------
767 // CRUD tests : READ_LIST tests
768 // ---------------------------------------------------------------
771 * Read item list override -see immediate superclass.
774 public void readItemList(String testName) {
775 readItemList(knownAuthorityWithItems, null, testName);
779 * Read item list by authority name.
782 public void readItemListByName(String testName) {
783 readItemList(null, READITEMS_SHORT_IDENTIFIER, testName);
789 * @param vcsid the vcsid
790 * @param name the name
792 private void readItemList(String vcsid, String name, String testName) {
794 // Submit the request to the service and store the response.
795 PersonAuthorityClient client = new PersonAuthorityClient();
798 res = client.readItemList(vcsid, null, null);
799 } else if (name != null) {
800 res = client.readItemListForNamedAuthority(name, null, null);
802 Assert.fail("readItemList passed null csid and name!");
804 AbstractCommonList list = null;
806 assertStatusCode(res, testName);
807 list = res.readEntity(AbstractCommonList.class);
814 List<AbstractCommonList.ListItem> items = list.getListItem();
815 int nItemsReturned = items.size();
816 // There will be 'nItemsToCreateInList'
817 // items created by the createItemList test,
818 // all associated with the same parent resource.
819 int nExpectedItems = nItemsToCreateInList;
820 if (logger.isDebugEnabled()) {
821 logger.debug(testName + ": Expected "
822 + nExpectedItems + " items; got: " + nItemsReturned);
824 Assert.assertEquals(nItemsReturned, nExpectedItems);
826 for (AbstractCommonList.ListItem item : items) {
828 AbstractCommonListUtils.ListItemGetElementValue(item, AuthorityItemJAXBSchema.REF_NAME);
829 Assert.assertTrue((null != value), "Item refName is null!");
831 // Per CSPACE-5132, lists items still return a field named displayName,
832 // not termDisplayName, for backward compatibility.
833 // (The format of list items will change significantly in CSPACE-5134.)
835 AbstractCommonListUtils.ListItemGetElementValue(item, AuthorityItemJAXBSchema.TERM_DISPLAY_NAME);
836 Assert.assertTrue((null != value), "Item termDisplayName is null!");
838 if (logger.isTraceEnabled()) {
839 AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger, testName);
846 @Test(groups = {"readList"},
847 dependsOnMethods = {"org.collectionspace.services.client.test.AbstractAuthorityServiceTest.readItemList"})
848 public void readContactList() {
849 readContactList(knownResourceId, knownItemResourceId);
855 * @param parentcsid the parentcsid
856 * @param itemcsid the itemcsid
858 private void readContactList(String parentcsid, String itemcsid) {
859 final String testName = "readContactList";
864 // Submit the request to the service and store the response.
865 PersonAuthorityClient client = new PersonAuthorityClient();
866 AbstractCommonList list = null;
867 Response res = client.readContactList(parentcsid, itemcsid);
869 assertStatusCode(res, testName);
870 list = res.readEntity(AbstractCommonList.class);
877 List<AbstractCommonList.ListItem> listitems =
879 int nItemsReturned = listitems.size();
880 // There will be one item created, associated with a
881 // known parent resource, by the createItem test.
883 // In addition, there will be 'nItemsToCreateInList'
884 // additional items created by the createItemList test,
885 // all associated with the same parent resource.
886 int nExpectedItems = nItemsToCreateInList + 1;
887 if (logger.isDebugEnabled()) {
888 logger.debug(testName + ": Expected "
889 + nExpectedItems + " items; got: " + nItemsReturned);
891 Assert.assertEquals(nItemsReturned, nExpectedItems);
893 // Optionally output additional data about list members for debugging.
894 boolean iterateThroughList = false;
895 if (iterateThroughList && logger.isDebugEnabled()) {
896 AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger, testName);
901 // There are no failure outcome tests at present.
902 // ---------------------------------------------------------------
903 // CRUD tests : UPDATE tests
904 // ---------------------------------------------------------------
907 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#update(java.lang.String)
910 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
911 // groups = {"update"}, dependsOnGroups = {"readItem", "readList"})
912 public void update(String testName) throws Exception {
913 // Retrieve the contents of a resource to update.
914 PersonAuthorityClient client = new PersonAuthorityClient();
915 PoxPayloadIn input = null;
917 Response res = client.read(knownResourceId);
919 assertStatusCode(res, testName);
920 if (logger.isDebugEnabled()) {
921 logger.debug("got PersonAuthority to update with ID: " + knownResourceId);
923 input = new PoxPayloadIn(res.readEntity(String.class));
930 PersonauthoritiesCommon personAuthority = (PersonauthoritiesCommon) extractPart(input,
931 client.getCommonPartName(), PersonauthoritiesCommon.class);
932 Assert.assertNotNull(personAuthority);
934 // Update the contents of this resource.
935 personAuthority.setDisplayName("updated-" + personAuthority.getDisplayName());
936 personAuthority.setVocabType("updated-" + personAuthority.getVocabType());
937 if (logger.isDebugEnabled()) {
938 logger.debug("to be updated PersonAuthority");
939 logger.debug(objectAsXmlString(personAuthority, PersonauthoritiesCommon.class));
942 // Submit the updated resource to the service and store the response.
943 PoxPayloadOut output = new PoxPayloadOut(PersonAuthorityClient.SERVICE_PAYLOAD_NAME);
944 PayloadOutputPart commonPart = output.addPart(client.getCommonPartName(), personAuthority);
946 res = client.update(knownResourceId, output);
948 assertStatusCode(res, testName);
949 // Retrieve the updated resource and verify that its contents exist.
950 input = new PoxPayloadIn(res.readEntity(String.class));
957 PersonauthoritiesCommon updatedPersonAuthority =
958 (PersonauthoritiesCommon) extractPart(input,
959 client.getCommonPartName(), PersonauthoritiesCommon.class);
960 Assert.assertNotNull(updatedPersonAuthority);
962 // Verify that the updated resource received the correct data.
963 Assert.assertEquals(updatedPersonAuthority.getDisplayName(),
964 personAuthority.getDisplayName(),
965 "Data in updated object did not match submitted data.");
969 * Update item override -see immediate superclass.
971 * @param testName the test name
972 * @throws Exception the exception
975 public void updateItem(String testName) throws Exception {
976 // Retrieve the contents of a resource to update.
977 PersonAuthorityClient client = new PersonAuthorityClient();
978 PoxPayloadIn input = null;
980 Response res = client.readItem(knownResourceId, knownItemResourceId);
982 assertStatusCode(res, testName);
983 if (logger.isDebugEnabled()) {
984 logger.debug("got Person to update with ID: "
985 + knownItemResourceId
986 + " in PersonAuthority: " + knownResourceId);
988 input = new PoxPayloadIn(res.readEntity(String.class));
995 PersonsCommon person = (PersonsCommon) extractPart(input,
996 client.getItemCommonPartName(), PersonsCommon.class);
997 Assert.assertNotNull(person);
999 if (logger.isDebugEnabled() == true) {
1000 logger.debug("About to update the following person...");
1001 logger.debug(objectAsXmlString(person, PersonsCommon.class));
1004 // Update the contents of this resource.
1005 person.setCsid(null);
1006 PersonTermGroupList termList = person.getPersonTermGroupList();
1007 Assert.assertNotNull(termList);
1008 List<PersonTermGroup> terms = termList.getPersonTermGroup();
1009 Assert.assertNotNull(terms);
1010 Assert.assertTrue(terms.size() > 0);
1011 String foreName = terms.get(0).getForeName();
1012 String updatedForeName = "updated-" + foreName;
1013 terms.get(0).setForeName(updatedForeName);
1014 if (logger.isDebugEnabled()) {
1015 logger.debug("to be updated Person");
1016 logger.debug(objectAsXmlString(person,
1017 PersonsCommon.class));
1020 // Submit the updated resource to the service and store the response.
1021 PoxPayloadOut output = new PoxPayloadOut(PersonAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
1022 PayloadOutputPart commonPart = output.addPart(client.getItemCommonPartName(), person);
1024 res = client.updateItem(knownResourceId, knownItemResourceId, output);
1026 assertStatusCode(res, testName);
1027 // Retrieve the updated resource and verify that its contents exist.
1028 input = new PoxPayloadIn(res.readEntity(String.class));
1035 PersonsCommon updatedPerson =
1036 (PersonsCommon) extractPart(input,
1037 client.getItemCommonPartName(), PersonsCommon.class);
1038 Assert.assertNotNull(updatedPerson);
1040 if (logger.isDebugEnabled() == true) {
1041 logger.debug("Updated to following person to:");
1042 logger.debug(objectAsXmlString(updatedPerson, PersonsCommon.class));
1045 // Verify that the updated resource received the correct data.
1046 PersonTermGroupList updatedTermList = person.getPersonTermGroupList();
1047 Assert.assertNotNull(updatedTermList);
1048 List<PersonTermGroup> updatedTerms = termList.getPersonTermGroup();
1049 Assert.assertNotNull(updatedTerms);
1050 Assert.assertEquals(updatedTerms.get(0).getForeName(), updatedForeName,
1051 "Data in updated Person did not match submitted data.");
1057 * @param testName the test name
1058 * @throws Exception the exception
1060 @Test(dataProvider = "testName", groups = {"update"},
1061 dependsOnMethods = {"readContact", "testContactSubmitRequest",
1062 "org.collectionspace.services.client.test.AbstractAuthorityServiceTest.updateItem"})
1063 public void updateContact(String testName) throws Exception {
1064 String contactsCommonLabel = new ContactClient().getCommonPartName();
1066 // Retrieve the contents of a resource to update.
1067 PersonAuthorityClient client = new PersonAuthorityClient();
1068 PoxPayloadIn input = null;
1070 Response res = client.readContact(knownResourceId, knownItemResourceId,
1071 knownContactResourceId);
1073 assertStatusCode(res, testName);
1074 if (logger.isDebugEnabled()) {
1075 logger.debug("got Contact to update with ID: "
1076 + knownContactResourceId
1077 + " in item: " + knownItemResourceId
1078 + " in parent: " + knownResourceId);
1080 input = new PoxPayloadIn(res.readEntity(String.class));
1087 ContactsCommon contact = (ContactsCommon) extractPart(input,
1088 contactsCommonLabel, ContactsCommon.class);
1089 Assert.assertNotNull(contact);
1091 // Verify the contents of this resource
1092 AddressGroupList addressGroupList = contact.getAddressGroupList();
1093 Assert.assertNotNull(addressGroupList);
1094 List<AddressGroup> addressGroups = addressGroupList.getAddressGroup();
1095 Assert.assertNotNull(addressGroups);
1096 Assert.assertTrue(addressGroups.size() > 0);
1097 String addressPlace1 = addressGroups.get(0).getAddressPlace1();
1098 Assert.assertNotNull(addressPlace1);
1100 // Update the contents of this resource.
1101 addressGroups.get(0).setAddressPlace1("updated-" + addressPlace1);
1102 contact.setAddressGroupList(addressGroupList);
1103 if (logger.isDebugEnabled()) {
1104 logger.debug("to be updated Contact");
1105 logger.debug(objectAsXmlString(contact,
1106 ContactsCommon.class));
1109 // Submit the updated resource to the service and store the response.
1110 PoxPayloadOut output = new PoxPayloadOut(ContactClient.SERVICE_PAYLOAD_NAME);
1111 PayloadOutputPart commonPart = output.addPart(contactsCommonLabel, contact);
1113 res = client.updateContact(knownResourceId, knownItemResourceId, knownContactResourceId, output);
1115 assertStatusCode(res, testName);
1116 // Retrieve the updated resource and verify that its contents exist.
1117 input = new PoxPayloadIn(res.readEntity(String.class));;
1123 ContactsCommon updatedContact = (ContactsCommon) extractPart(input,
1124 contactsCommonLabel, ContactsCommon.class);
1125 Assert.assertNotNull(updatedContact);
1127 // Verify that the updated resource received the correct data.
1128 Assert.assertEquals(updatedContact.getAddressGroupList().getAddressGroup().get(0).getAddressPlace1(),
1129 contact.getAddressGroupList().getAddressGroup().get(0).getAddressPlace1(),
1130 "Data in updated object did not match submitted data.");
1134 * Update non existent contact.
1136 * @param testName the test name
1137 * @throws Exception the exception
1139 @Test(dataProvider = "testName", groups = {"update"},
1140 dependsOnMethods = {"updateContact", "testContactSubmitRequest"})
1141 public void updateNonExistentContact(String testName) throws Exception {
1142 // Currently a no-op test
1145 // ---------------------------------------------------------------
1146 // CRUD tests : DELETE tests
1147 // ---------------------------------------------------------------
1149 // Note: delete sub-resources in ascending hierarchical order,
1150 // before deleting their parents.
1154 * @param testName the test name
1155 * @throws Exception the exception
1157 @Test(dataProvider = "testName", groups = {"delete"},
1158 dependsOnMethods = {"updateContact"})
1159 public void deleteContact(String testName) throws Exception {
1160 if (logger.isDebugEnabled()) {
1161 logger.debug("parentcsid =" + knownResourceId
1162 + " itemcsid = " + knownItemResourceId
1163 + " csid = " + knownContactResourceId);
1166 // Submit the request to the service and store the response.
1167 PersonAuthorityClient client = new PersonAuthorityClient();
1169 Response res = client.deleteContact(knownResourceId, knownItemResourceId,
1170 knownContactResourceId);
1172 assertStatusCode(res, testName);
1181 public void delete(String testName) throws Exception {
1182 // Do nothing. See localDelete(). This ensure proper test order.
1185 @Test(dataProvider = "testName", dependsOnMethods = {"localDeleteItem"})
1186 public void localDelete(String testName) throws Exception {
1187 super.delete(testName);
1191 public void deleteItem(String testName) throws Exception {
1192 // Do nothing. We need to wait until after the test "localDelete" gets run. When it does,
1193 // its dependencies will get run first and then we can call the base class' delete method.
1196 @Test(dataProvider = "testName", groups = {"delete"},
1197 dependsOnMethods = {"verifyIllegalItemDisplayName", "testContactSubmitRequest", "deleteContact"})
1198 public void localDeleteItem(String testName) throws Exception {
1199 super.deleteItem(testName);
1203 * Delete non existent contact.
1205 * @param testName the test name
1207 @Test(dataProvider = "testName", groups = {"delete"},
1208 dependsOnMethods = {"deleteContact"})
1209 public void deleteNonExistentContact(String testName) {
1210 // Submit the request to the service and store the response.
1211 PersonAuthorityClient client = new PersonAuthorityClient();
1212 setupDeleteNonExistent();
1213 Response res = client.deleteContact(knownResourceId, knownItemResourceId, NON_EXISTENT_ID);
1215 assertStatusCode(res, testName);
1224 * Test contact submit request.
1226 @Test(dataProvider = "testName",
1227 dependsOnMethods = {"createContact", "readContact", "testItemSubmitRequest"})
1228 public void testContactSubmitRequest(String testName) {
1230 // Expected status code: 200 OK
1231 final int EXPECTED_STATUS = Response.Status.OK.getStatusCode();
1233 // Submit the request to the service and store the response.
1234 String method = ServiceRequestType.READ.httpMethodName();
1235 String url = getContactResourceURL(knownResourceId,
1236 knownItemResourceId, knownContactResourceId);
1237 int statusCode = submitRequest(method, url);
1239 // Check the status code of the response: does it match
1240 // the expected response(s)?
1241 if (logger.isDebugEnabled()) {
1242 logger.debug("testContactSubmitRequest: url=" + url
1243 + " status=" + statusCode);
1245 Assert.assertEquals(statusCode, EXPECTED_STATUS);
1249 // ---------------------------------------------------------------
1250 // Cleanup of resources created during testing
1251 // ---------------------------------------------------------------
1253 * Deletes all resources created by tests, after all tests have been run.
1255 * This cleanup method will always be run, even if one or more tests fail.
1256 * For this reason, it attempts to remove all resources created
1257 * at any point during testing, even if some of those resources
1258 * may be expected to be deleted by certain tests.
1260 @AfterClass(alwaysRun = true)
1262 public void cleanUp() {
1263 String noTest = System.getProperty("noTestCleanup");
1264 if (Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
1265 if (logger.isDebugEnabled()) {
1266 logger.debug("Skipping Cleanup phase ...");
1271 if (logger.isDebugEnabled()) {
1272 logger.debug("Cleaning up temporary resources created for testing ...");
1275 String parentResourceId;
1276 String itemResourceId;
1277 String contactResourceId;
1278 // Clean up contact resources.
1279 PersonAuthorityClient client = new PersonAuthorityClient();
1280 parentResourceId = knownResourceId;
1281 for (Map.Entry<String, String> entry : allContactResourceIdsCreated.entrySet()) {
1282 contactResourceId = entry.getKey();
1283 itemResourceId = entry.getValue();
1284 // Note: Any non-success responses from the delete operation
1285 // below are ignored and not reported.
1286 Response res = client.deleteContact(parentResourceId, itemResourceId,
1291 // Finally, clean call our superclass' cleanUp method.
1296 // ---------------------------------------------------------------
1297 // Utility methods used by tests above
1298 // ---------------------------------------------------------------
1300 * Gets the contact service path component.
1302 * @return the contact service path component
1304 public String getContactServicePathComponent() {
1305 return ContactClient.SERVICE_PATH_COMPONENT;
1309 * Returns the root URL for the item service.
1311 * This URL consists of a base URL for all services, followed by
1312 * a path component for the owning parent, followed by the
1313 * path component for the items.
1315 * @param parentResourceIdentifier An identifier (such as a UUID) for the
1316 * parent authority resource of the relevant item resource.
1318 * @return The root URL for the item service.
1320 protected String getItemServiceRootURL(String parentResourceIdentifier) {
1321 return getResourceURL(parentResourceIdentifier) + "/" + getItemServicePathComponent();
1325 * Returns the URL of a specific item resource managed by a service, and
1326 * designated by an identifier (such as a universally unique ID, or UUID).
1328 * @param parentResourceIdentifier An identifier (such as a UUID) for the
1329 * parent authority resource of the relevant item resource.
1331 * @param itemResourceIdentifier An identifier (such as a UUID) for an
1334 * @return The URL of a specific item resource managed by a service.
1336 protected String getItemResourceURL(String parentResourceIdentifier, String itemResourceIdentifier) {
1337 return getItemServiceRootURL(parentResourceIdentifier) + "/" + itemResourceIdentifier;
1341 * Returns the root URL for the contact service.
1343 * This URL consists of a base URL for all services, followed by
1344 * a path component for the owning authority, followed by the
1345 * path component for the owning item, followed by the path component
1346 * for the contact service.
1348 * @param parentResourceIdentifier An identifier (such as a UUID) for the
1349 * parent authority resource of the relevant item resource.
1351 * @param itemResourceIdentifier An identifier (such as a UUID) for an
1354 * @return The root URL for the contact service.
1356 protected String getContactServiceRootURL(String parentResourceIdentifier,
1357 String itemResourceIdentifier) {
1358 return getItemResourceURL(parentResourceIdentifier, itemResourceIdentifier) + "/"
1359 + getContactServicePathComponent();
1363 * Returns the URL of a specific contact resource managed by a service, and
1364 * designated by an identifier (such as a universally unique ID, or UUID).
1366 * @param parentResourceIdentifier An identifier (such as a UUID) for the
1367 * parent resource of the relevant item resource.
1369 * @param resourceIdentifier An identifier (such as a UUID) for an
1372 * @return The URL of a specific resource managed by a service.
1374 protected String getContactResourceURL(String parentResourceIdentifier,
1375 String itemResourceIdentifier, String contactResourceIdentifier) {
1376 return getContactServiceRootURL(parentResourceIdentifier,
1377 itemResourceIdentifier) + "/" + contactResourceIdentifier;
1381 public void authorityTests(String testName) {
1382 // TODO Auto-generated method stub
1387 protected PersonsCommon updateItemInstance(PersonsCommon personsCommon) {
1389 PersonTermGroupList termList = personsCommon.getPersonTermGroupList();
1390 Assert.assertNotNull(termList);
1391 List<PersonTermGroup> terms = termList.getPersonTermGroup();
1392 Assert.assertNotNull(terms);
1393 Assert.assertTrue(terms.size() > 0);
1394 terms.get(0).setTermDisplayName("updated-" + terms.get(0).getTermDisplayName());
1395 terms.get(0).setTermName("updated-" + terms.get(0).getTermName());
1396 personsCommon.setPersonTermGroupList(termList);
1398 return personsCommon;
1402 protected void compareUpdatedItemInstances(PersonsCommon original,
1403 PersonsCommon updated) throws Exception {
1405 PersonTermGroupList originalTermList = original.getPersonTermGroupList();
1406 Assert.assertNotNull(originalTermList);
1407 List<PersonTermGroup> originalTerms = originalTermList.getPersonTermGroup();
1408 Assert.assertNotNull(originalTerms);
1409 Assert.assertTrue(originalTerms.size() > 0);
1411 PersonTermGroupList updatedTermList = updated.getPersonTermGroupList();
1412 Assert.assertNotNull(updatedTermList);
1413 List<PersonTermGroup> updatedTerms = updatedTermList.getPersonTermGroup();
1414 Assert.assertNotNull(updatedTerms);
1415 Assert.assertTrue(updatedTerms.size() > 0);
1417 Assert.assertEquals(updatedTerms.get(0).getTermDisplayName(),
1418 originalTerms.get(0).getTermDisplayName(),
1419 "Value in updated record did not match submitted data.");
1423 protected PoxPayloadOut createInstance(String commonPartName,
1424 String identifier) {
1425 String shortId = identifier;
1426 String displayName = "displayName-" + shortId;
1427 PoxPayloadOut result =
1428 PersonAuthorityClientUtils.createPersonAuthorityInstance(
1429 displayName, shortId, commonPartName);
1434 protected PoxPayloadOut createNonExistenceInstance(String commonPartName,
1435 String identifier) {
1436 String displayName = "displayName-NON_EXISTENT_ID";
1437 PoxPayloadOut result = PersonAuthorityClientUtils.createPersonAuthorityInstance(
1438 displayName, "NON_EXISTENT_SHORT_ID", commonPartName);
1442 protected PoxPayloadOut createNonExistenceItemInstance(String commonPartName, String identifier) {
1443 Map<String, String> nonexMap = new HashMap<String, String>();
1444 nonexMap.put(PersonJAXBSchema.SHORT_IDENTIFIER, "nonEX");
1445 nonexMap.put(PersonJAXBSchema.GENDER, "male");
1447 List<PersonTermGroup> terms = new ArrayList<PersonTermGroup>();
1448 PersonTermGroup term = new PersonTermGroup();
1449 term.setTermDisplayName("John Wayne");
1450 term.setTermName("John Wayne");
1451 term.setForeName("John");
1452 term.setSurName("Wayne");
1455 Map<String, List<String>> nonexRepeatablesMap = new HashMap<String, List<String>>();
1456 PoxPayloadOut result =
1457 PersonAuthorityClientUtils.createPersonInstance(NON_EXISTENT_ID,
1458 null, //PersonAuthorityClientUtils.createPersonAuthRefName(NON_EXISTENT_ID, null),
1459 nonexMap, terms, nonexRepeatablesMap, commonPartName);
1464 protected PersonauthoritiesCommon updateInstance(PersonauthoritiesCommon personauthoritiesCommon) {
1465 PersonauthoritiesCommon result = new PersonauthoritiesCommon();
1467 result.setDisplayName("updated-" + personauthoritiesCommon.getDisplayName());
1468 result.setVocabType("updated-" + personauthoritiesCommon.getVocabType());
1474 protected void compareUpdatedInstances(PersonauthoritiesCommon original,
1475 PersonauthoritiesCommon updated) throws Exception {
1476 // Verify that the updated resource received the correct data.
1477 Assert.assertEquals(updated.getDisplayName(),
1478 original.getDisplayName(),
1479 "Display name in updated object did not match submitted data.");
1483 protected void verifyReadItemInstance(PersonsCommon item) throws Exception {
1484 // Do nothing for now. Add more 'read' validation checks here if applicable.