]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5677: Added the remaining initial versioning tests requested by Patrick.
authorAron Roberts <aron@socrates.berkeley.edu>
Sat, 27 Oct 2012 00:35:52 +0000 (17:35 -0700)
committerAron Roberts <aron@socrates.berkeley.edu>
Sat, 27 Oct 2012 00:35:52 +0000 (17:35 -0700)
services/IntegrationTests/src/test/resources/test-data/xmlreplay/versioning/res/movement-list.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/versioning/versioning.xml

index 0021996a6a4767fbeb19c43777da43838439c140..25cdcca92934a27b6589dfee8a273e696e73bd69 100644 (file)
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
-    <totalItems>1</totalItems>
+    <totalItems>${totalItemsValue}</totalItems>
 </ns2:abstract-common-list>
index 4b00a2d951bc67b971277061020a49ec855b3938..9ab52ab0fde2a114c73c666eb4ec5343800f85e4 100644 (file)
       <uri>/cspace-services/movements/</uri>
       <filename>versioning/movement.xml</filename>
       <vars>
-        <!-- The currentLocation value should properly be a Storage Location or Organization -->
-        <!-- refName, but for the test-only function served by this temporary record, this -->
-        <!-- value is instead an arbitrary string. -->
-        <!-- (Note: that arbitrary string must also be present in one and only one -->
-        <!-- Movement record for the search test below to succeed.) -->
+        <!-- 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@lifesci.collectionspace.org">
       <method>PUT</method>
       <uri>/cspace-services/movements/${CreateMovement.CSID}</uri>
       <expectedCodes>200</expectedCodes>
     </test>
     
-    <!-- A keyword search on the current location value should retrieve only one -->
-    <!-- document, even though there are now two documents extant: the current -->
-    <!-- version and one past version, which was created as a result of the update. -->
+    <!-- The total number of Movement records reported should not change following -->
+    <!-- the update, even though a new version of one Movement document was created -->
+    <!-- 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, which was created 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 (GET) request should also verify that only the -->
-    <!-- current version, containing the most recently updated value(s), is returned. -->
+    <!-- Retrieving the document via a read (GET) request should also verify -->
+    <!-- that only the current version, containing the most recently updated -->
+    <!-- value(s), is returned. -->
     <test ID="ReadReturnsOnlyCurrentVersion">
       <method>GET</method>
       <uri>/cspace-services/movements/${CreateMovement.CSID}</uri>