]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
NOJIRA: Fix tests.
authorRay Lee <ray.lee@lyrasis.org>
Sun, 15 Mar 2020 23:34:06 +0000 (16:34 -0700)
committerRay Lee <ray.lee@lyrasis.org>
Sun, 15 Mar 2020 23:34:06 +0000 (16:34 -0700)
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/intake1.xml
services/intake/client/src/test/java/org/collectionspace/services/client/test/IntakeAuthRefsTest.java
services/intake/client/src/test/java/org/collectionspace/services/client/test/IntakeServiceTest.java
services/intake/client/src/test/java/org/collectionspace/services/client/test/OrganizationAuthRefDocsTest.java
services/intake/client/src/test/java/org/collectionspace/services/client/test/PersonAuthRefDocsTest.java
services/intake/jaxb/src/main/resources/intakes-common.xsd
services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityClientUtils.java
services/organization/client/src/test/java/org/collectionspace/services/client/test/OrgAuthorityAuthRefsTest.java
services/organization/client/src/test/java/org/collectionspace/services/client/test/OrgAuthorityServiceTest.java
services/organization/jaxb/src/main/resources/organization_common.xsd
services/security/client/src/test/java/org/collectionspace/services/security/client/test/AuthorizationServiceTest.java

index 38892b544362680cda8ac81e252991debeea4aed..593dea48678e3a22ccb71e7e9270f5aef9e5b77a 100644 (file)
@@ -5,7 +5,6 @@
         <entryNumber>CompleteIntake001</entryNumber>
         <normalLocation>urn:cspace:core.collectionspace.org:locationauthorities:name(location):item:name(MOMA1321979112557)'MOMA'</normalLocation>
         <insurancePolicyNumber>BH-90210</insurancePolicyNumber>
-        <depositorsRequirements>Must wear suit and tie</depositorsRequirements>
         <entryReason>commission</entryReason>
         <insuranceReferenceNumber>1234-5678-90</insuranceReferenceNumber>
         <returnDate>2010-07-14T04:00:00Z</returnDate>
         </conditionCheckersOrAssessors>
         <entryDate>2010-07-16T04:00:00Z</entryDate>
         <insuranceRenewalDate>2010-07-05T04:00:00Z</insuranceRenewalDate>
-        <currentOwner>urn:cspace:org.collectionspace.demo:personauthority:name(person):person:name(seanbean)'Sean+Bean'</currentOwner>
+        <currentOwners>
+            <currentOwner>urn:cspace:org.collectionspace.demo:personauthority:name(person):person:name(seanbean)'Sean+Bean'</currentOwner>
+        </currentOwners>
         <locationDate>2009-07-15T04:00:00Z</locationDate>
-        <depositor>urn:cspace:org.collectionspace.demo:personauthority:name(person):person:name(tommyjones)'Tommy+Jones'</depositor>
+        <depositorGroupList>
+            <depositorGroup>
+                <depositor>urn:cspace:org.collectionspace.demo:personauthority:name(person):person:name(tommyjones)'Tommy+Jones'</depositor>
+                <depositorsRequirements>Must wear suit and tie</depositorsRequirements>
+            </depositorGroup>
+        </depositorGroupList>
     </ns2:intakes_common>
 </document>
index 24b96e4cc3947b24cf6fc4ad941f89b8e582a87c..46cbe5f2b30813df29d64d9dea7d2877ada04daf 100644 (file)
@@ -40,6 +40,9 @@ import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.common.api.GregorianCalendarDateTimeUtils;
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.collectionspace.services.intake.ConditionCheckerOrAssessorList;
+import org.collectionspace.services.intake.CurrentOwnerList;
+import org.collectionspace.services.intake.DepositorGroup;
+import org.collectionspace.services.intake.DepositorGroupList;
 import org.collectionspace.services.intake.IntakesCommon;
 import org.collectionspace.services.intake.InsurerList;
 import org.collectionspace.services.jaxb.AbstractCommonList;
@@ -68,7 +71,7 @@ public class IntakeAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
     private String knownResourceId = null;
     private List<String> intakeIdsCreated = new ArrayList<String>();
     private List<String> personIdsCreated = new ArrayList<String>();
-    private String personAuthCSID = null; 
+    private String personAuthCSID = null;
     private String currentOwnerRefName = null;
     private String depositorRefName = null;
     private String conditionCheckerOrAssessorRefName = null;
@@ -80,7 +83,7 @@ public class IntakeAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
        protected String getServiceName() {
                throw new UnsupportedOperationException(); //FIXME: REM - See http://issues.collectionspace.org/browse/CSPACE-3498
        }
-    
+
     /* (non-Javadoc)
      * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
      */
@@ -93,7 +96,7 @@ public class IntakeAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
        protected CollectionSpaceClient getClientInstance(String clientPropertiesFilename) {
        throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
        }
-    
+
     /* (non-Javadoc)
      * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
      */
@@ -112,10 +115,10 @@ public class IntakeAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
 
         // Submit the request to the service and store the response.
         String identifier = createIdentifier();
-        
+
         // Create all the person refs and entities
         createPersonRefs();
-        
+
         // Submit the request to the service and store the response.
         IntakeClient intakeClient = new IntakeClient();
         PoxPayloadOut multipart = createIntakeInstance(
@@ -156,12 +159,12 @@ public class IntakeAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
                 logger.debug(testName + ": knownResourceId=" + knownResourceId);
             }
         }
-        
+
         // Store the IDs from every resource created by tests,
         // so they can be deleted after tests have been run.
         intakeIdsCreated.add(newId);
     }
-    
+
     protected void createPersonRefs() throws Exception {
        //
        // First, create a new person authority
@@ -179,32 +182,32 @@ public class IntakeAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         } finally {
                res.close();
         }
-        
+
         String authRefName = PersonAuthorityClientUtils.getAuthorityRefName(personAuthCSID, null);
         String csid = createPerson("Olivier", "Owner", "olivierOwner", authRefName);
         currentOwnerRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
         personIdsCreated.add(csid);
-        
+
         csid = createPerson("Debbie", "Depositor", "debbieDepositor", authRefName);
         depositorRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
         personIdsCreated.add(csid);
-        
+
         csid = createPerson("Andrew", "Assessor", "andrewAssessor", authRefName);
         conditionCheckerOrAssessorRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
         personIdsCreated.add(csid);
-        
+
         csid = createPerson("Ingrid", "Insurer", "ingridInsurer", authRefName);
         insurerRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
         personIdsCreated.add(csid);
-        
+
         csid = createPerson("Vince", "Valuer", "vinceValuer", authRefName);
         valuerRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
         personIdsCreated.add(csid);
     }
-    
+
     protected String createPerson(String firstName, String surName, String shortId, String authRefName ) throws Exception {
        String result = null;
-       
+
         PersonClient personAuthClient = new PersonClient();
         Map<String, String> personInfo = new HashMap<String,String>();
         personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
@@ -216,10 +219,10 @@ public class IntakeAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         term.setTermDisplayName(termName);
         term.setTermName(termName);
         personTerms.add(term);
-        PoxPayloadOut multipart = 
-               PersonAuthorityClientUtils.createPersonInstance(personAuthCSID, 
+        PoxPayloadOut multipart =
+               PersonAuthorityClientUtils.createPersonInstance(personAuthCSID,
                                authRefName, personInfo, personTerms, personAuthClient.getItemCommonPartName());
-        
+
         Response res = personAuthClient.createItem(personAuthCSID, multipart);
         try {
                int statusCode = res.getStatus();
@@ -230,7 +233,7 @@ public class IntakeAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         } finally {
                res.close();
         }
-        
+
        return result;
     }
 
@@ -249,7 +252,7 @@ public class IntakeAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
                IntakesCommon intake = (IntakesCommon) extractPart(input, intakeClient.getCommonPartName(), IntakesCommon.class);
                Assert.assertNotNull(intake);
                // Check a couple of fields
-               Assert.assertEquals(intake.getCurrentOwner(), currentOwnerRefName);
+               Assert.assertEquals(intake.getCurrentOwners().getCurrentOwner().get(0), currentOwnerRefName);
                Assert.assertEquals(intake.getConditionCheckersOrAssessors().getConditionCheckerOrAssessor().get(0), conditionCheckerOrAssessorRefName);
                Assert.assertEquals(intake.getInsurers().getInsurer().get(0), insurerRefName);
         } finally {
@@ -257,7 +260,7 @@ public class IntakeAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
                 res.close();
             }
         }
-        
+
         // Get the auth refs and check them
         res = intakeClient.getAuthorityRefs(knownResourceId);
         AuthorityRefList list = null;
@@ -269,7 +272,7 @@ public class IntakeAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
                        res.close();
             }
         }
-        
+
         List<AuthorityRefList.AuthorityRefItem> items = list.getAuthorityRefItem();
         int numAuthRefsFound = items.size();
         if (logger.isDebugEnabled()) {
@@ -308,7 +311,7 @@ public class IntakeAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
      * For this reason, it attempts to remove all resources created
      * at any point during testing, even if some of those resources
      * may be expected to be deleted by certain tests.
-     * @throws Exception 
+     * @throws Exception
      */
     @AfterClass(alwaysRun=true)
     public void cleanUp() throws Exception {
@@ -345,17 +348,30 @@ public class IntakeAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
     }
 
    private PoxPayloadOut createIntakeInstance(String entryNumber,
-               String entryDate,
-                               String currentOwner,
-                               String depositor,
-                               String conditionCheckerAssessor,
-                               String insurer,
-                               String Valuer ) throws Exception {
+            String entryDate,
+            String currentOwner,
+            String depositor,
+            String conditionCheckerAssessor,
+            String insurer,
+            String Valuer ) throws Exception {
         IntakesCommon intake = new IntakesCommon();
         intake.setEntryNumber(entryNumber);
         intake.setEntryDate(entryDate);
-        intake.setCurrentOwner(currentOwner);
-        intake.setDepositor(depositor);
+
+        CurrentOwnerList currentOwnerList = new CurrentOwnerList();
+        List<String> currentOwners = currentOwnerList.getCurrentOwner();
+
+        currentOwners.add(currentOwner);
+        intake.setCurrentOwners(currentOwnerList);
+
+        DepositorGroupList depositorGroupList = new DepositorGroupList();
+        List<DepositorGroup> depositorGroups = depositorGroupList.getDepositorGroup();
+        DepositorGroup depositorGroup = new DepositorGroup();
+
+        depositorGroup.setDepositor(depositor);
+        depositorGroups.add(depositorGroup);
+
+        intake.setDepositorGroupList(depositorGroupList);
         intake.setValuer(Valuer);
 
         ConditionCheckerOrAssessorList checkerOrAssessorList = new ConditionCheckerOrAssessorList();
index 38a421ad3b8f893d0dce94159ce5afd57ee9e726..b4256a9d3cb464122548184da59fc1e7f9dda1e6 100644 (file)
@@ -39,6 +39,8 @@ import org.collectionspace.services.intake.EntryMethodList;
 import org.collectionspace.services.intake.FieldCollectionEventNameList;
 import org.collectionspace.services.intake.CurrentLocationGroup;
 import org.collectionspace.services.intake.CurrentLocationGroupList;
+import org.collectionspace.services.intake.DepositorGroup;
+import org.collectionspace.services.intake.DepositorGroupList;
 import org.collectionspace.services.intake.IntakesCommon;
 import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.testng.Assert;
@@ -76,7 +78,7 @@ public class IntakeServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
     protected String getServiceName() {
         return IntakeClient.SERVICE_NAME;
     }
-    
+
     // ---------------------------------------------------------------
     // CRUD tests : READ tests
     // ---------------------------------------------------------------
@@ -112,7 +114,7 @@ public class IntakeServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
                 "UTF-8 data retrieved '" + fromRead.getEntryNote()
                 + "' does not match expected data '" + getUTF8DataFragment());
        }
-    
+
     @Override
     public void delete(String testName) throws Exception {
        // Do nothing because this test is not ready to delete the "knownResourceId".
@@ -121,7 +123,7 @@ public class IntakeServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
        // test is run, the localDelete() test/method will get run.  The localDelete() test/method in turn
        // calls the inherited delete() test/method.
     }
-    
+
     @Test(dataProvider = "testName", dependsOnMethods = {"CRUDTests", "verifyReadOnlyCoreFields"})
     public void localDelete(String testName) throws Exception {
        // Because of issues with TestNG not allowing @Test annotations on on override methods,
@@ -154,12 +156,12 @@ public class IntakeServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
                    logger.debug(testName + ": read status = " + res.getStatus());
                }
                Assert.assertEquals(res.getStatus(), testExpectedStatusCode);
-       
+
                input = new PoxPayloadIn(res.readEntity(String.class));
         } finally {
                res.close();
         }
-        
+
         PayloadInputPart payloadInputPart = input.getPart(COLLECTIONSPACE_CORE_SCHEMA);
         Element coreAsElement = null;
         if (payloadInputPart != null) {
@@ -188,7 +190,7 @@ public class IntakeServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
         Element createdBy = coreAsElement.element(COLLECTIONSPACE_CORE_CREATED_BY);
         String originalCreatedBy = createdBy.getText();
         createdBy.setText("foo");
-        
+
         if (logger.isDebugEnabled()) {
             logger.debug("Core part to be updated:");
             logger.debug(coreAsElement.asXML());
@@ -197,7 +199,7 @@ public class IntakeServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
         // Create an output payload to send to the service, and add the common part
         PoxPayloadOut output = new PoxPayloadOut(this.getServicePathComponent());
         PayloadOutputPart corePart = output.addPart(COLLECTIONSPACE_CORE_SCHEMA, coreAsElement);
-        
+
         // Submit the request to the service and store the response.
         res = client.update(knownResourceId, output);
            try {
@@ -209,19 +211,19 @@ public class IntakeServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
                Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
                        invalidStatusCodeMessage(testRequestType, statusCode));
                Assert.assertEquals(statusCode, testExpectedStatusCode);
-       
+
                input = new PoxPayloadIn(res.readEntity(String.class));
            } finally {
                res.close();
            }
-               
+
         PayloadInputPart updatedCorePart = input.getPart(COLLECTIONSPACE_CORE_SCHEMA);
         Element updatedCoreAsElement = null;
         if (updatedCorePart != null) {
                updatedCoreAsElement = updatedCorePart.getElementBody();
         }
         Assert.assertNotNull(updatedCoreAsElement);
-        
+
         tenantId = updatedCoreAsElement.element(COLLECTIONSPACE_CORE_TENANTID);
         String updatedTenantId = tenantId.getText();
         Assert.assertEquals(updatedTenantId, originalTenantId,
@@ -244,7 +246,7 @@ public class IntakeServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
     // ---------------------------------------------------------------
     // Utility tests : tests of code used in tests above
     // ---------------------------------------------------------------
-    
+
     /* (non-Javadoc)
      * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
      */
@@ -258,7 +260,7 @@ public class IntakeServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
      *
      * @param identifier the identifier
      * @return the multipart output
-     * @throws Exception 
+     * @throws Exception
      */
     @Override
     protected PoxPayloadOut createInstance(String identifier) throws Exception {
@@ -275,7 +277,7 @@ public class IntakeServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
      * @param entryDate the entry date
      * @param depositor the depositor
      * @return the multipart output
-     * @throws Exception 
+     * @throws Exception
      */
     private PoxPayloadOut createIntakeInstance(String entryNumber,
             String entryDate,
@@ -283,7 +285,15 @@ public class IntakeServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
         IntakesCommon intake = new IntakesCommon();
         intake.setEntryNumber(entryNumber);
         intake.setEntryDate(entryDate);
-        intake.setDepositor(depositor);
+
+        DepositorGroupList depositorGroupList = new DepositorGroupList();
+        List<DepositorGroup> depositorGroups = depositorGroupList.getDepositorGroup();
+        DepositorGroup depositorGroup = new DepositorGroup();
+
+        depositorGroup.setDepositor(depositor);
+        depositorGroups.add(depositorGroup);
+
+        intake.setDepositorGroupList(depositorGroupList);
 
         EntryMethodList entryMethodsList = new EntryMethodList();
         List<String> entryMethods = entryMethodsList.getEntryMethod();
@@ -332,27 +342,27 @@ public class IntakeServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
        @Override
        protected IntakesCommon updateInstance(IntakesCommon intakesCommon) {
                IntakesCommon result = new IntakesCommon();
-               
+
                result.setEntryNumber("updated-" + intakesCommon.getEntryNumber());
                result.setEntryNote(intakesCommon.getEntryNote());
 
         CurrentLocationGroupList currentLocationGroupList = intakesCommon.getCurrentLocationGroupList();
         Assert.assertNotNull(currentLocationGroupList);
-        
+
         List<CurrentLocationGroup> currentLocationGroups = currentLocationGroupList.getCurrentLocationGroup();
-        Assert.assertNotNull(currentLocationGroups);        
+        Assert.assertNotNull(currentLocationGroups);
         Assert.assertTrue(currentLocationGroups.size() > 0);
-        
+
         CurrentLocationGroup currentLocationGroup = currentLocationGroups.get(0);
         Assert.assertNotNull(currentLocationGroup);
-        
+
         String currentLocationNote = currentLocationGroup.getCurrentLocationNote();
         Assert.assertNotNull(currentLocationNote);
-        
+
         String updatedCurrentLocationNote = "updated-" + currentLocationNote;
         currentLocationGroups.get(0).setCurrentLocationNote(updatedCurrentLocationNote);
         result.setCurrentLocationGroupList(currentLocationGroupList);
-        
+
         return result;
        }
 
@@ -362,20 +372,20 @@ public class IntakeServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
         Assert.assertEquals(updated.getEntryNumber(),
                        original.getEntryNumber(),
                 "Data in updated object did not match submitted data.");
-        
+
         CurrentLocationGroupList currentLocationGroupList = updated.getCurrentLocationGroupList();
         Assert.assertNotNull(currentLocationGroupList);
         List<CurrentLocationGroup> currentLocationGroups = currentLocationGroupList.getCurrentLocationGroup();
         Assert.assertNotNull(currentLocationGroups);
         Assert.assertTrue(currentLocationGroups.size() > 0);
         Assert.assertNotNull(currentLocationGroups.get(0));
-        
+
         String updatedCurrentLocationNote = original.getCurrentLocationGroupList()
                        .getCurrentLocationGroup().get(0).getCurrentLocationNote();
         Assert.assertEquals(updatedCurrentLocationNote,
                 currentLocationGroups.get(0).getCurrentLocationNote(),
                 "Data in updated object did not match submitted data.");
-        
+
         Assert.assertEquals(updated.getEntryNote(), original.getEntryNote(),
                 "Data in updated object did not match submitted data.");
         //
@@ -387,7 +397,7 @@ public class IntakeServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
         }
         Assert.assertTrue(updated.getEntryNote().contains(getUTF8DataFragment()),
                 "UTF-8 data retrieved '" + updated.getEntryNote()
-                + "' does not contain expected data '" + getUTF8DataFragment());        
+                + "' does not contain expected data '" + getUTF8DataFragment());
        }
 
     /*
@@ -397,8 +407,8 @@ public class IntakeServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
     @Override
     @Test(dataProvider = "testName",
                dependsOnMethods = {
-                       "org.collectionspace.services.client.test.AbstractServiceTestImpl.baseCRUDTests"})    
+                       "org.collectionspace.services.client.test.AbstractServiceTestImpl.baseCRUDTests"})
        public void CRUDTests(String testName) {
-               // Needed for TestNG dependency chain.          
+               // Needed for TestNG dependency chain.
        }
 }
index 87a7a909588298e0ca8bd767c22d11edded68b58..716a15bf1bc3553cb6d9aa733661d13524f8aaec 100644 (file)
@@ -39,6 +39,9 @@ import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.common.api.GregorianCalendarDateTimeUtils;
 import org.collectionspace.services.common.authorityref.AuthorityRefDocList;
 import org.collectionspace.services.intake.ConditionCheckerOrAssessorList;
+import org.collectionspace.services.intake.CurrentOwnerList;
+import org.collectionspace.services.intake.DepositorGroup;
+import org.collectionspace.services.intake.DepositorGroupList;
 import org.collectionspace.services.intake.IntakesCommon;
 import org.collectionspace.services.intake.InsurerList;
 import org.collectionspace.services.jaxb.AbstractCommonList;
@@ -67,9 +70,9 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
     private String knownIntakeId = null;
     private List<String> intakeIdsCreated = new ArrayList<String>();
     private List<String> orgIdsCreated = new ArrayList<String>();
-    private String orgAuthCSID = null; 
-    //private String orgAuthRefName = null; 
-    private String currentOwnerOrgCSID = null; 
+    private String orgAuthCSID = null;
+    //private String orgAuthRefName = null;
+    private String currentOwnerOrgCSID = null;
     private String currentOwnerRefName = null;
     private String depositorRefName = null;
     private String conditionCheckerAssessorRefName = null;
@@ -83,7 +86,7 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
        protected String getServiceName() {
                throw new UnsupportedOperationException(); //FIXME: REM - See http://issues.collectionspace.org/browse/CSPACE-3498
        }
-    
+
     /* (non-Javadoc)
      * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
      */
@@ -96,7 +99,7 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
        protected CollectionSpaceClient getClientInstance(String clientPropertiesFilename) {
        throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
        }
-    
+
     /* (non-Javadoc)
      * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
      */
@@ -115,7 +118,7 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
 
         // Submit the request to the service and store the response.
         String identifier = createIdentifier();
-        
+
         // Create all the organization refs and entities
         createOrgRefs();
 
@@ -133,7 +136,7 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
         Response res = intakeClient.create(intakePayload);
         try {
                int statusCode = res.getStatus();
-       
+
                // Check the status code of the response: does it match
                // the expected response(s)?
                //
@@ -150,14 +153,14 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
             Assert.assertNotNull(newIntakeId, "Could not create a new Intake record.");
 
                // Store the ID returned from the first resource created
-               // for additional tests below.            
+               // for additional tests below.
                if (knownIntakeId == null) {
                    knownIntakeId = newIntakeId;
                    if (logger.isDebugEnabled()) {
                        logger.debug(testName + ": knownIntakeId=" + knownIntakeId);
                    }
                }
-               
+
                // Store the IDs from every resource created by tests,
                // so they can be deleted after tests have been run.
                intakeIdsCreated.add(newIntakeId);
@@ -166,14 +169,14 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
         }
 
     }
-    
+
     /**
      * Creates the organization refs.
-     * @throws Exception 
+     * @throws Exception
      */
     protected void createOrgRefs() throws Exception{
         OrganizationClient orgAuthClient = new OrganizationClient();
-        //orgAuthRefName = 
+        //orgAuthRefName =
        //      OrgAuthorityClientUtils.createOrgAuthRefName(ORGANIZATION_AUTHORITY_NAME, null);
         PoxPayloadOut multipart = OrgAuthorityClientUtils.createOrgAuthorityInstance(
                        ORGANIZATION_AUTHORITY_NAME, ORGANIZATION_AUTHORITY_NAME, orgAuthClient.getCommonPartName());
@@ -188,40 +191,40 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
         } finally {
                res.close();
         }
-        
+
                currentOwnerOrgCSID = createOrganization("olivierOwnerCompany", "Olivier Owner Company", "Olivier Owner Company");
         orgIdsCreated.add(currentOwnerOrgCSID);
         currentOwnerRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, currentOwnerOrgCSID, orgAuthClient);
-        
+
                String newOrgCSID =
                         createOrganization("debbieDepositorAssocs", "Debbie Depositor & Associates", "Debbie Depositor & Associates");
-        depositorRefName = 
+        depositorRefName =
                OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, newOrgCSID, orgAuthClient);
         orgIdsCreated.add(newOrgCSID);
-        
+
                newOrgCSID = createOrganization("andrewCheckerAssessorLtd", "Andrew Checker-Assessor Ltd.", "Andrew Checker-Assessor Ltd.");
-               conditionCheckerAssessorRefName = 
+               conditionCheckerAssessorRefName =
                OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, newOrgCSID, orgAuthClient);
         orgIdsCreated.add(newOrgCSID);
-        
+
                newOrgCSID = createOrganization("ingridInsurerBureau", "Ingrid Insurer Bureau", "Ingrid Insurer Bureau");
-               insurerRefName = 
+               insurerRefName =
                OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, newOrgCSID, orgAuthClient);
         orgIdsCreated.add(newOrgCSID);
-        
+
                newOrgCSID = createOrganization("vinceValuerLLC", "Vince Valuer LLC", "Vince Valuer LLC");
-               valuerRefName = 
+               valuerRefName =
                OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, newOrgCSID, orgAuthClient);
         orgIdsCreated.add(newOrgCSID);
     }
 
     protected String createOrganization(String shortId, String shortName, String longName) throws Exception {
        String result = null;
-       
+
         OrganizationClient orgAuthClient = new OrganizationClient();
         Map<String, String> orgInfo = new HashMap<String,String>();
         orgInfo.put(OrganizationJAXBSchema.SHORT_IDENTIFIER, shortId);
-        
+
         List<OrgTermGroup> orgTerms = new ArrayList<OrgTermGroup>();
         OrgTermGroup term = new OrgTermGroup();
         term.setTermDisplayName(shortName);
@@ -235,7 +238,7 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
         Response res = orgAuthClient.createItem(orgAuthCSID, multipart);
         try {
                int statusCode = res.getStatus();
-       
+
                Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
                        invalidStatusCodeMessage(testRequestType, statusCode));
                Assert.assertEquals(statusCode, STATUS_CREATED);
@@ -243,7 +246,7 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
         } finally {
                res.close();
         }
-        
+
         return result;
     }
 
@@ -253,7 +256,7 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
     public void readAndCheckAuthRefDocs(String testName) throws Exception {
         // Perform setup.
         testSetup(STATUS_OK, ServiceRequestType.READ);
-        
+
         // Get the auth ref docs and check them
        OrganizationClient orgAuthClient = new OrganizationClient();
        Response refDocListResp = orgAuthClient.getReferencingObjects(orgAuthCSID, currentOwnerOrgCSID);
@@ -305,7 +308,7 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
      * For this reason, it attempts to remove all resources created
      * at any point during testing, even if some of those resources
      * may be expected to be deleted by certain tests.
-     * @throws Exception 
+     * @throws Exception
      */
     @AfterClass(alwaysRun=true)
     public void cleanUp() throws Exception {
@@ -352,8 +355,21 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
         IntakesCommon intake = new IntakesCommon();
         intake.setEntryNumber(entryNumber);
         intake.setEntryDate(entryDate);
-        intake.setCurrentOwner(currentOwner);
-        intake.setDepositor(depositor);
+
+        CurrentOwnerList currentOwnerList = new CurrentOwnerList();
+        List<String> currentOwners = currentOwnerList.getCurrentOwner();
+
+        currentOwners.add(currentOwner);
+        intake.setCurrentOwners(currentOwnerList);
+
+        DepositorGroupList depositorGroupList = new DepositorGroupList();
+        List<DepositorGroup> depositorGroups = depositorGroupList.getDepositorGroup();
+        DepositorGroup depositorGroup = new DepositorGroup();
+
+        depositorGroup.setDepositor(depositor);
+        depositorGroups.add(depositorGroup);
+
+        intake.setDepositorGroupList(depositorGroupList);
         intake.setValuer(Valuer);
 
         ConditionCheckerOrAssessorList checkerOrAssessorList = new ConditionCheckerOrAssessorList();
index 50f5baa800662c23ba341ee39d5b0d245575d3ee..12c634aadfc8269d431eb343f2578165b056944c 100644 (file)
@@ -39,6 +39,9 @@ import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.common.api.GregorianCalendarDateTimeUtils;
 import org.collectionspace.services.common.authorityref.AuthorityRefDocList;
 import org.collectionspace.services.intake.ConditionCheckerOrAssessorList;
+import org.collectionspace.services.intake.CurrentOwnerList;
+import org.collectionspace.services.intake.DepositorGroup;
+import org.collectionspace.services.intake.DepositorGroupList;
 import org.collectionspace.services.intake.IntakesCommon;
 import org.collectionspace.services.intake.InsurerList;
 import org.collectionspace.services.jaxb.AbstractCommonList;
@@ -82,10 +85,10 @@ public class PersonAuthRefDocsTest extends BaseServiceTest<AbstractCommonList> {
             GregorianCalendarDateTimeUtils.currentDateUTC();
 
     @Override
-    public String getServiceName() { 
-       throw new UnsupportedOperationException(); //FIXME: REM - http://issues.collectionspace.org/browse/CSPACE-3498   
+    public String getServiceName() {
+       throw new UnsupportedOperationException(); //FIXME: REM - http://issues.collectionspace.org/browse/CSPACE-3498
     }
-    
+
     /* (non-Javadoc)
      * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
      */
@@ -167,7 +170,7 @@ public class PersonAuthRefDocsTest extends BaseServiceTest<AbstractCommonList> {
 
     /**
      * Creates the person refs.
-     * @throws Exception 
+     * @throws Exception
      */
     protected void createPersonRefs() throws Exception {
         PersonClient personAuthClient = new PersonClient();
@@ -225,7 +228,7 @@ public class PersonAuthRefDocsTest extends BaseServiceTest<AbstractCommonList> {
 
     protected String createPerson(String firstName, String surName, String shortId, String authRefName) throws Exception {
        String result = null;
-       
+
         PersonClient personAuthClient = new PersonClient();
         Map<String, String> personInfo = new HashMap<String, String>();
         personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
@@ -243,7 +246,7 @@ public class PersonAuthRefDocsTest extends BaseServiceTest<AbstractCommonList> {
         Response res = personAuthClient.createItem(personAuthCSID, multipart);
         try {
                int statusCode = res.getStatus();
-       
+
                Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
                        invalidStatusCodeMessage(testRequestType, statusCode));
                Assert.assertEquals(statusCode, STATUS_CREATED);
@@ -251,7 +254,7 @@ public class PersonAuthRefDocsTest extends BaseServiceTest<AbstractCommonList> {
         } finally {
                res.close();
         }
-        
+
         return result;
     }
 
@@ -274,7 +277,7 @@ public class PersonAuthRefDocsTest extends BaseServiceTest<AbstractCommonList> {
                 res.close();
             }
         }
-        
+
         List<AuthorityRefDocList.AuthorityRefDocItem> items =
                 list.getAuthorityRefDocItem();
         Assert.assertTrue(items != null);
@@ -313,12 +316,12 @@ public class PersonAuthRefDocsTest extends BaseServiceTest<AbstractCommonList> {
                 res.close();
             }
         }
-        
+
         items = list.getAuthorityRefDocItem();
         Assert.assertTrue(items != null);
         Assert.assertTrue(items.size() > 0);
         Assert.assertTrue(items.get(0) != null);
-        
+
         // Optionally output additional data about list members for debugging.
         iterateThroughList = true;
         fFoundIntake = false;
@@ -365,7 +368,7 @@ public class PersonAuthRefDocsTest extends BaseServiceTest<AbstractCommonList> {
                 res.close();
             }
         }
-        
+
         List<AuthorityRefDocList.AuthorityRefDocItem> items =
                 list.getAuthorityRefDocItem();
         Assert.assertTrue(items != null);
@@ -405,7 +408,7 @@ public class PersonAuthRefDocsTest extends BaseServiceTest<AbstractCommonList> {
      * For this reason, it attempts to remove all resources created
      * at any point during testing, even if some of those resources
      * may be expected to be deleted by certain tests.
-     * @throws Exception 
+     * @throws Exception
      */
     @AfterClass(alwaysRun = true)
     public void cleanUp() throws Exception {
@@ -452,8 +455,21 @@ public class PersonAuthRefDocsTest extends BaseServiceTest<AbstractCommonList> {
         IntakesCommon intake = new IntakesCommon();
         intake.setEntryNumber(entryNumber);
         intake.setEntryDate(entryDate);
-        intake.setCurrentOwner(currentOwner);
-        intake.setDepositor(depositor);
+
+        CurrentOwnerList currentOwnerList = new CurrentOwnerList();
+        List<String> currentOwners = currentOwnerList.getCurrentOwner();
+
+        currentOwners.add(currentOwner);
+        intake.setCurrentOwners(currentOwnerList);
+
+        DepositorGroupList depositorGroupList = new DepositorGroupList();
+        List<DepositorGroup> depositorGroups = depositorGroupList.getDepositorGroup();
+        DepositorGroup depositorGroup = new DepositorGroup();
+
+        depositorGroup.setDepositor(depositor);
+        depositorGroups.add(depositorGroup);
+
+        intake.setDepositorGroupList(depositorGroupList);
         intake.setValuer(Valuer);
 
         ConditionCheckerOrAssessorList checkerOrAssessorList = new ConditionCheckerOrAssessorList();
index a088782e275ca997812db26f4e6c6e9504920881..cde240b5463da60135b9087039c1f1202c9a74e0 100644 (file)
@@ -2,7 +2,7 @@
 
 <!--
     Intake schema (XSD)
-    
+
     Entity  : Intake
     Part    : Common
     Used for: JAXB binding between XML and Java objects
@@ -11,7 +11,7 @@
     $LastChangedDate$
 -->
 
-<xs:schema 
+<xs:schema
   xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
   jaxb:version="1.0" elementFormDefault="unqualified"
     Avoid XmlRootElement nightmare:
     See http://weblogs.java.net/blog/kohsuke/archive/2006/03/why_does_jaxb_p.html
 -->
-<!-- See http://wiki.collectionspace.org/display/collectionspace/Intake+Schema -->    
-    
+<!-- See http://wiki.collectionspace.org/display/collectionspace/Intake+Schema -->
+
     <!-- intake  -->
     <xs:element name="intakes_common">
         <xs:complexType>
             <xs:sequence>
                 <xs:element name="csid" type="xs:string" />
-                
+
                 <!--  Object Entry Information Group -->
-                <xs:element name="currentOwner" type="xs:string"/>
-                <xs:element name="depositor" type="xs:string"/>
-                <xs:element name="depositorsRequirements" type="xs:string"/>
+                <xs:element name="currentOwners" type="currentOwnerList"/>
+                <xs:element name="depositorGroupList" type="depositorGroupList"/>
                 <xs:element name="entryDate" type="xs:string"/>
                 <xs:element name="entryMethods" type="entryMethodList"/>
                 <xs:element name="entryNote" type="xs:string"/>
         </xs:complexType>
     </xs:element>
 
+    <xs:complexType name="currentOwnerList">
+        <xs:sequence>
+            <xs:element name="currentOwner" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="depositorGroupList">
+        <xs:sequence>
+            <xs:element name="depositorGroup" type="depositorGroup" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="depositorGroup">
+        <xs:sequence>
+            <xs:element name="depositor" type="xs:string"/>
+            <xs:element name="depositorsRequirements" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+
     <xs:complexType name="entryMethodList">
         <xs:sequence>
             <xs:element name="entryMethod" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
             <xs:element name="conditionCheckerOrAssessor" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
         </xs:sequence>
     </xs:complexType>
-    
-</xs:schema>
 
+</xs:schema>
index 69520c7b18e85ce74f3bf1130759394123fd278c..dbaddb91670a0b0f8a833543457d2b47b3c5ecf8 100644 (file)
@@ -1,4 +1,4 @@
-/**    
+/**
  * This document is a part of the source code and related artifacts
  * for CollectionSpace, an open source collections management system
  * for museums and related institutions:
@@ -31,7 +31,8 @@ import org.collectionspace.services.client.test.ServiceRequestType;
 import org.collectionspace.services.common.api.Tools;
 
 import org.collectionspace.services.organization.StructuredDateGroup;
-import org.collectionspace.services.organization.ContactNameList;
+import org.collectionspace.services.organization.ContactGroup;
+import org.collectionspace.services.organization.ContactGroupList;
 import org.collectionspace.services.organization.FunctionList;
 import org.collectionspace.services.organization.GroupList;
 import org.collectionspace.services.organization.HistoryNoteList;
@@ -48,7 +49,7 @@ import org.slf4j.LoggerFactory;
  * OrgAuthorityClientUtils.
  */
 public class OrgAuthorityClientUtils {
-    
+
     /** The Constant logger. */
     private static final Logger logger =
         LoggerFactory.getLogger(OrgAuthorityClientUtils.class);
@@ -58,13 +59,13 @@ public class OrgAuthorityClientUtils {
      * @param csid the id of the OrgAuthority
      * @param client if null, creates a new client
      * @return
-     * @throws Exception 
+     * @throws Exception
      */
     public static String getAuthorityRefName(String csid, OrganizationClient client) throws Exception{
        if (client==null) {
                client = new OrganizationClient();
        }
-       
+
         Response res = client.read(csid);
         try {
                int statusCode = res.getStatus();
@@ -74,7 +75,7 @@ public class OrgAuthorityClientUtils {
                //FIXME: remove the following try catch once Aron fixes signatures
                try {
                    PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
-                   OrgauthoritiesCommon orgAuthority = 
+                   OrgauthoritiesCommon orgAuthority =
                        (OrgauthoritiesCommon) CollectionSpaceClientUtils.extractPart(input,
                            client.getCommonPartName(), OrgauthoritiesCommon.class);
                        if(orgAuthority==null) {
@@ -94,13 +95,13 @@ public class OrgAuthorityClientUtils {
      * @param csid the ID of the Organization
      * @param client if null, creates a new client
      * @return
-     * @throws Exception 
+     * @throws Exception
      */
     public static String getOrgRefName(String inAuthority, String csid, OrganizationClient client) throws Exception{
        if (client == null) {
                client = new OrganizationClient();
        }
-       
+
         Response res = client.readItem(inAuthority, csid);
         try {
                int statusCode = res.getStatus();
@@ -111,7 +112,7 @@ public class OrgAuthorityClientUtils {
                //FIXME: remove the following try catch once Aron fixes signatures
                try {
                    PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
-                   OrganizationsCommon org = 
+                   OrganizationsCommon org =
                        (OrganizationsCommon) CollectionSpaceClientUtils.extractPart(input,
                            client.getItemCommonPartName(), OrganizationsCommon.class);
                        if(org==null) {
@@ -130,7 +131,7 @@ public class OrgAuthorityClientUtils {
      * Creates the org authority instance.
      *
      * @param displayName the display name
-     * @param shortIdentifier the short Id 
+     * @param shortIdentifier the short Id
      * @param headerLabel the header label
      * @return the multipart output
      */
@@ -181,14 +182,14 @@ public class OrgAuthorityClientUtils {
                                +"\" in orgAuthority: \"" + orgAuthorityRefName +"\"");
        }
        PoxPayloadOut multipart =
-               createOrganizationInstance(orgAuthorityRefName, 
+               createOrganizationInstance(orgAuthorityRefName,
                                orgInfo, terms, orgRepeatablesInfo, client.getItemCommonPartName());
 
        Response res = client.createItem(inAuthority, multipart);
        String result;
-       try {   
+       try {
                int statusCode = res.getStatus();
-       
+
                if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
                        throw new RuntimeException("Could not create Item: \""+orgInfo.get(OrganizationJAXBSchema.SHORT_IDENTIFIER)
                                        +"\" in orgAuthority: \"" + orgAuthorityRefName
@@ -198,15 +199,15 @@ public class OrgAuthorityClientUtils {
                        throw new RuntimeException("Unexpected Status when creating Item: \""+ orgInfo.get(OrganizationJAXBSchema.SHORT_IDENTIFIER)
                                        +"\" in orgAuthority: \"" + orgAuthorityRefName +"\", Status:"+ statusCode);
                }
-       
+
                result = extractId(res);
        } finally {
                res.close();
        }
-       
+
        return result;
     }
-    
+
     public static List<OrgTermGroup> getTermGroupInstance(String shortIdentifier, String displayName) {
         if (Tools.isBlank(shortIdentifier)) {
             shortIdentifier = getGeneratedIdentifier();
@@ -214,7 +215,7 @@ public class OrgAuthorityClientUtils {
         if (Tools.isBlank(shortIdentifier)) {
             displayName = shortIdentifier;
         }
-        
+
         List<OrgTermGroup> terms = new ArrayList<OrgTermGroup>();
         OrgTermGroup term = new OrgTermGroup();
         term.setTermDisplayName(displayName);
@@ -222,21 +223,21 @@ public class OrgAuthorityClientUtils {
         terms.add(term);
         return terms;
     }
-    
+
     /*
      * Create a very simple Organization term -just a short ID and display name.
      */
     public static PoxPayloadOut createOrganizationInstance(String shortIdentifier, String displayName,
             String headerLabel) {
         List<OrgTermGroup> terms = getTermGroupInstance(shortIdentifier, displayName);
-        
+
         Map<String, String> orgInfo = new HashMap<String, String>();
         orgInfo.put(OrganizationJAXBSchema.SHORT_IDENTIFIER, shortIdentifier);
-        
+
         final Map<String, List<String>> EMPTY_ORG_REPEATABLES_INFO = new HashMap<String, List<String>>();
 
         return createOrganizationInstance(null, orgInfo, terms, EMPTY_ORG_REPEATABLES_INFO, headerLabel);
-    }      
+    }
 
     /**
      * Creates the organization instance.
@@ -266,35 +267,42 @@ public class OrgAuthorityClientUtils {
      * @param headerLabel the header label
      * @return the multipart output
      */
-    public static PoxPayloadOut createOrganizationInstance( 
-                       String orgAuthRefName, 
-                       Map<String, String> orgInfo, 
+    public static PoxPayloadOut createOrganizationInstance(
+                       String orgAuthRefName,
+                       Map<String, String> orgInfo,
                        List<OrgTermGroup> terms,
                        Map<String, List<String>> orgRepeatablesInfo,
                        String headerLabel) {
-        
+
         OrganizationsCommon organization = new OrganizationsCommon();
                String shortId = orgInfo.get(OrganizationJAXBSchema.SHORT_IDENTIFIER);
                if (shortId == null || shortId.isEmpty()) {
                        throw new IllegalArgumentException("shortIdentifier cannot be null or empty");
-               }       
+               }
                organization.setShortIdentifier(shortId);
                String value = null;
         List<String> values = null;
-        
+
         // Set values in the Term Information Group
         OrgTermGroupList termList = new OrgTermGroupList();
         if (terms == null || terms.isEmpty()) {
             terms = getTermGroupInstance(getGeneratedIdentifier());
         }
-        termList.getOrgTermGroup().addAll(terms); 
+        termList.getOrgTermGroup().addAll(terms);
         organization.setOrgTermGroupList(termList);
-        
+
         if ((values = (List<String>)orgRepeatablesInfo.get(OrganizationJAXBSchema.CONTACT_NAMES))!=null) {
-                ContactNameList contactsList = new ContactNameList();
-                List<String> contactNames = contactsList.getContactName();
-               contactNames.addAll(values);
-                organization.setContactNames(contactsList);
+            ContactGroupList contactGroupList = new ContactGroupList();
+            List<ContactGroup> contactGroups = contactGroupList.getContactGroup();
+
+            for (String contactName : values) {
+                ContactGroup contactGroup = new ContactGroup();
+                contactGroup.setContactName(contactName);
+
+                contactGroups.add(contactGroup);
+            }
+
+            organization.setContactGroupList(contactGroupList);
         }
         if ((value = (String)orgInfo.get(OrganizationJAXBSchema.FOUNDING_DATE))!=null) {
             StructuredDateGroup foundingDate = new StructuredDateGroup();
@@ -375,7 +383,7 @@ public class OrgAuthorityClientUtils {
         }
         return id;
     }
-    
+
     /**
      * Creates the org auth ref name.
      *
@@ -451,9 +459,9 @@ public class OrgAuthorityClientUtils {
         terms.add(term);
         return terms;
     }
-    
+
     private static String getGeneratedIdentifier() {
-        return "id" + new Date().getTime(); 
+        return "id" + new Date().getTime();
    }
-    
+
 }
index 7d7904257caa99c6c29b80b0f26bd3c14f56b7b9..afa7c9cc49bfe4f3eac569e9bf263ce99b6a1814 100644 (file)
@@ -65,7 +65,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
     // Instance variables specific to this test.
     final String PERSON_AUTHORITY_NAME = "TestPersonAuthForOrgTest";
     final String ORG_AUTHORITY_NAME = "TestOrgAuth";
-    
+
        @Override
        public String getServicePathComponent() {
                return OrganizationClient.SERVICE_PATH_COMPONENT;
@@ -77,16 +77,16 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
        }
 
     protected String knownItemResourceId = null;
-       
+
     private String knownResourceRefName = null;
-            
+
     /** The person ids created. */
     private List<String> personIdsCreated = new ArrayList<String>();
-    
+
     // CSID for the instance of the test Person authority
     // created during testing.
     private String personAuthCSID = null;
-    
+
     /** The organization contact person refNames. */
     private String organizationContactPersonRefName1 = null;
     private String organizationContactPersonRefName2 = null;
@@ -94,7 +94,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
     // The refName of an Organization item that represents
     // the sub-body organization of a second Organization item.
     private String subBodyRefName = null;
-    
+
     /** The number of authorityreferences expected. */
     private final int NUM_AUTH_REFS_EXPECTED = 2;      // Place authRef not legal, should not be returned.
 
@@ -110,7 +110,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
     protected CollectionSpaceClient getClientInstance() {
        throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
     }
-    
+
        @Override
        protected CollectionSpaceClient getClientInstance(String clientPropertiesFilename) {
        throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
@@ -163,7 +163,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
                Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
                    invalidStatusCodeMessage(testRequestType, statusCode));
                Assert.assertEquals(statusCode, testExpectedStatusCode);
-       
+
                // Store the IDs from every resource created by tests,
                // so they can be deleted after tests have been run.
                String newId = extractId(res);
@@ -173,7 +173,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
                allResourceIdsCreated.add(newId);
         } finally {
             res.close();
-        }        
+        }
 
         // Create all the person refs and entities
         createPersonRefs();
@@ -193,7 +193,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
         testOrgContactNames.add(organizationContactPersonRefName1);
         testOrgContactNames.add(organizationContactPersonRefName2);
         testOrgRepeatablesMap.put(OrganizationJAXBSchema.CONTACT_NAMES, testOrgContactNames);
-        
+
         List<OrgTermGroup> terms = OrgAuthorityClientUtils.getTermGroupInstance("Org name");
 
         // Finishing creating the new Organization item, then
@@ -206,10 +206,10 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
         // so they can be deleted after tests have been run.
         allResourceItemIdsCreated.put(knownItemResourceId, knownResourceId);
     }
-    
+
     /**
      * Creates the person refs.
-     * @throws Exception 
+     * @throws Exception
      */
     protected void createPersonRefs() throws Exception {
         PersonClient personAuthClient = new PersonClient();
@@ -217,7 +217,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
         // refName by which it can be identified.
        PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
            PERSON_AUTHORITY_NAME, PERSON_AUTHORITY_NAME, personAuthClient.getCommonPartName());
-        
+
        Response res = personAuthClient.create(multipart);
         try {
             int statusCode = res.getStatus();
@@ -230,7 +230,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
         }
 
         //String authRefName = PersonAuthorityClientUtils.getAuthorityRefName(personAuthCSID, null);
-        
+
         // Create temporary Person resources, and their corresponding refNames
         // by which they can be identified.
                String csid = createPerson(personAuthCSID, "Charlie", "Orgcontact", "charlieOrgcontact" + System.currentTimeMillis(), null ); // authRefName);
@@ -243,7 +243,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
         personIdsCreated.add(csid);
         organizationContactPersonRefName2 = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
     }
-    
+
     /**
      * Creates the person.
      *
@@ -252,7 +252,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
      * @param shortId
      * @param authRefName
      * @return the string
-     * @throws Exception 
+     * @throws Exception
      */
     protected String createPerson(String personAuthCSID, String firstName, String surName, String shortId, String authRefName ) throws Exception {
         PersonClient personAuthClient = new PersonClient();
@@ -266,15 +266,15 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
         term.setForeName(firstName);
         term.setSurName(surName);
         personTerms.add(term);
-       PoxPayloadOut multipart = 
+       PoxPayloadOut multipart =
            PersonAuthorityClientUtils.createPersonInstance(personAuthCSID,
                        null, personInfo, personTerms, personAuthClient.getItemCommonPartName());
-        
+
        String result = null;
        Response res = personAuthClient.createItem(personAuthCSID, multipart);
        try {
                int statusCode = res.getStatus();
-       
+
                Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
                        invalidStatusCodeMessage(testRequestType, statusCode));
                Assert.assertEquals(statusCode, STATUS_CREATED);
@@ -282,7 +282,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
        } finally {
                res.close();
        }
-       
+
        return result;
     }
 
@@ -317,11 +317,11 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
                 res.close();
             }
         }
-        
+
         // Check one or more of the authority fields in the Organization item
-        Assert.assertEquals(organization.getContactNames().getContactName().get(0),
+        Assert.assertEquals(organization.getContactGroupList().getContactGroup().get(0).getContactName(),
                 organizationContactPersonRefName1);
-        Assert.assertEquals(organization.getContactNames().getContactName().get(1),
+        Assert.assertEquals(organization.getContactGroupList().getContactGroup().get(1).getContactName(),
                 organizationContactPersonRefName2);
 
 
@@ -338,7 +338,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
                        res2.close();
             }
         }
-        
+
         List<AuthorityRefList.AuthorityRefItem> items = list.getAuthorityRefItem();
         int numAuthRefsFound = items.size();
         if(logger.isDebugEnabled()){
@@ -377,7 +377,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
      * For this reason, it attempts to remove all resources created
      * at any point during testing, even if some of those resources
      * may be expected to be deleted by certain tests.
-     * @throws Exception 
+     * @throws Exception
      */
     @AfterClass(alwaysRun=true)
     public void cleanUp() throws Exception {
@@ -388,11 +388,11 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
             }
             return;
        }
-       
+
         if (logger.isDebugEnabled()) {
             logger.debug("Cleaning up temporary resources created for testing ...");
         }
-                
+
         String parentResourceId;
         String itemResourceId;
         OrganizationClient client = new OrganizationClient();
@@ -404,7 +404,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
             // below are ignored and not reported.
             client.deleteItem(parentResourceId, itemResourceId).close();
         }
-        
+
         //
         // Delete the person authority items we created for the authRefs.  Note
         // that we needed to delete the objects/records referencing these authority items first since
@@ -416,13 +416,13 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
             // Note: Any non-success responses are ignored and not reported.
             personAuthClient.deleteItem(personAuthCSID, resourceId).close();
         }
-        
+
         // Delete PersonAuthority resource(s).
         // Note: Any non-success response is ignored and not reported.
         if (personAuthCSID != null) {
                personAuthClient.delete(personAuthCSID).close();
-        }        
-        
+        }
+
         // Clean up parent resources.
         for (String resourceId : allResourceIdsCreated) {
             // Note: Any non-success responses from the delete operation
index 263cb3863f7ebb0077bceff647c324552fc7d884..d2e5f688f22fabebbdd11cd01ead3fa4471d797e 100644 (file)
@@ -47,6 +47,7 @@ import org.collectionspace.services.client.OrgAuthorityClientUtils;
 import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.organization.OrgauthoritiesCommon;
 import org.collectionspace.services.organization.OrganizationsCommon;
+import org.collectionspace.services.organization.ContactGroup;
 import org.collectionspace.services.organization.OrgTermGroup;
 import org.collectionspace.services.organization.OrgTermGroupList;
 import org.slf4j.Logger;
@@ -75,7 +76,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
        super();
         TEST_SHORTID = "TestOrg";
     }
-    
+
     @Override
     public String getServicePathComponent() {
         return OrganizationClient.SERVICE_PATH_COMPONENT;
@@ -85,23 +86,23 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
     protected String getServiceName() {
         return OrganizationClient.SERVICE_NAME;
     }
-    
+
     private final String TEST_ORG_NAME = "Test Org";
     private final String TEST_ORG_MAIN_BODY_NAME = "The real official test organization";
     private final String TEST_ORG_FOUNDING_PLACE = "Anytown, USA";
     private final String TEST_ORG_FOUNDING_DATE = "May 26, 1907";
-    
+
     /** The known item resource short ID. */
     private String knownItemResourceShortIdentifer = null;
-    
+
     /** The known contact resource id. */
     private String knownContactResourceId = null;
-    
+
     /** The all contact resource ids created. */
     private Map<String, String> allContactResourceIdsCreated = new HashMap<String, String>();
 
     /**
-     * 
+     *
      */
     protected void setKnownItemResource(String id, String shortIdentifer) {
         knownItemResourceId = id;
@@ -133,13 +134,13 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
     @Override
     protected PoxPayloadOut createItemInstance(String parentCsid, String identifier) throws Exception {
         String headerLabel = new OrganizationClient().getItemCommonPartName();
-        
+
         String shortId = TEST_SHORTID + identifier;
         Map<String, String> testOrgMap = new HashMap<String, String>();
         testOrgMap.put(OrganizationJAXBSchema.SHORT_IDENTIFIER, shortId);
         testOrgMap.put(OrganizationJAXBSchema.FOUNDING_DATE, TEST_ORG_FOUNDING_DATE);
         testOrgMap.put(OrganizationJAXBSchema.FOUNDING_PLACE, TEST_ORG_FOUNDING_PLACE);
-        
+
         List<OrgTermGroup> terms = new ArrayList<OrgTermGroup>();
         OrgTermGroup term = new OrgTermGroup();
         term.setTermDisplayName(TEST_ORG_NAME);
@@ -154,7 +155,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
        protected String createItemInAuthority(AuthorityClient client, String authorityId, String shortId) {
                return createItemInAuthority(client, authorityId, shortId, null /*refname*/);
        }
-    
+
     /**
      * Creates the item in authority.
      *
@@ -168,19 +169,19 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         if (logger.isDebugEnabled()) {
             logger.debug(testName + ":...");
         }
-        
+
         Map<String, String> testOrgMap = new HashMap<String, String>();
         testOrgMap.put(OrganizationJAXBSchema.SHORT_IDENTIFIER, shortId);
         testOrgMap.put(OrganizationJAXBSchema.FOUNDING_DATE, TEST_ORG_FOUNDING_DATE);
         testOrgMap.put(OrganizationJAXBSchema.FOUNDING_PLACE, TEST_ORG_FOUNDING_PLACE);
-        
+
         List<OrgTermGroup> terms = new ArrayList<OrgTermGroup>();
         OrgTermGroup term = new OrgTermGroup();
         term.setTermDisplayName(TEST_ORG_NAME);
         term.setTermName(TEST_ORG_NAME);
         term.setMainBodyName(TEST_ORG_MAIN_BODY_NAME);
         terms.add(term);
-        
+
         Map<String, List<String>> testOrgRepeatablesMap = new HashMap<String, List<String>>();
         List<String> testOrgContactNames = new ArrayList<String>();
         testOrgContactNames.add("joe@example.org");
@@ -211,7 +212,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
      * Creates the contact.
      *
      * @param testName the test name
-     * @throws Exception 
+     * @throws Exception
      */
     @Test(dataProvider = "testName", groups = {"create"},
                dependsOnMethods = {"createItem"})
@@ -226,7 +227,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
      * @param parentcsid the parentcsid
      * @param itemcsid the itemcsid
      * @return the string
-     * @throws Exception 
+     * @throws Exception
      */
     private String createContactInItem(String parentcsid, String itemcsid) throws Exception {
 
@@ -327,7 +328,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
             Assert.fail("readInternal: Internal error. One of CSID or shortId must be non-null");
         }
         try {
-            assertStatusCode(res, testName);           
+            assertStatusCode(res, testName);
             //FIXME: remove the following try catch once Aron fixes signatures
             try {
                 PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
@@ -349,7 +350,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
 
     /**
      * Read item in Named Auth.
-     * 
+     *
      * TODO Enable this if we really need this - it is a funky case, where we would have
      * the shortId of the item, but the CSID of the parent authority!? Unlikely.
      *
@@ -361,7 +362,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
     readItemInternal(testName, null, knownResourceShortIdentifer, knownItemResourceId, null);
     }
      */
-    
+
     /**
      * Read named item.
      *
@@ -373,7 +374,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
     public void readNamedItem(String testName) throws Exception {
         readItemInternal(testName, knownResourceId, null, null, knownItemResourceShortIdentifer);
     }
-    
+
     /**
      * Read item in Named Auth.
      *
@@ -444,24 +445,24 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
 
             // Verify the number and contents of values in a repeatable field,
             // as created in the instance record used for testing.
-            List<String> contactNames = organization.getContactNames().getContactName();
-            Assert.assertTrue(contactNames.size() > 0);
-            Assert.assertNotNull(contactNames.get(0));
 
+            List<ContactGroup> contactGroups = organization.getContactGroupList().getContactGroup();
+            Assert.assertTrue(contactGroups.size() > 0);
+            Assert.assertNotNull(contactGroups.get(0).getContactName());
         } finally {
                if (res != null) {
                 res.close();
             }
         }
     }
-    
+
     @Override
     protected void verifyReadItemInstance(OrganizationsCommon item) throws Exception {
-        List<String> contactNames = item.getContactNames().getContactName();
-        Assert.assertTrue(contactNames.size() > 0);
-        Assert.assertNotNull(contactNames.get(0));
+        List<ContactGroup> contactGroups = item.getContactGroupList().getContactGroup();
+        Assert.assertTrue(contactGroups.size() > 0);
+        Assert.assertNotNull(contactGroups.get(0).getContactName());
     }
-    
+
     /**
      * Verify illegal item display name.
      *
@@ -479,7 +480,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         Response res = client.readItem(knownResourceId, knownItemResourceId);
         OrganizationsCommon organization = null;
         try {
-            assertStatusCode(res, testName);           
+            assertStatusCode(res, testName);
             // Check whether organization has expected displayName.
             PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
             organization = (OrganizationsCommon) extractPart(input,
@@ -490,7 +491,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
                 res.close();
             }
         }
-        
+
         //
         // Make an invalid UPDATE request, without a display name
         //
@@ -501,7 +502,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         Assert.assertTrue(terms.size() > 0);
         terms.get(0).setTermDisplayName(null);
         terms.get(0).setTermName(null);
-        
+
         setupUpdateWithInvalidBody(); // we expect a failure
         // Submit the updated resource to the service and store the response.
         PoxPayloadOut output = new PoxPayloadOut(OrganizationClient.SERVICE_ITEM_PAYLOAD_NAME);
@@ -534,7 +535,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         Response res =client.readContact(knownResourceId, knownItemResourceId,
                 knownContactResourceId);
         try {
-            assertStatusCode(res, testName);           
+            assertStatusCode(res, testName);
             // Check whether we've received a contact.
             PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
             ContactsCommon contact = (ContactsCommon) extractPart(input,
@@ -558,7 +559,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
      * Read contact non existent.
      *
      * @param testName the test name
-     * @throws Exception 
+     * @throws Exception
      */
     @Test(dataProvider = "testName", groups = {"readItem"},
                dependsOnMethods = {"readContact"})
@@ -589,7 +590,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
 
     /**
      * Read item list.
-     * @throws Exception 
+     * @throws Exception
      */
     @Override
 //     @Test(groups = {"readList"}, dependsOnMethods = {"readList"})
@@ -599,7 +600,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
 
     /**
      * Read item list by authority name.
-     * @throws Exception 
+     * @throws Exception
      */
     @Override
 //    @Test(dataProvider = "testName",
@@ -613,7 +614,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
      *
      * @param vcsid the vcsid
      * @param name the name
-     * @throws Exception 
+     * @throws Exception
      */
     private void readItemList(String vcsid, String name) throws Exception {
 
@@ -631,17 +632,17 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         } else {
             Assert.fail("readItemList passed null csid and name!");
         }
-        
+
         AbstractCommonList list = null;
         try {
-            assertStatusCode(res, testName);           
+            assertStatusCode(res, testName);
             list = res.readEntity(AbstractCommonList.class);
         } finally {
                if (res != null) {
                 res.close();
             }
         }
-        
+
         List<AbstractCommonList.ListItem> items = list.getListItem();
         int nItemsReturned = items.size();
         // There will be 'nItemsToCreateInList'
@@ -669,7 +670,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
 
     /**
      * Read contact list.
-     * @throws Exception 
+     * @throws Exception
      */
     @Test(groups = {"readList"},
                dependsOnMethods = {"org.collectionspace.services.client.test.AbstractAuthorityServiceTest.readItemList"})
@@ -682,7 +683,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
      *
      * @param parentcsid the parentcsid
      * @param itemcsid the itemcsid
-     * @throws Exception 
+     * @throws Exception
      */
     private void readContactList(String parentcsid, String itemcsid) throws Exception {
         final String testName = "readContactList";
@@ -742,7 +743,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         Response res = client.readContact(knownResourceId, knownItemResourceId, knownContactResourceId);
         ContactsCommon contact = null;
         try {
-            assertStatusCode(res, testName);           
+            assertStatusCode(res, testName);
             if (logger.isDebugEnabled()) {
                 logger.debug("got Contact to update with ID: "
                         + knownContactResourceId
@@ -791,7 +792,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
                        (ContactsCommon) extractPart(input,
                        new ContactClient().getCommonPartName(), ContactsCommon.class);
                Assert.assertNotNull(updatedContact);
-       
+
                // Verify that the updated resource received the correct data.
                Assert.assertEquals(updatedContact.getAddressGroupList().getAddressGroup().get(0).getAddressPlace1(),
                        contact.getAddressGroupList().getAddressGroup().get(0).getAddressPlace1(),
@@ -855,8 +856,8 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
     public void delete(String testName) throws Exception {
        // Do nothing.  See localDelete().  This ensure proper test order.
     }
-    
-    @Test(dataProvider = "testName", dependsOnMethods = {"localDeleteItem"})    
+
+    @Test(dataProvider = "testName", dependsOnMethods = {"localDeleteItem"})
     public void localDelete(String testName) throws Exception {
        super.delete(testName);
     }
@@ -866,18 +867,18 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
        // Do nothing.  We need to wait until after the test "localDelete" gets run.  When it does,
        // its dependencies will get run first and then we can call the base class' delete method.
     }
-    
+
     @Test(dataProvider = "testName", groups = {"delete"},
        dependsOnMethods = {"verifyIllegalItemDisplayName", "testContactSubmitRequest", "deleteContact"})
     public void localDeleteItem(String testName) throws Exception {
        super.deleteItem(testName);
-    }    
-    
+    }
+
     /**
      * Delete non existent contact.
      *
      * @param testName the test name
-     * @throws Exception 
+     * @throws Exception
      */
     @Test(dataProvider = "testName", groups = {"delete"},
                dependsOnMethods = {"deleteContact"})
@@ -932,7 +933,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
      * For this reason, it attempts to remove all resources created
      * at any point during testing, even if some of those resources
      * may be expected to be deleted by certain tests.
-     * @throws Exception 
+     * @throws Exception
      */
     @AfterClass(alwaysRun = true)
     @Override
@@ -1066,12 +1067,12 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
        @Override
        public void authorityTests(String testName) {
                // TODO Auto-generated method stub
-               
+
        }
 
        @Override
        protected OrganizationsCommon updateItemInstance(OrganizationsCommon organizationsCommon) {
-                            
+
             OrgTermGroupList termList = organizationsCommon.getOrgTermGroupList();
             Assert.assertNotNull(termList);
             List<OrgTermGroup> terms = termList.getOrgTermGroup();
@@ -1088,23 +1089,23 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
        protected void compareUpdatedItemInstances(OrganizationsCommon original,
                        OrganizationsCommon updated,
                        boolean compareRevNumbers) throws Exception {
-            
+
             OrgTermGroupList originalTermList = original.getOrgTermGroupList();
             Assert.assertNotNull(originalTermList);
             List<OrgTermGroup> originalTerms = originalTermList.getOrgTermGroup();
             Assert.assertNotNull(originalTerms);
             Assert.assertTrue(originalTerms.size() > 0);
-            
+
             OrgTermGroupList updatedTermList = updated.getOrgTermGroupList();
             Assert.assertNotNull(updatedTermList);
             List<OrgTermGroup> updatedTerms = updatedTermList.getOrgTermGroup();
             Assert.assertNotNull(updatedTerms);
             Assert.assertTrue(updatedTerms.size() > 0);
-            
+
             Assert.assertEquals(updatedTerms.get(0).getTermDisplayName(),
                 originalTerms.get(0).getTermDisplayName(),
                 "Value in updated record did not match submitted data.");
-            
+
             if (compareRevNumbers == true) {
                Assert.assertEquals(original.getRev(), updated.getRev(), "Revision numbers should match.");
             }
@@ -1131,7 +1132,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
                 displayName, shortId, commonPartName);
         return result;
        }
-       
+
     protected PoxPayloadOut createNonExistenceItemInstance(String commonPartName,
                String identifier) {
         Map<String, String> nonexOrgMap = new HashMap<String, String>();
@@ -1146,10 +1147,10 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
        @Override
        protected OrgauthoritiesCommon updateInstance(OrgauthoritiesCommon orgauthoritiesCommon) {
                OrgauthoritiesCommon result = new OrgauthoritiesCommon();
-               
+
         result.setDisplayName("updated-" + orgauthoritiesCommon.getDisplayName());
         result.setVocabType("updated-" + orgauthoritiesCommon.getVocabType());
-        
+
                return result;
        }
 
index b73a89e645031aa21932a1b62f441e50ba7ce8d0..37976cefdf5b3e750b80ece5c90fa94f02100cde 100644 (file)
@@ -8,7 +8,7 @@
     Used for: JAXB binding between XML and Java objects
 -->
 
-<xs:schema 
+<xs:schema
     xmlns:xs="http://www.w3.org/2001/XMLSchema"
     xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
     jaxb:version="1.0" elementFormDefault="unqualified"
                 <!--  Common identifier -->
                 <xs:element name="csid" type="xs:string" />
                                <xs:element name="rev" type="xs:integer" /> <!-- Revision number -->
-                
+
                 <!--  Organization Information Group -->
                 <xs:element name="inAuthority" type="xs:string" />
                 <xs:element name="shortIdentifier" type="xs:string"/>
                 <xs:element name="refName" type="xs:string"/>
-                
+
                 <!-- Term Information repeatable group -->
                 <xs:element name="orgTermGroupList" type="orgTermGroupList"/>
-                                
+
                 <xs:element name="foundingDateGroup" type="structuredDateGroup"/>
                 <xs:element name="dissolutionDateGroup" type="structuredDateGroup"/>
                 <xs:element name="foundingPlace" type="xs:string"/>
-                
+
                 <xs:element name="groups" type="groupList"/>
                 <xs:element name="functions" type="functionList"/>
-                <xs:element name="contactNames" type="contactNameList"/>
+                <xs:element name="contactGroupList" type="contactGroupList"/>
                 <xs:element name="historyNotes" type="historyNoteList"/>
             </xs:sequence>
         </xs:complexType>
     </xs:element>
-    
-    <xs:complexType name="contactNameList">
+
+    <xs:element name="contactGroupList" type="contactGroupList"/>
+
+    <xs:complexType name="contactGroupList">
         <xs:sequence>
-            <xs:element name="contactName" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+            <xs:element name="contactGroup" type="contactGroup" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="contactGroup">
+        <xs:sequence>
+            <xs:element name="contactName" type="xs:string"/>
+            <xs:element name="contactRole" type="xs:string"/>
+            <xs:element name="contactStatus" type="xs:string"/>
+            <xs:element name="contactDateGroup" type="structuredDateGroup"/>
+            <xs:element name="contactEndDateGroup" type="structuredDateGroup"/>
         </xs:sequence>
     </xs:complexType>
 
@@ -73,7 +85,7 @@
             <xs:element name="historyNote" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
         </xs:sequence>
     </xs:complexType>
-    
+
     <xs:complexType name="orgTermGroupList">
         <xs:sequence>
             <xs:element name="orgTermGroup" type="orgTermGroup" minOccurs="0" maxOccurs="unbounded"/>
             <xs:element name="scalarValuesComputed" type="xs:boolean"/>
         </xs:sequence>
     </xs:complexType>
-    
-</xs:schema>
 
+</xs:schema>
index e9c6b4c1f43f4b74aa156f9146d67849f8b4ee0b..abc1148bff930968417ef5bced83f49af0db85ad 100644 (file)
@@ -66,6 +66,8 @@ import org.collectionspace.services.client.RoleClient;
 import org.collectionspace.services.client.RoleFactory;
 import org.collectionspace.services.client.test.BaseServiceTest;
 import org.collectionspace.services.dimension.DimensionsCommon;
+import org.collectionspace.services.intake.DepositorGroup;
+import org.collectionspace.services.intake.DepositorGroupList;
 import org.collectionspace.services.intake.IntakesCommon;
 import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.testng.Assert;
@@ -226,7 +228,7 @@ public class AuthorizationServiceTest extends BaseServiceTest<AbstractCommonList
 
        /*
         * (non-Javadoc)
-        * 
+        *
         * @see
         * org.collectionspace.services.client.test.BaseServiceTest#getClientInstance
         * ()
@@ -325,13 +327,21 @@ public class AuthorizationServiceTest extends BaseServiceTest<AbstractCommonList
         * @param depositor
         *            the depositor
         * @return the multipart output
-        * @throws Exception 
+        * @throws Exception
         */
        private PoxPayloadOut createIntakeInstance(String entryNumber, String entryDate, String depositor) throws Exception {
                IntakesCommon intake = new IntakesCommon();
                intake.setEntryNumber(entryNumber);
                intake.setEntryDate(entryDate);
-               intake.setDepositor(depositor);
+
+               DepositorGroupList depositorGroupList = new DepositorGroupList();
+               List<DepositorGroup> depositorGroups = depositorGroupList.getDepositorGroup();
+               DepositorGroup depositorGroup = new DepositorGroup();
+
+               depositorGroup.setDepositor(depositor);
+               depositorGroups.add(depositorGroup);
+
+               intake.setDepositorGroupList(depositorGroupList);
 
                PoxPayloadOut multipart = new PoxPayloadOut(IntakeClient.SERVICE_PAYLOAD_NAME);
                PayloadOutputPart commonPart = multipart.addPart(intake, MediaType.APPLICATION_XML_TYPE);