From: Aron Roberts Date: Wed, 15 Sep 2010 01:20:16 +0000 (+0000) Subject: CSPACE-2893: In the Acquisition service, enabled the retrieval of terms used (authori... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=fa18111b98707b763d7cce7b1ff83e8cdca0f976;p=tmp%2Fjakarta-migration.git CSPACE-2893: In the Acquisition service, enabled the retrieval of terms used (authorityrefs) from the 'owners->owner' repeatable scalar field. --- diff --git a/services/acquisition/client/src/test/java/org/collectionspace/services/client/test/AcquisitionAuthRefsTest.java b/services/acquisition/client/src/test/java/org/collectionspace/services/client/test/AcquisitionAuthRefsTest.java index 618fa18db..f5b72ef5a 100644 --- a/services/acquisition/client/src/test/java/org/collectionspace/services/client/test/AcquisitionAuthRefsTest.java +++ b/services/acquisition/client/src/test/java/org/collectionspace/services/client/test/AcquisitionAuthRefsTest.java @@ -41,6 +41,7 @@ import org.collectionspace.services.acquisition.AcquisitionsCommon; import org.collectionspace.services.acquisition.AcquisitionFunding; import org.collectionspace.services.acquisition.AcquisitionFundingList; import org.collectionspace.services.acquisition.AcquisitionSourceList; +import org.collectionspace.services.acquisition.OwnerList; import org.jboss.resteasy.client.ClientResponse; @@ -75,8 +76,9 @@ public class AcquisitionAuthRefsTest extends BaseServiceTest { private String personAuthCSID = null; private String acquisitionAuthorizerRefName = null; private List acquisitionFundingSourcesRefNames = new ArrayList(); + private List ownersRefNames = new ArrayList(); private List acquisitionSourcesRefNames = new ArrayList(); - private final int NUM_AUTH_REFS_EXPECTED = 3; + private final int NUM_AUTH_REFS_EXPECTED = 5; /* (non-Javadoc) * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance() @@ -119,6 +121,7 @@ public class AcquisitionAuthRefsTest extends BaseServiceTest { "April 1, 2010", acquisitionAuthorizerRefName, acquisitionFundingSourcesRefNames, + ownersRefNames, acquisitionSourcesRefNames); AcquisitionClient acquisitionClient = new AcquisitionClient(); @@ -180,6 +183,14 @@ public class AcquisitionAuthRefsTest extends BaseServiceTest { acquisitionFundingSourcesRefNames.add(PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null)); personIdsCreated.add(csid); */ + + csid = createPerson("Owen", "OwnerOne", "owenOwnerOne", authRefName); + ownersRefNames.add(PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null)); + personIdsCreated.add(csid); + + csid = createPerson("Orelia", "OwnerTwo", "oreliaOwnerTwo", authRefName); + ownersRefNames.add(PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null)); + personIdsCreated.add(csid); csid = createPerson("Sammy", "SourceOne", "sammySourceOne", authRefName); acquisitionSourcesRefNames.add(PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null)); @@ -256,6 +267,12 @@ public class AcquisitionAuthRefsTest extends BaseServiceTest { */ // In scalar repeatable fields + OwnerList ownersList = acquisition.getOwners(); + List owners = ownersList.getOwner(); + for (String refName : owners) { + Assert.assertTrue(ownersRefNames.contains(refName)); + } + AcquisitionSourceList acquisitionSources = acquisition.getAcquisitionSources(); List sources = acquisitionSources.getAcquisitionSource(); for (String refName : sources) { @@ -358,12 +375,16 @@ public class AcquisitionAuthRefsTest extends BaseServiceTest { String accessionDate, String acquisitionAuthorizer, List acquisitionFundingSources, + List acqOwners, List acquisitionSources) { AcquisitionsCommon acquisition = new AcquisitionsCommon(); acquisition.setAccessionDate(accessionDate); acquisition.setAcquisitionAuthorizer(acquisitionAuthorizer); + // AcquisitionFunding-related authrefs fields are *not* currently + // enabled, as described in issue CSPACE-2818 + /* AcquisitionFundingList acqFundingsList = new AcquisitionFundingList(); List acqFundings = acqFundingsList.getAcquisitionFunding(); @@ -381,6 +402,13 @@ public class AcquisitionAuthRefsTest extends BaseServiceTest { acquisition.setAcquisitionFundingList(acqFundingsList); */ + OwnerList ownersList = new OwnerList(); + List owners = ownersList.getOwner(); + for (String owner: acqOwners) { + owners.add(owner); + } + acquisition.setOwners(ownersList); + AcquisitionSourceList acqSourcesList = new AcquisitionSourceList(); List acqSources = acqSourcesList.getAcquisitionSource(); for (String acqSource: acquisitionSources) { diff --git a/services/common/src/main/config/services/tenant-bindings.xml b/services/common/src/main/config/services/tenant-bindings.xml index 184665b56..fdce5391a 100644 --- a/services/common/src/main/config/services/tenant-bindings.xml +++ b/services/common/src/main/config/services/tenant-bindings.xml @@ -767,6 +767,7 @@ label="acquisitions_common" updated="" order="1"> authRefacquisitionAuthorizer + authRefowners|owner authRefacquisitionSources|acquisitionSource @@ -1910,6 +1911,7 @@ label="acquisitions_common" updated="" order="1"> authRefacquisitionAuthorizer + authRefowners|owner authRefacquisitionSources|acquisitionSource