]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-3917,CSPACE-5049: Additional check of server-side variable expansion in collec...
authorAron Roberts <aron@socrates.berkeley.edu>
Thu, 26 Apr 2012 01:31:26 +0000 (18:31 -0700)
committerAron Roberts <aron@socrates.berkeley.edu>
Thu, 26 Apr 2012 01:31:26 +0000 (18:31 -0700)
services/IntegrationTests/src/test/resources/test-data/xmlreplay/imports/import-objectexit-varexpansion.xml [moved from services/IntegrationTests/src/test/resources/test-data/xmlreplay/imports/import-objectexit-docid.xml with 100% similarity]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/imports/imports.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/imports/res/import-objectexit-varexpansion.res.xml [moved from services/IntegrationTests/src/test/resources/test-data/xmlreplay/imports/res/import-objectexit-docid.res.xml with 54% similarity]

index 45f8e63acd6336fed402cd68f26e7b9331f944ea..0d829b1f38eae2c87f762b668f0768b58173b4d2 100644 (file)
         
         <!--
             Import a record with a client-provided CSID.
-            Then also insert the value of that CSID into a field via the ${docID} variable. 
+            Then also exercise the Imports services's variable expansion:
+            * Insert the value of that CSID into a field via expansion
+              of the ${docID} variable.
+            * Verify that variable has been expanded in the imported record.
+            * Verify that a server-side variable has also been expanded in the
+              wrapper template for imported records; specifically, that an
+              expected value is is present in the collectionspace_core part.
             (See "Variables supported in expansion of request" in
             http://wiki.collectionspace.org/display/collectionspace/Imports+Service+Home)
         -->
-        <test ID="importObjectExitWithDocID">
+        <test ID="importObjectExitWithVarExpansion">
             <expectedCodes>200</expectedCodes>
             <method>POST</method>
             <uri>/cspace-services/imports</uri>
-            <filename>imports/import-objectexit-docid.xml</filename>
+            <filename>imports/import-objectexit-varexpansion.xml</filename>
             <vars>
                 <var ID="recordCSID">920c578f-e5d6-45da-adab-6f26f6a491ff</var>
             </vars>
                 <filename>imports/res/import-objectexit.res.xml</filename>
             </response>
         </test>
-        <test ID="verifyObjectExitWithDocID">
+        <test ID="verifyObjectExitWithVarExpansion">
             <expectedCodes>200</expectedCodes>
             <method>GET</method>
-            <uri>/cspace-services/objectexit/${importObjectExitWithDocID.recordCSID}</uri>
+            <uri>/cspace-services/objectexit/${importObjectExitWithVarExpansion.recordCSID}</uri>
             <response>
                 <expected level="ADDOK" />
-                <filename>imports/res/import-objectexit-docID.res.xml</filename>
+                <filename>imports/res/import-objectexit-varexpansion.res.xml</filename>
                 <label>objectexit_common</label>
             </response>
         </test>
-        <test ID="deleteObjectExitWithDocID">
+        <test ID="deleteObjectExitWithVarExpansion">
             <expectedCodes>200</expectedCodes>
             <method>DELETE</method>
-            <uri>/cspace-services/objectexit/${importObjectExitWithDocID.recordCSID}</uri>
+            <uri>/cspace-services/objectexit/${importObjectExitWithVarExpansion.recordCSID}</uri>
         </test>
         
         <!--
     -->
     <testGroup ID="importsTemporaryTestGroup" autoDeletePOSTS="false">
         
+        <!-- Add new or changed tests here -->
+        
+    </testGroup>
+    
+    
+    <!--
+      Test group holding notes and markup fragments for possible future
+      standard tests of the Imports service.
+    -->
+    <testGroup ID="importsTestNotesGroup" autoDeletePOSTS="false">
+        
         <!-- The following tests are not currently working, and thus are commented out. -->
         <!--
             Import a single ObjectExit record, at least one of whose fields
         </test>
         -->
         
-        <!-- FIXME: Add forms-based import test -->
+        <!-- FIXME: Add a test of the forms-based import pathway. -->
+        <!-- This may require support for the requisite MIME type in XmlReplay -->
         <!--
         <test ID="import-post-form">
             <expectedCodes>200</expectedCodes>
         </test>
         -->
         
-        <!-- FIXME: Add tests with invalid payloads, via each imports path -->
-        
-        <!-- Add new or changed tests here -->
+        <!-- FIXME: Add import of records with schema expansion part(s). -->
         
+        <!-- FIXME: Add tests with invalid payloads, via each imports path, -->
+        <!-- and verify failure results. -->
+                
     </testGroup>
 
 </xmlReplay>
similarity index 54%
rename from services/IntegrationTests/src/test/resources/test-data/xmlreplay/imports/res/import-objectexit-docid.res.xml
rename to services/IntegrationTests/src/test/resources/test-data/xmlreplay/imports/res/import-objectexit-varexpansion.res.xml
index cde41b302bf3419d0532cdd37f2945d404b178de..d007a8b73496129fcc04d5b923ab1bfe366574a5 100644 (file)
@@ -1,8 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <document name="objectexit">
     <ns2:objectexit_common xmlns:ns2="http://collectionspace.org/services/objectexit" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-        <exitNote>The value of a 'docID' variable in the original import document should be inserted here: ${importObjectExitWithDocID.recordCSID}</exitNote>
+        <exitNote>The value of a 'docID' variable in the original import document should be inserted here: ${importObjectExitWithVarExpansion.recordCSID}</exitNote>
         <exitNumber>OE-IMPORT-TEST-1999.8</exitNumber>
     </ns2:objectexit_common>
+    <ns2:collectionspace_core xmlns:ns2="http://collectionspace.org/collectionspace_core/"
+                              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+        <!-- Note: This test may fail if the identifier for the core tenant changes. -->
+        <tenantId>1</tenantId>
+    </ns2:collectionspace_core>
 </document>