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.person.PersonauthoritiesCommon;
50 import org.collectionspace.services.person.PersonTermGroup;
51 import org.collectionspace.services.person.PersonTermGroupList;
52 import org.collectionspace.services.person.PersonsCommon;
54 import org.jboss.resteasy.client.ClientResponse;
55 //import org.jboss.resteasy.plugins.providers.multipart.OutputPart;
56 import org.slf4j.Logger;
57 import org.slf4j.LoggerFactory;
58 import org.testng.Assert;
59 import org.testng.annotations.AfterClass;
60 import org.testng.annotations.Test;
63 * PersonAuthorityServiceTest, carries out tests against a
64 * deployed and running PersonAuthority Service.
66 * $LastChangedRevision: 753 $
67 * $LastChangedDate: 2009-09-23 11:03:36 -0700 (Wed, 23 Sep 2009) $
69 public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<PersonauthoritiesCommon, PersonsCommon> { //FIXME: Test classes for Vocab, Person, Org, and Location should have a base class!
72 private final String CLASS_NAME = PersonAuthorityServiceTest.class.getName();
73 private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
76 public String getServicePathComponent() {
77 return PersonAuthorityClient.SERVICE_PATH_COMPONENT;
81 protected String getServiceName() {
82 return PersonAuthorityClient.SERVICE_NAME;
85 public String getItemServicePathComponent() {
86 return AuthorityClient.ITEMS;
88 /** The test forename. */
89 final String TEST_FORE_NAME = "John";
90 /** The test middle name. */
91 final String TEST_MIDDLE_NAME = null;
92 /** The test surname. */
93 final String TEST_SUR_NAME = "Wayne";
94 /** The test birthdate. */
95 final String TEST_BIRTH_DATE = "May 26, 1907";
96 /** The test death date. */
97 final String TEST_DEATH_DATE = "June 11, 1979";
98 //private String knownResourceRefName = null;
99 private String knownItemResourceShortIdentifer = null;
100 // The resource ID of an item resource used for partial term matching tests.
101 private String knownItemPartialTermResourceId = null;
102 /** The known contact resource id. */
103 private String knownContactResourceId = null;
104 /** The all contact resource ids created. */
105 private Map<String, String> allContactResourceIdsCreated =
106 new HashMap<String, String>();
108 protected void setKnownResource(String id, String shortIdentifer,
110 knownResourceId = id;
111 knownResourceShortIdentifer = shortIdentifer;
112 //knownResourceRefName = refName;
115 protected void setKnownItemResource(String id, String shortIdentifer) {
116 knownItemResourceId = id;
117 knownItemResourceShortIdentifer = shortIdentifer;
121 * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
124 protected CollectionSpaceClient getClientInstance() {
125 return new PersonAuthorityClient();
128 // ---------------------------------------------------------------
129 // CRUD tests : CREATE tests
130 // ---------------------------------------------------------------
133 * @see org.collectionspace.services.client.test.ServiceTest#create(java.lang.String)
136 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
137 // groups = {"create"})
138 public void create(String testName) throws Exception {
139 // Perform setup, such as initializing the type of service request
140 // (e.g. CREATE, DELETE), its valid and expected status codes, and
141 // its associated HTTP method name (e.g. POST, DELETE).
144 // Submit the request to the service and store the response.
145 PersonAuthorityClient client = new PersonAuthorityClient();
146 String shortId = createIdentifier();
147 String displayName = "displayName-" + shortId;
148 //String baseRefName = PersonAuthorityClientUtils.createPersonAuthRefName(shortId, null);
149 PoxPayloadOut multipart =
150 PersonAuthorityClientUtils.createPersonAuthorityInstance(
151 displayName, shortId, client.getCommonPartName());
154 ClientResponse<Response> res = client.create(multipart);
156 assertStatusCode(res, testName);
157 newID = extractId(res);
160 res.releaseConnection();
163 // Save values for additional tests
164 if (knownResourceId == null) {
165 setKnownResource(newID, shortId, null ); //baseRefName);
166 if (logger.isDebugEnabled()) {
167 logger.debug(testName + ": knownResourceId=" + knownResourceId);
170 // Store the IDs from every resource created by tests,
171 // so they can be deleted after tests have been run.
172 allResourceIdsCreated.add(newID);
176 protected PoxPayloadOut createInstance(String identifier) {
177 PersonAuthorityClient client = new PersonAuthorityClient();
178 String displayName = "displayName-" + identifier;
179 PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
180 displayName, identifier, client.getCommonPartName());
185 protected PoxPayloadOut createItemInstance(String parentCsid, String identifier) {
186 String headerLabel = new PersonAuthorityClient().getItemCommonPartName();
188 HashMap<String, String> personInfo = new HashMap<String, String>();
189 String shortId = "johnWayneTempActor";
190 personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId);
192 List<PersonTermGroup> terms = new ArrayList<PersonTermGroup>();
193 PersonTermGroup term = new PersonTermGroup();
194 term.setTermDisplayName("John Wayne Temp");
195 term.setTermName("JohnWayneTemp");
198 return PersonAuthorityClientUtils.createPersonInstance(parentCsid, identifier, personInfo, terms, headerLabel);
202 * Creates an item in an authority, using test data.
204 * @param vcsid the vcsid
205 * @param authRefName the auth ref name
209 protected String createItemInAuthority(String vcsid) {
211 final String testName = "createItemInAuthority";
212 if (logger.isDebugEnabled()) {
213 logger.debug(testName + ":" + vcsid + "...");
216 Map<String, String> johnWayneMap = new HashMap<String, String>();
218 // Fill the property map
220 String shortId = "johnWayneActor";
221 johnWayneMap.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId);
222 johnWayneMap.put(PersonJAXBSchema.GENDER, "male");
223 johnWayneMap.put(PersonJAXBSchema.BIRTH_DATE, TEST_BIRTH_DATE);
224 johnWayneMap.put(PersonJAXBSchema.BIRTH_PLACE, "Winterset, Iowa");
225 johnWayneMap.put(PersonJAXBSchema.DEATH_DATE, TEST_DEATH_DATE);
226 johnWayneMap.put(PersonJAXBSchema.BIO_NOTE, "born Marion Robert Morrison and better"
227 + "known by his stage name John Wayne, was an American film actor, director "
228 + "and producer. He epitomized rugged masculinity and has become an enduring "
229 + "American icon. He is famous for his distinctive voice, walk and height. "
230 + "He was also known for his conservative political views and his support in "
231 + "the 1950s for anti-communist positions.");
233 List<PersonTermGroup> johnWayneTerms = new ArrayList<PersonTermGroup>();
234 PersonTermGroup term = new PersonTermGroup();
235 term.setTermDisplayName("John Wayne DisplayName");
236 term.setTermName("John Wayne");
237 term.setForeName(TEST_FORE_NAME);
238 term.setSurName(TEST_SUR_NAME);
239 johnWayneTerms.add(term);
241 Map<String, List<String>> johnWayneRepeatablesMap = new HashMap<String, List<String>>();
242 List<String> johnWayneGroups = new ArrayList<String>();
243 johnWayneGroups.add("Irish");
244 johnWayneGroups.add("Scottish");
245 johnWayneRepeatablesMap.put(PersonJAXBSchema.GROUPS, johnWayneGroups);
247 return createItemInAuthority(vcsid, null /*authRefName*/, shortId, johnWayneMap, johnWayneTerms, johnWayneRepeatablesMap);
252 * Creates an item in an authority.
254 * @param vcsid the vcsid
255 * @param authRefName the auth ref name
256 * @param itemFieldProperties a set of properties specifying the values of fields.
257 * @param itemRepeatableFieldProperties a set of properties specifying the values of repeatable fields.
260 private String createItemInAuthority(String vcsid, String authRefName, String shortId,
261 Map itemFieldProperties, List<PersonTermGroup> terms, Map itemRepeatableFieldProperties) {
263 final String testName = "createItemInAuthority";
264 if (logger.isDebugEnabled()) {
265 logger.debug(testName + ":" + vcsid + "...");
268 // Submit the request to the service and store the response.
269 PersonAuthorityClient client = new PersonAuthorityClient();
270 PoxPayloadOut multipart =
271 PersonAuthorityClientUtils.createPersonInstance(vcsid, null /*authRefName*/, itemFieldProperties,
272 terms, itemRepeatableFieldProperties, client.getItemCommonPartName());
274 ClientResponse<Response> res = client.createItem(vcsid, multipart);
277 assertStatusCode(res, testName);
278 newID = PersonAuthorityClientUtils.extractId(res);
281 res.releaseConnection();
285 // Store the ID returned from the first item resource created
286 // for additional tests below.
287 if (knownItemResourceId == null) {
288 setKnownItemResource(newID, shortId);
289 if (logger.isDebugEnabled()) {
290 logger.debug(testName + ": knownItemResourceId=" + knownItemResourceId);
293 if (logger.isDebugEnabled()) {
294 logger.debug(testName + " (created):" + vcsid + "/(" + newID + "," + shortId + ")");
297 // Store the IDs from any item resources created
298 // by tests, along with the IDs of their parents, so these items
299 // can be deleted after all tests have been run.
300 allResourceItemIdsCreated.put(newID, vcsid);
306 * Creates the contact.
308 * @param testName the test name
310 @Test(dataProvider = "testName", groups = {"create"},
311 dependsOnMethods = {"createItem"})
312 public void createContact(String testName) {
314 String newID = createContactInItem(knownResourceId, knownItemResourceId);
318 * Creates the contact in item.
320 * @param parentcsid the parentcsid
321 * @param itemcsid the itemcsid
324 private String createContactInItem(String parentcsid, String itemcsid) {
326 final String testName = "createContactInItem";
327 if (logger.isDebugEnabled()) {
328 logger.debug(testName + ":...");
330 // Submit the request to the service and store the response.
331 PersonAuthorityClient client = new PersonAuthorityClient();
332 String identifier = createIdentifier();
333 PoxPayloadOut multipart = ContactClientUtils.createContactInstance(parentcsid,
334 itemcsid, identifier, new ContactClient().getCommonPartName());
337 ClientResponse<Response> res =
338 client.createContact(parentcsid, itemcsid, multipart);
341 assertStatusCode(res, testName);
342 newID = PersonAuthorityClientUtils.extractId(res);
345 res.releaseConnection();
349 // Store the ID returned from the first contact resource created
350 // for additional tests below.
351 if (knownContactResourceId == null) {
352 knownContactResourceId = newID;
353 if (logger.isDebugEnabled()) {
354 logger.debug(testName + ": knownContactResourceId=" + knownContactResourceId);
358 // Store the IDs from any contact resources created
359 // by tests, along with the IDs of their parent items,
360 // so these items can be deleted after all tests have been run.
361 allContactResourceIdsCreated.put(newID, itemcsid);
367 * Attempts to create an authority with an short identifier that contains
368 * non-word characters.
370 * @param testName the test name
372 @Test(dataProvider = "testName", groups = {"create", "nonWordCharsInShortId"})
373 public void createWithShortIdNonWordChars(String testName) throws Exception {
374 testExpectedStatusCode = STATUS_BAD_REQUEST;
375 testRequestType = ServiceRequestType.CREATE;
376 testSetup(testExpectedStatusCode, testRequestType);
378 // Create the payload to be included in the body of the request
379 PersonAuthorityClient client = new PersonAuthorityClient();
380 String shortId = createIdentifier() + "*" + createIdentifier();
381 String displayName = "displayName-" + shortId;
382 PoxPayloadOut multipart =
383 PersonAuthorityClientUtils.createPersonAuthorityInstance(
384 displayName, shortId, client.getCommonPartName());
386 // Submit the request to the service and store the response.
387 ClientResponse<Response> res = client.create(multipart);
389 // Check the status code of the response: does it match
390 // the expected response(s)?
392 assertStatusCode(res, testName);
395 res.releaseConnection();
401 * Attempts to create an item with an short identifier that contains
402 * non-word characters.
404 * @param testName the test name
406 @Test(dataProvider = "testName", groups = {"create", "nonWordCharsInShortId"},
407 dependsOnMethods = {"org.collectionspace.services.client.test.AbstractServiceTestImpl.create"})
408 public void createItemWithShortIdNonWordChars(String testName) {
409 testExpectedStatusCode = STATUS_BAD_REQUEST;
410 testRequestType = ServiceRequestType.CREATE;
411 testSetup(testExpectedStatusCode, testRequestType);
413 PersonAuthorityClient client = new PersonAuthorityClient();
414 // Create the payload to be included in the body of the request
415 String shortId = "7-Eleven";
416 Map<String, String> fieldProperties = new HashMap<String, String>();
417 fieldProperties.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId);
419 List<PersonTermGroup> terms = new ArrayList<PersonTermGroup>();
420 PersonTermGroup term = new PersonTermGroup();
421 term.setTermDisplayName(shortId);
422 term.setTermName(shortId);
425 final Map NULL_REPEATABLE_FIELD_PROPERTIES = null;
426 PoxPayloadOut multipart =
427 PersonAuthorityClientUtils.createPersonInstance(knownResourceId,
428 null /*knownResourceRefName*/, fieldProperties, terms,
429 NULL_REPEATABLE_FIELD_PROPERTIES, client.getItemCommonPartName());
431 // Send the request and receive a response
432 ClientResponse<Response> res = client.createItem(knownResourceId, multipart);
433 // Check the status code of the response: does it match
434 // the expected response(s)?
436 assertStatusCode(res, testName);
439 res.releaseConnection();
444 // ---------------------------------------------------------------
445 // CRUD tests : CREATE LIST tests
446 // ---------------------------------------------------------------
449 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createList(java.lang.String)
452 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
453 // groups = {"createList"}, dependsOnGroups = {"create"})
454 public void createList(String testName) throws Exception {
455 for (int i = 0; i < nItemsToCreateInList; i++) {
461 * Creates the contact list.
463 * @param testName the test name
464 * @throws Exception the exception
466 @Test(dataProvider = "testName", groups = {"createList"},
467 dependsOnMethods = {"org.collectionspace.services.client.test.AbstractAuthorityServiceTest.createItemList"})
468 public void createContactList(String testName) throws Exception {
469 // Add contacts to the initially-created, known item record.
470 for (int j = 0; j < nItemsToCreateInList; j++) {
471 createContact(testName);
475 // ---------------------------------------------------------------
476 // CRUD tests : READ tests
477 // ---------------------------------------------------------------
480 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#read(java.lang.String)
483 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
484 // groups = {"read"}, dependsOnGroups = {"create"})
485 public void read(String testName) throws Exception {
486 readInternal(testName, knownResourceId, null);
492 * @param testName the test name
493 * @throws Exception the exception
496 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
497 // groups = {"read"}, dependsOnMethods = {"read"})
498 public void readByName(String testName) throws Exception {
499 readInternal(testName, null, knownResourceShortIdentifer);
502 protected void readInternal(String testName, String CSID, String shortId) {
503 // Submit the request to the service and store the response.
504 PersonAuthorityClient client = new PersonAuthorityClient();
505 ClientResponse<String> res = null;
508 res = client.read(CSID);
509 } else if (shortId != null) {
510 res = client.readByName(shortId);
512 Assert.fail("readInternal: Internal error. One of CSID or shortId must be non-null");
515 assertStatusCode(res, testName);
516 //FIXME: remove the following try catch once Aron fixes signatures
518 PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
519 PersonauthoritiesCommon personAuthority = (PersonauthoritiesCommon) extractPart(input,
520 client.getCommonPartName(), PersonauthoritiesCommon.class);
521 Assert.assertNotNull(personAuthority);
522 } catch (Exception e) {
523 throw new RuntimeException(e);
527 res.releaseConnection();
535 * @param testName the test name
536 * @throws Exception the exception
538 @Test(dataProvider = "testName", groups = {"readItem", "readNamedItemInNamedAuth"},
539 dependsOnMethods = {"readItemInNamedAuth"})
540 public void readNamedItem(String testName) throws Exception {
541 readItemInternal(testName, knownResourceId, null, null, knownItemResourceShortIdentifer);
545 * Read item in Named Auth.
547 * @param testName the test name
548 * @throws Exception the exception
550 @Test(dataProvider = "testName", groups = {"readItem"},
551 dependsOnMethods = {"readItem"})
552 public void readItemInNamedAuth(String testName) throws Exception {
553 readItemInternal(testName, null, knownResourceShortIdentifer, knownItemResourceId, null);
558 * Read Named item in Named Auth.
560 * @param testName the test name
561 * @throws Exception the exception
563 @Test(dataProvider = "testName", groups = {"readItem"},
564 dependsOnMethods = {"readNamedItem"})
565 public void readNamedItemInNamedAuth(String testName) throws Exception {
566 readItemInternal(testName, null, knownResourceShortIdentifer, null, knownItemResourceShortIdentifer);
569 protected void readItemInternal(String testName,
570 String authCSID, String authShortId, String itemCSID, String itemShortId)
573 if (logger.isDebugEnabled()) {
574 logger.debug("Reading:" + ((authCSID != null) ? authCSID : authShortId) + "/"
575 + ((itemCSID != null) ? authCSID : itemShortId));
578 // Submit the request to the service and store the response.
579 PersonAuthorityClient client = new PersonAuthorityClient();
581 ClientResponse<String> res = null;
582 if (authCSID != null) {
583 if (itemCSID != null) {
584 res = client.readItem(authCSID, itemCSID);
585 } else if (itemShortId != null) {
586 res = client.readNamedItem(authCSID, itemShortId);
588 Assert.fail("readInternal: Internal error. One of CSID or shortId must be non-null");
590 } else if (authShortId != null) {
591 if (itemCSID != null) {
592 res = client.readItemInNamedAuthority(authShortId, itemCSID);
593 } else if (itemShortId != null) {
594 res = client.readNamedItemInNamedAuthority(authShortId, itemShortId);
596 Assert.fail("readInternal: Internal error. One of CSID or shortId must be non-null");
599 Assert.fail("readInternal: Internal error. One of authCSID or authShortId must be non-null");
602 assertStatusCode(res, testName);
603 // Check whether we've received a person.
604 PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
605 PersonsCommon person = (PersonsCommon) extractPart(input,
606 client.getItemCommonPartName(), PersonsCommon.class);
607 Assert.assertNotNull(person);
608 boolean showFull = true;
609 if (showFull && logger.isDebugEnabled()) {
610 logger.debug(testName + ": returned payload:");
611 logger.debug(objectAsXmlString(person, PersonsCommon.class));
614 // Check that the person item is within the expected Person Authority.
615 Assert.assertEquals(person.getInAuthority(), knownResourceId);
617 // Verify the number and contents of values in a repeatable field,
618 // as created in the instance record used for testing.
619 List<String> groups = person.getGroups().getGroup();
620 Assert.assertTrue(groups.size() > 0);
621 Assert.assertNotNull(groups.get(0));
624 res.releaseConnection();
629 // Note: This test depends on server-side validation logic to require
630 // a non-null (and potentially, non-empty) displayname for each term,
631 // and will fail if that validation is not present.
634 * Verify illegal item display name.
636 * @param testName the test name
637 * @throws Exception the exception
639 @Test(dataProvider = "testName", groups = {"update"})
640 public void verifyIllegalItemDisplayName(String testName) throws Exception {
641 // Perform setup for read.
644 // Submit the request to the service and store the response.
645 PersonAuthorityClient client = new PersonAuthorityClient();
646 ClientResponse<String> res = client.readItem(knownResourceId, knownItemResourceId);
647 PoxPayloadIn input = null;
649 assertStatusCode(res, testName);
650 input = new PoxPayloadIn(res.getEntity());
653 res.releaseConnection();
657 // Make an invalid UPDATE request, without a display name
659 PersonsCommon person = (PersonsCommon) extractPart(input,
660 client.getItemCommonPartName(), PersonsCommon.class);
661 Assert.assertNotNull(person);
662 // Try to Update with no displayName
663 List<PersonTermGroup> johnWayneTerms = new ArrayList<PersonTermGroup>();
664 PersonTermGroup term = new PersonTermGroup();
665 term.setTermDisplayName("John Wayne DisplayName");
666 term.setTermName("John Wayne");
667 term.setForeName(TEST_FORE_NAME);
668 term.setSurName(TEST_SUR_NAME);
669 johnWayneTerms.add(term);
671 PersonTermGroupList termList = person.getPersonTermGroupList();
672 Assert.assertNotNull(termList);
673 List<PersonTermGroup> terms = termList.getPersonTermGroup();
674 Assert.assertNotNull(terms);
675 Assert.assertTrue(terms.size() > 0);
676 terms.get(0).setTermDisplayName(null);
677 terms.get(0).setTermName(null);
679 // Submit the updated resource to the service and store the response.
680 PoxPayloadOut output = new PoxPayloadOut(PersonAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
681 PayloadOutputPart commonPart = output.addPart(client.getItemCommonPartName(), person);
682 setupUpdateWithInvalidBody();
683 res = client.updateItem(knownResourceId, knownItemResourceId, output);
685 assertStatusCode(res, testName);
688 res.releaseConnection();
696 * @param testName the test name
697 * @throws Exception the exception
699 @Test(dataProvider = "testName", groups = {"readItem"},
700 dependsOnMethods = {"createContact", "org.collectionspace.services.client.test.AbstractAuthorityServiceTest.readItem"})
701 public void readContact(String testName) throws Exception {
705 // Submit the request to the service and store the response.
706 PersonAuthorityClient client = new PersonAuthorityClient();
707 PoxPayloadIn input = null;
708 ClientResponse<String> res =
709 client.readContact(knownResourceId, knownItemResourceId,
710 knownContactResourceId);
712 assertStatusCode(res, testName);
713 // Check whether we've received a contact.
714 input = new PoxPayloadIn(res.getEntity());
717 res.releaseConnection();
721 ContactsCommon contact = (ContactsCommon) extractPart(input,
722 new ContactClient().getCommonPartName(), ContactsCommon.class);
723 Assert.assertNotNull(contact);
724 boolean showFull = true;
725 if (showFull && logger.isDebugEnabled()) {
726 logger.debug(testName + ": returned payload:");
727 logger.debug(objectAsXmlString(contact, ContactsCommon.class));
729 Assert.assertEquals(contact.getInAuthority(), knownResourceId);
730 Assert.assertEquals(contact.getInItem(), knownItemResourceId);
735 * Read contact non existent.
737 * @param testName the test name
739 @Test(dataProvider = "testName", groups = {"readItem"},
740 dependsOnMethods = {"readContact"})
741 public void readContactNonExistent(String testName) {
743 setupReadNonExistent();
745 // Submit the request to the service and store the response.
746 PersonAuthorityClient client = new PersonAuthorityClient();
747 ClientResponse<String> res =
748 client.readContact(knownResourceId, knownItemResourceId, NON_EXISTENT_ID);
750 assertStatusCode(res, testName);
753 res.releaseConnection();
758 // ---------------------------------------------------------------
759 // CRUD tests : READ_LIST tests
760 // ---------------------------------------------------------------
766 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
767 // groups = {"readList"}, dependsOnMethods = {"readList"})
768 public void readItemList(String testName) {
769 readItemList(knownAuthorityWithItems, null, testName);
773 * Read item list by authority name.
776 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
777 // groups = {"readList"}, dependsOnMethods = {"readItemList"})
778 public void readItemListByName(String testName) {
779 readItemList(null, READITEMS_SHORT_IDENTIFIER, testName);
785 * @param vcsid the vcsid
786 * @param name the name
788 private void readItemList(String vcsid, String name, String testName) {
790 // Submit the request to the service and store the response.
791 PersonAuthorityClient client = new PersonAuthorityClient();
792 ClientResponse<AbstractCommonList> res = null;
794 res = client.readItemList(vcsid, null, null);
795 } else if (name != null) {
796 res = client.readItemListForNamedAuthority(name, null, null);
798 Assert.fail("readItemList passed null csid and name!");
800 AbstractCommonList list = null;
802 assertStatusCode(res, testName);
803 list = res.getEntity();
806 res.releaseConnection();
810 List<AbstractCommonList.ListItem> items = list.getListItem();
811 int nItemsReturned = items.size();
812 // There will be 'nItemsToCreateInList'
813 // items created by the createItemList test,
814 // all associated with the same parent resource.
815 int nExpectedItems = nItemsToCreateInList;
816 if (logger.isDebugEnabled()) {
817 logger.debug(testName + ": Expected "
818 + nExpectedItems + " items; got: " + nItemsReturned);
820 Assert.assertEquals(nItemsReturned, nExpectedItems);
822 for (AbstractCommonList.ListItem item : items) {
824 AbstractCommonListUtils.ListItemGetElementValue(item, AuthorityItemJAXBSchema.REF_NAME);
825 Assert.assertTrue((null != value), "Item refName is null!");
827 // Per CSPACE-5132, lists items still return a field named displayName,
828 // not termDisplayName, for backward compatibility.
829 // (The format of list items will change significantly in CSPACE-5134.)
831 AbstractCommonListUtils.ListItemGetElementValue(item, AuthorityItemJAXBSchema.DISPLAY_NAME);
832 Assert.assertTrue((null != value), "Item displayName is null!");
834 if (logger.isTraceEnabled()) {
835 AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger, testName);
842 @Test(groups = {"readList"},
843 dependsOnMethods = {"org.collectionspace.services.client.test.AbstractAuthorityServiceTest.readItemList"})
844 public void readContactList() {
845 readContactList(knownResourceId, knownItemResourceId);
851 * @param parentcsid the parentcsid
852 * @param itemcsid the itemcsid
854 private void readContactList(String parentcsid, String itemcsid) {
855 final String testName = "readContactList";
860 // Submit the request to the service and store the response.
861 PersonAuthorityClient client = new PersonAuthorityClient();
862 AbstractCommonList list = null;
863 ClientResponse<AbstractCommonList> res =
864 client.readContactList(parentcsid, itemcsid);
866 assertStatusCode(res, testName);
867 list = res.getEntity();
870 res.releaseConnection();
874 List<AbstractCommonList.ListItem> listitems =
876 int nItemsReturned = listitems.size();
877 // There will be one item created, associated with a
878 // known parent resource, by the createItem test.
880 // In addition, there will be 'nItemsToCreateInList'
881 // additional items created by the createItemList test,
882 // all associated with the same parent resource.
883 int nExpectedItems = nItemsToCreateInList + 1;
884 if (logger.isDebugEnabled()) {
885 logger.debug(testName + ": Expected "
886 + nExpectedItems + " items; got: " + nItemsReturned);
888 Assert.assertEquals(nItemsReturned, nExpectedItems);
890 // Optionally output additional data about list members for debugging.
891 boolean iterateThroughList = false;
892 if (iterateThroughList && logger.isDebugEnabled()) {
893 AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger, testName);
898 // There are no failure outcome tests at present.
899 // ---------------------------------------------------------------
900 // CRUD tests : UPDATE tests
901 // ---------------------------------------------------------------
904 * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#update(java.lang.String)
907 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
908 // groups = {"update"}, dependsOnGroups = {"readItem", "readList"})
909 public void update(String testName) throws Exception {
910 // Retrieve the contents of a resource to update.
911 PersonAuthorityClient client = new PersonAuthorityClient();
912 PoxPayloadIn input = null;
914 ClientResponse<String> res = client.read(knownResourceId);
916 assertStatusCode(res, testName);
917 if (logger.isDebugEnabled()) {
918 logger.debug("got PersonAuthority to update with ID: " + knownResourceId);
920 input = new PoxPayloadIn(res.getEntity());
923 res.releaseConnection();
927 PersonauthoritiesCommon personAuthority = (PersonauthoritiesCommon) extractPart(input,
928 client.getCommonPartName(), PersonauthoritiesCommon.class);
929 Assert.assertNotNull(personAuthority);
931 // Update the contents of this resource.
932 personAuthority.setDisplayName("updated-" + personAuthority.getDisplayName());
933 personAuthority.setVocabType("updated-" + personAuthority.getVocabType());
934 if (logger.isDebugEnabled()) {
935 logger.debug("to be updated PersonAuthority");
936 logger.debug(objectAsXmlString(personAuthority, PersonauthoritiesCommon.class));
939 // Submit the updated resource to the service and store the response.
940 PoxPayloadOut output = new PoxPayloadOut(PersonAuthorityClient.SERVICE_PAYLOAD_NAME);
941 PayloadOutputPart commonPart = output.addPart(client.getCommonPartName(), personAuthority);
943 res = client.update(knownResourceId, output);
945 assertStatusCode(res, testName);
946 // Retrieve the updated resource and verify that its contents exist.
947 input = new PoxPayloadIn(res.getEntity());
950 res.releaseConnection();
954 PersonauthoritiesCommon updatedPersonAuthority =
955 (PersonauthoritiesCommon) extractPart(input,
956 client.getCommonPartName(), PersonauthoritiesCommon.class);
957 Assert.assertNotNull(updatedPersonAuthority);
959 // Verify that the updated resource received the correct data.
960 Assert.assertEquals(updatedPersonAuthority.getDisplayName(),
961 personAuthority.getDisplayName(),
962 "Data in updated object did not match submitted data.");
968 * @param testName the test name
969 * @throws Exception the exception
972 // @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
973 // groups = {"update"}, dependsOnMethods = {"update"})
974 public void updateItem(String testName) throws Exception {
975 // Retrieve the contents of a resource to update.
976 PersonAuthorityClient client = new PersonAuthorityClient();
977 PoxPayloadIn input = null;
979 ClientResponse<String> res =
980 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.getEntity());
991 res.releaseConnection();
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.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.setTermDisplayName("John Wayne");
1434 term.setTermName("John Wayne");
1435 term.setForeName("John");
1436 term.setSurName("Wayne");
1439 Map<String, List<String>> nonexRepeatablesMap = new HashMap<String, List<String>>();
1440 PoxPayloadOut result =
1441 PersonAuthorityClientUtils.createPersonInstance(NON_EXISTENT_ID,
1442 null, //PersonAuthorityClientUtils.createPersonAuthRefName(NON_EXISTENT_ID, null),
1443 nonexMap, terms, nonexRepeatablesMap, commonPartName);
1449 protected PersonauthoritiesCommon updateInstance(
1450 PersonauthoritiesCommon commonPartObject) {
1451 // TODO Auto-generated method stub
1456 protected void compareUpdatedInstances(PersonauthoritiesCommon original,
1457 PersonauthoritiesCommon updated) throws Exception {
1458 // TODO Auto-generated method stub
1462 protected void verifyReadItemInstance(PersonsCommon item) throws Exception {
1463 // Do nothing for now. Add more 'read' validation checks here if applicable.