]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
DRYD-202: More support for term/item lists in POSTs and PUTs to vocabulary resources.
authorremillet <remillet@yahoo.com>
Wed, 24 Jan 2018 01:18:47 +0000 (17:18 -0800)
committerremillet <remillet@yahoo.com>
Wed, 24 Jan 2018 01:18:47 +0000 (17:18 -0800)
41 files changed:
services/IntegrationTests/src/main/java/org/collectionspace/services/IntegrationTests/xmlreplay/XmlReplay.java
services/IntegrationTests/src/test/resources/test-data/xmlreplay/acquisitions/acquisitions.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefs.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefsComplex.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefsSimple.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authrefs/authrefsSimple2.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batch-update-object-loc.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batch.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/collectionobject-adv-search.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/dimension/1.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/listener/listener-update-object-loc.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/loanin/loanin.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/loanout/loanout.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/object-exit.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe11.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe15.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe9.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/authrefs-listAuthrefs.res.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/generic_persons_common_delete_all_relations_PUT.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/person.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/res/authrefs-listAuthrefs.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/testsciperson.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/relation/relation.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/report.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/versioning/versioning.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/ReplaceVocabItems/responses/ReplaceVocabItems.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddDeleteVocabItems/responses/updateAddDeleteVocabItems.res.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddDeleteVocabItems/updateAddDeleteWithItems-vocab.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddOnlyVocabItems/responses/updateAddOnlyVocabItems.res.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddOnlyVocabItems/updateAddOnlyWithItems-vocab.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddSoftDeleteVocabItems/responses/updateAddSoftDeleteVocabItems.res.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddSoftDeleteVocabItems/updateAddSoftDeleteWithItems-vocab.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/vocabulary.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-master.xml
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java
services/loanin/client/src/test/java/org/collectionspace/services/client/test/LoaninAuthRefsTest.java
services/loanout/client/src/test/java/org/collectionspace/services/client/test/LoanoutAuthRefsTest.java
services/vocabulary/client/src/main/java/org/collectionspace/services/client/VocabularyClient.java
services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/VocabularyResource.java

index 587a41906fffd4cab2dc3b576d3f845648c4149b..1567c6c6adbd981d4a272f90c8fa0fdc5d143fc0 100644 (file)
@@ -781,6 +781,10 @@ public class XmlReplay {
                     serviceResult.error = msg;
                     serviceResult.failureReason = " : SYSTEM ERROR; ";
                     results.add(serviceResult);
+                    //
+                    // Fail fast
+                    //
+                    throw t;
                 }
             }
             if (Tools.isTrue(autoDeletePOSTS) && param_autoDeletePOSTS){
index 5f974a5c3ca3d46802ace17744f1ed6eb09130ce..f21b64fd396cb1a4e9affb7926b4c176c1266fd4 100644 (file)
@@ -3,72 +3,69 @@
     <auths>
         <!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->
         <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
-        <auth ID="testAdministator">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>
     </auths>
-   
-    <testGroup ID="makeone" autoDeletePOSTS="true">
-       <test ID="ac1"  auth="test">
-             <method>POST</method>
-             <uri>/cspace-services/acquisitions/</uri>
-             <filename>acquisitions/ac1.xml</filename>
-         </test>
+
+    <testGroup ID="makeone" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
+        <test ID="ac1" auth="admin@core.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/acquisitions/</uri>
+            <filename>acquisitions/ac1.xml</filename>
+        </test>
         <test ID="ac1get">
             <method>GET</method>
             <uri>/cspace-services/acquisitions/${ac1.CSID}</uri>
             <response>
-                <expected level="TEXT" />
+                <expected level="TEXT"></expected>
                 <label>acquisitions_common</label>
                 <filename>acquisitions/res/ac1.res.xml</filename>
-             </response>
-         </test>
-    </testGroup>       
+            </response>
+        </test>
+    </testGroup>
 
-    <testGroup ID="testList" autoDeletePOSTS="true">
-         <test ID="ac1"  auth="test">
-             <method>POST</method>
-             <uri>/cspace-services/acquisitions/</uri>
-             <filename>acquisitions/ac1.xml</filename>
-         </test>
-         
-         <test ID="ac1get">
+    <testGroup ID="testList" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
+        <test ID="ac1">
+            <method>POST</method>
+            <uri>/cspace-services/acquisitions/</uri>
+            <filename>acquisitions/ac1.xml</filename>
+        </test>
+
+        <test ID="ac1get">
             <method>GET</method>
             <uri>/cspace-services/acquisitions/${ac1.CSID}</uri>
             <response>
-                <expected level="TEXT" />
+                <expected level="TEXT"></expected>
                 <label>acquisitions_common</label>
-                               <filename>acquisitions/res/ac1.res.xml</filename>
-             </response>
-         </test>
+                <filename>acquisitions/res/ac1.res.xml</filename>
+            </response>
+        </test>
+
+        <test ID="ac2">
+            <method>POST</method>
+            <uri>/cspace-services/acquisitions/</uri>
+            <filename>acquisitions/ac2.xml</filename>
+        </test>
 
-        <test ID="ac2"  auth="test">
-             <method>POST</method>
-             <uri>/cspace-services/acquisitions/</uri>
-             <filename>acquisitions/ac2.xml</filename>
-         </test>
-         
         <test ID="ac2get">
             <method>GET</method>
             <uri>/cspace-services/acquisitions/${ac2.CSID}</uri>
             <response>
-                <expected level="TEXT" />
+                <expected level="TEXT"></expected>
                 <label>acquisitions_common</label>
-                               <filename>acquisitions/res/ac2.res.xml</filename>
-             </response>
+                <filename>acquisitions/res/ac2.res.xml</filename>
+            </response>
         </test>
 
         <test ID="ac3list">
             <method>GET</method>
             <uri>/cspace-services/acquisitions/?sortBy=&amp;pgNum=0&amp;pgSz=10</uri>
             <response>
-                <expected level="TEXT" />
+                <expected level="TEXT"></expected>
                 <label>acquisitions_common</label>
                 <filename>acquisitions/res/ac3list.res.xml</filename>
-             </response>
+            </response>
         </test>
-        
+
     </testGroup>
-     
+
 
 </xmlReplay>
-        
-        
index ff361053f45a00b779a78865f23a60e6fa3cb20a..53f8374e5c7df5b2874bf0becf5604ecf5d6efdf 100644 (file)
@@ -4,7 +4,7 @@
                         testGroup ID="person" is not live.  It works, but may not clean up correctly. 
                         For now, use ID="updatePerson"
        -->
-       <testGroup ID="AuthRefs" autoDeletePOSTS="true">
+    <testGroup ID="AuthRefs" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
                <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
                        <method>POST</method>
                        <uri>/cspace-services/personauthorities/</uri>
@@ -31,7 +31,7 @@
                        <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}</uri>
                </test>
 
-               <test ID="loanout1" auth="test">
+               <test ID="loanout1">
                        <method>POST</method>
                        <uri>/cspace-services/loansout/</uri>
                        <filename>authrefs/loanout.xml</filename>
@@ -41,7 +41,7 @@
                        </vars>
                </test>
 
-               <test ID="loanout2" auth="test">
+               <test ID="loanout2">
                        <method>POST</method>
                        <uri>/cspace-services/loansout/</uri>
                        <filename>authrefs/loanout.xml</filename>
@@ -51,7 +51,7 @@
                        </vars>
                </test>
 
-               <test ID="loanout3" auth="test">
+               <test ID="loanout3">
                        <method>POST</method>
                        <uri>/cspace-services/loansout/</uri>
                        <filename>authrefs/loanout.xml</filename>
@@ -61,7 +61,7 @@
                        </vars>
                </test>
 
-               <test ID="loanout4" auth="test">
+               <test ID="loanout4">
                        <method>POST</method>
                        <uri>/cspace-services/loansout/</uri>
                        <filename>authrefs/loanout.xml</filename>
@@ -71,7 +71,7 @@
                        </vars>
                </test>
 
-               <test ID="loanout5" auth="test">
+               <test ID="loanout5">
                        <method>POST</method>
                        <uri>/cspace-services/loansout/</uri>
                        <filename>authrefs/loanout.xml</filename>
@@ -81,7 +81,7 @@
                        </vars>
                </test>
 
-               <test ID="loanout6" auth="test">
+               <test ID="loanout6">
                        <method>POST</method>
                        <uri>/cspace-services/loansout/</uri>
                        <filename>authrefs/loanout.xml</filename>
@@ -91,7 +91,7 @@
                        </vars>
                </test>
 
-               <test ID="loanout7" auth="test">
+               <test ID="loanout7">
                        <method>POST</method>
                        <uri>/cspace-services/loansout/</uri>
                        <filename>authrefs/loanout.xml</filename>
                        </vars>
                </test>
 
-               <test ID="loanout8" auth="test">
+               <test ID="loanout8">
                        <method>POST</method>
                        <uri>/cspace-services/loansout/</uri>
                        <filename>authrefs/loanout.xml</filename>
                        </vars>
                </test>
 
-               <test ID="loanout9" auth="test">
+               <test ID="loanout9">
                        <method>POST</method>
                        <uri>/cspace-services/loansout/</uri>
                        <filename>authrefs/loanout.xml</filename>
                        </vars>
                </test>
 
-               <test ID="loanout10" auth="test">
+               <test ID="loanout10">
                        <method>POST</method>
                        <uri>/cspace-services/loansout/</uri>
                        <filename>authrefs/loanout.xml</filename>
index 18f76bd43009ba4bde9ca97f7508554dba6f07bc..8a6672b3665d696dbda421de50f8791d82739bd8 100644 (file)
@@ -5,7 +5,7 @@
                         For now, use ID="updatePerson"
        -->
        <testGroup ID="AuthRefsComplex" autoDeletePOSTS="true">
-               <test ID="intake1" auth="test">
+               <test ID="intake1">
                        <method>POST</method>
                        <uri>/cspace-services/intakes/</uri>
                        <filename>authrefs/intake1.xml</filename>
index badb978d1c0cc208327dbc27856483d4af07a5d8..7a2bae39ef1791908fbc8ad9871132be93bbe711 100644 (file)
@@ -1,97 +1,97 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xmlReplay>
-       <!-- 
+    <!-- 
                         testGroup ID="person" is not live.  It works, but may not clean up correctly. 
                         For now, use ID="updatePerson"
        -->
-       <testGroup ID="AuthRefsSimple" autoDeletePOSTS="true">
-               <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
-                       <method>POST</method>
-                       <uri>/cspace-services/personauthorities/</uri>
-                       <filename>authrefs/newPersonAuthority.xml</filename>
-               </test>
-               <test ID="Person1">
-                       <method>POST</method>
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
-                       <filename>authrefs/newPerson1.xml</filename>
-               </test>
-               <test ID="Person2">
-                       <method>POST</method>
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
-                       <filename>authrefs/newPerson2.xml</filename>
-               </test>
+    <testGroup ID="AuthRefsSimple" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
+        <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/</uri>
+            <filename>authrefs/newPersonAuthority.xml</filename>
+        </test>
+        <test ID="Person1">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+            <filename>authrefs/newPerson1.xml</filename>
+        </test>
+        <test ID="Person2">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+            <filename>authrefs/newPerson2.xml</filename>
+        </test>
 
-        <test ID="GetPerson1">
-                       <method>GET</method>
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>
-               </test>
+        <test ID="GetPerson1">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>
+        </test>
 
-        <test ID="GetPerson2">
-                       <method>GET</method>
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}</uri>
-               </test>
+        <test ID="GetPerson2">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}</uri>
+        </test>
 
-               <test ID="loanout1" auth="test">
-                       <method>POST</method>
-                       <uri>/cspace-services/loansout/</uri>
-                       <filename>authrefs/loanout.xml</filename>
-                       <vars>
-                               <var ID="loannum">42</var>
-                               <var ID="person">${GetPerson1.got("//refName")}</var>
-                       </vars>
-               </test>
+        <test ID="loanout1">
+            <method>POST</method>
+            <uri>/cspace-services/loansout/</uri>
+            <filename>authrefs/loanout.xml</filename>
+            <vars>
+                <var ID="loannum">42</var>
+                <var ID="person">${GetPerson1.got("//refName")}</var>
+            </vars>
+        </test>
 
-               <test ID="loanout2" auth="test">
-                       <method>POST</method>
-                       <uri>/cspace-services/loansout/</uri>
-                       <filename>authrefs/loanout.xml</filename>
-                       <vars>
-                               <var ID="loannum">102</var>
-                               <var ID="person">${GetPerson2.got("//refName")}</var>
-                       </vars>
-               </test>
+        <test ID="loanout2">
+            <method>POST</method>
+            <uri>/cspace-services/loansout/</uri>
+            <filename>authrefs/loanout.xml</filename>
+            <vars>
+                <var ID="loannum">102</var>
+                <var ID="person">${GetPerson2.got("//refName")}</var>
+            </vars>
+        </test>
 
-               <test ID="getLoan1AuthRefs">
-                       <method>GET</method>
-                       <uri>/cspace-services/loansout/${loanout1.CSID}/authorityrefs</uri>
-                       <response>
-                               <expected level="ADDOK" />
-                               <filename>authrefs/res/foo.res.xml</filename>
-                        </response>
-               </test>
+        <test ID="getLoan1AuthRefs">
+            <method>GET</method>
+            <uri>/cspace-services/loansout/${loanout1.CSID}/authorityrefs</uri>
+            <response>
+                <expected level="ADDOK"></expected>
+                <filename>authrefs/res/foo.res.xml</filename>
+            </response>
+        </test>
 
-               <test ID="getPerson1RefObjs">
-                       <method>GET</method>
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs</uri>
-                       <response>
-                               <expected level="ADDOK" />
-                               <filename>authrefs/res/refObjs.res.xml</filename>
-                        </response>
-               </test>
+        <test ID="getPerson1RefObjs">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs</uri>
+            <response>
+                <expected level="ADDOK"></expected>
+                <filename>authrefs/res/refObjs.res.xml</filename>
+            </response>
+        </test>
 
-               <test ID="OrganizationAuth1">
-                       <method>POST</method>
-                       <uri>/cspace-services/orgauthorities/</uri>
-                       <filename>authrefs/orgauthorities_common.xml</filename>
-               </test>
-               <test ID="Org1">
-                       <method>POST</method>
-                       <uri>/cspace-services/orgauthorities/${OrganizationAuth1.CSID}/items/</uri>
-                       <filename>authrefs/organizations_common.xml</filename>
-                       <vars>
-                               <var ID="person1">${GetPerson1.got("//refName")}</var>
-                               <var ID="person2">${GetPerson2.got("//refName")}</var>
-                       </vars>
-               </test>
+        <test ID="OrganizationAuth1">
+            <method>POST</method>
+            <uri>/cspace-services/orgauthorities/</uri>
+            <filename>authrefs/orgauthorities_common.xml</filename>
+        </test>
 
-               <test ID="getOrg1AuthRefs">
-                       <method>GET</method>
-                       <uri>/cspace-services/orgauthorities/${OrganizationAuth1.CSID}/items/${Org1.CSID}/authorityrefs</uri>
-                       <response>
-                               <expected level="ADDOK" />
-                               <filename>authrefs/res/foo.res.xml</filename>
-                        </response>
-               </test>
-       </testGroup>
+        <test ID="Org1">
+            <method>POST</method>
+            <uri>/cspace-services/orgauthorities/${OrganizationAuth1.CSID}/items/</uri>
+            <filename>authrefs/organizations_common.xml</filename>
+            <vars>
+                <var ID="person1">${GetPerson1.got("//refName")}</var>
+                <var ID="person2">${GetPerson2.got("//refName")}</var>
+            </vars>
+        </test>
+
+        <test ID="getOrg1AuthRefs">
+            <method>GET</method>
+            <uri>/cspace-services/orgauthorities/${OrganizationAuth1.CSID}/items/${Org1.CSID}/authorityrefs</uri>
+            <response>
+                <expected level="ADDOK"></expected>
+                <filename>authrefs/res/foo.res.xml</filename>
+            </response>
+        </test>
+    </testGroup>
 </xmlReplay>
index e9e1925cbf7bffdb90c43421b5e2c8997d2e0d4e..1eca2584e06d943c5aac772eea996c9f7064dbda 100644 (file)
@@ -1,62 +1,62 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xmlReplay>
-       <!-- 
+    <!-- 
                         testGroup ID="person" is not live.  It works, but may not clean up correctly. 
                         For now, use ID="updatePerson"
        -->
-       <testGroup ID="AuthRefsSimple2" autoDeletePOSTS="true">
-               <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
-                       <method>POST</method>
-                       <uri>/cspace-services/personauthorities/</uri>
-                       <filename>authrefs/newPersonAuthority.xml</filename>
-               </test>
-               <test ID="Person1">
-                       <method>POST</method>
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
-                       <filename>authrefs/newPerson1.xml</filename>
-               </test>
+    <testGroup ID="AuthRefsSimple2" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
+        <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/</uri>
+            <filename>authrefs/newPersonAuthority.xml</filename>
+        </test>
+        <test ID="Person1">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+            <filename>authrefs/newPerson1.xml</filename>
+        </test>
 
-        <test ID="GetPerson1">
-                       <method>GET</method>
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>
-               </test>
+        <test ID="GetPerson1">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>
+        </test>
 
-               <test ID="loanin1" auth="test">
-                       <method>POST</method>
-                       <uri>/cspace-services/loansin/</uri>
-                       <filename>authrefs/loanin.xml</filename>
-                       <vars>
-                               <var ID="loannum">42</var>
-                               <var ID="person">${GetPerson1.got("//refName")}</var>
-                       </vars>
-               </test>
+        <test ID="loanin1">
+            <method>POST</method>
+            <uri>/cspace-services/loansin/</uri>
+            <filename>authrefs/loanin.xml</filename>
+            <vars>
+                <var ID="loannum">42</var>
+                <var ID="person">${GetPerson1.got("//refName")}</var>
+            </vars>
+        </test>
 
-               <test ID="getloanin1" auth="test">
-                       <method>GET</method>
-                       <uri>/cspace-services/loansin/${loanin1.CSID}/</uri>
-                       <response>
-                               <expected level="ADDOK" />
-                               <filename>authrefs/res/foo.res.xml</filename>
-                        </response>
-               </test>
+        <test ID="getloanin1">
+            <method>GET</method>
+            <uri>/cspace-services/loansin/${loanin1.CSID}/</uri>
+            <response>
+                <expected level="ADDOK"></expected>
+                <filename>authrefs/res/foo.res.xml</filename>
+            </response>
+        </test>
 
-               <test ID="getLoan1AuthRefs">
-                       <method>GET</method>
-                       <uri>/cspace-services/loansin/${loanin1.CSID}/authorityrefs</uri>
-                       <response>
-                               <expected level="ADDOK" />
-                               <filename>authrefs/res/foo.res.xml</filename>
-                        </response>
-               </test>
+        <test ID="getLoan1AuthRefs">
+            <method>GET</method>
+            <uri>/cspace-services/loansin/${loanin1.CSID}/authorityrefs</uri>
+            <response>
+                <expected level="ADDOK"></expected>
+                <filename>authrefs/res/foo.res.xml</filename>
+            </response>
+        </test>
 
-               <test ID="getPerson1RefObjs">
-                       <method>GET</method>
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs</uri>
-                       <response>
-                               <expected level="ADDOK" />
-                               <filename>authrefs/res/refObjs.res.xml</filename>
-                        </response>
-               </test>
+        <test ID="getPerson1RefObjs">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs</uri>
+            <response>
+                <expected level="ADDOK"></expected>
+                <filename>authrefs/res/refObjs.res.xml</filename>
+            </response>
+        </test>
 
-       </testGroup>
+    </testGroup>
 </xmlReplay>
index 9e011213aa2037af50a848fd72212481d48d88c8..ab8cb26e02268e14266c3c57afa4c426ef4848f0 100644 (file)
@@ -9,7 +9,7 @@
     <!-- This tests the UpdateObjectLocationBatchJob -->
     <!-- in various invocation modes -->
         
-    <testGroup ID="invocationModeSingle" autoDeletePOSTS="true">
+    <testGroup ID="invocationModeSingle" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
         
         <!-- Tests with CollectionObject->Movement relations -->
             
         
         <!-- This post of a batch job invocation request doesn't create a new record, -->
         <!-- so we need to exclude it from the post-run auto-deletion of records. -->
-        <test ID="invokeBatch" auth="test" autoDeletePOSTS="false">
+        <test ID="invokeBatch" autoDeletePOSTS="false">
             <method>POST</method>
             <uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>
             <filename>batch/batch-invoke-updateobjloc-single.xml</filename>
             <expectedCodes>201</expectedCodes>
         </test>
         
-        <test ID="invokeBatchAfterAddingReverseRelation" auth="test" autoDeletePOSTS="false">
+        <test ID="invokeBatchAfterAddingReverseRelation" autoDeletePOSTS="false">
             <method>POST</method>
             <uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>
             <filename>batch/batch-invoke-updateobjloc-single.xml</filename>
             </vars>
         </test>
         
-        <test ID="invokeBatchAfterSoftDeletingMovement" auth="test" autoDeletePOSTS="false">
+        <test ID="invokeBatchAfterSoftDeletingMovement" autoDeletePOSTS="false">
             <method>POST</method>
             <uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>
             <filename>batch/batch-invoke-updateobjloc-single.xml</filename>
             </vars>
         </test>
         
-        <test ID="invokeBatchAfterSoftDeletingCollectionObject" auth="test" autoDeletePOSTS="false">
+        <test ID="invokeBatchAfterSoftDeletingCollectionObject" autoDeletePOSTS="false">
             <method>POST</method>
             <uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>
             <filename>batch/batch-invoke-updateobjloc-single.xml</filename>
         
     </testGroup>
     
-    <testGroup ID="invocationModeSingleWithTiebreaker" autoDeletePOSTS="true">
+    <testGroup ID="invocationModeSingleWithTiebreaker" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
                     
         <test ID="createBatchRecordWithTiebreaker">
             <method>POST</method>
             <expectedCodes>200</expectedCodes>
         </test>
  
-        <test ID="invokeBatchAfterMovement1ModificationWithTiebreaker" auth="test" autoDeletePOSTS="false">
+        <test ID="invokeBatchAfterMovement1ModificationWithTiebreaker" autoDeletePOSTS="false">
             <method>POST</method>
             <uri>/cspace-services/batch/${createBatchRecordWithTiebreaker.CSID}</uri>
             <filename>batch/batch-invoke-updateobjloc-single.xml</filename>
             <expectedCodes>200</expectedCodes>
         </test>
  
-        <test ID="invokeBatchAfterMovement2ModificationWithTiebreaker" auth="test" autoDeletePOSTS="false">
+        <test ID="invokeBatchAfterMovement2ModificationWithTiebreaker" autoDeletePOSTS="false">
             <method>POST</method>
             <uri>/cspace-services/batch/${createBatchRecordWithTiebreaker.CSID}</uri>
             <filename>batch/batch-invoke-updateobjloc-single.xml</filename>
             <expectedCodes>200</expectedCodes>
         </test>
  
-        <test ID="invokeBatchAfterMovement3ModificationWithTiebreaker" auth="test" autoDeletePOSTS="false">
+        <test ID="invokeBatchAfterMovement3ModificationWithTiebreaker" autoDeletePOSTS="false">
             <method>POST</method>
             <uri>/cspace-services/batch/${createBatchRecordWithTiebreaker.CSID}</uri>
             <filename>batch/batch-invoke-updateobjloc-single.xml</filename>
             
     </testGroup>
     
-    <testGroup ID="invocationModeList" autoDeletePOSTS="true">
+    <testGroup ID="invocationModeList" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
         
         <test ID="createBatchRecord">
             <method>POST</method>
             <expectedCodes>201</expectedCodes>
         </test>
         
-        <test ID="invokeBatchWithList" auth="test" autoDeletePOSTS="false">
+        <test ID="invokeBatchWithList" autoDeletePOSTS="false">
             <method>POST</method>
             <uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>
             <filename>batch/batch-invoke-updateobjloc-list.xml</filename>
 
     </testGroup>
     
-    <testGroup ID="invocationModeGroup" autoDeletePOSTS="true">
+    <testGroup ID="invocationModeGroup" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
         
         <test ID="createBatchRecord">
             <method>POST</method>
             <expectedCodes>201</expectedCodes>
         </test>
         
-        <test ID="invokeBatchWithGroup" auth="test" autoDeletePOSTS="false">
+        <test ID="invokeBatchWithGroup" autoDeletePOSTS="false">
             <method>POST</method>
             <uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>
             <filename>batch/batch-invoke-updateobjloc-group.xml</filename>
     <!-- These tests verify that updates to the computed current location values -->
     <!-- in CollectionObject records succeed, even in tenants where Movement -->
     <!-- records are configured to be versioned. See CSPACE-6188 for more details. -->    
-    <testGroup ID="invocationModeSingleInVersioningEnabledTenant" autoDeletePOSTS="true">
+    <testGroup ID="invocationModeSingleInVersioningEnabledTenant" autoDeletePOSTS="true" authForCleanup="admin@testsci.collectionspace.org">
         
         <test ID="createBatchRecordInVersioningTenant" auth="admin@testsci.collectionspace.org">
             <method>POST</method>
             <expectedCodes>201</expectedCodes>
         </test>
         
-        <test ID="invokeBatchWithNoContext" auth="test" autoDeletePOSTS="false">
+        <test ID="invokeBatchWithNoContext" autoDeletePOSTS="false">
             <method>POST</method>
             <uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>
             <filename>batch/batch-invoke-updateobjloc-nocontext.xml</filename>
index 1621f330ca399c16f5ffa757cad88f6b13531a1b..7684a080abe4d33ab0b07dda3c8062a64b1517f7 100644 (file)
@@ -6,7 +6,7 @@
            <auth ID="bigbird@cspace.org">YmlnYmlyZEBjc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
        </auths>
        
-       <testGroup ID="testPermissionsAndRoles" autoDeletePOSTS="true">
+    <testGroup ID="testPermissionsAndRoles" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
            <!-- 
               Setup accounts, roles, and permissions for tests.
            -->
            </test>
        </testGroup>
        
-       <testGroup ID="testSingle" autoDeletePOSTS="true">
-           <test ID="TestCreateAndLinkLoanOutBatchJob" auth="test">
+    <testGroup ID="testSingle" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
+           <test ID="TestCreateAndLinkLoanOutBatchJob">
                        <method>POST</method>
                        <uri>/cspace-services/batch/</uri>
                    <filename>batch/TestCreateAndLinkLoanOutBatchJob.xml</filename>
                </test>
-               <test ID="createCollObj1" auth="test">
+               <test ID="createCollObj1">
                        <method>POST</method>
                        <uri>/cspace-services/collectionobjects/</uri>
                        <filename>batch/collObj1.xml</filename>
                </test>
-               <test ID="testInvokeSingle" auth="test" autoDeletePOSTS="false">
+               <test ID="testInvokeSingle" autoDeletePOSTS="false">
                        <method>POST</method>
                    <uri>/cspace-services/batch/${TestCreateAndLinkLoanOutBatchJob.CSID}</uri>
                    <filename>batch/batch-invoke-single.xml</filename>
                                <var ID="CollObj1">${createCollObj1.CSID}</var>
                        </vars>
                </test>
-               <test ID="testInvokeList" auth="test" autoDeletePOSTS="false">
+               <test ID="testInvokeList" autoDeletePOSTS="false">
                        <method>POST</method>
                        <uri>/cspace-services/batch/${TestCreateAndLinkLoanOutBatchJob.CSID}</uri>
                    <filename>batch/batch-invoke-list.xml</filename>
                                <var ID="CollObj1">${createCollObj1.CSID}</var>
                        </vars>
                </test>
-               <test ID="testBadInvoke" auth="test" autoDeletePOSTS="false">
+               <test ID="testBadInvoke" autoDeletePOSTS="false">
                        <method>POST</method>
                        <expectedCodes>400</expectedCodes>
                        <uri>/cspace-services/batch/${TestCreateAndLinkLoanOutBatchJob.CSID}</uri>
                                <var ID="CollObj1">${createCollObj1.CSID}</var>
                        </vars>
                </test>
-               <test ID="testInvokeEmptyList" auth="test" autoDeletePOSTS="false">
+               <test ID="testInvokeEmptyList" autoDeletePOSTS="false">
                        <method>POST</method>
                        <expectedCodes>400</expectedCodes>
                        <uri>/cspace-services/batch/${TestCreateAndLinkLoanOutBatchJob.CSID}</uri>
                                <var ID="CollObj1">${createCollObj1.CSID}</var>
                        </vars>
                </test>
-               <test ID="testFilteredList1" auth="test">
+               <test ID="testFilteredList1">
                        <method>GET</method>
                        <uri>/cspace-services/batch?doctype=CollectionObject&amp;inv=single</uri>
                </test>
-               <test ID="testFilteredList2" auth="test">
+               <test ID="testFilteredList2">
                        <method>GET</method>
                        <uri>/cspace-services/batch?doctype=Intake&amp;inv=group</uri>
                </test>
index 79e18b11d46fe87ccf1c71ee83bcb986f59ea59a..069c0dd32ae3f93a82641229c416ddefcea12de0 100644 (file)
@@ -6,7 +6,7 @@
         <auth ID="admin@testsci.collectionspace.org">YWRtaW5AdGVzdHNjaS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
     </auths>
     
-    <testGroup ID="advSearchCommonSchema" autoDeletePOSTS="true">
+    <testGroup ID="advSearchCommonSchema" autoDeletePOSTS="true" authForCleanup="admin@testsci.collectionspace.org">
         <!-- Create a new CollectionObject record with a common part. -->
        <test ID="co1"  auth="admin@testsci.collectionspace.org">
              <method>POST</method>
@@ -26,7 +26,7 @@
          </test>
     </testGroup>
    
-    <testGroup ID="advSearchExtensionSchema" autoDeletePOSTS="true">
+    <testGroup ID="advSearchExtensionSchema" autoDeletePOSTS="true" authForCleanup="admin@testsci.collectionspace.org">
         <!-- Create a new CollectionObject record with an extension schema part -->
        <test ID="co2" auth="admin@testsci.collectionspace.org">
              <method>POST</method>
index 17e18715351ae87688f3851594f4e215b6f9a991..bc9801a0dfec826a72a42cd3ae3cca4f16004984 100644 (file)
@@ -2,75 +2,52 @@
 <xmlReplay>
     <auths>
         <!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->
-        <auth ID="admin@core.collectionspace.org">59PnafP1k9rcuGNMxbCfyQ3TphxKBqecsJI2Yv5vrms=</auth>
+        <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
         <auth ID="bigbird2010">YmlnYmlyZDIwMTA6YmlnYmlyZDIwMTA=</auth>
+        <!-- A bogus set of credentials -->
     </auths>
-    
-   <!-- ================================================================================ -->
-    
-   <testGroup ID="dimensionTestGroup" autoDeletePOSTS="false">
-        <!-- should fail on auth="bigbird2010" since bigbird2010 is not defined on back end. -->
-        <test ID="dimension1"  auth="bigbird2010">
+
+    <!-- ================================================================================ -->
+
+    <testGroup ID="dimensionTestGroup" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
+        <test ID="dimension1" auth="bigbird2010">
             <expectedCodes>401,403</expectedCodes>
             <method>POST</method>
             <uri>/cspace-services/dimensions/</uri>
-            <part>
-                <label>dimensions_common</label>
-                <filename>dimension/1.xml</filename>
-            </part>
+            <filename>dimension/1.xml</filename>
         </test>
 
-        <!-- should succeed on auth="test" since test is admin user. -->
-        <test ID="dimension2"  auth="admin@core.collectionspace.org">
-            <!-- actually, this one should succeed since "test" is admin, but it fails now. -->
-            <expectedCodes>201,403</expectedCodes>
+        <test ID="dimension2" auth="admin@core.collectionspace.org">
+            <expectedCodes>201</expectedCodes>
             <method>POST</method>
             <uri>/cspace-services/dimensions/</uri>
-            <part>
-                <label>dimensions_common</label>
-                <filename>dimension/1.xml</filename>
-            </part>
+            <filename>dimension/1.xml</filename>
         </test>
-
-        
     </testGroup>
 
-    <testGroup ID="dimensionCRUDGroup" autoDeletePOSTS="true">
-         <!-- should succeed on auth="test" since test is admin user. -->
-         <test ID="dimPOST"  auth="admin@core.collectionspace.org">
-             <!-- actually, this one should succeed since "test" is admin, but it fails now. -->
-             <expectedCodes>201</expectedCodes>
-             <method>POST</method>
-             <uri>/cspace-services/dimensions/</uri>
-             <part>
-                 <label>dimensions_common</label>
-                 <filename>dimension/1.xml</filename>
-             </part>
-         </test>
+    <testGroup ID="dimensionCRUDGroup" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
+        <test ID="dimPOST" auth="admin@core.collectionspace.org">
+            <expectedCodes>201</expectedCodes>
+            <method>POST</method>
+            <uri>/cspace-services/dimensions/</uri>
+            <filename>dimension/1.xml</filename>
+        </test>
 
-        <test ID="dimGET"  auth="admin@core.collectionspace.org">
-            <!-- actually, this one should succeed since "test" is admin, but it fails now. -->
+        <test ID="dimGET" auth="admin@core.collectionspace.org">
             <method>GET</method>
             <uri>/cspace-services/dimensions/${dimPOST.CSID}</uri>
         </test>
 
-        <test ID="dimPUT"  auth="admin@core.collectionspace.org">
+        <test ID="dimPUT" auth="admin@core.collectionspace.org">
             <method>PUT</method>
             <uri>/cspace-services/dimensions/${dimPOST.CSID}</uri>
-            <part>
-                <label>dimensions_common</label>
-                <filename>dimension/2-put.xml</filename>
-            </part>
+            <filename>dimension/2-put.xml</filename>
         </test>
 
-        <test ID="dimGET2"  auth="admin@core.collectionspace.org">
+        <test ID="dimGET2" auth="admin@core.collectionspace.org">
             <method>GET</method>
             <uri>/cspace-services/dimensions/${dimPOST.CSID}</uri>
         </test>
-
-
-     </testGroup>
+    </testGroup>
 
 </xmlReplay>
-        
-        
index 2e9afdc0fb07716e4f63a3b8a73b3834678d65b1..787ad27ab59ab1eff1fae415cefd7b73a47b158f 100644 (file)
@@ -1,11 +1,8 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <document name="dimensions">
-       <ns2:dimensions_common
-       xmlns:ns2="http://collectionspace.org/services/dimension"
-       xmlns:ns3="http://collectionspace.org/services/jaxb">
-         <dimension>dimensionType-1288727556164</dimension>
-         <value>entryNumber-1288727556164</value>
-         <valueDate>entryDate-1288727556164</valueDate>
-       </ns2:dimensions_common>
+    <ns2:dimensions_common xmlns:ns2="http://collectionspace.org/services/dimension" xmlns:ns3="http://collectionspace.org/services/jaxb">
+        <dimension>dimensionType-1288727556164</dimension>
+        <value>entryNumber-1288727556164</value>
+        <valueDate>entryDate-1288727556164</valueDate>
+    </ns2:dimensions_common>
 </document>
-
index 04c2eb72559f64e8ae7155f877bb487d523424a8..0df70ffbb186ac38e8eb93d0a06e49fdffa35af2 100644 (file)
     <!-- These tests verify that updates to the computed current location values -->
     <!-- in CollectionObject records succeed, even in tenants where Movement -->
     <!-- records are configured to be versioned. See CSPACE-6171 for more details. -->    
-    <testGroup ID="updateObjectLocationOnMoveInVersioningEnabledTenant" autoDeletePOSTS="true">
+    <testGroup ID="updateObjectLocationOnMoveInVersioningEnabledTenant" autoDeletePOSTS="true" authForCleanup="admin@testsci.collectionspace.org">
 
         <test ID="createCollectionObjectInVersioningTenant" auth="admin@testsci.collectionspace.org">
             <method>POST</method>
index 7df8f2059bafd25248df3c0ab8d6abcfbe2d468a..c64b8fa6bcc1f4b4cd5dc6212c489c47a2b47151 100644 (file)
@@ -3,26 +3,16 @@
     <auths>
         <!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->
         <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
-        <auth ID="testAdministator">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>
     </auths>
-   
-    <testGroup ID="makeone" autoDeletePOSTS="false">
-       <test ID="ac1"  auth="test">
-             <method>POST</method>
-             <uri>/cspace-services/loansin/</uri>
-             <part>
-                 <label>loansin_common</label>
-                 <filename>loanin/li1.xml</filename>
-             </part>
-         </test>
-     </testGroup>       
-
-     <testGroup ID="cleanup" autoDeletePOSTS="true">
-         <test ID="ac1"  auth="test">
-             <method>DELETE</method>
-             <uri>/cspace-services/loansin/8080b6b8-393a-4e8a-b823</uri>
-         </test>
-     </testGroup>
-    
 
+    <testGroup ID="makeone" autoDeletePOSTS="true">
+        <test ID="ac1">
+            <method>POST</method>
+            <uri>/cspace-services/loansin/</uri>
+            <part>
+                <label>loansin_common</label>
+                <filename>loanin/li1.xml</filename>
+            </part>
+        </test>
+    </testGroup>
 </xmlReplay>
index ae9687d53d6b154d9592efb90c0b4cfe86650e57..41a39dfca3ff352041e30afceb412273b7d51780 100644 (file)
@@ -3,17 +3,14 @@
     <auths>
         <!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->
         <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
-        <auth ID="testAdministator">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>
     </auths>
-   
-    <testGroup ID="makeone" autoDeletePOSTS="false">
-         <test ID="loanout1"  auth="test">
-             <method>POST</method>
-             <uri>/cspace-services/loansout/</uri>
-             <filename>loanout/1.xml</filename>
-         </test>
+
+    <testGroup ID="makeone" autoDeletePOSTS="true">
+        <test ID="loanout1">
+            <method>POST</method>
+            <uri>/cspace-services/loansout/</uri>
+            <filename>loanout/1.xml</filename>
+        </test>
     </testGroup>
 
 </xmlReplay>
-        
-        
index 81eadadb08ec36fe8f7119c461b70b36c8b5c37c..244dbaeefc51c1f3874bf6cedfbeb62dddc7a4fb 100644 (file)
@@ -3,87 +3,85 @@
     <auths>
         <!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->
         <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
-        <auth ID="testAdministator">YWRtaW5AY29sbGVjdGlvbnNwYWNlLm9yZzpBZG1pbmlzdHJhdG9y</auth>
     </auths>
-   
+
     <!-- ============= authrefs ============================================== -->
     <!-- run this group with autoDeletePOSTS="false" and then you can hit
       http://nightly.collectionspace.org:8180/cspace-services/objectexit/
     then grab a CSID, and paste it in here:
       http://nightly.collectionspace.org:8180/cspace-services/objectexit/d781aed4-2e2c-45e2-ad8d/authorityrefs
     -->
-    <testGroup ID="authrefs" autoDeletePOSTS="false">
+    <testGroup ID="authrefs" autoDeletePOSTS="true">
         <test ID="oe9">
-         <method>POST</method>
-         <uri>/cspace-services/personauthorities/</uri>
-         <part>
-             <label>personauthorities_common</label>
-             <filename>objectexit/oe9.xml</filename>
-         </part>
-      </test>
-      <test ID="oe11">
-             <method>POST</method>
-             <uri>/cspace-services/personauthorities/${oe9.CSID}/items/</uri>
-             <part>
-                 <label>persons_common</label>
-                 <filename>objectexit/oe11.xml</filename>
-             </part>
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/</uri>
+            <filename>objectexit/oe9.xml</filename>
+        </test>
+        <test ID="oe11">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/${oe9.CSID}/items/</uri>
+            <filename>objectexit/oe11.xml</filename>
         </test>
         <test ID="oe15">
-             <method>POST</method>
-             <uri>/cspace-services/objectexit/</uri>
-             <part>
-                 <label>objectexit_common</label>
-                 <filename>objectexit/oe15.xml</filename>
-             </part>
+            <method>POST</method>
+            <uri>/cspace-services/objectexit/</uri>
+            <filename>objectexit/oe15.xml</filename>
+        </test>
+        <test ID="listAuthRefs">
+            <method>GET</method>
+            <uri>/cspace-services/objectexit/${oe15.CSID}/authorityrefs</uri>
+            <response>
+                <expected level="ADDOK"></expected>
+                <filename>objectexit/res/authrefs-listAuthrefs.res.xml</filename>
+            </response>
         </test>
     </testGroup>
-     
+
     <testGroup ID="makeone" autoDeletePOSTS="false">
-         <test ID="oe1"  auth="test">
-             <method>POST</method>
-             <uri>/cspace-services/objectexit/</uri>
-             <filename>objectexit/oe1.xml</filename>
-         </test>
+        <test ID="oe1">
+            <method>POST</method>
+            <uri>/cspace-services/objectexit/</uri>
+            <filename>objectexit/oe1.xml</filename>
+        </test>
         <test ID="oe2">
             <method>GET</method>
             <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
             <response>
-                <expected level="ADDOK" />
+                <expected level="ADDOK"></expected>
                 <filename>objectexit/res/oe2.res.xml</filename>
                 <label>objectexit_common</label>
-             </response>
+            </response>
+        </test>
+        <test ID="cleanup">
+            <method>DELETE</method>
+            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
         </test>
-         <test ID="cleanup"  auth="test">
-             <method>DELETE</method>
-             <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
-         </test>               
     </testGroup>
-    
+
     <testGroup ID="testStartName" autoDeletePOSTS="false">
-         <test ID="oe1x"  auth="test">
-             <method>POST</method>
-             <uri>/cspace-services/objectexit/</uri>
-             <filename>objectexit/oe1.xml</filename>
-         </test>
+        <test ID="oe1x">
+            <method>POST</method>
+            <uri>/cspace-services/objectexit/</uri>
+            <filename>objectexit/oe1.xml</filename>
+        </test>
         <test ID="oe2x">
             <method>GET</method>
             <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
             <response>
-                <expected level="ADDOK" />
+                <expected level="ADDOK"></expected>
                 <filename>objectexit/res/oe2.res.xml</filename>
                 <!-- startElement wins over partName.  partName adorns the partName with /document/*[local-name()='$partName']  where $partName is the element value. -->
                 <startElement>/document/*[local-name()='objectexit_common']</startElement>
-             </response>
+            </response>
         </test>
     </testGroup>
-    
+
     <testGroup ID="checkList" autoDeletePOSTS="true">
-        <test ID="oe35"  auth="test">
-             <method>POST</method>
-             <uri>/cspace-services/objectexit/</uri>
-             <vars>
-               <var ID="exitNumber">checkList-1234</var>
+        <test ID="oe35">
+            <method>POST</method>
+            <uri>/cspace-services/objectexit/</uri>
+            <vars>
+                <var ID="exitNumber">checkList-1234</var>
             </vars>
             <filename>objectexit/oe35.xml</filename>
         </test>
             <method>GET</method>
             <uri>/cspace-services/objectexit/</uri>
             <response>
-                <expected level="ADDOK" />
+                <expected level="ADDOK"></expected>
                 <filename>objectexit/res/oe35.res.xml</filename>
                 <vars>
-                 <var ID="targetCSID">${oe35.CSID}</var>
-               </vars>
+                    <var ID="targetCSID">${oe35.CSID}</var>
+                </vars>
                 <!--
                    Look for one <list-item> with the <exitNumber> that
                     we set in the POST, and see if it is in the response
                 -->
                 <startElement>//list-item[./exitNumber='checkList-1234']</startElement>
-             </response>
+            </response>
         </test>
     </testGroup>
 
     <testGroup ID="cleanup" autoDeletePOSTS="true">
-         <test ID="oe1"  auth="test">
-             <method>DELETE</method>
-             <uri>/cspace-services/objectexit/065aa56e-a4f5-44b7-955e</uri>
-         </test>
-         <test ID="oe1"  auth="test">
-             <method>DELETE</method>
-             <uri>/cspace-services/objectexit/1735327c-f9bb-42c7-959b</uri>
-         </test>
-         <test ID="oe1"  auth="test">
-             <method>DELETE</method>
-             <uri>/cspace-services/objectexit/106cb53d-ee79-44e3-8665</uri>
-         </test>
+        <test ID="oe1">
+            <method>DELETE</method>
+            <uri>/cspace-services/objectexit/065aa56e-a4f5-44b7-955e</uri>
+        </test>
+        <test ID="oe1">
+            <method>DELETE</method>
+            <uri>/cspace-services/objectexit/1735327c-f9bb-42c7-959b</uri>
+        </test>
+        <test ID="oe1">
+            <method>DELETE</method>
+            <uri>/cspace-services/objectexit/106cb53d-ee79-44e3-8665</uri>
+        </test>
     </testGroup>
-    
+
     <testGroup ID="domwalk" autoDeletePOSTS="false">
-         <test ID="oe1"  auth="test">
-             <method>POST</method>
-             <uri>/cspace-services/objectexit/</uri>
-             <part>
-                 <label>objectexit_common</label>
-                 <filename>objectexit/oe1.xml</filename>
-             </part>
-         </test>
+        <test ID="oe1">
+            <method>POST</method>
+            <uri>/cspace-services/objectexit/</uri>
+            <part>
+                <label>objectexit_common</label>
+                <filename>objectexit/oe1.xml</filename>
+            </part>
+        </test>
         <test ID="oe2">
             <method>GET</method>
             <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
             <response>
-                <expected level="TEXT" />
+                <expected level="TEXT"></expected>
                 <label>objectexit_common</label>
                 <filename>objectexit/res/oe2.res.xml</filename>
-             </response>
+            </response>
         </test>
     </testGroup>
 
 
 
     <testGroup ID="repeat" autoDeletePOSTS="true">
-        <test ID="oeRepeat"  auth="admin@core.collectionspace.org">
+        <test ID="oeRepeat" auth="admin@core.collectionspace.org">
             <method>POST</method>
             <uri>/cspace-services/objectexit/</uri>
             <part>
 
     <!-- ================================================================================ -->
 
-     <testGroup ID="CRUDL" autoDeletePOSTS="true">
-         <test ID="oe1"  auth="admin@core.collectionspace.org">
-             <method>POST</method>
-             <uri>/cspace-services/objectexit/</uri>
-             <part>
-                 <label>objectexit_common</label>
-                 <filename>objectexit/oe1.xml</filename>
-             </part>
-         </test>
+    <testGroup ID="CRUDL" autoDeletePOSTS="true">
+        <test ID="oe1" auth="admin@core.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/objectexit/</uri>
+            <part>
+                <label>objectexit_common</label>
+                <filename>objectexit/oe1.xml</filename>
+            </part>
+        </test>
         <test ID="oe2">
             <method>GET</method>
             <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
             <response>
                 <label>objectexit_common</label>
                 <filename>objectexit/res/oe2.res.xml</filename>
-             </response>
+            </response>
         </test>
         <test ID="oe3">
-             <method>POST</method>
-             <uri>/cspace-services/objectexit/</uri>
-             <part>
-                 <label>objectexit_common</label>
-                 <filename>objectexit/oe3.xml</filename>
-             </part>
-         </test>
+            <method>POST</method>
+            <uri>/cspace-services/objectexit/</uri>
+            <part>
+                <label>objectexit_common</label>
+                <filename>objectexit/oe3.xml</filename>
+            </part>
+        </test>
         <test ID="oe4">
-             <method>POST</method>
-             <uri>/cspace-services/objectexit/</uri>
-             <part>
-                 <label>objectexit_common</label>
-                 <filename>objectexit/oe4.xml</filename>
-             </part>
-         </test>
-         <test ID="oe5">
-             <method>POST</method>
-             <uri>/cspace-services/objectexit/</uri>
-             <part>
-                 <label>objectexit_common</label>
-                 <filename>objectexit/oe5.xml</filename>
-             </part>
-         </test>
-         <!--
+            <method>POST</method>
+            <uri>/cspace-services/objectexit/</uri>
+            <part>
+                <label>objectexit_common</label>
+                <filename>objectexit/oe4.xml</filename>
+            </part>
+        </test>
+        <test ID="oe5">
+            <method>POST</method>
+            <uri>/cspace-services/objectexit/</uri>
+            <part>
+                <label>objectexit_common</label>
+                <filename>objectexit/oe5.xml</filename>
+            </part>
+        </test>
+        <!--
          <test ID="oe6">
             <method>GET</method>
             <uri>/cspace-services/objectexit/</uri>
                 <filename>objectexit/res/oe6.res.xml</filename>
              </response>
          -->
-            <!-- response>oe6.res.xml</response -->
-            <!--response elements will need parts, too, e.g. personauthorities_common -->
-            <!-- inside oe6.res.xml, there is a CSID which will change every time, and should be ref'd as 6f7a1e3e-5821-4ef2-bfcf ==> ${oe1.CSID} -->
+        <!-- response>oe6.res.xml</response -->
+        <!--response elements will need parts, too, e.g. personauthorities_common -->
+        <!-- inside oe6.res.xml, there is a CSID which will change every time, and should be ref'd as 6f7a1e3e-5821-4ef2-bfcf ==> ${oe1.CSID} -->
         <!--
         </test>
          -->
-         <test ID="oe7">
+        <test ID="oe7">
             <method>GET</method>
             <uri>/cspace-services/objectexit/9223372036854775807</uri>
             <expectedCodes>404</expectedCodes>
             <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
             <reponse>oe8.res.xml</reponse>
         </test>
-         <test ID="oe9">
-             <method>POST</method>
-             <uri>/cspace-services/personauthorities/</uri>
-             <part>
-                 <label>personauthorities_common</label>
-                 <filename>objectexit/oe9.xml</filename>
-             </part>
-         </test>
-         <test ID="oe10">
+        <test ID="oe9">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/</uri>
+            <part>
+                <label>personauthorities_common</label>
+                <filename>objectexit/oe9.xml</filename>
+            </part>
+        </test>
+        <test ID="oe10">
             <method>GET</method>
             <uri>/cspace-services/personauthorities/${oe9.CSID}</uri>
         </test>
-       
+
         <test ID="oe11">
-             <method>POST</method>
-             <uri>/cspace-services/personauthorities/${oe9.CSID}/items/</uri>
-             <part>
-                 <label>persons_common</label>
-                 <filename>objectexit/oe11.xml</filename>
-             </part>
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/${oe9.CSID}/items/</uri>
+            <part>
+                <label>persons_common</label>
+                <filename>objectexit/oe11.xml</filename>
+            </part>
         </test>
         <test ID="oe12">
             <method>GET</method>
             <uri>/cspace-services/personauthorities/${oe9.CSID}/items/${oe11.CSID}</uri>
         </test>
         <test ID="oe13">
-             <method>POST</method>
-             <uri>/cspace-services/personauthorities/${oe9.CSID}/items/</uri>
-             <part>
-                 <label>persons_common</label>
-                 <filename>objectexit/oe13.xml</filename>
-             </part>
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/${oe9.CSID}/items/</uri>
+            <part>
+                <label>persons_common</label>
+                <filename>objectexit/oe13.xml</filename>
+            </part>
         </test>
         <test ID="oe14">
             <method>GET</method>
             <uri>/cspace-services/personauthorities/${oe11.CSID}/items/${oe13.CSID}</uri>
         </test>
         <test ID="oe15">
-             <method>POST</method>
-             <uri>/cspace-services/objectexit/</uri>
-             <part>
-                 <label>objectexit_common</label>
-                 <filename>objectexit/oe15.xml</filename>
-             </part>
+            <method>POST</method>
+            <uri>/cspace-services/objectexit/</uri>
+            <part>
+                <label>objectexit_common</label>
+                <filename>objectexit/oe15.xml</filename>
+            </part>
         </test>
         <test ID="oe16">
             <method>GET</method>
             <method>DELETE</method>
             <uri>/cspace-services/personauthorities/${oe9.CSID}/items/${oe11.CSID}</uri>
         </test>
+
         <test ID="oe19">
             <method>DELETE</method>
             <uri>/cspace-services/personauthorities/${oe9.CSID}/items/${oe13.CSID}</uri>
             <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
         </test>
         <test ID="oe23">
-             <method>PUT</method>
-             <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
-             <part>
-                 <label>objectexit_common</label>
-                 <filename>objectexit/oe23.xml</filename>
-             </part>
+            <method>PUT</method>
+            <uri>/cspace-services/objectexit/${oe1.CSID}</uri>
+            <part>
+                <label>objectexit_common</label>
+                <filename>objectexit/oe23.xml</filename>
+            </part>
         </test>
         <test ID="oe24">
             <method>DELETE</method>
             <uri>/cspace-services/objectexit/9223372036854775807</uri>
             <expectedCodes>404</expectedCodes>
         </test>
-       <test ID="oe26">
-             <method>PUT</method>
-             <uri>/cspace-services/objectexit/9223372036854775807</uri>
-             <part>
-                 <label>objectexit_common</label>
-                 <filename>objectexit/oe23.xml</filename><!-- won't be found, so just re-using older post file as payload.-->
-             </part>
-             <expectedCodes>404</expectedCodes>
+        <test ID="oe26">
+            <method>PUT</method>
+            <uri>/cspace-services/objectexit/9223372036854775807</uri>
+            <part>
+                <label>objectexit_common</label>
+                <filename>objectexit/oe23.xml</filename>
+                <!-- won't be found, so just re-using older post file as payload.-->
+            </part>
+            <expectedCodes>404</expectedCodes>
         </test>
         <test ID="oe27">
             <method>GET</method>
             <uri>/cspace-services/objectexit/${oe5.CSID}</uri>
         </test>
 
-     </testGroup>
+    </testGroup>
 
     <!-- =========== domlist Walk a DOM ================================================ -->
 
     <testGroup ID="domlist" autoDeletePOSTS="true">
-         <test ID="oe1"  auth="admin@core.collectionspace.org">
-             <method>POST</method>
-             <uri>/cspace-services/objectexit/</uri>
-             <part>
-                 <label>objectexit_common</label>
-                 <filename>objectexit/oe1.xml</filename>
-             </part>
-         </test>
+        <test ID="oe1" auth="admin@core.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/objectexit/</uri>
+            <part>
+                <label>objectexit_common</label>
+                <filename>objectexit/oe1.xml</filename>
+            </part>
+        </test>
         <test ID="oe3">
-             <method>POST</method>
-             <uri>/cspace-services/objectexit/</uri>
-             <part>
-                 <label>objectexit_common</label>
-                 <filename>objectexit/oe3.xml</filename>
-             </part>
-         </test>
+            <method>POST</method>
+            <uri>/cspace-services/objectexit/</uri>
+            <part>
+                <label>objectexit_common</label>
+                <filename>objectexit/oe3.xml</filename>
+            </part>
+        </test>
         <test ID="oe4">
-             <method>POST</method>
-             <uri>/cspace-services/objectexit/</uri>
-             <part>
-                 <label>objectexit_common</label>
-                 <filename>objectexit/oe4.xml</filename>
-             </part>
-         </test>
-         <test ID="oe5">
-             <method>POST</method>
-             <uri>/cspace-services/objectexit/</uri>
-             <part>
-                 <label>objectexit_common</label>
-                 <filename>objectexit/oe5.xml</filename>
-             </part>
-         </test>
-         <test ID="oe6">
+            <method>POST</method>
+            <uri>/cspace-services/objectexit/</uri>
+            <part>
+                <label>objectexit_common</label>
+                <filename>objectexit/oe4.xml</filename>
+            </part>
+        </test>
+        <test ID="oe5">
+            <method>POST</method>
+            <uri>/cspace-services/objectexit/</uri>
+            <part>
+                <label>objectexit_common</label>
+                <filename>objectexit/oe5.xml</filename>
+            </part>
+        </test>
+        <test ID="oe6">
             <method>GET</method>
             <uri>/cspace-services/objectexit/</uri>
             <response>
-                <expected level="TEXT" />
+                <expected level="TEXT"></expected>
                 <filename>objectexit/res/oe6.res.xml</filename>
-             </response>
+            </response>
         </test>
     </testGroup>
-    
+
 
 </xmlReplay>
-        
-        
index 2b55fdd122fda2677fcebfa6a0bda145a29913e7..955f11e0118a5c49c10aa9f2ed9dc1ab75f5b240 100644 (file)
@@ -1,2 +1,17 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb"><inAuthority>7f441679-ab83-4832-85f9</inAuthority><shortIdentifier>owenCurOwner</shortIdentifier><refName>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(owenCurOwner)</refName><displayNameComputed>true</displayNameComputed><shortDisplayNameComputed>true</shortDisplayNameComputed><foreName>Owen the Cur</foreName><surName>Owner</surName></ns2:persons_common>
-
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="persons">
+    <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">
+        <shortIdentifier>owenCurOwner</shortIdentifier>
+        <foreName>Owen the oe11</foreName>
+        <surName>Owneroe11</surName>
+        <personTermGroupList>
+            <personTermGroup>
+                <termName>John Wayneoe11</termName>
+                <termPrefForLang>false</termPrefForLang>
+                <termDisplayName>John Wayneoe11</termDisplayName>
+                <foreName>oe11forename</foreName>
+                <surName>oe11surname</surName>
+            </personTermGroup>
+        </personTermGroupList>
+    </ns2:persons_common>
+</document>
index 3c358d87a3b279e4241177081fdb865bfd5b94eb..aba0de97a4e35aab30e3c05f17b15220effc278d 100644 (file)
@@ -1,2 +1,8 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:ns3="http://collectionspace.org/services/jaxb"><depositor>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor)</depositor><exitDate>exitDate-1290026474563</exitDate><exitNumber>exitNumber-1290026474563</exitNumber></ns2:objectexit_common>
-
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="objectexit">
+    <ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:ns3="http://collectionspace.org/services/jaxb">
+        <depositor>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor)</depositor>
+        <exitDate>exitDate-1290026474563</exitDate>
+        <exitNumber>exitNumber-1290026474563</exitNumber>
+    </ns2:objectexit_common>
+</document>
index 41fbedd9a14b5cb03f43a286d3a97e7aa6eadd5a..ca8c61e8e00e43675b2563e829681d437f111fc8 100644 (file)
@@ -1,2 +1,7 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:personauthorities_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb"><displayName>ObjectexitPersonAuth</displayName><shortIdentifier>ObjectexitPersonAuth</shortIdentifier><refName>urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth'</refName><vocabType>PersonAuthority</vocabType></ns2:personauthorities_common>
-
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="persons">
+    <ns2:personauthorities_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">
+        <displayName>ObjectexitPersonAuth</displayName>
+        <shortIdentifier>ObjectexitPersonAuth</shortIdentifier>
+    </ns2:personauthorities_common>
+</document>
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/authrefs-listAuthrefs.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/authrefs-listAuthrefs.res.xml
new file mode 100644 (file)
index 0000000..bc55d96
--- /dev/null
@@ -0,0 +1,16 @@
+<ns3:authority-ref-list xmlns:ns2="http://collectionspace.org/services/jaxb" xmlns:ns3="http://collectionspace.org/services/common/authorityref">
+    <pageNum>0</pageNum>
+    <pageSize>40</pageSize>
+    <itemsInPage>1</itemsInPage>
+    <totalItems>1</totalItems>
+    <authority-ref-item>
+        <sourceField>objectexit_common:depositor</sourceField>
+        <refName>
+            urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor)
+        </refName>
+        <authDisplayName>ObjectexitPersonAuth</authDisplayName>
+        <uri>
+            /personauthorities/urn:cspace:name(ObjectexitPersonAuth)/items/urn:cspace:name(davenportDepositor)
+        </uri>
+    </authority-ref-item>
+</ns3:authority-ref-list>
\ No newline at end of file
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/generic_persons_common_delete_all_relations_PUT.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/generic_persons_common_delete_all_relations_PUT.xml
new file mode 100644 (file)
index 0000000..c43a764
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="persons">
+    <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">
+        <!-- Delete all existing relationships. -->
+    </ns3:relations-common-list>
+</document>
index 6ff2193ae7d15ab414b8a35ee798bdb287c7cf7f..e0c664ef1fea57f0841847f5debc7f6414e9286e 100644 (file)
@@ -1,16 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xmlReplay>
-    <!-- 
+    <!--
          testGroup ID="person" is not live.  It works, but may not clean up correctly. 
          For now, use ID="updatePerson"
     -->
-    <testGroup ID="person" autoDeletePOSTS="true">
+    <testGroup ID="person" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
         <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
             <method>POST</method>
             <uri>/cspace-services/personauthorities/</uri>
             <filename>person/personauthorities_common.xml</filename>
             <vars>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
             </vars>
         </test>
         <test ID="Person1">
             <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
             <filename>person/persons_common.xml</filename>
             <vars>
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
-               <var ID="shortIdentifier">johnWayneActor1</var>
+                <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="shortIdentifier">johnWayneActor1</var>
+                <var ID="termDisplayNameSuffix">actor1</var>
             </vars>
         </test>
         <test ID="Person2">
             <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
             <filename>person/persons_common.xml</filename>
             <vars>
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
-               <var ID="shortIdentifier">johnWayneActor2</var>
+                <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="shortIdentifier">johnWayneActor2</var>
+                <var ID="termDisplayNameSuffix">actor2</var>
             </vars>
         </test>
         <test>
             <method>GET</method>
             <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)</uri>
         </test>
-        
         <test>
             <method>GET</method>
             <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>
             <method>GET</method>
             <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
         </test>
-        
-        <test ID="relatePersons"  auth="test">
-             <method>POST</method>
-             <uri>/cspace-services/relations/</uri>
-             <filename>relation/r-1.xml</filename>
-             <vars>
+        <test ID="relatePersons">
+            <method>POST</method>
+            <uri>/cspace-services/relations/</uri>
+            <filename>relation/r-1.xml</filename>
+            <vars>
                 <var ID="subjectCsid">${Person1.CSID}</var>
                 <var ID="objectCsid">${Person2.CSID}</var>
                 <var ID="subjectDocumentType">Persons</var>
                 <var ID="objectDocumentType">Persons</var>
                 <var ID="relationshipType">hasBroader</var>
-             </vars>
-        </test>
-        
-        <test ID="relatePersonsInverse"  auth="test">
-             <method>POST</method>
-             <uri>/cspace-services/relations/</uri>
-             <filename>relation/r-1.xml</filename>
-             <vars>
-             <!-- Person2 and Person1 are switched in this record. 
+            </vars>
+        </test>
+        <test ID="relatePersonsInverse">
+            <method>POST</method>
+            <uri>/cspace-services/relations/</uri>
+            <filename>relation/r-1.xml</filename>
+            <vars>
+                <!-- Person2 and Person1 are switched in this record. 
                   Ultimately we don't want any hasNarrower actually stored.
              -->
                 <var ID="subjectCsid">${Person2.CSID}</var>
                 <var ID="subjectDocumentType">Persons</var>
                 <var ID="objectDocumentType">Persons</var>
                 <var ID="relationshipType">hasNarrower</var>
-             </vars>
-         </test>
-        
-   </testGroup>
-   
-   <testGroup ID="addOnePerson" autoDeletePOSTS="false">
+            </vars>
+        </test>
+    </testGroup>
+    
+    <testGroup ID="addOnePerson" autoDeletePOSTS="false">
         <test ID="Person1">
+            <expectedCodes>404</expectedCodes>
             <method>POST</method>
             <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
             <filename>person/persons_common_w_relations.xml</filename>
             <vars>
-               <!--<var ID="inAuthority">${PersonAuth1.CSID}</var>-->
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
             </vars>
         </test>
-        
-       </testGroup>
-       
-       <testGroup ID="updatePerson" autoDeletePOSTS="true">
-           <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
+    </testGroup>
+    <testGroup ID="updatePerson" autoDeletePOSTS="true">
+        <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
             <method>POST</method>
             <uri>/cspace-services/personauthorities/</uri>
             <filename>person/personauthorities_common.xml</filename>
             <vars>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
             </vars>
         </test>
-        
         <test ID="Person1">
             <method>POST</method>
             <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
             <filename>person/persons_common.xml</filename>
             <vars>
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
-               <var ID="shortIdentifier">johnWayneActor</var>
+                <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="shortIdentifier">johnWayneActor</var>
             </vars>
         </test>
-        
         <test ID="PersonParent">
             <method>POST</method>
             <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
             <filename>person/persons_common.xml</filename>
             <vars>
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
-               <var ID="shortIdentifier">johnWayneActorParent</var>
+                <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="shortIdentifier">johnWayneActorParent</var>
             </vars>
         </test>
-        
         <test ID="PersonChild">
             <method>POST</method>
             <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
             <filename>person/persons_common.xml</filename>
             <vars>
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
-               <var ID="shortIdentifier">johnWayneActorChild</var>
+                <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="shortIdentifier">johnWayneActorChild</var>
             </vars>
         </test>
-        
         <test ID="PersonChild2">
             <method>POST</method>
             <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
             <filename>person/persons_common.xml</filename>
             <vars>
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
-               <var ID="shortIdentifier">johnWayneActorChild2</var>
+                <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="shortIdentifier">johnWayneActorChild2</var>
             </vars>
         </test>
-        
-        
-           <test ID="PersonPUT_1p2c">
+        <test ID="PersonPUT_1p2c">
             <method>PUT</method>
             <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
             <filename>person/persons_common_w_relations.xml</filename>
             <vars>
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
-               <var ID="shortIdentifier">johnWayneActor</var>
-               <var ID="myCSID">${Person1.CSID}</var>
-               <var ID="parentCSID">${PersonParent.CSID}</var>
-               <var ID="childCSID">${PersonChild.CSID}</var>
+                <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="shortIdentifier">johnWayneActor</var>
+                <var ID="myCSID">${Person1.CSID}</var>
+                <var ID="parentCSID">${PersonParent.CSID}</var>
+                <var ID="childCSID">${PersonChild.CSID}</var>
             </vars>
         </test>
-        
         <test ID="GETPersonPUT_1p2c">
             <method>GET</method>
             <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>
         </test>
-        
         <test ID="GETPersonPUT_siblings">
             <method>GET</method>
             <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${PersonChild.CSID}?showSiblings=true</uri>
         </test>
-         
-        
-           <test ID="PersonPUT_1p">
+        <test ID="PersonPUT_1p">
             <method>PUT</method>
             <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
             <filename>person/persons_common_w_relations_2.xml</filename>
             <vars>
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
-               <var ID="shortIdentifier">johnWayneActor</var>
-               <var ID="myCSID">${Person1.CSID}</var>
-               <var ID="parentCSID">${PersonParent.CSID}</var>
+                <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="shortIdentifier">johnWayneActor</var>
+                <var ID="myCSID">${Person1.CSID}</var>
+                <var ID="parentCSID">${PersonParent.CSID}</var>
             </vars>
         </test>
-        
         <test ID="GETPersonPUT_1p">
             <method>GET</method>
             <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>
         </test>
-        
-      
         <test ID="PersonPUT_1p1c">
             <method>PUT</method>
             <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
             <filename>person/persons_common_w_relations.xml</filename>
             <vars>
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
-               <var ID="shortIdentifier">johnWayneActor</var>
-               <var ID="myCSID">${Person1.CSID}</var>
-               <var ID="parentCSID">${PersonParent.CSID}</var>
-               <var ID="childCSID">${PersonChild.CSID}</var>
+                <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="shortIdentifier">johnWayneActor</var>
+                <var ID="myCSID">${Person1.CSID}</var>
+                <var ID="parentCSID">${PersonParent.CSID}</var>
+                <var ID="childCSID">${PersonChild.CSID}</var>
             </vars>
         </test>
-        
         <test ID="GETPersonPUT_1p1c">
             <method>GET</method>
             <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>
         </test>
-      
-           <test ID="PersonPUT_2c">
+        <test ID="PersonPUT_2c">
             <method>PUT</method>
             <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
             <filename>person/persons_common_w_relations_3.xml</filename>
             <vars>
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
-               <var ID="shortIdentifier">johnWayneActor</var>
-               <var ID="myCSID">${Person1.CSID}</var>
-               <var ID="childCSID">${PersonChild.CSID}</var>
-               <var ID="child2CSID">${PersonChild2.CSID}</var>
+                <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="shortIdentifier">johnWayneActor</var>
+                <var ID="myCSID">${Person1.CSID}</var>
+                <var ID="childCSID">${PersonChild.CSID}</var>
+                <var ID="child2CSID">${PersonChild2.CSID}</var>
             </vars>
         </test>
-        
         <test ID="GETPersonPUT_2c">
             <method>GET</method>
             <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>
         </test>
-       </testGroup>
-       
-       !-- ========================= POST a person ===================================================== -->
-       
-       <testGroup ID="postPerson" autoDeletePOSTS="true">
-           <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
+        <test ID="Person1DeleteAllRels">
+            <method>PUT</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
+            <filename>person/generic_persons_common_delete_all_relations_PUT.xml</filename>
+        </test>
+    </testGroup>
+
+    <!-- ========================= POST a person ===================================================== -->
+    <testGroup ID="postPerson" autoDeletePOSTS="true">
+        <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
             <method>POST</method>
             <uri>/cspace-services/personauthorities/</uri>
             <filename>person/personauthorities_common.xml</filename>
             <vars>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
             </vars>
         </test>
-        
         <test ID="PersonParent">
             <method>POST</method>
             <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
             <filename>person/persons_common.xml</filename>
             <vars>
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
-               <var ID="shortIdentifier">johnWayneActorParent</var>
+                <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="shortIdentifier">johnWayneActorParent</var>
             </vars>
         </test>
-        
         <test ID="PersonChild">
             <method>POST</method>
             <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
             <filename>person/persons_common.xml</filename>
             <vars>
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
-               <var ID="shortIdentifier">johnWayneActorChild</var>
-               <var ID="termDisplayNameSuffix">actorChild1</var>
+                <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="shortIdentifier">johnWayneActorChild</var>
+                <var ID="termDisplayNameSuffix">actorChild1</var>
             </vars>
         </test>
-        
         <test ID="PersonChild2">
             <method>POST</method>
             <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
             <filename>person/persons_common.xml</filename>
             <vars>
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
-               <var ID="shortIdentifier">johnWayneActorChild2</var>
-               <var ID="termDisplayNameSuffix">actorChild2</var>
+                <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="shortIdentifier">johnWayneActorChild2</var>
+                <var ID="termDisplayNameSuffix">actorChild2</var>
             </vars>
         </test>
-        
         <test ID="PersonChild3">
             <method>POST</method>
             <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
             <filename>person/persons_common.xml</filename>
             <vars>
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
-               <var ID="shortIdentifier">johnWayneActorChild3</var>
-               <var ID="termDisplayNameSuffix">actorChild3</var>
+                <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="shortIdentifier">johnWayneActorChild3</var>
+                <var ID="termDisplayNameSuffix">actorChild3</var>
             </vars>
         </test>
-        
         <test ID="Person1">
             <method>POST</method>
             <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
             <filename>person/persons_common_w_relations_POST.xml</filename>
             <vars>
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
-               <var ID="shortIdentifier">johnWayneActor</var>
-               <!--var ID="targetCSID">${itemCSID}</var-->
-               <var ID="parentCSID">${PersonParent.CSID}</var>
-               <var ID="parentUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonParent.CSID}</var>
-               <var ID="childCSID">${PersonChild.CSID}</var>
-               <var ID="childUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID}</var>
-               <var ID="child2CSID">${PersonChild2.CSID}</var>
-               <var ID="child2Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild2.CSID}</var>
-               <var ID="child3CSID">${PersonChild3.CSID}</var>
-               <var ID="child3Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild3.CSID}</var>
+                <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="shortIdentifier">johnWayneActor</var>
+                <!--var ID="targetCSID">${itemCSID}</var-->
+                <var ID="parentCSID">${PersonParent.CSID}</var>
+                <var ID="parentUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonParent.CSID}</var>
+                <var ID="childCSID">${PersonChild.CSID}</var>
+                <var ID="childUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID}</var>
+                <var ID="child2CSID">${PersonChild2.CSID}</var>
+                <var ID="child2Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild2.CSID}</var>
+                <var ID="child3CSID">${PersonChild3.CSID}</var>
+                <var ID="child3Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild3.CSID}</var>
             </vars>
         </test>
-        
-           <test ID="GETpostPerson">
+        <test ID="GETpostPerson">
             <method>GET</method>
             <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>
         </test>
-        
         <test ID="GETpostPerson_siblings">
             <method>GET</method>
             <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${PersonChild.CSID}?showSiblings=true</uri>
             <response>
-                               <expected level="ADDOK" />
-                               <filename>person/res/GETpostPerson_siblings.res.xml</filename>
-                               <vars>
-                                       <var ID="personCSID">${Person1.CSID}</var>
-                                       <var ID="childCSID">${PersonChild.CSID}</var>
-                                       <var ID="child2CSID">${PersonChild2.CSID}</var>
-                                       <var ID="child3CSID">${PersonChild3.CSID}</var>
-                                       <var ID="termDisplayNameSuffix2">${PersonChild2.termDisplayNameSuffix}</var>
-                                       <var ID="termDisplayNameSuffix3">${PersonChild3.termDisplayNameSuffix}</var>
-                               </vars>
-                               <startElement>/document/*[local-name()='relations-common-list']</startElement>
-                </response>
-               </test>
-        
+                <expected level="ADDOK"></expected>
+                <filename>person/res/GETpostPerson_siblings.res.xml</filename>
+                <vars>
+                    <var ID="personCSID">${Person1.CSID}</var>
+                    <var ID="childCSID">${PersonChild.CSID}</var>
+                    <var ID="child2CSID">${PersonChild2.CSID}</var>
+                    <var ID="child3CSID">${PersonChild3.CSID}</var>
+                    <var ID="termDisplayNameSuffix2">${PersonChild2.termDisplayNameSuffix}</var>
+                    <var ID="termDisplayNameSuffix3">${PersonChild3.termDisplayNameSuffix}</var>
+                </vars>
+                <startElement>/document/*[local-name()='relations-common-list']</startElement>
+            </response>
+        </test>
         <test ID="GETpostPerson_allRelations">
             <method>GET</method>
             <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showAllRelations=true</uri>
             <response>
-                               <expected level="ADDOK" />
-                               <filename>person/res/showAllRelations.res.xml</filename>
-                               <!-- NOTE: vars are referenced in showAllRelations.res.xml
+                <expected level="ADDOK"></expected>
+                <filename>person/res/showAllRelations.res.xml</filename>
+                <!-- NOTE: vars are referenced in showAllRelations.res.xml
                                     from tests in this test group, e.g. 
                                     PersonParent.CSID :: ${PersonParent.CSID} 
                                     These vars are all in the expression context while this group is active,
                                     because we hang onto all ServiceResult objects for the duration of the group,
                                     and ServiceObjects keep their vars.
                                -->
-                               <startElement>/document/*[local-name()='relations-common-list']</startElement>
-                        </response>
-                        
-               </test>
-               
-         <test ID="relationsGET">
-             <method>GET</method>
-             <uri>/cspace-services/relations/</uri>
-         </test>
-         
-         <test ID="relations_sbj">
-             <method>GET</method>
-             <uri>/cspace-services/relations?sbj=${PersonAuth1.CSID}</uri>
-         </test>
-         
-         <test ID="relations_obj">
-             <method>GET</method>
-             <uri>/cspace-services/relations?obj=${PersonAuth1.CSID}</uri>
-         </test>
-        
-       </testGroup>
-       
-       <testGroup ID="PersonAddRelsDeleteRels" autoDeletePOSTS="true">
-           <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
+                <startElement>/document/*[local-name()='relations-common-list']</startElement>
+            </response>
+        </test>
+        <test ID="relationsGET">
+            <method>GET</method>
+            <uri>/cspace-services/relations/</uri>
+        </test>
+        <test ID="relations_sbj">
+            <method>GET</method>
+            <uri>/cspace-services/relations?sbj=${PersonAuth1.CSID}</uri>
+        </test>
+        <test ID="relations_obj">
+            <method>GET</method>
+            <uri>/cspace-services/relations?obj=${PersonAuth1.CSID}</uri>
+        </test>
+        <test ID="Person1DeleteAllRels">
+            <method>PUT</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
+            <filename>person/generic_persons_common_delete_all_relations_PUT.xml</filename>
+        </test>
+    </testGroup>
+    <testGroup ID="PersonAddRelsDeleteRels" autoDeletePOSTS="true">
+        <test ID="PersonAuth1" auth="admin@core.collectionspace.org">
             <method>POST</method>
             <uri>/cspace-services/personauthorities/</uri>
             <filename>person/personauthorities_common.xml</filename>
             <vars>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
             </vars>
         </test>
-        
         <test ID="PersonParent">
             <method>POST</method>
             <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
             <filename>person/persons_common.xml</filename>
             <vars>
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
-               <var ID="shortIdentifier">johnWayneActorParent</var>
+                <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="shortIdentifier">johnWayneActorParent</var>
             </vars>
         </test>
-
-        
         <test ID="PersonChild">
             <method>POST</method>
             <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
             <filename>person/persons_common.xml</filename>
             <vars>
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
-               <var ID="shortIdentifier">johnWayneActorChild</var>
+                <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="shortIdentifier">johnWayneActorChild</var>
             </vars>
         </test>
-        
         <test ID="PersonChild2">
             <method>POST</method>
             <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
             <filename>person/persons_common.xml</filename>
             <vars>
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
-               <var ID="shortIdentifier">johnWayneActorChild2</var>
+                <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="shortIdentifier">johnWayneActorChild2</var>
             </vars>
         </test>
-        
         <test ID="PersonChild3">
             <method>POST</method>
             <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
             <filename>person/persons_common.xml</filename>
             <vars>
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
-               <var ID="shortIdentifier">johnWayneActorChild3</var>
+                <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="shortIdentifier">johnWayneActorChild3</var>
             </vars>
         </test>
-        
-        
         <test ID="Person1">
             <method>POST</method>
             <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
             <filename>person/persons_common_w_relations_POST.xml</filename>
             <vars>
-               <var ID="inAuthority">${PersonAuth1.CSID}</var>
-               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
-               <var ID="shortIdentifier">johnWayneActor</var>
-               <var ID="parentCSID">${PersonParent.CSID}</var>
-               <var ID="parentUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonParent.CSID}</var>
-               <var ID="childCSID">${PersonChild.CSID}</var>
-               <var ID="childUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID}</var>
-               <var ID="child2CSID">${PersonChild2.CSID}</var>
-               <var ID="child2Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild2.CSID}</var>
-               <var ID="child3CSID">${PersonChild3.CSID}</var>
-               <var ID="child3Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild3.CSID}</var>
+                <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="shortIdentifier">johnWayneActor</var>
+                <var ID="parentCSID">${PersonParent.CSID}</var>
+                <var ID="parentUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonParent.CSID}</var>
+                <var ID="childCSID">${PersonChild.CSID}</var>
+                <var ID="childUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID}</var>
+                <var ID="child2CSID">${PersonChild2.CSID}</var>
+                <var ID="child2Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild2.CSID}</var>
+                <var ID="child3CSID">${PersonChild3.CSID}</var>
+                <var ID="child3Uri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild3.CSID}</var>
             </vars>
         </test>
-        
-           <test ID="GETpostPerson">
+        <test ID="GETpostPerson">
             <method>GET</method>
             <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}?showRelations=true</uri>
         </test>
-    
-               <test ID="GETPersonAuthorityList">
+        <test ID="GETPersonAuthorityList">
             <method>GET</method>
             <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/</uri>
         </test>
-    
-               <test ID="Person1DeleteRels">
-                       <method>PUT</method>
-                       <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
-                       <filename>person/persons_common_delete_relations_PUT.xml</filename>
-                       <vars>
-                               <var ID="inAuthority">${PersonAuth1.CSID}</var>
-                               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
-                               <var ID="shortIdentifier">johnWayneActor</var>
-                               <var ID="childCSID">${PersonChild.CSID}</var>
-                               <var ID="childUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID}</var>
-                       </vars>
-               </test>
-               
-               <test ID="GETPerson_afterDeleteOneChild">
+        <test ID="Person1DeleteRels">
+            <method>PUT</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
+            <filename>person/persons_common_delete_relations_PUT.xml</filename>
+            <vars>
+                <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="shortIdentifier">johnWayneActor</var>
+                <var ID="childCSID">${PersonChild.CSID}</var>
+                <var ID="childUri">/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${PersonChild.CSID}</var>
+            </vars>
+        </test>
+        <test ID="GETPerson_afterDeleteOneChild">
             <method>GET</method>
             <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}?showRelations=true</uri>
         </test>
-    
-               
-               <test ID="Person1DeleteAllRels">
-                       <method>PUT</method>
-                       <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
-                       <filename>person/persons_common_delete_all_relations_PUT.xml</filename>
-                       <vars>
-                               <var ID="inAuthority">${PersonAuth1.CSID}</var>
-                               <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
-                               <var ID="shortIdentifier">johnWayneActor</var>
-                       </vars>
-               </test>
-               
-               <test ID="GETPerson_afterDeleteAllRelations">
+        <test ID="Person1DeleteAllRels">
+            <method>PUT</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(CSPACE3739PersonAuthority)/items/${Person1.CSID}</uri>
+            <filename>person/persons_common_delete_all_relations_PUT.xml</filename>
+            <vars>
+                <var ID="inAuthority">${PersonAuth1.CSID}</var>
+                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>
+                <var ID="shortIdentifier">johnWayneActor</var>
+            </vars>
+        </test>
+        <test ID="GETPerson_afterDeleteAllRelations">
             <method>GET</method>
             <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showRelations=true</uri>
         </test>
-    
-               
-
     </testGroup>
-    
 </xmlReplay>
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/res/authrefs-listAuthrefs.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/res/authrefs-listAuthrefs.xml
new file mode 100644 (file)
index 0000000..bc55d96
--- /dev/null
@@ -0,0 +1,16 @@
+<ns3:authority-ref-list xmlns:ns2="http://collectionspace.org/services/jaxb" xmlns:ns3="http://collectionspace.org/services/common/authorityref">
+    <pageNum>0</pageNum>
+    <pageSize>40</pageSize>
+    <itemsInPage>1</itemsInPage>
+    <totalItems>1</totalItems>
+    <authority-ref-item>
+        <sourceField>objectexit_common:depositor</sourceField>
+        <refName>
+            urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor)
+        </refName>
+        <authDisplayName>ObjectexitPersonAuth</authDisplayName>
+        <uri>
+            /personauthorities/urn:cspace:name(ObjectexitPersonAuth)/items/urn:cspace:name(davenportDepositor)
+        </uri>
+    </authority-ref-item>
+</ns3:authority-ref-list>
\ No newline at end of file
index 3e0cf50b27e0cd1c6b4408aa0ee7aa0d5dbe3de0..f4b1bec862d4e8325be42f3d68bc2bf82cd57d91 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
 <xmlReplay>
-  <!-- Authenticate into the testsci tenant for extension testing -->
-  <auths default="admin@testsci.collectionspace.org">
-    <auth ID="admin@testsci.collectionspace.org"
-      >YWRtaW5AdGVzdHNjaS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
-  </auths>
+    <!-- Authenticate into the testsci tenant for extension testing -->
+    <auths default="admin@testsci.collectionspace.org">
+        <auth ID="admin@testsci.collectionspace.org">YWRtaW5AdGVzdHNjaS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
+    </auths>
 
-  <!-- 
+    <!-- 
     testGroup ID="person" is not live.  It works, but may not clean up correctly. 
     For now, use ID="updatePerson"
   -->
-  <testGroup ID="person" autoDeletePOSTS="true">
-    <test ID="PersonAuth1" auth="admin@testsci.collectionspace.org">
-      <method>POST</method>
-      <uri>/cspace-services/personauthorities/</uri>
-      <filename>person/personauthorities_common.xml</filename>
-      <vars>
-        <var ID="authShortIdentifier">TestPersonAuthority</var>
-      </vars>
-    </test>
-    <test ID="Person1">
-      <method>POST</method>
-      <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
-      <filename>person/persons_common_and_testsci.xml</filename>
-      <vars>
-        <var ID="shortIdentifier">johnWayneActor1</var>
-        <var ID="foreName">John</var>
-        <var ID="surName">Wayne</var>
-        <var ID="entityType">Actor</var>
-      </vars>
-    </test>
-    <test ID="Person2">
-      <method>POST</method>
-      <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
-      <filename>person/persons_common_and_testsci.xml</filename>
-      <vars>
-        <var ID="shortIdentifier">billyBob1</var>
-        <var ID="foreName">Billy-Bob</var>
-        <var ID="surName">Homeboy</var>
-        <var ID="entityType">Goof</var>
-      </vars>
-    </test>
-    <test ID="getAuthorityList">
-      <method>GET</method>
-      <uri>/cspace-services/personauthorities/</uri>
-    </test>
-    <test ID="getAuthorityByName">
-      <method>GET</method>
-      <uri>/cspace-services/personauthorities/urn:cspace:name(TestPersonAuthority)</uri>
-    </test>
-    <test ID="getAuthorityByCSID">
-      <method>GET</method>
-      <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}</uri>
-    </test>
-    <test ID="getPersonList">
-      <method>GET</method>
-      <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
-    </test>
-    <test ID="getPerson1">
-      <method>GET</method>
-      <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>
-    </test>
+    <testGroup ID="person" autoDeletePOSTS="true" authForCleanup="admin@testsci.collectionspace.org">
+        <test ID="PersonAuth1" auth="admin@testsci.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/</uri>
+            <filename>person/personauthorities_common.xml</filename>
+            <vars>
+                <var ID="authShortIdentifier">TestPersonAuthority</var>
+            </vars>
+        </test>
+        <test ID="Person1">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+            <filename>person/persons_common_and_testsci.xml</filename>
+            <vars>
+                <var ID="shortIdentifier">johnWayneActor1</var>
+                <var ID="foreName">John</var>
+                <var ID="surName">Wayne</var>
+                <var ID="entityType">Actor</var>
+            </vars>
+        </test>
+        <test ID="Person2">
+            <method>POST</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+            <filename>person/persons_common_and_testsci.xml</filename>
+            <vars>
+                <var ID="shortIdentifier">billyBob1</var>
+                <var ID="foreName">Billy-Bob</var>
+                <var ID="surName">Homeboy</var>
+                <var ID="entityType">Goof</var>
+            </vars>
+        </test>
+        <test ID="getAuthorityList">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/</uri>
+        </test>
+        <test ID="getAuthorityByName">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/urn:cspace:name(TestPersonAuthority)</uri>
+        </test>
+        <test ID="getAuthorityByCSID">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}</uri>
+        </test>
+        <test ID="getPersonList">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/</uri>
+        </test>
+        <test ID="getPerson1">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}</uri>
+        </test>
 
-    <test ID="UpdatePerson2WithRelations">
-      <method>PUT</method>
-      <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}</uri>
-      <filename>person/persons_common_and_testsci_set_broader.xml</filename>
-      <vars>
-        <var ID="shortIdentifier">billyBob1</var>
-        <var ID="foreName">Billy-Bob</var>
-        <var ID="surName">Homeboy</var>
-        <var ID="entityType">Goof</var>
-        <var ID="childCSID">${Person2.CSID}</var>
-        <var ID="parentCSID">${Person1.CSID}</var>
-        <var ID="parentName">John Wayne</var>
-      </vars>
-    </test>
+        <test ID="UpdatePerson2WithRelations">
+            <method>PUT</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}</uri>
+            <filename>person/persons_common_and_testsci_set_broader.xml</filename>
+            <vars>
+                <var ID="shortIdentifier">billyBob1</var>
+                <var ID="foreName">Billy-Bob</var>
+                <var ID="surName">Homeboy</var>
+                <var ID="entityType">Goof</var>
+                <var ID="childCSID">${Person2.CSID}</var>
+                <var ID="parentCSID">${Person1.CSID}</var>
+                <var ID="parentName">John Wayne</var>
+            </vars>
+        </test>
 
-    <test ID="getPerson1WithRelations">
-      <method>GET</method>
-      <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showAllRelations=true</uri>
-      <response>
-        <expected level="ADDOK"/>
-        <filename>person/res/testsciPersonWithRelns.res.xml</filename>
-        <!-- NOTE: vars are referenced in testsciPersonWithRelns.res.xml
+        <test ID="getPerson1WithRelations">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}?showAllRelations=true</uri>
+            <response>
+                <expected level="ADDOK"></expected>
+                <filename>person/res/testsciPersonWithRelns.res.xml</filename>
+                <!-- NOTE: vars are referenced in testsciPersonWithRelns.res.xml
           from tests in this test group, e.g. 
           PersonParent.CSID :: ${PersonParent.CSID} 
           These vars are all in the expression context while this group is active,
           because we hang onto all ServiceResult objects for the duration of the group,
           and ServiceObjects keep their vars.
         -->
-        <startElement>/document/*[local-name()='relations-common-list']</startElement>
-      </response>
-    </test>
-               
-               <test ID="getPerson2WithRelations">
-      <method>GET</method>
-      <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}?showAllRelations=true</uri>
-      <response>
-        <expected level="ADDOK"/>
-        <filename>person/res/testsciPersonWithRelns.res.xml</filename>
-        <!-- NOTE: vars are referenced in testsciPersonWithRelns.res.xml
+                <startElement>/document/*[local-name()='relations-common-list']</startElement>
+            </response>
+        </test>
+
+        <test ID="getPerson2WithRelations">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person2.CSID}?showAllRelations=true</uri>
+            <response>
+                <expected level="ADDOK"></expected>
+                <filename>person/res/testsciPersonWithRelns.res.xml</filename>
+                <!-- NOTE: vars are referenced in testsciPersonWithRelns.res.xml
           from tests in this test group, e.g. 
           PersonParent.CSID :: ${PersonParent.CSID} 
           These vars are all in the expression context while this group is active,
           because we hang onto all ServiceResult objects for the duration of the group,
           and ServiceObjects keep their vars.
         -->
-        <startElement>/document/*[local-name()='relations-common-list']</startElement>
-      </response>
-               </test>
+                <startElement>/document/*[local-name()='relations-common-list']</startElement>
+            </response>
+        </test>
 
-               <test ID="createLoanin1" auth="test">
-                       <method>POST</method>
-                       <uri>/cspace-services/loansin/</uri>
-                       <filename>authrefs/loanin.xml</filename>
-                       <vars>
-                               <var ID="loannum">42</var>
-                               <var ID="person">${getPerson1.got("//refName")}</var>
-                       </vars>
-               </test>
+        <test ID="createLoanin1">
+            <method>POST</method>
+            <uri>/cspace-services/loansin/</uri>
+            <filename>authrefs/loanin.xml</filename>
+            <vars>
+                <var ID="loannum">42</var>
+                <var ID="person">${getPerson1.got("//refName")}</var>
+            </vars>
+        </test>
 
-               <test ID="getPerson1RefObjs">
-                       <method>GET</method>
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs</uri>
-                       <response>
-                               <expected level="ADDOK"/>
-                               <filename>person/res/refObjs.res.xml</filename>
-                               <vars>
-                                       <var ID="numFound">1</var>
-                               </vars>
-                       </response>
-               </test>
+        <test ID="getPerson1RefObjs">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs</uri>
+            <response>
+                <expected level="ADDOK"></expected>
+                <filename>person/res/refObjs.res.xml</filename>
+                <vars>
+                    <var ID="numFound">1</var>
+                </vars>
+            </response>
+        </test>
 
-               <test ID="createAcquisition1" auth="test">
-                       <method>POST</method>
-                       <uri>/cspace-services/acquisitions/</uri>
-                       <filename>person/acquisition.xml</filename>
-                       <vars>
-                               <var ID="acqNum">42</var>
-                               <var ID="owner">${getPerson1.got("//refName")}</var>
-                       </vars>
-               </test>
+        <test ID="createAcquisition1">
+            <method>POST</method>
+            <uri>/cspace-services/acquisitions/</uri>
+            <filename>person/acquisition.xml</filename>
+            <vars>
+                <var ID="acqNum">42</var>
+                <var ID="owner">${getPerson1.got("//refName")}</var>
+            </vars>
+        </test>
 
-               <test ID="getPerson1RefObjs">
-                       <method>GET</method>
-                       <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs</uri>
-                       <response>
-                               <expected level="ADDOK"/>
-                               <filename>person/res/refObjs.res.xml</filename>
-                               <vars>
-                                       <var ID="numFound">2</var>
-                               </vars>
-                       </response>
-               </test>
+        <test ID="getPerson1RefObjs">
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/${PersonAuth1.CSID}/items/${Person1.CSID}/refObjs</uri>
+            <response>
+                <expected level="ADDOK"></expected>
+                <filename>person/res/refObjs.res.xml</filename>
+                <vars>
+                    <var ID="numFound">2</var>
+                </vars>
+            </response>
+        </test>
 
-  </testGroup>
+    </testGroup>
 
 </xmlReplay>
-
index bce5372a34b6c1a1607271b5e31a25b9787e1e76..934e534f8ce7ecca51710148135d68fd82ebab04 100644 (file)
@@ -5,18 +5,18 @@
         <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
     </auths>
    
-    <testGroup ID="makeRelations" autoDeletePOSTS="true">
-         <test ID="oe1"  auth="test">
+    <testGroup ID="makeRelations" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
+         <test ID="oe1">
              <method>POST</method>
              <uri>/cspace-services/objectexit/</uri>
              <filename>relation/oe1.xml</filename>
          </test>
-         <test ID="oe2"  auth="test">
+         <test ID="oe2">
              <method>POST</method>
              <uri>/cspace-services/objectexit/</uri>
              <filename>relation/oe1.xml</filename>
          </test>
-         <test ID="relate1"  auth="test">
+         <test ID="relate1">
              <method>POST</method>
              <uri>/cspace-services/relations/</uri>
              <filename>relation/r-1.xml</filename>
@@ -28,7 +28,7 @@
                 <var ID="relationshipType">hasBroader</var>
              </vars>
          </test>
-         <test ID="relate2"  auth="test">
+         <test ID="relate2">
              <method>POST</method>
              <uri>/cspace-services/relations/</uri>
              <filename>relation/r-1.xml</filename>
@@ -41,7 +41,7 @@
                 <var ID="relationshipType">hasBroader</var>
              </vars>
          </test>
-         <test ID="relationsGET"  auth="test">
+         <test ID="relationsGET">
              <method>GET</method>
              <uri>/cspace-services/relations/</uri>
          </test>
         -->
     </testGroup>
     
-    <testGroup ID="makeRelationsNested" autoDeletePOSTS="true">
-         <test ID="oe1"  auth="test">
+    <testGroup ID="makeRelationsNested" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
+         <test ID="oe1">
              <method>POST</method>
              <uri>/cspace-services/objectexit/</uri>
              <filename>relation/oe1.xml</filename>
          </test>
-         <test ID="oe2"  auth="test">
+         <test ID="oe2">
              <method>POST</method>
              <uri>/cspace-services/objectexit/</uri>
              <filename>relation/oe1.xml</filename>
          </test>
-         <test ID="relate1"  auth="test">
+         <test ID="relate1">
              <method>POST</method>
              <uri>/cspace-services/relations/</uri>
              <filename>relation/r-2.xml</filename>
                 <var ID="relationshipType">hasBroader</var>
              </vars>
          </test>
-         <test ID="relationsGET"  auth="test">
+         <test ID="relationsGET">
              <method>GET</method>
              <uri>/cspace-services/relations/</uri>
          </test>
     </testGroup>
          
     <testGroup ID="r2only" autoDeletePOSTS="true">
-         <test ID="relate"  auth="test">
+         <test ID="relate">
              <method>POST</method>
              <uri>/cspace-services/relations/</uri>
              <filename>relation/r-2.xml</filename>
@@ -96,7 +96,7 @@
                 <var ID="relationshipType">hasBroader</var>
              </vars>
          </test>
-         <test ID="relationsGET"  auth="test">
+         <test ID="relationsGET">
              <method>GET</method>
              <uri>/cspace-services/relations/</uri>
          </test>
index 1b0ccaf7830de408f6b127b7da25e70b05e737bd..51ee9466284d13f1d9d6e71f546d9ddc1f88f98a 100644 (file)
@@ -1,25 +1,25 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xmlReplay>
-    
+
     <auths>
         <!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->
         <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
     </auths>
-    
-    <testGroup ID="testSingle" autoDeletePOSTS="true">
-        
-        <test ID="createReport1" auth="test">
+
+    <testGroup ID="testSingle" autoDeletePOSTS="true" authForCleanup="admin@core.collectionspace.org">
+
+        <test ID="createReport1">
             <method>POST</method>
             <uri>/cspace-services/reports/</uri>
             <filename>report/report1Record.xml</filename>
             <expectedCodes>201</expectedCodes>
         </test>
-        <test ID="readReport1" auth="test">
+        <test ID="readReport1">
             <method>GET</method>
             <uri>/cspace-services/reports/${createReport1.CSID}</uri>
         </test>
-        
-        <test ID="createAcquisition1" auth="test">
+
+        <test ID="createAcquisition1">
             <method>POST</method>
             <uri>/cspace-services/acquisitions/</uri>
             <filename>report/acquisition1.xml</filename>
@@ -28,7 +28,7 @@
             </vars>
             <expectedCodes>201</expectedCodes>
         </test>
-        
+
         <!--
             This test is still mostly a placeholder, merely verifying that,
             with a generated report returned matching the 'application/xml' MIME
@@ -40,7 +40,7 @@
             the (more permissive) TEXT level appears to be far too lenient.
             - ADR 2013-05-13
         -->
-        <test ID="testInvokeSingle" auth="test" autoDeletePOSTS="false">
+        <test ID="testInvokeSingle" autoDeletePOSTS="false">
             <method>POST</method>
             <uri>/cspace-services/reports/${createReport1.CSID}</uri>
             <filename>report/report1InvContextStandalone.xml</filename>
@@ -48,7 +48,7 @@
                 <var ID="acquisitionCSID">${createAcquisition1.CSID}</var>
             </vars>
             <response>
-                <expected level="ADDOK"/>
+                <expected level="ADDOK"></expected>
                 <filename>report/res/report1.res.xml</filename>
                 <vars>
                     <var ID="acquisitionReferenceNumber">${createAcquisition1.acquisitionReferenceNumber}</var>
             </response>
             <expectedCodes>200</expectedCodes>
         </test>
-        
+
         <!-- See the Batch service tests within the IntegrationTests -->
         <!-- module for templates for additional report invocation tests -->
         <!-- that can be added here. -->
-        
+
     </testGroup>
 
 </xmlReplay>
-
index 5d4201c0d57965f6ea04950ea28f2c5c7f9fdf6f..a3c6f621c01a1c45bf24024576e4265ced47cf18 100644 (file)
@@ -1,96 +1,94 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xmlReplay>
-  <!-- Authenticate into the testsci tenant. By default, versioning -->
-  <!-- support is exposed in the Location/Movement/Inventory service -->
-  <!-- in that tenant. -->
-  <auths default="admin@testsci.collectionspace.org">
-    <auth ID="admin@testsci.collectionspace.org"
-      >YWRtaW5AdGVzdHNjaS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
-  </auths>
+    <!-- Authenticate into the testsci tenant. By default, versioning -->
+    <!-- support is exposed in the Location/Movement/Inventory service -->
+    <!-- in that tenant. -->
+    <auths default="admin@testsci.collectionspace.org">
+        <auth ID="admin@testsci.collectionspace.org">YWRtaW5AdGVzdHNjaS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
+    </auths>
 
-  <!-- Verifies that, by default: -->
-  <!--   * Versioned records are excluded (filtered out) from list results. -->
-  <!--   * Only the current version of a record is retrieved on a read request. -->
-  <testGroup ID="VersionedRecordFiltering" autoDeletePOSTS="true">
-  
-    <test ID="CreateMovement" auth="admin@testsci.collectionspace.org">
-      <method>POST</method>
-      <uri>/cspace-services/movements/</uri>
-      <filename>versioning/movement.xml</filename>
-      <vars>
-        <!-- This currentLocation value should properly be a Storage Location -->
-        <!-- or Organization refName, but for the test-only function served by -->
-        <!-- this temporary record, this value can instead be an arbitrary string. -->
-        <!-- (Note: that this arbitrary string must be uniquely present in one -->
-        <!-- and only one Movement record for the search test below to succeed.) -->
-        <var ID="currentLocationValue">jlmbsoqtqbfjotldjlmbsoq</var>
-        <var ID="currentLocationNoteValue">old current location note</var>
-      </vars>
-      <expectedCodes>201</expectedCodes>
-    </test>
-    
-    <test ID="ListAllMovementRecords">
-      <method>GET</method>
-      <uri>/cspace-services/movements</uri>
-    </test>
-    
-    <test ID="UpdateMovement" auth="admin@testsci.collectionspace.org">
-      <method>PUT</method>
-      <uri>/cspace-services/movements/${CreateMovement.CSID}</uri>
-      <filename>versioning/movement.xml</filename>
-      <vars>
-        <var ID="currentLocationValue">${CreateMovement.currentLocationValue}</var>
-        <var ID="currentLocationNoteValue">new current location note</var>
-      </vars>
-      <expectedCodes>200</expectedCodes>
-    </test>
-    
-    <!-- The total number of Movement records reported should not change following -->
-    <!-- the update, even though a past version of one Movement document was created -->
-    <!-- automatically as a result of that update. -->
-    <test ID="ListAllMovementRecordsFollowingUpdate">
-      <method>GET</method>
-      <uri>/cspace-services/movements</uri>
-      <response>
-        <expected level="ADDOK"/>
-        <vars>
-          <var ID="totalItemsValue">${ListAllMovementRecords.got("//totalItems")}</var>
-        </vars>
-        <filename>versioning/res/movement-list.res.xml</filename>
-      </response>
-    </test>
-    
-    <!-- A keyword search on the (intended to be unique) currentLocation value -->
-    <!-- should retrieve only one document record, even though there are now two -->
-    <!-- documents extant containing that value: the current version and one past -->
-    <!-- version, the latter created automatically as a result of the update. -->
-    <test ID="SearchReturnsOnlyCurrentVersion">
-      <method>GET</method>
-      <uri>/cspace-services/movements?kw=${CreateMovement.currentLocationValue}</uri>
-      <response>
-        <expected level="ADDOK"/>
-        <vars>
-          <var ID="totalItemsValue">1</var>
-        </vars>
-        <filename>versioning/res/movement-list.res.xml</filename>
-      </response>
-    </test>
-    
-    <!-- Retrieving the document via a read request should return only -->
-    <!-- the current version, containing the most recently updated value(s). -->
-    <test ID="ReadReturnsOnlyCurrentVersion">
-      <method>GET</method>
-      <uri>/cspace-services/movements/${CreateMovement.CSID}</uri>
-      <vars>
-        <var ID="currentLocationNoteValue">${UpdateMovement.currentLocationNoteValue}</var>
-      </vars>
-      <response>
-        <expected level="ADDOK"/>
-        <filename>versioning/res/movement.res.xml</filename>
-      </response>
-    </test>
+    <!-- Verifies that, by default: -->
+    <!--   * Versioned records are excluded (filtered out) from list results. -->
+    <!--   * Only the current version of a record is retrieved on a read request. -->
+    <testGroup ID="VersionedRecordFiltering" autoDeletePOSTS="true" authForCleanup="admin@testsci.collectionspace.org">
 
-  </testGroup>
+        <test ID="CreateMovement" auth="admin@testsci.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/movements/</uri>
+            <filename>versioning/movement.xml</filename>
+            <vars>
+                <!-- This currentLocation value should properly be a Storage Location -->
+                <!-- or Organization refName, but for the test-only function served by -->
+                <!-- this temporary record, this value can instead be an arbitrary string. -->
+                <!-- (Note: that this arbitrary string must be uniquely present in one -->
+                <!-- and only one Movement record for the search test below to succeed.) -->
+                <var ID="currentLocationValue">jlmbsoqtqbfjotldjlmbsoq</var>
+                <var ID="currentLocationNoteValue">old current location note</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
 
-</xmlReplay>
+        <test ID="ListAllMovementRecords">
+            <method>GET</method>
+            <uri>/cspace-services/movements</uri>
+        </test>
+
+        <test ID="UpdateMovement" auth="admin@testsci.collectionspace.org">
+            <method>PUT</method>
+            <uri>/cspace-services/movements/${CreateMovement.CSID}</uri>
+            <filename>versioning/movement.xml</filename>
+            <vars>
+                <var ID="currentLocationValue">${CreateMovement.currentLocationValue}</var>
+                <var ID="currentLocationNoteValue">new current location note</var>
+            </vars>
+            <expectedCodes>200</expectedCodes>
+        </test>
+
+        <!-- The total number of Movement records reported should not change following -->
+        <!-- the update, even though a past version of one Movement document was created -->
+        <!-- automatically as a result of that update. -->
+        <test ID="ListAllMovementRecordsFollowingUpdate">
+            <method>GET</method>
+            <uri>/cspace-services/movements</uri>
+            <response>
+                <expected level="ADDOK"></expected>
+                <vars>
+                    <var ID="totalItemsValue">${ListAllMovementRecords.got("//totalItems")}</var>
+                </vars>
+                <filename>versioning/res/movement-list.res.xml</filename>
+            </response>
+        </test>
+
+        <!-- A keyword search on the (intended to be unique) currentLocation value -->
+        <!-- should retrieve only one document record, even though there are now two -->
+        <!-- documents extant containing that value: the current version and one past -->
+        <!-- version, the latter created automatically as a result of the update. -->
+        <test ID="SearchReturnsOnlyCurrentVersion">
+            <method>GET</method>
+            <uri>/cspace-services/movements?kw=${CreateMovement.currentLocationValue}</uri>
+            <response>
+                <expected level="ADDOK"></expected>
+                <vars>
+                    <var ID="totalItemsValue">1</var>
+                </vars>
+                <filename>versioning/res/movement-list.res.xml</filename>
+            </response>
+        </test>
 
+        <!-- Retrieving the document via a read request should return only -->
+        <!-- the current version, containing the most recently updated value(s). -->
+        <test ID="ReadReturnsOnlyCurrentVersion">
+            <method>GET</method>
+            <uri>/cspace-services/movements/${CreateMovement.CSID}</uri>
+            <vars>
+                <var ID="currentLocationNoteValue">${UpdateMovement.currentLocationNoteValue}</var>
+            </vars>
+            <response>
+                <expected level="ADDOK"></expected>
+                <filename>versioning/res/movement.res.xml</filename>
+            </response>
+        </test>
+
+    </testGroup>
+
+</xmlReplay>
index c6f84fdec80760288f5bb1e3893d6ea5ca8ce30e..9eb678e11b9f6c93b1540b78d9b36a939d94083b 100644 (file)
@@ -1,13 +1,15 @@
 <document name="vocabularies">
     <ns2:vocabularies_common xmlns:ns2="http://collectionspace.org/services/vocabulary" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-        <rev>6</rev>
+        <rev>10</rev>
         <shortIdentifier>createReplaceVocabItems</shortIdentifier>
         <csid>${csid}</csid>
-        <displayName>createReplaceVocabItems Vocabulary</displayName>
+        <displayName>Updated createReplaceVocabItems Vocabulary</displayName>
         <description>
-            This is a test vocabulary for test createReplaceVocabItems
+            This is an updated test vocabulary created in the createReplaceVocabItems XMLReplay test group
         </description>
-        <source>createReplaceVocabItems</source>
+        <source>
+            Some updated mythical book posted with item terms in createReplaceVocabItems test group
+        </source>
         <refName>
             urn:cspace:testsci.collectionspace.org:vocabularies:name(createReplaceVocabItems)'createReplaceVocabItems Vocabulary'
         </refName>
     <ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
         <pageNum>0</pageNum>
         <pageSize>2500</pageSize>
-        <itemsInPage>0</itemsInPage>
-        <totalItems>0</totalItems>
+        <itemsInPage>3</itemsInPage>
+        <totalItems>3</totalItems>
         <fieldsReturned>
             csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|deprecated|termStatus|description|source|order|displayName|shortIdentifier
         </fieldsReturned>
+        <list-item>
+            <refName>
+                urn:cspace:testsci.collectionspace.org:vocabularies:name(createReplaceVocabItems):item:name(replacementitema)'Replacement item A'
+            </refName>
+            <workflowState>project</workflowState>
+            <rev>0</rev>
+            <sas>false</sas>
+            <proposed>true</proposed>
+            <order>1</order>
+            <displayName>Replacement item A</displayName>
+            <shortIdentifier>replacementitema</shortIdentifier>
+        </list-item>
+        <list-item>
+            <refName>
+                urn:cspace:testsci.collectionspace.org:vocabularies:name(createReplaceVocabItems):item:name(replacementitemb)'Replacement item B'
+            </refName>
+            <workflowState>project</workflowState>
+            <rev>0</rev>
+            <sas>false</sas>
+            <proposed>true</proposed>
+            <order>2</order>
+            <displayName>Replacement item B</displayName>
+            <shortIdentifier>replacementitemb</shortIdentifier>
+        </list-item>
+        <list-item>
+            <refName>
+                urn:cspace:testsci.collectionspace.org:vocabularies:name(createReplaceVocabItems):item:name(replacementitemc)'Replacement item C'
+            </refName>
+            <workflowState>project</workflowState>
+            <rev>0</rev>
+            <sas>false</sas>
+            <proposed>true</proposed>
+            <order>3</order>
+            <displayName>Replacement item C</displayName>
+            <shortIdentifier>replacementitemc</shortIdentifier>
+        </list-item>
     </ns2:abstract-common-list>
 </document>
\ No newline at end of file
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddDeleteVocabItems/responses/updateAddDeleteVocabItems.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddDeleteVocabItems/responses/updateAddDeleteVocabItems.res.xml
new file mode 100644 (file)
index 0000000..fba9c64
--- /dev/null
@@ -0,0 +1,75 @@
+<document name="vocabularies">
+    <ns2:vocabularies_common xmlns:ns2="http://collectionspace.org/services/vocabulary" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+        <rev>10</rev>
+        <shortIdentifier>createUpdateAddDeleteVocabItems</shortIdentifier>
+        <csid>${csid}</csid>
+        <displayName>Updated createUpdateAddDeleteVocabItems Vocabulary</displayName>
+        <description>
+            This is an updated test vocabulary created in the createUpdateAddDeleteVocabItems XMLReplay test group
+        </description>
+        <source>
+            Some updated mythical book posted with item terms in createUpdateAddDeleteVocabItems test group
+        </source>
+        <refName>
+            urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddDeleteVocabItems)'createUpdateAddDeleteVocabItems Vocabulary'
+        </refName>
+        <vocabType>enum</vocabType>
+    </ns2:vocabularies_common>
+    <ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
+        <pageNum>0</pageNum>
+        <pageSize>2500</pageSize>
+        <itemsInPage>4</itemsInPage>
+        <totalItems>4</totalItems>
+        <fieldsReturned>
+            csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|deprecated|termStatus|description|source|order|displayName|shortIdentifier
+        </fieldsReturned>
+        <list-item>
+            <refName>
+                urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddDeleteVocabItems):item:name(addeditema)'Added item A'
+            </refName>
+            <workflowState>project</workflowState>
+            <rev>0</rev>
+            <sas>false</sas>
+            <proposed>true</proposed>
+            <order>2</order>
+            <displayName>Added item A</displayName>
+            <shortIdentifier>addeditema</shortIdentifier>
+        </list-item>
+        <list-item>
+            <refName>
+                urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddDeleteVocabItems):item:name(addeditemb)'Added item B'
+            </refName>
+            <workflowState>project</workflowState>
+            <rev>0</rev>
+            <sas>false</sas>
+            <proposed>true</proposed>
+            <order>3</order>
+            <displayName>Added item B</displayName>
+            <shortIdentifier>addeditemb</shortIdentifier>
+        </list-item>
+        <list-item>
+            <refName>
+                urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddDeleteVocabItems):item:name(addeditemc)'Added item C'
+            </refName>
+            <workflowState>project</workflowState>
+            <rev>0</rev>
+            <sas>false</sas>
+            <proposed>true</proposed>
+            <order>4</order>
+            <displayName>Added item C</displayName>
+            <shortIdentifier>addeditemc</shortIdentifier>
+        </list-item>
+        <list-item>
+            <refName>
+                urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddDeleteVocabItems):item:name(createItem301)'Updated createItem301'
+            </refName>
+            <workflowState>project</workflowState>
+            <rev>1</rev>            
+            <sas>false</sas>
+            <proposed>true</proposed>
+            <order>1</order>
+            <displayName>Updated createItem301</displayName>
+            <shortIdentifier>createItem301</shortIdentifier>
+        </list-item>        
+    </ns2:abstract-common-list>
+</document>
\ No newline at end of file
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddDeleteVocabItems/updateAddDeleteWithItems-vocab.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddDeleteVocabItems/updateAddDeleteWithItems-vocab.xml
new file mode 100644 (file)
index 0000000..6128ace
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="vocabularies">
+    <ns3:vocabularies_common xmlns:ns3="http://collectionspace.org/services/vocabulary" xmlns:ns2="http://collectionspace.org/services/jaxb">
+        <displayName>Updated createUpdateAddDeleteVocabItems Vocabulary</displayName>
+        <shortIdentifier>createUpdateAddDeleteVocabItems</shortIdentifier>
+        <description>This is an updated test vocabulary created in the createUpdateAddDeleteVocabItems XMLReplay test group</description>
+        <source>Some updated mythical book posted with item terms in createUpdateAddDeleteVocabItems test group</source>
+    </ns3:vocabularies_common>
+    <ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
+        <list-item>
+            <order>1</order>
+            <displayName>Updated createItem301</displayName>
+            <shortIdentifier>createItem301</shortIdentifier>
+        </list-item>
+        <list-item>
+            <order>2</order>
+            <displayName>Added item A</displayName>
+            <shortIdentifier>addeditema</shortIdentifier>
+        </list-item>
+        <list-item>
+            <order>3</order>
+            <displayName>Added item B</displayName>
+            <shortIdentifier>addeditemb</shortIdentifier>
+        </list-item>
+        <list-item>
+            <order>4</order>
+            <displayName>Added item C</displayName>
+            <shortIdentifier>addeditemc</shortIdentifier>
+        </list-item>
+    </ns2:abstract-common-list>
+</document>
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddOnlyVocabItems/responses/updateAddOnlyVocabItems.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddOnlyVocabItems/responses/updateAddOnlyVocabItems.res.xml
new file mode 100644 (file)
index 0000000..2150bfa
--- /dev/null
@@ -0,0 +1,99 @@
+<document name="vocabularies">
+    <ns2:vocabularies_common xmlns:ns2="http://collectionspace.org/services/vocabulary" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+        <rev>8</rev>
+        <shortIdentifier>createUpdateAddOnlyVocabItems</shortIdentifier>
+        <csid>${csid}</csid>
+        <displayName>Updated createUpdateAddOnlyVocabItems Vocabulary</displayName>
+        <description>
+            This is an updated test vocabulary created in the createUpdateAddOnlyVocabItems XMLReplay test group
+        </description>
+        <source>
+            Some updated mythical book posted with item terms in createUpdateAddOnlyVocabItems test group
+        </source>
+        <refName>
+            urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddOnlyVocabItems)'createUpdateAddOnlyVocabItems Vocabulary'
+        </refName>
+        <vocabType>enum</vocabType>
+    </ns2:vocabularies_common>
+    <ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
+        <pageNum>0</pageNum>
+        <pageSize>2500</pageSize>
+        <itemsInPage>6</itemsInPage>
+        <totalItems>6</totalItems>
+        <fieldsReturned>
+            csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|deprecated|termStatus|description|source|order|displayName|shortIdentifier
+        </fieldsReturned>
+        <list-item>
+            <refName>
+                urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddOnlyVocabItems):item:name(addeditema)'Added item A'
+            </refName>
+            <workflowState>project</workflowState>
+            <rev>0</rev>
+            <sas>false</sas>
+            <proposed>true</proposed>
+            <order>4</order>
+            <displayName>Added item A</displayName>
+            <shortIdentifier>addeditema</shortIdentifier>
+        </list-item>
+        <list-item>
+            <refName>
+                urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddOnlyVocabItems):item:name(addeditemb)'Added item B'
+            </refName>
+            <workflowState>project</workflowState>
+            <rev>0</rev>
+            <sas>false</sas>
+            <proposed>true</proposed>
+            <order>5</order>
+            <displayName>Added item B</displayName>
+            <shortIdentifier>addeditemb</shortIdentifier>
+        </list-item>
+        <list-item>
+            <refName>
+                urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddOnlyVocabItems):item:name(addeditemc)'Added item C'
+            </refName>
+            <workflowState>project</workflowState>
+            <rev>0</rev>
+            <sas>false</sas>
+            <proposed>true</proposed>
+            <order>6</order>
+            <displayName>Added item C</displayName>
+            <shortIdentifier>addeditemc</shortIdentifier>
+        </list-item>
+        <list-item>
+            <refName>
+                urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddOnlyVocabItems):item:name(createItem101)'createItem101'
+            </refName>
+            <workflowState>project</workflowState>
+            <rev>0</rev>            
+            <sas>false</sas>
+            <proposed>true</proposed>
+            <order>1</order>
+            <displayName>createItem101</displayName>
+            <shortIdentifier>createItem101</shortIdentifier>
+        </list-item>        
+        <list-item>
+            <refName>
+                urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddOnlyVocabItems):item:name(createItem201)'createItem201'
+            </refName>
+            <workflowState>project</workflowState>
+            <rev>0</rev>            
+            <sas>false</sas>
+            <proposed>true</proposed>
+            <order>2</order>
+            <displayName>createItem201</displayName>
+            <shortIdentifier>createItem201</shortIdentifier>
+        </list-item>
+        <list-item>
+            <refName>
+                urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddOnlyVocabItems):item:name(createItem301)'Updated createItem301'
+            </refName>
+            <workflowState>project</workflowState>
+            <rev>1</rev>            
+            <sas>false</sas>
+            <proposed>true</proposed>
+            <order>3</order>
+            <displayName>Updated createItem301</displayName>
+            <shortIdentifier>createItem301</shortIdentifier>
+        </list-item>        
+    </ns2:abstract-common-list>
+</document>
\ No newline at end of file
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddOnlyVocabItems/updateAddOnlyWithItems-vocab.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddOnlyVocabItems/updateAddOnlyWithItems-vocab.xml
new file mode 100644 (file)
index 0000000..a8ef9e4
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="vocabularies">
+    <ns3:vocabularies_common xmlns:ns3="http://collectionspace.org/services/vocabulary" xmlns:ns2="http://collectionspace.org/services/jaxb">
+        <displayName>Updated createUpdateAddOnlyVocabItems Vocabulary</displayName>
+        <shortIdentifier>createUpdateAddOnlyVocabItems</shortIdentifier>
+        <description>This is an updated test vocabulary created in the createUpdateAddOnlyVocabItems XMLReplay test group</description>
+        <source>Some updated mythical book posted with item terms in createUpdateAddOnlyVocabItems test group</source>
+    </ns3:vocabularies_common>
+    <ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
+        <list-item>
+            <order>3</order>
+            <displayName>Updated createItem301</displayName>
+            <shortIdentifier>createItem301</shortIdentifier>
+        </list-item>
+        <list-item>
+            <order>4</order>
+            <displayName>Added item A</displayName>
+            <shortIdentifier>addeditema</shortIdentifier>
+        </list-item>
+        <list-item>
+            <order>5</order>
+            <displayName>Added item B</displayName>
+            <shortIdentifier>addeditemb</shortIdentifier>
+        </list-item>
+        <list-item>
+            <order>6</order>
+            <displayName>Added item C</displayName>
+            <shortIdentifier>addeditemc</shortIdentifier>
+        </list-item>
+    </ns2:abstract-common-list>
+</document>
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddSoftDeleteVocabItems/responses/updateAddSoftDeleteVocabItems.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddSoftDeleteVocabItems/responses/updateAddSoftDeleteVocabItems.res.xml
new file mode 100644 (file)
index 0000000..9f5991f
--- /dev/null
@@ -0,0 +1,99 @@
+<document name="vocabularies">
+    <ns2:vocabularies_common xmlns:ns2="http://collectionspace.org/services/vocabulary" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+        <rev>10</rev>
+        <shortIdentifier>createUpdateAddSoftDeleteVocabItems</shortIdentifier>
+        <csid>${csid}</csid>
+        <displayName>Updated createUpdateAddSoftDeleteVocabItems Vocabulary</displayName>
+        <description>
+            This is an updated test vocabulary created in the createUpdateAddSoftDeleteVocabItems XMLReplay test group
+        </description>
+        <source>
+            Some updated mythical book posted with item terms in createUpdateAddSoftDeleteVocabItems test group
+        </source>
+        <refName>
+            urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddSoftDeleteVocabItems)'createUpdateAddSoftDeleteVocabItems Vocabulary'
+        </refName>
+        <vocabType>enum</vocabType>
+    </ns2:vocabularies_common>
+    <ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
+        <pageNum>0</pageNum>
+        <pageSize>2500</pageSize>
+        <itemsInPage>6</itemsInPage>
+        <totalItems>6</totalItems>
+        <fieldsReturned>
+            csid|uri|refName|updatedAt|workflowState|rev|sourcePage|sas|proposed|deprecated|termStatus|description|source|order|displayName|shortIdentifier
+        </fieldsReturned>
+        <list-item>
+            <refName>
+                urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddSoftDeleteVocabItems):item:name(addeditema)'Added item A'
+            </refName>
+            <workflowState>project</workflowState>
+            <rev>0</rev>
+            <sas>false</sas>
+            <proposed>true</proposed>
+            <order>2</order>
+            <displayName>Added item A</displayName>
+            <shortIdentifier>addeditema</shortIdentifier>
+        </list-item>
+        <list-item>
+            <refName>
+                urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddSoftDeleteVocabItems):item:name(addeditemb)'Added item B'
+            </refName>
+            <workflowState>project</workflowState>
+            <rev>0</rev>
+            <sas>false</sas>
+            <proposed>true</proposed>
+            <order>3</order>
+            <displayName>Added item B</displayName>
+            <shortIdentifier>addeditemb</shortIdentifier>
+        </list-item>
+        <list-item>
+            <refName>
+                urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddSoftDeleteVocabItems):item:name(addeditemc)'Added item C'
+            </refName>
+            <workflowState>project</workflowState>
+            <rev>0</rev>
+            <sas>false</sas>
+            <proposed>true</proposed>
+            <order>4</order>
+            <displayName>Added item C</displayName>
+            <shortIdentifier>addeditemc</shortIdentifier>
+        </list-item>
+        <list-item>
+            <refName>
+                urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddSoftDeleteVocabItems):item:name(createItem101)'createItem101'
+            </refName>
+            <workflowState>deleted</workflowState>
+            <rev>1</rev>            
+            <sas>false</sas>
+            <proposed>true</proposed>
+            <order>1</order>
+            <displayName>createItem101</displayName>
+            <shortIdentifier>createItem101</shortIdentifier>
+        </list-item>        
+        <list-item>
+            <refName>
+                urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddSoftDeleteVocabItems):item:name(createItem201)'createItem201'
+            </refName>
+            <workflowState>deleted</workflowState>
+            <rev>1</rev>            
+            <sas>false</sas>
+            <proposed>true</proposed>
+            <order>2</order>
+            <displayName>createItem201</displayName>
+            <shortIdentifier>createItem201</shortIdentifier>
+        </list-item>
+        <list-item>
+            <refName>
+                urn:cspace:testsci.collectionspace.org:vocabularies:name(createUpdateAddSoftDeleteVocabItems):item:name(createItem301)'Updated createItem301'
+            </refName>
+            <workflowState>project</workflowState>
+            <rev>1</rev>            
+            <sas>false</sas>
+            <proposed>true</proposed>
+            <order>1</order>
+            <displayName>Updated createItem301</displayName>
+            <shortIdentifier>createItem301</shortIdentifier>
+        </list-item>        
+    </ns2:abstract-common-list>
+</document>
\ No newline at end of file
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddSoftDeleteVocabItems/updateAddSoftDeleteWithItems-vocab.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/vocabulary/UpdateAddSoftDeleteVocabItems/updateAddSoftDeleteWithItems-vocab.xml
new file mode 100644 (file)
index 0000000..e3fa5bd
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document name="vocabularies">
+    <ns3:vocabularies_common xmlns:ns3="http://collectionspace.org/services/vocabulary" xmlns:ns2="http://collectionspace.org/services/jaxb">
+        <displayName>Updated createUpdateAddSoftDeleteVocabItems Vocabulary</displayName>
+        <shortIdentifier>createUpdateAddSoftDeleteVocabItems</shortIdentifier>
+        <description>This is an updated test vocabulary created in the createUpdateAddSoftDeleteVocabItems XMLReplay test group</description>
+        <source>Some updated mythical book posted with item terms in createUpdateAddSoftDeleteVocabItems test group</source>
+    </ns3:vocabularies_common>
+    <ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
+        <list-item>
+            <order>1</order>
+            <displayName>Updated createItem301</displayName>
+            <shortIdentifier>createItem301</shortIdentifier>
+        </list-item>
+        <list-item>
+            <order>2</order>
+            <displayName>Added item A</displayName>
+            <shortIdentifier>addeditema</shortIdentifier>
+        </list-item>
+        <list-item>
+            <order>3</order>
+            <displayName>Added item B</displayName>
+            <shortIdentifier>addeditemb</shortIdentifier>
+        </list-item>
+        <list-item>
+            <order>4</order>
+            <displayName>Added item C</displayName>
+            <shortIdentifier>addeditemc</shortIdentifier>
+        </list-item>
+    </ns2:abstract-common-list>
+</document>
index f9bb9190e0418f4621cf145d6b006f1dbdb9d8e6..b02a86342d4265f7f9ca8c7c4664cd358fd1d3ec 100644 (file)
@@ -6,6 +6,108 @@
            <auth ID="admin@testsci.collectionspace.org">YWRtaW5AdGVzdHNjaS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
        </auths>
     
+    <!--
+        Test adding to a vocabulary's terms with an entirely new set of terms.
+    -->
+    <testGroup ID="UpdateAddSoftDeleteVocabItems" autoDeletePOSTS="true" authForCleanup="admin@testsci.collectionspace.org">
+        <test ID="createUpdateAddSoftDeleteVocabItems" auth="admin@testsci.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/vocabularies/</uri>
+            <filename>vocabulary/vocab-Template.xml</filename>
+        </test>
+        <test ID="createItem101">
+            <method>POST</method>
+            <uri>/cspace-services/vocabularies/${createUpdateAddSoftDeleteVocabItems.CSID}/items/</uri>
+            <filename>vocabulary/vocab-Item-template.xml</filename>
+            <vars>
+                <var ID="order">1</var>
+            </vars>
+        </test>
+        <test ID="createItem201">
+            <method>POST</method>
+            <uri>/cspace-services/vocabularies/${createUpdateAddSoftDeleteVocabItems.CSID}/items/</uri>
+            <filename>vocabulary/vocab-Item-template.xml</filename>
+            <vars>
+                <var ID="order">2</var>
+            </vars>
+        </test>
+        <test ID="createItem301">
+            <method>POST</method>
+            <uri>/cspace-services/vocabularies/${createUpdateAddSoftDeleteVocabItems.CSID}/items/</uri>
+            <filename>vocabulary/vocab-Item-template.xml</filename>
+            <vars>
+                <var ID="order">3</var>
+            </vars>
+        </test>
+        <test ID="updateUpdateAddSoftDeleteVocabItems" auth="admin@testsci.collectionspace.org">
+            <method>PUT</method>
+            <uri>/cspace-services/vocabularies/${createUpdateAddSoftDeleteVocabItems.CSID}?omittedItemAction=softdelete</uri>
+            <filename>vocabulary/UpdateAddSoftDeleteVocabItems/updateAddSoftDeleteWithItems-vocab.xml</filename>
+        </test>
+        <test ID="getUpdateAddSoftDeleteVocabItems">
+            <method>GET</method>
+            <uri>/cspace-services/vocabularies/${createUpdateAddSoftDeleteVocabItems.CSID}?showItems=true</uri>
+            <response>
+                <vars>
+                    <var ID="csid">${createUpdateAddSoftDeleteVocabItems.CSID}</var>
+                </vars>
+                <expected level="ADDOK" />
+                <filename>vocabulary/UpdateAddSoftDeleteVocabItems/responses/updateAddSoftDeleteVocabItems.res.xml</filename>
+            </response>            
+        </test>
+    </testGroup>
+    
+    <!--
+        Test adding to a vocabulary's terms with an entirely new set of terms.
+    -->
+    <testGroup ID="UpdateAddOnlyVocabItems" autoDeletePOSTS="true" authForCleanup="admin@testsci.collectionspace.org">
+        <test ID="createUpdateAddOnlyVocabItems" auth="admin@testsci.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/vocabularies/</uri>
+            <filename>vocabulary/vocab-Template.xml</filename>
+        </test>
+        <test ID="createItem101">
+            <method>POST</method>
+            <uri>/cspace-services/vocabularies/${createUpdateAddOnlyVocabItems.CSID}/items/</uri>
+            <filename>vocabulary/vocab-Item-template.xml</filename>
+            <vars>
+                <var ID="order">1</var>
+            </vars>
+        </test>
+        <test ID="createItem201">
+            <method>POST</method>
+            <uri>/cspace-services/vocabularies/${createUpdateAddOnlyVocabItems.CSID}/items/</uri>
+            <filename>vocabulary/vocab-Item-template.xml</filename>
+            <vars>
+                <var ID="order">2</var>
+            </vars>
+        </test>
+        <test ID="createItem301">
+            <method>POST</method>
+            <uri>/cspace-services/vocabularies/${createUpdateAddOnlyVocabItems.CSID}/items/</uri>
+            <filename>vocabulary/vocab-Item-template.xml</filename>
+            <vars>
+                <var ID="order">3</var>
+            </vars>
+        </test>
+        <test ID="updateUpdateAddOnlyVocabItems" auth="admin@testsci.collectionspace.org">
+            <method>PUT</method>
+            <uri>/cspace-services/vocabularies/${createUpdateAddOnlyVocabItems.CSID}</uri>
+            <filename>vocabulary/UpdateAddOnlyVocabItems/updateAddOnlyWithItems-vocab.xml</filename>
+        </test>
+        <test ID="getUpdateAddOnlyVocabItems">
+            <method>GET</method>
+            <uri>/cspace-services/vocabularies/${createUpdateAddOnlyVocabItems.CSID}?showItems=true</uri>
+            <response>
+                <vars>
+                    <var ID="csid">${createUpdateAddOnlyVocabItems.CSID}</var>
+                </vars>
+                <expected level="ADDOK" />
+                <filename>vocabulary/UpdateAddOnlyVocabItems/responses/updateAddOnlyVocabItems.res.xml</filename>
+            </response>            
+        </test>
+    </testGroup>
+    
     <!--
         Test replace a vocabulary's terms with an entirely new set of terms.
     -->
         </test>
         <test ID="updateReplaceVocabItems" auth="admin@testsci.collectionspace.org">
             <method>PUT</method>
-            <uri>/cspace-services/vocabularies/${createReplaceVocabItems.CSID}</uri>
-            <filename>vocabulary/ReplaceVocabItems/ReplaceVocabItems.res.xml</filename>
-        </test>
-<!-- 
-        <test ID="deleteReplaceVocabItems">
-            <method>DELETE</method>
-            <uri>/cspace-services/vocabularies/${createReplaceVocabItems.CSID}/items</uri>
-        </test>
-        <test ID="getReplaceVocabItems">
-            <method>GET</method>
-            <uri>/cspace-services/vocabularies/${createReplaceVocabItems.CSID}</uri>
+            <uri>/cspace-services/vocabularies/${createReplaceVocabItems.CSID}?omittedItemAction=delete</uri>
+            <filename>vocabulary/ReplaceVocabItems/replaceWithItems-vocab.xml</filename>
         </test>
         <test ID="getReplaceVocabItems">
             <method>GET</method>
                     <var ID="csid">${createReplaceVocabItems.CSID}</var>
                 </vars>
                 <expected level="ADDOK" />
-                <label>vocabularies_common</label>
-                <filename>vocabulary/ReplaceVocabItems/responses/ReplaceVocabItems.res.xml</filename>
+                <filename>vocabulary/ReplaceVocabItems/responses/replaceVocabItems.res.xml</filename>
+            </response>            
+        </test>
+    </testGroup>
+    
+    <!--
+        Test replace a vocabulary's terms with an entirely new set of terms.
+    -->
+    <testGroup ID="UpdateAddDeleteVocabItems" autoDeletePOSTS="true" authForCleanup="admin@testsci.collectionspace.org">
+        <test ID="createUpdateAddDeleteVocabItems" auth="admin@testsci.collectionspace.org">
+            <method>POST</method>
+            <uri>/cspace-services/vocabularies/</uri>
+            <filename>vocabulary/vocab-Template.xml</filename>
+        </test>
+        <test ID="createItem101">
+            <method>POST</method>
+            <uri>/cspace-services/vocabularies/${createUpdateAddDeleteVocabItems.CSID}/items/</uri>
+            <filename>vocabulary/vocab-Item-template.xml</filename>
+            <vars>
+                <var ID="order">1</var>
+            </vars>
+        </test>
+        <test ID="createItem201">
+            <method>POST</method>
+            <uri>/cspace-services/vocabularies/${createUpdateAddDeleteVocabItems.CSID}/items/</uri>
+            <filename>vocabulary/vocab-Item-template.xml</filename>
+            <vars>
+                <var ID="order">2</var>
+            </vars>
+        </test>
+        <test ID="createItem301">
+            <method>POST</method>
+            <uri>/cspace-services/vocabularies/${createUpdateAddDeleteVocabItems.CSID}/items/</uri>
+            <filename>vocabulary/vocab-Item-template.xml</filename>
+            <vars>
+                <var ID="order">3</var>
+            </vars>
+        </test>
+        <test ID="updateUpdateAddDeleteVocabItems" auth="admin@testsci.collectionspace.org">
+            <method>PUT</method>
+            <uri>/cspace-services/vocabularies/${createUpdateAddDeleteVocabItems.CSID}?omittedItemAction=delete</uri>
+            <filename>vocabulary/UpdateAddDeleteVocabItems/updateAddDeleteWithItems-vocab.xml</filename>
+        </test>
+        <test ID="getUpdateAddDeleteVocabItems">
+            <method>GET</method>
+            <uri>/cspace-services/vocabularies/${createUpdateAddDeleteVocabItems.CSID}?showItems=true</uri>
+            <response>
+                <vars>
+                    <var ID="csid">${createUpdateAddDeleteVocabItems.CSID}</var>
+                </vars>
+                <expected level="ADDOK" />
+                <filename>vocabulary/UpdateAddDeleteVocabItems/responses/updateAddDeleteVocabItems.res.xml</filename>
             </response>            
         </test>
- -->        
     </testGroup>    
     
     <testGroup ID="DeleteVocabJustItems" autoDeletePOSTS="true" authForCleanup="admin@testsci.collectionspace.org">
             <uri>/cspace-services/vocabularies/</uri>
             <filename>vocabulary/vocab-Template.xml</filename>
         </test>
-        <test ID="createItem1" auth="cpw">
+        <test ID="createItem1">
             <method>POST</method>
             <uri>/cspace-services/vocabularies/${createEmptyVocab.CSID}/items/</uri>
             <filename>vocabulary/vocab-Item-template.xml</filename>
index 03449900d41814429b95ef31c848eb2d79755f6d..92e45c48fc80d774c0136c9bcaf8362d41c0c71c 100644 (file)
@@ -37,7 +37,7 @@
  
     <run controlFile="report/report.xml" />
     <run controlFile="authrefs/authrefs.xml" testGroup="AuthRefs" />
-    <run controlFile="vocabulary/vocabulary.xml" testGroup="TestOrder" />
+    <run controlFile="vocabulary/vocabulary.xml" />
     <run controlFile="authrefs/authrefsSimple.xml" testGroup="AuthRefsSimple" />
     <run controlFile="authrefs/authrefsComplex.xml" testGroup="AuthRefsComplex" />
     <run controlFile="authority/authority.xml" testGroup="TestAuthoritiesMultiVocabSearch" />
index cd910aae5c9b992222e277066076ac3f38a5fc7d..4bd7077265fb9ae29c4b478b75bb50db676f2566 100644 (file)
@@ -49,6 +49,7 @@ import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.client.XmlTools;
 import org.collectionspace.services.client.workflow.WorkflowClient;
+
 import org.collectionspace.services.common.CSWebApplicationException;
 import org.collectionspace.services.common.NuxeoBasedResource;
 import org.collectionspace.services.common.ResourceMap;
@@ -79,7 +80,10 @@ import org.collectionspace.services.common.query.QueryManager;
 import org.collectionspace.services.common.repository.RepositoryClient;
 import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityDocumentModelHandler;
 import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityItemDocumentModelHandler;
-import org.collectionspace.services.common.workflow.service.nuxeo.WorkflowDocumentModelHandler;
+import org.collectionspace.services.common.vocabulary.RefNameServiceUtils.AuthorityItemSpecifier;
+import org.collectionspace.services.common.vocabulary.RefNameServiceUtils.SpecifierForm;
+import org.collectionspace.services.common.vocabulary.RefNameServiceUtils.Specifier;
+
 import org.collectionspace.services.config.ClientType;
 import org.collectionspace.services.config.service.ServiceBindingType;
 import org.collectionspace.services.jaxb.AbstractCommonList;
@@ -91,10 +95,9 @@ import org.collectionspace.services.nuxeo.client.java.NuxeoDocumentFilter;
 import org.collectionspace.services.nuxeo.client.java.NuxeoRepositoryClientImpl;
 import org.collectionspace.services.nuxeo.util.NuxeoUtils;
 import org.collectionspace.services.workflow.WorkflowCommon;
-import org.collectionspace.services.common.vocabulary.RefNameServiceUtils.AuthorityItemSpecifier;
-import org.collectionspace.services.common.vocabulary.RefNameServiceUtils.SpecifierForm;
-import org.collectionspace.services.common.vocabulary.RefNameServiceUtils.Specifier;
+import org.collectionspace.services.common.workflow.service.nuxeo.WorkflowDocumentModelHandler;
 import org.collectionspace.services.description.ServiceDescription;
+
 import org.jboss.resteasy.util.HttpResponseCodes;
 import org.nuxeo.ecm.core.api.DocumentModel;
 import org.nuxeo.ecm.core.api.DocumentModelList;
@@ -773,12 +776,21 @@ public abstract class AuthorityResource<AuthCommon, AuthItemHandler>
         // We omit the parentShortId, only needed when doing a create...
         AuthorityItemDocumentModelHandler handler = (AuthorityItemDocumentModelHandler)createItemDocumentHandler(ctx, parentcsid, parentShortId);
         handler.setShouldUpdateRevNumber(shouldUpdateRevNumber);
-        if (isProposed != null) {
-               handler.setIsProposed(isProposed);
-        }
-        if (isSASItem != null) {
-               handler.setIsSASItem(isSASItem);
+        //
+        // Update the SAS fields if either value is non-null
+        //
+        boolean updateSASFields = isProposed != null || isSASItem != null;
+        handler.setshouldUpdateSASFields(updateSASFields);
+        if (updateSASFields == true) {
+               handler.setshouldUpdateSASFields(true);
+               if (isProposed != null) {
+                       handler.setIsProposed(isProposed);
+               }
+               if (isSASItem != null) {
+                       handler.setIsSASItem(isSASItem);
+               }
         }
+        
         getRepositoryClient(ctx).update(ctx, itemcsid, handler);
         result = ctx.getOutput();
 
index 7cc8e3ed26053afe1799726c27b6a17498d92663..7a60881e54d6507ee6e82615135190c208e07254 100644 (file)
@@ -94,6 +94,7 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon>
     protected String authorityItemCommonSchemaName;
     private String authorityItemTermGroupXPathBase;
     
+    private boolean shouldUpdateSASFields = true;
     private boolean syncHierarchicalRelationships = false;
     private boolean isProposed = false; // used by local authority to propose a new shared item. Allows local deployments to use new terms until they become official
     private boolean isSAS = false; // used to indicate if the authority item originated as a SAS item
@@ -115,6 +116,17 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon>
     
     abstract public String getParentCommonSchemaName();
     
+    //
+    // Getter and Setter for 'shouldUpdateSASFields'
+    //
+    public boolean getShouldUpdateSASFields() {
+       return shouldUpdateSASFields;
+    }
+    
+    public void setshouldUpdateSASFields(boolean flag) {
+       shouldUpdateSASFields = flag;
+    }
+    
     //
     // Getter and Setter for 'proposed'
     //
@@ -870,16 +882,19 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon>
        if (this.getShouldUpdateRevNumber() == true && !isMarkedAsSASItem) { // We won't update rev numbers on synchronization with SAS items and on local changes to SAS items
                updateRevNumbers(wrapDoc);
        }
-       //
-       // If this is a proposed item (not part of the SAS), mark it as such
-       //
-        documentModel.setProperty(authorityItemCommonSchemaName, AuthorityItemJAXBSchema.PROPOSED,
-                       new Boolean(this.getIsProposed()));
-        //
-        // If it is a SAS authority item, mark it as such
-        //
-        documentModel.setProperty(authorityItemCommonSchemaName, AuthorityItemJAXBSchema.SAS,
-                       new Boolean(this.getIsSASItem()));
+       
+       if (getShouldUpdateSASFields() == true) {
+               //
+               // If this is a proposed item (not part of the SAS), mark it as such
+               //
+               documentModel.setProperty(authorityItemCommonSchemaName, AuthorityItemJAXBSchema.PROPOSED,
+                               new Boolean(this.getIsProposed()));
+               //
+               // If it is a SAS authority item, mark it as such
+               //
+               documentModel.setProperty(authorityItemCommonSchemaName, AuthorityItemJAXBSchema.SAS,
+                               new Boolean(this.getIsSASItem()));
+       }
     }
     
     /**
index df8e25ba607407001ea091f8df8a30f7c77f07db..b8ef0b8eb0e56e684d40dddbce45ab24ceb8a6a4 100644 (file)
@@ -333,10 +333,11 @@ public class LoaninAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
      * may be expected to be deleted by certain tests.
      * @throws Exception 
      */
-    @AfterClass(alwaysRun=true)
+    @Override
+       @AfterClass(alwaysRun=true)
     public void cleanUp() throws Exception {
         String noTest = System.getProperty("noTestCleanup");
-       if(Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
+       if (Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
             if (logger.isDebugEnabled()) {
                 logger.debug("Skipping Cleanup phase ...");
             }
@@ -345,31 +346,58 @@ public class LoaninAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         if (logger.isDebugEnabled()) {
             logger.debug("Cleaning up temporary resources created for testing ...");
         }
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        //
+        // Delete the loansin records before the person items/terms
+        //
+       LoaninClient loaninClient = new LoaninClient();
+        for (String csid : loaninIdsCreated) {
+               Response res = null;
+               try {
+                       res = loaninClient.delete(csid);
+                       if (res.getStatus() != Response.Status.OK.getStatusCode()) {
+                               throw new Exception(String.format("Could not delete loansin record with CSID=%s", csid));
+                       }
+               } catch (Throwable t) {
+                       if (res != null) res.close();
+                       throw t;
+               }
+        }
+        //
         // Delete Person resource(s) (before PersonAuthority resources).
-        
-        for (String resourceId : personIdsCreated) {
-            // Note: Any non-success responses are ignored and not reported.
-                       personAuthClient.deleteItem(personAuthCSID, resourceId).close();
+        //
+        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();        
+        for (String csid : personIdsCreated) {
+               Response res = null;
+               try {
+                       res = personAuthClient.deleteItem(personAuthCSID, csid);
+                       if (res.getStatus() != Response.Status.OK.getStatusCode()) {
+                               throw new Exception(String.format("Could not delete person item/term record with CSID=%s inside person authority with CSID=%s", 
+                                               csid, personAuthCSID));
+                       }
+               } catch (Throwable t) {
+                       if (res != null) res.close();
+                       throw t;
+               }
         }
-        
-        // Delete PersonAuthority resource(s).
-        // Note: Any non-success response is ignored and not reported.
+        //
+        // Delete the PersonAuthority resource.
+        //
         if (personAuthCSID != null) {
-               personAuthClient.delete(personAuthCSID);
-               // Delete Loans In resource(s).
-               LoaninClient loaninClient = new LoaninClient();
-               for (String resourceId : loaninIdsCreated) {
-                   // Note: Any non-success responses are ignored and not reported.
-                   loaninClient.delete(resourceId).close();
-               }
+               Response res = null;
+               try {
+                       res = personAuthClient.delete(personAuthCSID);
+               } catch (Throwable t) {
+                       if (res != null) res.close();
+                       throw t;
+               }
         }
     }
 
     // ---------------------------------------------------------------
     // Utility methods used by tests above
     // ---------------------------------------------------------------
-    public String getServiceName() {
+    @Override
+       public String getServiceName() {
         return SERVICE_NAME;
     }
 
index eac316a5ecda8e5a81d7054b0911b9c816939c48..94076561f51d7ff1cfd5565124e9e96eb7b5224f 100644 (file)
@@ -324,10 +324,11 @@ public class LoanoutAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
      * may be expected to be deleted by certain tests.
      * @throws Exception 
      */
-    @AfterClass(alwaysRun=true)
+    @Override
+       @AfterClass(alwaysRun=true)
     public void cleanUp() throws Exception {
         String noTest = System.getProperty("noTestCleanup");
-       if(Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
+       if (Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
             if (logger.isDebugEnabled()) {
                 logger.debug("Skipping Cleanup phase ...");
             }
@@ -336,29 +337,63 @@ public class LoanoutAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         if (logger.isDebugEnabled()) {
             logger.debug("Cleaning up temporary resources created for testing ...");
         }
+        //
+        // Delete the loansout record(s) first
+        //
+        LoanoutClient loanoutClient = new LoanoutClient();
+        for (String resourceId : loanoutIdsCreated) {
+               Response res = null;
+               try {
+                       res = loanoutClient.delete(resourceId);
+                       if (res.getStatus() != Response.Status.OK.getStatusCode()) {
+                               throw new Exception(String.format("Could not delete the Loansout record=%s",
+                                               resourceId));
+                       }
+               } catch (Throwable t) {
+                       if (res != null) res.close();
+                       throw t;
+               }
+        }
+        //
+        // Delete the person terms/items before the person authority
+        //
         PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
-        // Delete Person resource(s) (before PersonAuthority resources).
         for (String resourceId : personIdsCreated) {
-            // Note: Any non-success responses are ignored and not reported.
-            personAuthClient.deleteItem(personAuthCSID, resourceId).close();
+               Response res = null;
+               try {
+                       res = personAuthClient.deleteItem(personAuthCSID, resourceId);
+                       if (res.getStatus() != Response.Status.OK.getStatusCode()) {
+                               throw new Exception(String.format("Could not delete person term=%s from authority=%s",
+                                               resourceId, personAuthCSID));
+                       }
+               } catch (Throwable t) {
+                       if (res != null) res.close();
+                       throw t;
+               }
         }
-        // Delete PersonAuthority resource(s).
-        // Note: Any non-success response is ignored and not reported.
+        //
+        // Finally, delete the PersonAuthority resource(s).
+        //
         if (personAuthCSID != null) {
-               personAuthClient.delete(personAuthCSID).close();
-               // Delete Loans In resource(s).
-               LoanoutClient loanoutClient = new LoanoutClient();
-               for (String resourceId : loanoutIdsCreated) {
-                   // Note: Any non-success responses are ignored and not reported.
-                   loanoutClient.delete(resourceId).close();
-               }
+               Response res = null;
+               try {
+                       res = personAuthClient.delete(personAuthCSID);
+                       if (res.getStatus() != Response.Status.OK.getStatusCode()) {
+                               throw new Exception(String.format("Could not delete the Person authority=%s",
+                                               personAuthCSID));
+                       }
+               } catch (Throwable t) {
+                       if (res != null) res.close();
+                       throw t;
+               }
         }
     }
 
     // ---------------------------------------------------------------
     // Utility methods used by tests above
     // ---------------------------------------------------------------
-    public String getServiceName() {
+    @Override
+       public String getServiceName() {
         return SERVICE_NAME;
     }
 
index 3159c1b6d6bc5cd7f122c4aba90cb3f79d21c921..b733c7646e00648d4995a3110ea2e31458f36f88 100644 (file)
@@ -38,7 +38,16 @@ public class VocabularyClient extends AuthorityClientImpl<VocabulariesCommon, Vo
        public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
        public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME;
     public static final String TERM_INFO_GROUP_XPATH_BASE = "vocabularyTermGroup";
-       public static String SHOW_ITEMS_QP = "showItems"; // query param on GET of vocabulary to get list of items included in the result payload
+    
+    //
+    // Request query parameter constants
+    //
+       public static final String SHOW_ITEMS_QP = "showItems"; // query param on GET of vocabulary to get list of items included in the result payload
+       public static final String OMITTED_ITEM_ACTION_QP = "omittedItemAction";  // values can be "delete", "softdelete", "ignore"; the value of "ignore" is the default       
+       public static final String DELETE_OMITTED_ITEMS = "delete";
+       public static final String SOFTDELETE_OMITTED_ITEMS = "softdelete";
+       public static final String IGNORE_OMITTED_ITEMS = "ignore";    
+       
        //
        // Subitem constants
        //
index caa828e7f0556f60603bdcc6f23bae2fecb7ae42..64a5f9e3890387df61a223d5da4911c840c0e236 100644 (file)
@@ -39,6 +39,7 @@ import org.collectionspace.services.common.context.ServiceBindingUtils;
 import org.collectionspace.services.common.context.ServiceContext;
 import org.collectionspace.services.common.document.DocumentException;
 import org.collectionspace.services.common.document.DocumentHandler;
+import org.collectionspace.services.common.document.DocumentNotFoundException;
 import org.collectionspace.services.common.document.JaxbUtils;
 import org.collectionspace.services.common.repository.RepositoryClient;
 import org.collectionspace.services.common.vocabulary.AuthorityResource;
@@ -58,6 +59,10 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.w3c.dom.Element;
 
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
 import javax.ws.rs.PUT;
@@ -84,7 +89,7 @@ public class VocabularyResource extends
     
     private final static String vocabularyItemServiceName = "vocabularyitems";
        private final static String VOCABULARYITEMS_COMMON = "vocabularyitems_common";
-    
+
     final Logger logger = LoggerFactory.getLogger(VocabularyResource.class);
 
        public VocabularyResource() {
@@ -115,7 +120,10 @@ public class VocabularyResource extends
                                try {
                            DocumentHandler<?, AbstractCommonList, DocumentModel, DocumentModelList> handler = createDocumentHandler(ctx);                          
                            String csid = repoClient.create(ctx, handler);
-                           handleItemsPayload(Method.POST, repoSession, csid, resourceMap, uriInfo, input);
+                           //
+                           // Handle any supplied list of items/terms
+                           //
+                           handleItemsPayload(Method.POST, ctx, csid, resourceMap, uriInfo, input);
                            UriBuilder path = UriBuilder.fromResource(resourceClass);
                            path.path("" + csid);
                            Response response = Response.created(path.build()).build();
@@ -137,14 +145,15 @@ public class VocabularyResource extends
     @Override
     public byte[] updateAuthority(
                @Context ResourceMap resourceMap,
-               @Context UriInfo uriInfo,
+               @Context UriInfo ui,
             @PathParam("csid") String specifier,
             String xmlPayload) {
         PoxPayloadOut result = null;
         try {
+               UriInfoWrapper uriInfo = new UriInfoWrapper(ui); // We need to make the queryParams maps read-write instead of read-only
             PoxPayloadIn theUpdate = new PoxPayloadIn(xmlPayload);
             Specifier spec = Specifier.getSpecifier(specifier, "updateAuthority", "UPDATE");
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext(theUpdate);
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext(theUpdate, uriInfo);
                        RepositoryClient<PoxPayloadIn, PoxPayloadOut> repoClient = this.getRepositoryClient(ctx);
 
                        CoreSessionInterface repoSession = repoClient.getRepositorySession(ctx);
@@ -158,7 +167,7 @@ public class VocabularyResource extends
                        csid = getRepositoryClient(ctx).findDocCSID(null, ctx, whereClause);
                    }
                    getRepositoryClient(ctx).update(ctx, csid, handler);
-                   handleItemsPayload(Method.PUT, repoSession, csid, resourceMap, uriInfo, theUpdate);
+                   handleItemsPayload(Method.PUT, ctx, csid, resourceMap, uriInfo, theUpdate);
                    result = ctx.getOutput();
             } catch (Throwable t) {
                repoSession.setTransactionRollbackOnly();
@@ -172,9 +181,175 @@ public class VocabularyResource extends
         return result.getBytes();
     }
     
+    private void updateWithItemsPayload(
+               AbstractCommonList itemsList,
+               ServiceContext<PoxPayloadIn, PoxPayloadOut> existingCtx,
+               String parentIdentifier,
+               ResourceMap resourceMap,
+               UriInfo uriInfo,
+               PoxPayloadIn input) throws Exception {
+       
+       CoreSessionInterface repoSession = (CoreSessionInterface) existingCtx.getCurrentRepositorySession();
+       //
+       // First try to update and/or create items in the incoming payload
+       //
+               for (ListItem item : itemsList.getListItem()) {
+                       String errMsg = null;
+                       boolean success = true;
+                       Response response = null;
+                       PoxPayloadOut payloadOut = null;
+                       PoxPayloadIn itemXmlPayload = getItemXmlPayload(item);
+                       String itemSpecifier = getSpecifier(item);
+                       if (itemSpecifier != null) {
+                               try {
+                                       payloadOut = updateAuthorityItem(repoSession, resourceMap, uriInfo, parentIdentifier, itemSpecifier, itemXmlPayload);
+                                       if (payloadOut == null) {
+                                       success = false;
+                                       errMsg = String.format("Could not update the term list payload of vocabuary '%s'.", parentIdentifier);
+                               }
+                               } catch (DocumentNotFoundException dnf) {
+                                       //
+                                       // Since the item doesn't exist, we're being ask to create it
+                                       //
+                               response = this.createAuthorityItem(repoSession, resourceMap, uriInfo, parentIdentifier, itemXmlPayload);
+                               if (response.getStatus() != Response.Status.CREATED.getStatusCode()) {
+                                       success = false;
+                                       errMsg = String.format("Could not create the term list payload of vocabuary '%s'.", parentIdentifier);
+                               }
+                               }
+                       } else {
+                               success = false;
+                               errMsg = String.format("Could not update the term list payload of vocabuary '%s' because one of the item is missing a CSID or short identifier value.",
+                                               parentIdentifier);
+                       }
+                       //
+                       // Throw an exception as soon as we have problems with any item
+                       //
+                       if (success == false) {
+                               throw new DocumentException(errMsg);
+                       }
+               }
+
+               //
+               // Next, delete the items that were omitted from the incoming payload
+               //
+               if (shouldDeleteOmittedItems(uriInfo) == true) {
+                       String omittedItemAction = getOmittedItemAction(uriInfo);
+                       Set<String> shortIdsInPayload = getListOfShortIds(itemsList);
+                       AbstractCommonList abstractCommonList = this.getAuthorityItemList(existingCtx, parentIdentifier, uriInfo);
+                       if (abstractCommonList != null && !Tools.isEmpty(abstractCommonList.getListItem())) {
+                               if (omittedItemAction.equalsIgnoreCase(VocabularyClient.DELETE_OMITTED_ITEMS)) {
+                                       deleteAuthorityItems(existingCtx, abstractCommonList, shortIdsInPayload, parentIdentifier);
+                               } else {
+                                       sotfDeleteAuthorityItems(existingCtx, abstractCommonList, shortIdsInPayload, parentIdentifier);
+                               }
+                       }
+               }
+       }
+    
+    private void deleteAuthorityItems(
+               ServiceContext<PoxPayloadIn, PoxPayloadOut> existingCtx,
+               AbstractCommonList abstractCommonList,
+               Set<String> shortIdsInPayload,
+               String parentIdentifier) throws Exception {
+       
+               for (ListItem item : abstractCommonList.getListItem()) {
+                       String shortId = getShortId(item);
+                       if (shortIdsInPayload.contains(shortId) == false) {
+                               deleteAuthorityItem(existingCtx, parentIdentifier, getCsid(item), AuthorityServiceUtils.UPDATE_REV);
+                       }
+               }       
+    }
+    
+    private void sotfDeleteAuthorityItems(
+               ServiceContext<PoxPayloadIn, PoxPayloadOut> existingCtx,
+               AbstractCommonList abstractCommonList,
+               Set<String> shortIdsInPayload,
+               String parentIdentifier) throws Exception {
+       
+               for (ListItem item : abstractCommonList.getListItem()) {
+                       String shortId = getShortId(item);
+                       if (shortIdsInPayload.contains(shortId) == false) {
+                               //deleteAuthorityItem(existingCtx, parentIdentifier, getCsid(item), AuthorityServiceUtils.UPDATE_REV);
+                               this.updateItemWorkflowWithTransition(existingCtx, parentIdentifier, getCsid(item), 
+                                               WorkflowClient.WORKFLOWTRANSITION_DELETE, AuthorityServiceUtils.UPDATE_REV);
+                       }
+               }       
+    }
+        
+    private boolean shouldDeleteOmittedItems(UriInfo uriInfo) throws DocumentException {
+       boolean result = false;
+       
+               String omittedItemAction = getOmittedItemAction(uriInfo);               
+               if (Tools.isEmpty(omittedItemAction) == false) {
+                       switch (omittedItemAction) {
+                               case VocabularyClient.DELETE_OMITTED_ITEMS:
+                               case VocabularyClient.SOFTDELETE_OMITTED_ITEMS:
+                                       result = true;
+                                       break;
+                               case VocabularyClient.IGNORE_OMITTED_ITEMS:
+                                       // do nothing
+                                       break;
+                               default:
+                                       String msg = String.format("Unknown value '%s' for update on a vocabulary/termlist resource.", omittedItemAction);
+                                       throw new DocumentException(msg);
+                       }
+               }
+               
+               return result;
+       }
+    
+    private String getOmittedItemAction(UriInfo uriInfo) {
+               MultivaluedMap<String,String> queryParams = uriInfo.getQueryParameters();
+               String omittedItemAction = queryParams.getFirst(VocabularyClient.OMITTED_ITEM_ACTION_QP);
+               return omittedItemAction;
+    }
+
+       /*
+     * Returns the set of short identifiers in the abstract common list of authority items
+     */
+    private Set<String> getListOfShortIds(AbstractCommonList itemsList) {
+               HashSet<String> result = new HashSet<String>();
+               
+               for (ListItem item : itemsList.getListItem()) {
+                       result.add(getShortId(item));
+               }
+               
+               return result;
+       }
+
+       private void createWithItemsPayload(
+               AbstractCommonList itemsList,
+               ServiceContext existingCtx,
+               String parentIdentifier,
+               ResourceMap resourceMap,
+               UriInfo uriInfo,
+               PoxPayloadIn input) throws Exception {
+       
+               for (ListItem item : itemsList.getListItem()) {
+                       String errMsg = null;
+                       boolean success = true;
+                       Response response = null;
+                       PoxPayloadIn itemXmlPayload = getItemXmlPayload(item);
+
+                       CoreSessionInterface repoSession = (CoreSessionInterface) existingCtx.getCurrentRepositorySession();
+                       response = this.createAuthorityItem(repoSession, resourceMap, uriInfo, parentIdentifier, itemXmlPayload);
+                       if (response.getStatus() != Response.Status.CREATED.getStatusCode()) {
+                               success = false;
+                               errMsg = String.format("Could not create the term list payload of vocabuary '%s'.", parentIdentifier);
+                       }
+                       //
+                       // Throw an exception as soon as we have problems with any item
+                       //
+                       if (success == false) {
+                               throw new DocumentException(errMsg);
+                       }
+               }       
+       }    
+    
     private boolean handleItemsPayload(
                Method method,
-               CoreSessionInterface repoSession,
+               ServiceContext existingCtx,
                String parentIdentifier,
                ResourceMap resourceMap,
                UriInfo uriInfo,
@@ -184,46 +359,48 @@ public class VocabularyResource extends
        PayloadInputPart abstractCommonListPart  = input.getPart(PoxPayload.ABSTRACT_COMMON_LIST_ROOT_ELEMENT_LABEL);
        if (abstractCommonListPart != null) {
                AbstractCommonList itemsList = (AbstractCommonList) abstractCommonListPart.getBody();
-               for (ListItem item : itemsList.getListItem()) {
-                       String errMsg = null;
-                       boolean success = true;
-                       Response response = null;
-                       PoxPayloadOut payloadOut = null;
-                       PoxPayloadIn itemXmlPayload = getItemXmlPayload(item);
-                       switch (method) {
-                               case POST:
-                                       response = this.createAuthorityItem(repoSession, resourceMap, uriInfo, parentIdentifier, itemXmlPayload);
-                                       if (response.getStatus() != Response.Status.CREATED.getStatusCode()) {
-                                               success = false;
-                                               errMsg = String.format("Could not create the term list payload of vocabuary '%s'.", parentIdentifier);
-                                       }
-                                       break;
-                               case PUT:
-                                       String itemSpecifier = getSpecifier(item);
-                                       if (itemSpecifier != null) {
-                                               payloadOut = updateAuthorityItem(repoSession, resourceMap, uriInfo, parentIdentifier, itemSpecifier, itemXmlPayload);
-                                               if (payloadOut == null) {
-                                                       success = false;
-                                                       errMsg = String.format("Could not update the term list payload of vocabuary '%s'.", parentIdentifier);
-                                               }
-                                       } else {
-                                               success = false;
-                                               errMsg = String.format("Could not update the term list payload of vocabuary '%s' because one of the item is missing a CSID or short identifier value.",
-                                                               parentIdentifier);
-                                       }
-                                       break;                                  
-                       }
-                       //
-                       // Throw an exception as soon as we have problems with any item
-                       //
-                       if (success == false) {
-                                       throw new DocumentException(errMsg);
-                       }
-               }
+                       switch (method) {
+                       case POST:
+                           createWithItemsPayload(itemsList, existingCtx, parentIdentifier, resourceMap, uriInfo, input);
+                               break;
+                       case PUT:
+                           updateWithItemsPayload(itemsList, existingCtx, parentIdentifier, resourceMap, uriInfo, input);
+                               break;                                  
+                       }
        }
        
        return result;
-       }    
+       }
+    
+    private String getCsid(ListItem item) {
+       String result = null;
+       
+               for (Element ele : item.getAny()) {
+                       String fieldName = ele.getTagName();
+                       String fieldValue = ele.getTextContent();
+                       if (fieldName.equalsIgnoreCase("csid")) {
+                               result = fieldValue;
+                               break;
+                       }
+               }       
+       
+       return result;
+    }
+    
+    private String getShortId(ListItem item) {
+       String result = null;
+       
+       for (Element ele : item.getAny()) {
+                       String fieldName = ele.getTagName();
+                       String fieldValue = ele.getTextContent();
+                       if (fieldName.equalsIgnoreCase("shortIdentifier")) {
+                               result = fieldValue;
+                               break;
+                       }
+               }
+       
+       return result;
+    }
     
     /**
      * We'll return null if we can create a specifier from the list item.
@@ -234,27 +411,9 @@ public class VocabularyResource extends
     private String getSpecifier(ListItem item) {
                String result = null;
 
-               String csid = null;
-               for (Element ele : item.getAny()) {
-                       String fieldName = ele.getTagName();
-                       String fieldValue = ele.getTextContent();
-                       if (fieldName.equalsIgnoreCase("csid")) {
-                               result = csid = fieldValue;
-                               break;
-                       }
-               }
-               
+               String csid = getCsid(item);            
                if (csid == null) {
-                       String shortId = null;
-                       for (Element ele : item.getAny()) {
-                               String fieldName = ele.getTagName();
-                               String fieldValue = ele.getTextContent();
-                               if (fieldName.equalsIgnoreCase("shortIdentifier")) {
-                                       shortId = fieldValue;
-                                       break;
-                               }
-                       }
-                       
+                       String shortId = getShortId(item);                      
                        if (shortId != null) {
                                result = Specifier.createShortIdURNValue(shortId);
                        }