]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5728: Updated XmlReplay-based tests to verify that correct computedCurrentLoca...
authorAron Roberts <aron@socrates.berkeley.edu>
Tue, 8 Jan 2013 22:31:28 +0000 (14:31 -0800)
committerAron Roberts <aron@socrates.berkeley.edu>
Tue, 8 Jan 2013 22:31:28 +0000 (14:31 -0800)
services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batch-invoke-updateobjloc-single.xml [moved from services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batch-invoke-updateobjloc.xml with 100% similarity]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/batch-update-object-loc.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/res/collectionobject.res.xml [new file with mode: 0644]

index 63b308b5a21732112a39eca98da798621207457e..1e306a61140964787a39c5a617e8231af5d1928d 100644 (file)
@@ -7,7 +7,7 @@
         \r
     <!-- This tests the UpdateObjectLocationBatchJob -->\r
         \r
-    <testGroup ID="testSingleRecordBatchUpdate" autoDeletePOSTS="false">\r
+    <testGroup ID="testSingleRecordBatchUpdate" autoDeletePOSTS="true">\r
             \r
         <test ID="createBatchRecord">\r
             <method>POST</method>\r
             <expectedCodes>201</expectedCodes>\r
         </test>\r
         \r
+        <!-- The currentLocation value of this Movement record, which -->\r
+        <!-- has the most recent locationDate value, should thus be -->\r
+        <!-- reflected in the computedCurrentLocation value in the -->\r
+        <!-- CollectionObject record after invoking the batch job. -->\r
         <test ID="createMovement2">\r
             <method>POST</method>\r
             <uri>/cspace-services/movements</uri>\r
         <test ID="invokeBatch" auth="test" autoDeletePOSTS="false">\r
             <method>POST</method>\r
             <uri>/cspace-services/batch/${createBatchRecord.CSID}</uri>\r
-            <filename>batch/batch-invoke-updateobjloc.xml</filename>\r
+            <filename>batch/batch-invoke-updateobjloc-single.xml</filename>\r
             <vars>\r
                 <var ID="collectionObjectCSID">${createCollectionObject.CSID}</var>\r
             </vars>\r
+            <expectedCodes>200</expectedCodes>\r
         </test>\r
 \r
+        <!-- Verify that, following the invocation of the batch job, the -->\r
+        <!-- computedCurrentLocation field in the CollectionObject record -->\r
+        <!-- has been updated to the appropriate value, reflecting the -->\r
+        <!-- most recent movement (e.g. the Movement record with latest locationDate). -->\r
         <test ID="readUpdatedCollectionObjectRecord">\r
             <method>GET</method>\r
             <uri>/cspace-services/collectionobjects/${createCollectionObject.CSID}</uri>\r
             <filename>batch/updateobjloc.xml</filename>\r
+            <response>\r
+                <expected level="TEXT" />\r
+                <filename>batch/res/collectionobject.res.xml</filename>\r
+                <vars>\r
+                    <var ID="computedCurrentLocationValue">${createMovement2.currentLocation}</var>\r
+                </vars>\r
+            </response>\r
+            <expectedCodes>200</expectedCodes>\r
         </test> \r
         \r
     </testGroup>\r
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/res/collectionobject.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/batch/res/collectionobject.res.xml
new file mode 100644 (file)
index 0000000..865d897
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="collectionobjects">
+
+  <ns2:collectionobjects_common
+    xmlns:ns2="http://collectionspace.org/services/collectionobject">
+    <computedCurrentLocation>${computedCurrentLocationValue}</computedCurrentLocation>
+  </ns2:collectionobjects_common>
+
+</document>
\ No newline at end of file