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;
29 import javax.ws.rs.core.Response;
31 import org.collectionspace.services.client.AbstractCommonListUtils;
32 import org.collectionspace.services.client.AuthorityClient;
33 import org.collectionspace.services.client.CollectionSpaceClient;
34 import org.collectionspace.services.client.PayloadOutputPart;
35 import org.collectionspace.services.client.PoxPayloadIn;
36 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;
44 import org.collectionspace.services.client.PersonAuthorityClient;
45 import org.collectionspace.services.client.PersonAuthorityClientUtils;
46 import org.collectionspace.services.jaxb.AbstractCommonList;
47 import org.collectionspace.services.PersonJAXBSchema;
48 import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;
49 import org.collectionspace.services.nuxeo.util.NuxeoUtils;
50 import org.collectionspace.services.person.PersonauthoritiesCommon;
51 import org.collectionspace.services.person.PersonTermGroup;
52 import org.collectionspace.services.person.PersonTermGroupList;
53 import org.collectionspace.services.person.PersonsCommon;
55 import org.jboss.resteasy.client.ClientResponse;
56 //import org.jboss.resteasy.plugins.providers.multipart.OutputPart;
57 import org.slf4j.Logger;
58 import org.slf4j.LoggerFactory;
59 import org.testng.Assert;
60 import org.testng.annotations.AfterClass;
61 import org.testng.annotations.Test;
64 * PersonAuthorityServiceTest, carries out tests against a
65 * deployed and running PersonAuthority Service.
67 * $LastChangedRevision: 753 $
68 * $LastChangedDate: 2009-09-23 11:03:36 -0700 (Wed, 23 Sep 2009) $
70 public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<PersonauthoritiesCommon, PersonsCommon> { //FIXME: Test classes for Vocab, Person, Org, and Location should have a base class!
73 private final String CLASS_NAME = PersonAuthorityServiceTest.class.getName();
74 private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
75 private final String REFNAME = "refName";
76 private final String TERM_DISPLAY_NAME = "termDisplayName";
77 // private final String TERM_DISPLAY_NAME_ELPATH =
78 // NuxeoUtils.getPrimaryElPathPropertyName(null,
79 // new PersonAuthorityClient().getTermInfoGroupXpathBase(), TERM_DISPLAY_NAME);
82 public String getServicePathComponent() {
83 return PersonAuthorityClient.SERVICE_PATH_COMPONENT;
87 protected String getServiceName() {
88 return PersonAuthorityClient.SERVICE_NAME;
91 public String getItemServicePathComponent() {
92 return AuthorityClient.ITEMS;
94 /** The test forename. */
95 final String TEST_FORE_NAME = "John";
96 /** The test middle name. */
97 final String TEST_MIDDLE_NAME = null;
98 /** The test surname. */
99 final String TEST_SUR_NAME = "Wayne";
100 /** The test birthdate. */
101 final String TEST_BIRTH_DATE = "May 26, 1907";
102 /** The test death date. */
103 final String TEST_DEATH_DATE = "June 11, 1979";
104 //private String knownResourceRefName = null;
105 private String knownItemResourceShortIdentifer = null;
106 // The resource ID of an item resource used for partial term matching tests.
107 private String knownItemPartialTermResourceId = null;
108 /** The known contact resource id. */
109 private String knownContactResourceId = null;
110 /** The all contact resource ids created. */
111 private Map<String, String> allContactResourceIdsCreated =
112 new HashMap<String, String>();
114 protected void setKnownResource(String id, String shortIdentifer,
116 knownResourceId = id;
117 knownResourceShortIdentifer = shortIdentifer;
118 //knownResourceRefName = refName;
121 protected void setKnownItemResource(String id, String shortIdentifer) {
122 knownItemResourceId = id;
123 knownItemResourceShortIdentifer = shortIdentifer;
127 * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
130 protected CollectionSpaceClient getClientInstance() {
131 return new PersonAuthorityClient();
134 // ---------------------------------------------------------------
135 // CRUD tests : CREATE tests
136 // ---------------------------------------------------------------
139 * @see org.collectionspace.services.client.test.ServiceTest#create(java.lang.String)
142 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
143 // groups = {"create"})
144 public void create(String testName) throws Exception {
145 // Perform setup, such as initializing the type of service request
146 // (e.g. CREATE, DELETE), its valid and expected status codes, and
147 // its associated HTTP method name (e.g. POST, DELETE).
150 // Submit the request to the service and store the response.
151 PersonAuthorityClient client = new PersonAuthorityClient();
152 String shortId = createIdentifier();
153 String displayName = "displayName-" + shortId;
154 //String baseRefName = PersonAuthorityClientUtils.createPersonAuthRefName(shortId, null);
155 PoxPayloadOut multipart =
156 PersonAuthorityClientUtils.createPersonAuthorityInstance(
157 displayName, shortId, client.getCommonPartName());
160 ClientResponse<Response> res = client.create(multipart);
162 assertStatusCode(res, testName);
163 newID = extractId(res);
166 res.releaseConnection();
169 // Save values for additional tests
170 if (knownResourceId == null) {
171 setKnownResource(newID, shortId, null ); //baseRefName);
172 if (logger.isDebugEnabled()) {
173 logger.debug(testName + ": knownResourceId=" + knownResourceId);
176 // Store the IDs from every resource created by tests,
177 // so they can be deleted after tests have been run.
178 allResourceIdsCreated.add(newID);
182 protected PoxPayloadOut createInstance(String identifier) {
183 PersonAuthorityClient client = new PersonAuthorityClient();
184 String displayName = "displayName-" + identifier;
185 PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
186 displayName, identifier, client.getCommonPartName());
191 protected PoxPayloadOut createItemInstance(String parentCsid, String identifier) {
192 String headerLabel = new PersonAuthorityClient().getItemCommonPartName();
194 HashMap<String, String> personInfo = new HashMap<String, String>();
195 String shortId = "johnWayneTempActor";
196 personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId);
198 List<PersonTermGroup> terms = new ArrayList<PersonTermGroup>();
199 PersonTermGroup term = new PersonTermGroup();
200 term.setTermDisplayName("John Wayne Temp");
201 term.setTermName("JohnWayneTemp");
204 return PersonAuthorityClientUtils.createPersonInstance(parentCsid, identifier, personInfo, terms, headerLabel);
208 * Creates an item in an authority, using test data.
210 * @param vcsid the vcsid
211 * @param authRefName the auth ref name
215 protected String createItemInAuthority(String vcsid) {
217 final String testName = "createItemInAuthority";
218 if (logger.isDebugEnabled()) {
219 logger.debug(testName + ":" + vcsid + "...");
222 Map<String, String> johnWayneMap = new HashMap<String, String>();
224 // Fill the property map
226 String shortId = "johnWayneActor";
227 johnWayneMap.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId);
228 johnWayneMap.put(PersonJAXBSchema.GENDER, "male");
229 johnWayneMap.put(PersonJAXBSchema.BIRTH_DATE, TEST_BIRTH_DATE);
230 johnWayneMap.put(PersonJAXBSchema.BIRTH_PLACE, "Winterset, Iowa");
231 johnWayneMap.put(PersonJAXBSchema.DEATH_DATE, TEST_DEATH_DATE);
232 johnWayneMap.put(PersonJAXBSchema.BIO_NOTE, "born Marion Robert Morrison and better"
233 + "known by his stage name John Wayne, was an American film actor, director "
234 + "and producer. He epitomized rugged masculinity and has become an enduring "
235 + "American icon. He is famous for his distinctive voice, walk and height. "
236 + "He was also known for his conservative political views and his support in "
237 + "the 1950s for anti-communist positions.");
239 List<PersonTermGroup> johnWayneTerms = new ArrayList<PersonTermGroup>();
240 PersonTermGroup term = new PersonTermGroup();
241 term.setTermDisplayName("John Wayne DisplayName");
242 term.setTermName("John Wayne");
243 term.setForeName(TEST_FORE_NAME);
244 term.setSurName(TEST_SUR_NAME);
245 johnWayneTerms.add(term);
247 Map<String, List<String>> johnWayneRepeatablesMap = new HashMap<String, List<String>>();
248 List<String> johnWayneGroups = new ArrayList<String>();
249 johnWayneGroups.add("Irish");
250 johnWayneGroups.add("Scottish");
251 johnWayneRepeatablesMap.put(PersonJAXBSchema.GROUPS, johnWayneGroups);
253 return createItemInAuthority(vcsid, null /*authRefName*/, shortId, johnWayneMap, johnWayneTerms, johnWayneRepeatablesMap);
258 * Creates an item in an authority.
260 * @param vcsid the vcsid
261 * @param authRefName the auth ref name
262 * @param itemFieldProperties a set of properties specifying the values of fields.
263 * @param itemRepeatableFieldProperties a set of properties specifying the values of repeatable fields.
266 private String createItemInAuthority(String vcsid, String authRefName, String shortId,
267 Map itemFieldProperties, List<PersonTermGroup> terms, Map itemRepeatableFieldProperties) {
269 final String testName = "createItemInAuthority";
270 if (logger.isDebugEnabled()) {
271 logger.debug(testName + ":" + vcsid + "...");
274 // Submit the request to the service and store the response.
275 PersonAuthorityClient client = new PersonAuthorityClient();
276 PoxPayloadOut multipart =
277 PersonAuthorityClientUtils.createPersonInstance(vcsid, null /*authRefName*/, itemFieldProperties,
278 terms, itemRepeatableFieldProperties, client.getItemCommonPartName());
280 ClientResponse<Response> res = client.createItem(vcsid, multipart);
283 assertStatusCode(res, testName);
284 newID = PersonAuthorityClientUtils.extractId(res);
287 res.releaseConnection();
291 // Store the ID returned from the first item resource created
292 // for additional tests below.
293 if (knownItemResourceId == null) {
294 setKnownItemResource(newID, shortId);
295 if (logger.isDebugEnabled()) {
296 logger.debug(testName + ": knownItemResourceId=" + knownItemResourceId);
299 if (logger.isDebugEnabled()) {
300 logger.debug(testName + " (created):" + vcsid + "/(" + newID + "," + shortId + ")");
303 // Store the IDs from any item resources created
304 // by tests, along with the IDs of their parents, so these items
305 // can be deleted after all tests have been run.
306 allResourceItemIdsCreated.put(newID, vcsid);
312 * Creates the contact.
314 * @param testName the test name
316 @Test(dataProvider = "testName", groups = {"create"},
317 dependsOnMethods = {"createItem"})
318 public void createContact(String testName) {
320 String newID = createContactInItem(knownResourceId, knownItemResourceId);
324 * Creates the contact in item.
326 * @param parentcsid the parentcsid
327 * @param itemcsid the itemcsid
330 private String createContactInItem(String parentcsid, String itemcsid) {
332 final String testName = "createContactInItem";
333 if (logger.isDebugEnabled()) {
334 logger.debug(testName + ":...");
336 // Submit the request to the service and store the response.
337 PersonAuthorityClient client = new PersonAuthorityClient();
338 String identifier = createIdentifier();
339 PoxPayloadOut multipart = ContactClientUtils.createContactInstance(parentcsid,
340 itemcsid, identifier, new ContactClient().getCommonPartName());
343 ClientResponse<Response> res =
344 client.createContact(parentcsid, itemcsid, multipart);
347 assertStatusCode(res, testName);
348 newID = PersonAuthorityClientUtils.extractId(res);
351 res.releaseConnection();
355 // Store the ID returned from the first contact resource created
356 // for additional tests below.
357 if (knownContactResourceId == null) {
358 knownContactResourceId = newID;
359 if (logger.isDebugEnabled()) {
360 logger.debug(testName + ": knownContactResourceId=" + knownContactResourceId);
364 // Store the IDs from any contact resources created
365 // by tests, along with the IDs of their parent items,
366 // so these items can be deleted after all tests have been run.
367 allContactResourceIdsCreated.put(newID, itemcsid);
373 * Attempts to create an authority with an short identifier that contains
374 * non-word characters.
376 * @param testName the test name
378 @Test(dataProvider = "testName", groups = {"create", "nonWordCharsInShortId"})
379 public void createWithShortIdNonWordChars(String testName) throws Exception {
380 testExpectedStatusCode = STATUS_BAD_REQUEST;
381 testRequestType = ServiceRequestType.CREATE;
382 testSetup(testExpectedStatusCode, testRequestType);
384 // Create the payload to be included in the body of the request
385 PersonAuthorityClient client = new PersonAuthorityClient();
386 String shortId = createIdentifier() + "*" + createIdentifier();
387 String displayName = "displayName-" + shortId;
388 PoxPayloadOut multipart =
389 PersonAuthorityClientUtils.createPersonAuthorityInstance(
390 displayName, shortId, client.getCommonPartName());
392 // Submit the request to the service and store the response.
393 ClientResponse<Response> res = client.create(multipart);
395 // Check the status code of the response: does it match
396 // the expected response(s)?
398 assertStatusCode(res, testName);
401 res.releaseConnection();
407 * Attempts to create an item with an short identifier that contains
408 * non-word characters.
410 * @param testName the test name
412 @Test(dataProvider = "testName", groups = {"create", "nonWordCharsInShortId"},
413 dependsOnMethods = {"org.collectionspace.services.client.test.AbstractServiceTestImpl.create"})
414 public void createItemWithShortIdNonWordChars(String testName) {
415 testExpectedStatusCode = STATUS_BAD_REQUEST;
416 testRequestType = ServiceRequestType.CREATE;
417 testSetup(testExpectedStatusCode, testRequestType);
419 PersonAuthorityClient client = new PersonAuthorityClient();
420 // Create the payload to be included in the body of the request
421 String shortId = "7-Eleven";
422 Map<String, String> fieldProperties = new HashMap<String, String>();
423 fieldProperties.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId);
425 List<PersonTermGroup> terms = new ArrayList<PersonTermGroup>();
426 PersonTermGroup term = new PersonTermGroup();
427 term.setTermDisplayName(shortId);
428 term.setTermName(shortId);
431 final Map NULL_REPEATABLE_FIELD_PROPERTIES = null;
432 PoxPayloadOut multipart =
433 PersonAuthorityClientUtils.createPersonInstance(knownResourceId,
434 null /*knownResourceRefName*/, fieldProperties, terms,
435 NULL_REPEATABLE_FIELD_PROPERTIES, client.getItemCommonPartName());
437 // Send the request and receive a response
438 ClientResponse<Response> res = client.createItem(knownResourceId, multipart);
439 // Check the status code of the response: does it match
440 // the expected response(s)?
442 assertStatusCode(res, testName);
445 res.releaseConnection();
450 // ---------------------------------------------------------------
451 // CRUD tests : CREATE LIST tests
452 // ---------------------------------------------------------------
455 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createList(java.lang.String)
458 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
459 // groups = {"createList"}, dependsOnGroups = {"create"})
460 public void createList(String testName) throws Exception {
461 for (int i = 0; i < nItemsToCreateInList; i++) {
467 * Creates the contact list.
469 * @param testName the test name
470 * @throws Exception the exception
472 @Test(dataProvider = "testName", groups = {"createList"},
473 dependsOnMethods = {"org.collectionspace.services.client.test.AbstractAuthorityServiceTest.createItemList"})
474 public void createContactList(String testName) throws Exception {
475 // Add contacts to the initially-created, known item record.
476 for (int j = 0; j < nItemsToCreateInList; j++) {
477 createContact(testName);
481 // ---------------------------------------------------------------
482 // CRUD tests : READ tests
483 // ---------------------------------------------------------------
486 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#read(java.lang.String)
489 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
490 // groups = {"read"}, dependsOnGroups = {"create"})
491 public void read(String testName) throws Exception {
492 readInternal(testName, knownResourceId, null);
498 * @param testName the test name
499 * @throws Exception the exception
502 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
503 // groups = {"read"}, dependsOnMethods = {"read"})
504 public void readByName(String testName) throws Exception {
505 readInternal(testName, null, knownResourceShortIdentifer);
508 protected void readInternal(String testName, String CSID, String shortId) {
509 // Submit the request to the service and store the response.
510 PersonAuthorityClient client = new PersonAuthorityClient();
511 ClientResponse<String> res = null;
514 res = client.read(CSID);
515 } else if (shortId != null) {
516 res = client.readByName(shortId);
518 Assert.fail("readInternal: Internal error. One of CSID or shortId must be non-null");
521 assertStatusCode(res, testName);
522 //FIXME: remove the following try catch once Aron fixes signatures
524 PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
525 PersonauthoritiesCommon personAuthority = (PersonauthoritiesCommon) extractPart(input,
526 client.getCommonPartName(), PersonauthoritiesCommon.class);
527 Assert.assertNotNull(personAuthority);
528 } catch (Exception e) {
529 throw new RuntimeException(e);
533 res.releaseConnection();
541 * @param testName the test name
542 * @throws Exception the exception
544 @Test(dataProvider = "testName", groups = {"readItem", "readNamedItemInNamedAuth"},
545 dependsOnMethods = {"readItemInNamedAuth"})
546 public void readNamedItem(String testName) throws Exception {
547 readItemInternal(testName, knownResourceId, null, null, knownItemResourceShortIdentifer);
551 * Read item in Named Auth.
553 * @param testName the test name
554 * @throws Exception the exception
556 @Test(dataProvider = "testName", groups = {"readItem"},
557 dependsOnMethods = {"readItem"})
558 public void readItemInNamedAuth(String testName) throws Exception {
559 readItemInternal(testName, null, knownResourceShortIdentifer, knownItemResourceId, null);
564 * Read Named item in Named Auth.
566 * @param testName the test name
567 * @throws Exception the exception
569 @Test(dataProvider = "testName", groups = {"readItem"},
570 dependsOnMethods = {"readNamedItem"})
571 public void readNamedItemInNamedAuth(String testName) throws Exception {
572 readItemInternal(testName, null, knownResourceShortIdentifer, null, knownItemResourceShortIdentifer);
575 protected void readItemInternal(String testName,
576 String authCSID, String authShortId, String itemCSID, String itemShortId)
579 if (logger.isDebugEnabled()) {
580 logger.debug("Reading:" + ((authCSID != null) ? authCSID : authShortId) + "/"
581 + ((itemCSID != null) ? authCSID : itemShortId));
584 // Submit the request to the service and store the response.
585 PersonAuthorityClient client = new PersonAuthorityClient();
587 ClientResponse<String> res = null;
588 if (authCSID != null) {
589 if (itemCSID != null) {
590 res = client.readItem(authCSID, itemCSID);
591 } else if (itemShortId != null) {
592 res = client.readNamedItem(authCSID, itemShortId);
594 Assert.fail("readInternal: Internal error. One of CSID or shortId must be non-null");
596 } else if (authShortId != null) {
597 if (itemCSID != null) {
598 res = client.readItemInNamedAuthority(authShortId, itemCSID);
599 } else if (itemShortId != null) {
600 res = client.readNamedItemInNamedAuthority(authShortId, itemShortId);
602 Assert.fail("readInternal: Internal error. One of CSID or shortId must be non-null");
605 Assert.fail("readInternal: Internal error. One of authCSID or authShortId must be non-null");
608 assertStatusCode(res, testName);
609 // Check whether we've received a person.
610 PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
611 PersonsCommon person = (PersonsCommon) extractPart(input,
612 client.getItemCommonPartName(), PersonsCommon.class);
613 Assert.assertNotNull(person);
614 boolean showFull = true;
615 if (showFull && logger.isDebugEnabled()) {
616 logger.debug(testName + ": returned payload:");
617 logger.debug(objectAsXmlString(person, PersonsCommon.class));
620 // Check that the person item is within the expected Person Authority.
621 Assert.assertEquals(person.getInAuthority(), knownResourceId);
623 // Verify the number and contents of values in a repeatable field,
624 // as created in the instance record used for testing.
625 List<String> groups = person.getGroups().getGroup();
626 Assert.assertTrue(groups.size() > 0);
627 Assert.assertNotNull(groups.get(0));
630 res.releaseConnection();
635 // FIXME: This test depends on server-side validation logic to require
636 // a non-null (and potentially, non-empty) displayname for each term,
637 // and will fail if that validation is not present.
640 * Verify illegal item display name.
642 * @param testName the test name
643 * @throws Exception the exception
645 @Test(dataProvider = "testName", groups = {"update"})
646 public void verifyIllegalItemDisplayName(String testName) throws Exception {
647 // Perform setup for read.
650 // Submit the request to the service and store the response.
651 PersonAuthorityClient client = new PersonAuthorityClient();
652 ClientResponse<String> res = client.readItem(knownResourceId, knownItemResourceId);
653 PoxPayloadIn input = null;
655 assertStatusCode(res, testName);
656 input = new PoxPayloadIn(res.getEntity());
659 res.releaseConnection();
663 // Make an invalid UPDATE request, without a display name
665 PersonsCommon person = (PersonsCommon) extractPart(input,
666 client.getItemCommonPartName(), PersonsCommon.class);
667 Assert.assertNotNull(person);
668 // Try to Update with no displayName
669 List<PersonTermGroup> johnWayneTerms = new ArrayList<PersonTermGroup>();
670 PersonTermGroup term = new PersonTermGroup();
671 term.setTermDisplayName("John Wayne DisplayName");
672 term.setTermName("John Wayne");
673 term.setForeName(TEST_FORE_NAME);
674 term.setSurName(TEST_SUR_NAME);
675 johnWayneTerms.add(term);
677 PersonTermGroupList termList = person.getPersonTermGroupList();
678 Assert.assertNotNull(termList);
679 List<PersonTermGroup> terms = termList.getPersonTermGroup();
680 Assert.assertNotNull(terms);
681 terms.get(0).setTermDisplayName(null);
683 // Submit the updated resource to the service and store the response.
684 PoxPayloadOut output = new PoxPayloadOut(PersonAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
685 PayloadOutputPart commonPart = output.addPart(client.getItemCommonPartName(), person);
686 setupUpdateWithInvalidBody();
687 res = client.updateItem(knownResourceId, knownItemResourceId, output);
689 assertStatusCode(res, testName);
692 res.releaseConnection();
700 * @param testName the test name
701 * @throws Exception the exception
703 @Test(dataProvider = "testName", groups = {"readItem"},
704 dependsOnMethods = {"createContact", "org.collectionspace.services.client.test.AbstractAuthorityServiceTest.readItem"})
705 public void readContact(String testName) throws Exception {
709 // Submit the request to the service and store the response.
710 PersonAuthorityClient client = new PersonAuthorityClient();
711 PoxPayloadIn input = null;
712 ClientResponse<String> res =
713 client.readContact(knownResourceId, knownItemResourceId,
714 knownContactResourceId);
716 assertStatusCode(res, testName);
717 // Check whether we've received a contact.
718 input = new PoxPayloadIn(res.getEntity());
721 res.releaseConnection();
725 ContactsCommon contact = (ContactsCommon) extractPart(input,
726 new ContactClient().getCommonPartName(), ContactsCommon.class);
727 Assert.assertNotNull(contact);
728 boolean showFull = true;
729 if (showFull && logger.isDebugEnabled()) {
730 logger.debug(testName + ": returned payload:");
731 logger.debug(objectAsXmlString(contact, ContactsCommon.class));
733 Assert.assertEquals(contact.getInAuthority(), knownResourceId);
734 Assert.assertEquals(contact.getInItem(), knownItemResourceId);
739 * Read contact non existent.
741 * @param testName the test name
743 @Test(dataProvider = "testName", groups = {"readItem"},
744 dependsOnMethods = {"readContact"})
745 public void readContactNonExistent(String testName) {
747 setupReadNonExistent();
749 // Submit the request to the service and store the response.
750 PersonAuthorityClient client = new PersonAuthorityClient();
751 ClientResponse<String> res =
752 client.readContact(knownResourceId, knownItemResourceId, NON_EXISTENT_ID);
754 assertStatusCode(res, testName);
757 res.releaseConnection();
762 // ---------------------------------------------------------------
763 // CRUD tests : READ_LIST tests
764 // ---------------------------------------------------------------
770 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
771 // groups = {"readList"}, dependsOnMethods = {"readList"})
772 public void readItemList(String testName) {
773 readItemList(knownAuthorityWithItems, null, testName);
777 * Read item list by authority name.
780 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
781 // groups = {"readList"}, dependsOnMethods = {"readItemList"})
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();
796 ClientResponse<AbstractCommonList> res = null;
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.getEntity();
810 res.releaseConnection();
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, REFNAME);
829 Assert.assertTrue((null != value), "Item refName is null!");
832 AbstractCommonListUtils.ListItemGetElementValue(item, TERM_DISPLAY_NAME);
833 Assert.assertTrue((null != value), "Item displayName is null!");
835 if (logger.isTraceEnabled()) {
836 AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger, testName);
843 @Test(groups = {"readList"},
844 dependsOnMethods = {"org.collectionspace.services.client.test.AbstractAuthorityServiceTest.readItemList"})
845 public void readContactList() {
846 readContactList(knownResourceId, knownItemResourceId);
852 * @param parentcsid the parentcsid
853 * @param itemcsid the itemcsid
855 private void readContactList(String parentcsid, String itemcsid) {
856 final String testName = "readContactList";
861 // Submit the request to the service and store the response.
862 PersonAuthorityClient client = new PersonAuthorityClient();
863 AbstractCommonList list = null;
864 ClientResponse<AbstractCommonList> res =
865 client.readContactList(parentcsid, itemcsid);
867 assertStatusCode(res, testName);
868 list = res.getEntity();
871 res.releaseConnection();
875 List<AbstractCommonList.ListItem> listitems =
877 int nItemsReturned = listitems.size();
878 // There will be one item created, associated with a
879 // known parent resource, by the createItem test.
881 // In addition, there will be 'nItemsToCreateInList'
882 // additional items created by the createItemList test,
883 // all associated with the same parent resource.
884 int nExpectedItems = nItemsToCreateInList + 1;
885 if (logger.isDebugEnabled()) {
886 logger.debug(testName + ": Expected "
887 + nExpectedItems + " items; got: " + nItemsReturned);
889 Assert.assertEquals(nItemsReturned, nExpectedItems);
891 // Optionally output additional data about list members for debugging.
892 boolean iterateThroughList = false;
893 if (iterateThroughList && logger.isDebugEnabled()) {
894 AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger, testName);
899 // There are no failure outcome tests at present.
900 // ---------------------------------------------------------------
901 // CRUD tests : UPDATE tests
902 // ---------------------------------------------------------------
905 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#update(java.lang.String)
908 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
909 // groups = {"update"}, dependsOnGroups = {"readItem", "readList"})
910 public void update(String testName) throws Exception {
911 // Retrieve the contents of a resource to update.
912 PersonAuthorityClient client = new PersonAuthorityClient();
913 PoxPayloadIn input = null;
915 ClientResponse<String> res = client.read(knownResourceId);
917 assertStatusCode(res, testName);
918 if (logger.isDebugEnabled()) {
919 logger.debug("got PersonAuthority to update with ID: " + knownResourceId);
921 input = new PoxPayloadIn(res.getEntity());
924 res.releaseConnection();
928 PersonauthoritiesCommon personAuthority = (PersonauthoritiesCommon) extractPart(input,
929 client.getCommonPartName(), PersonauthoritiesCommon.class);
930 Assert.assertNotNull(personAuthority);
932 // Update the contents of this resource.
933 personAuthority.setDisplayName("updated-" + personAuthority.getDisplayName());
934 personAuthority.setVocabType("updated-" + personAuthority.getVocabType());
935 if (logger.isDebugEnabled()) {
936 logger.debug("to be updated PersonAuthority");
937 logger.debug(objectAsXmlString(personAuthority, PersonauthoritiesCommon.class));
940 // Submit the updated resource to the service and store the response.
941 PoxPayloadOut output = new PoxPayloadOut(PersonAuthorityClient.SERVICE_PAYLOAD_NAME);
942 PayloadOutputPart commonPart = output.addPart(client.getCommonPartName(), personAuthority);
944 res = client.update(knownResourceId, output);
946 assertStatusCode(res, testName);
947 // Retrieve the updated resource and verify that its contents exist.
948 input = new PoxPayloadIn(res.getEntity());
951 res.releaseConnection();
955 PersonauthoritiesCommon updatedPersonAuthority =
956 (PersonauthoritiesCommon) extractPart(input,
957 client.getCommonPartName(), PersonauthoritiesCommon.class);
958 Assert.assertNotNull(updatedPersonAuthority);
960 // Verify that the updated resource received the correct data.
961 Assert.assertEquals(updatedPersonAuthority.getDisplayName(),
962 personAuthority.getDisplayName(),
963 "Data in updated object did not match submitted data.");
969 * @param testName the test name
970 * @throws Exception the exception
973 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
974 // groups = {"update"}, dependsOnMethods = {"update"})
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 ClientResponse<String> res =
981 client.readItem(knownResourceId, knownItemResourceId);
983 assertStatusCode(res, testName);
984 if (logger.isDebugEnabled()) {
985 logger.debug("got Person to update with ID: "
986 + knownItemResourceId
987 + " in PersonAuthority: " + knownResourceId);
989 input = new PoxPayloadIn(res.getEntity());
992 res.releaseConnection();
996 PersonsCommon person = (PersonsCommon) extractPart(input,
997 client.getItemCommonPartName(), PersonsCommon.class);
998 Assert.assertNotNull(person);
1000 if (logger.isDebugEnabled() == true) {
1001 logger.debug("About to update the following person...");
1002 logger.debug(objectAsXmlString(person, PersonsCommon.class));
1005 // Update the contents of this resource.
1006 person.setCsid(null);
1007 PersonTermGroupList termList = person.getPersonTermGroupList();
1008 Assert.assertNotNull(termList);
1009 List<PersonTermGroup> terms = termList.getPersonTermGroup();
1010 Assert.assertNotNull(terms);
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.getEntity());
1031 res.releaseConnection();
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 ClientResponse<String> res =
1071 client.readContact(knownResourceId, knownItemResourceId, 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.getEntity());
1083 res.releaseConnection();
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.getEntity());;
1120 res.releaseConnection();
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 ClientResponse<Response> res =
1170 client.deleteContact(knownResourceId, knownItemResourceId, knownContactResourceId);
1172 assertStatusCode(res, testName);
1175 res.releaseConnection();
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 ClientResponse<Response> res =
1214 client.deleteContact(knownResourceId, knownItemResourceId, NON_EXISTENT_ID);
1216 assertStatusCode(res, testName);
1219 res.releaseConnection();
1225 * Test contact submit request.
1227 @Test(dataProvider = "testName",
1228 dependsOnMethods = {"createContact", "readContact", "testItemSubmitRequest"})
1229 public void testContactSubmitRequest(String testName) {
1231 // Expected status code: 200 OK
1232 final int EXPECTED_STATUS = Response.Status.OK.getStatusCode();
1234 // Submit the request to the service and store the response.
1235 String method = ServiceRequestType.READ.httpMethodName();
1236 String url = getContactResourceURL(knownResourceId,
1237 knownItemResourceId, knownContactResourceId);
1238 int statusCode = submitRequest(method, url);
1240 // Check the status code of the response: does it match
1241 // the expected response(s)?
1242 if (logger.isDebugEnabled()) {
1243 logger.debug("testContactSubmitRequest: url=" + url
1244 + " status=" + statusCode);
1246 Assert.assertEquals(statusCode, EXPECTED_STATUS);
1250 // ---------------------------------------------------------------
1251 // Cleanup of resources created during testing
1252 // ---------------------------------------------------------------
1254 * Deletes all resources created by tests, after all tests have been run.
1256 * This cleanup method will always be run, even if one or more tests fail.
1257 * For this reason, it attempts to remove all resources created
1258 * at any point during testing, even if some of those resources
1259 * may be expected to be deleted by certain tests.
1261 @AfterClass(alwaysRun = true)
1263 public void cleanUp() {
1264 String noTest = System.getProperty("noTestCleanup");
1265 if (Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
1266 if (logger.isDebugEnabled()) {
1267 logger.debug("Skipping Cleanup phase ...");
1271 if (logger.isDebugEnabled()) {
1272 logger.debug("Cleaning up temporary resources created for testing ...");
1274 String parentResourceId;
1275 String itemResourceId;
1276 String contactResourceId;
1277 // Clean up contact resources.
1278 PersonAuthorityClient client = new PersonAuthorityClient();
1279 parentResourceId = knownResourceId;
1280 for (Map.Entry<String, String> entry : allContactResourceIdsCreated.entrySet()) {
1281 contactResourceId = entry.getKey();
1282 itemResourceId = entry.getValue();
1283 // Note: Any non-success responses from the delete operation
1284 // below are ignored and not reported.
1285 ClientResponse<Response> res =
1286 client.deleteContact(parentResourceId, itemResourceId, contactResourceId);
1287 res.releaseConnection();
1289 // Clean up item resources.
1290 for (Map.Entry<String, String> entry : allResourceItemIdsCreated.entrySet()) {
1291 itemResourceId = entry.getKey();
1292 parentResourceId = entry.getValue();
1293 // Note: Any non-success responses from the delete operation
1294 // below are ignored and not reported.
1295 ClientResponse<Response> res =
1296 client.deleteItem(parentResourceId, itemResourceId);
1297 res.releaseConnection();
1299 // Clean up parent resources.
1303 // ---------------------------------------------------------------
1304 // Utility methods used by tests above
1305 // ---------------------------------------------------------------
1307 * Gets the contact service path component.
1309 * @return the contact service path component
1311 public String getContactServicePathComponent() {
1312 return ContactClient.SERVICE_PATH_COMPONENT;
1316 * Returns the root URL for the item service.
1318 * This URL consists of a base URL for all services, followed by
1319 * a path component for the owning parent, followed by the
1320 * path component for the items.
1322 * @param parentResourceIdentifier An identifier (such as a UUID) for the
1323 * parent authority resource of the relevant item resource.
1325 * @return The root URL for the item service.
1327 protected String getItemServiceRootURL(String parentResourceIdentifier) {
1328 return getResourceURL(parentResourceIdentifier) + "/" + getItemServicePathComponent();
1332 * Returns the URL of a specific item resource managed by a service, and
1333 * designated by an identifier (such as a universally unique ID, or UUID).
1335 * @param parentResourceIdentifier An identifier (such as a UUID) for the
1336 * parent authority resource of the relevant item resource.
1338 * @param itemResourceIdentifier An identifier (such as a UUID) for an
1341 * @return The URL of a specific item resource managed by a service.
1343 protected String getItemResourceURL(String parentResourceIdentifier, String itemResourceIdentifier) {
1344 return getItemServiceRootURL(parentResourceIdentifier) + "/" + itemResourceIdentifier;
1348 * Returns the root URL for the contact service.
1350 * This URL consists of a base URL for all services, followed by
1351 * a path component for the owning authority, followed by the
1352 * path component for the owning item, followed by the path component
1353 * for the contact service.
1355 * @param parentResourceIdentifier An identifier (such as a UUID) for the
1356 * parent authority resource of the relevant item resource.
1358 * @param itemResourceIdentifier An identifier (such as a UUID) for an
1361 * @return The root URL for the contact service.
1363 protected String getContactServiceRootURL(String parentResourceIdentifier,
1364 String itemResourceIdentifier) {
1365 return getItemResourceURL(parentResourceIdentifier, itemResourceIdentifier) + "/"
1366 + getContactServicePathComponent();
1370 * Returns the URL of a specific contact resource managed by a service, and
1371 * designated by an identifier (such as a universally unique ID, or UUID).
1373 * @param parentResourceIdentifier An identifier (such as a UUID) for the
1374 * parent resource of the relevant item resource.
1376 * @param resourceIdentifier An identifier (such as a UUID) for an
1379 * @return The URL of a specific resource managed by a service.
1381 protected String getContactResourceURL(String parentResourceIdentifier,
1382 String itemResourceIdentifier, String contactResourceIdentifier) {
1383 return getContactServiceRootURL(parentResourceIdentifier,
1384 itemResourceIdentifier) + "/" + contactResourceIdentifier;
1388 public void authorityTests(String testName) {
1389 // TODO Auto-generated method stub
1394 protected PersonsCommon updateItemInstance(PersonsCommon authorityItem) {
1395 // TODO Auto-generated method stub
1400 protected void compareUpdatedItemInstances(PersonsCommon original,
1401 PersonsCommon updated) throws Exception {
1402 // TODO Auto-generated method stub
1407 protected PoxPayloadOut createInstance(String commonPartName,
1408 String identifier) {
1409 String shortId = identifier;
1410 String displayName = "displayName-" + shortId;
1411 PoxPayloadOut result =
1412 PersonAuthorityClientUtils.createPersonAuthorityInstance(
1413 displayName, shortId, commonPartName);
1418 protected PoxPayloadOut createNonExistenceInstance(String commonPartName,
1419 String identifier) {
1420 String displayName = "displayName-NON_EXISTENT_ID";
1421 PoxPayloadOut result = PersonAuthorityClientUtils.createPersonAuthorityInstance(
1422 displayName, "NON_EXISTENT_SHORT_ID", commonPartName);
1426 protected PoxPayloadOut createNonExistenceItemInstance(String commonPartName, String identifier) {
1427 Map<String, String> nonexMap = new HashMap<String, String>();
1428 nonexMap.put(PersonJAXBSchema.SHORT_IDENTIFIER, "nonEX");
1429 nonexMap.put(PersonJAXBSchema.GENDER, "male");
1431 List<PersonTermGroup> terms = new ArrayList<PersonTermGroup>();
1432 PersonTermGroup term = new PersonTermGroup();
1433 term.setForeName("John");
1434 term.setSurName("Wayne");
1437 Map<String, List<String>> nonexRepeatablesMap = new HashMap<String, List<String>>();
1438 PoxPayloadOut result =
1439 PersonAuthorityClientUtils.createPersonInstance(NON_EXISTENT_ID,
1440 null, //PersonAuthorityClientUtils.createPersonAuthRefName(NON_EXISTENT_ID, null),
1441 nonexMap, terms, nonexRepeatablesMap, commonPartName);
1447 protected PersonauthoritiesCommon updateInstance(
1448 PersonauthoritiesCommon commonPartObject) {
1449 // TODO Auto-generated method stub
1454 protected void compareUpdatedInstances(PersonauthoritiesCommon original,
1455 PersonauthoritiesCommon updated) throws Exception {
1456 // TODO Auto-generated method stub
1460 protected void verifyReadItemInstance(PersonsCommon item) throws Exception {
1461 // Do nothing for now. Add more 'read' validation checks here if applicable.