]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5024: Resolved issue with adding tests for a second authority (Storage Locatio...
authorAron Roberts <aron@socrates.berkeley.edu>
Fri, 20 Apr 2012 22:34:53 +0000 (15:34 -0700)
committerAron Roberts <aron@socrates.berkeley.edu>
Fri, 20 Apr 2012 22:34:53 +0000 (15:34 -0700)
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/authority.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/locationitem.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/personitem.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/locationItems.res.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/locationItemsContainingWord1.res.xml [moved from services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/locationauthorityWord1.res.xml with 100% similarity]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/personItems.res.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/personItemsContainingWord1.res.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/personItemsContainingWord2.res.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/personauthorityWord1.res.xml [deleted file]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/personauthorityWord2.res.xml [deleted file]

index a9ad6275d5249a6641e05be647e6a0eab55dd1b9..ac58ac4e841876c8968db4e0400d7b5d1d8e2352 100644 (file)
@@ -19,8 +19,8 @@
             <uri>/cspace-services/personauthorities</uri>
             <filename>authority/personauthority.xml</filename>
             <vars>
-                <!-- Nonsense words (terms, strings, tokens ...) to build short -->
-                <!-- identifiers and display names, and to populate text field(s). -->
+                <!-- Nonsense words to build short identifiers and display -->
+                <!-- names, and to populate text field(s). -->
                 <var ID="word1">jlmbsoq</var>
                 <var ID="word2">tqbfjotld</var>
                 <!-- Partial term searches using one or more of those words. -->
@@ -91,7 +91,7 @@
         </test>
                 
         <!-- Create one item in a vocabulary in the Location Authority -->
-        <test ID="createLocationItem1">
+        <test ID="createLocationItem">
             <expectedCodes>201</expectedCodes>
             <method>POST</method>
             <uri>/cspace-services/locationauthorities/${createLocationAuthority.CSID}/items</uri>
                 <var ID="itemShortIdentifier">${createPersonAuthority1.word1}item1</var>
             </vars>
         </test>
+        <test ID="verifyLocationItem">
+            <expectedCodes>200</expectedCodes>
+            <method>GET</method>
+            <uri>/cspace-services/locationauthorities/${createLocationAuthority.CSID}/items/${createLocationItem.CSID}</uri>
+        </test>
         
         <!--
             Perform 'all vocabularies' searches and verify that the
             expected items were returned by each search.
         -->
         
+        <!-- List (without searching) -->
+        
+        <test ID="getPersonItems">
+            <expectedCodes>200</expectedCodes>
+            <method>GET</method>
+            <uri>/cspace-services/personauthorities/_ALL_/items?pgSz=3&amp;pgNum=0</uri>
+            <response>
+                <expected level="TEXT"/>
+                <filename>authority/res/personItems.res.xml</filename>
+            </response>
+        </test>
+        
         <!-- Keyword searches -->
         
         <!-- On first word -->
             <uri>/cspace-services/personauthorities/_ALL_/items?kw=${createPersonAuthority1.word1}</uri>
             <response>
                 <expected level="TEXT"/>
-                <filename>authority/res/personauthorityWord1.res.xml</filename>
+                <filename>authority/res/personItemsContainingWord1.res.xml</filename>
             </response>
         </test>
         <!-- On second word -->
             <uri>/cspace-services/personauthorities/_ALL_/items?kw=${createPersonAuthority1.word2}</uri>
             <response>
                 <expected level="TEXT"/>
-                <filename>authority/res/personauthorityWord2.res.xml</filename>
+                <filename>authority/res/personItemsContainingWord2.res.xml</filename>
             </response>
         </test>
         
             <uri>/cspace-services/personauthorities/_ALL_/items?pt=${createPersonAuthority1.word1PartialTermStem}</uri>
             <response>
                 <expected level="TEXT"/>
-                <filename>authority/res/personauthorityWord1.res.xml</filename>
+                <filename>authority/res/personItemsContainingWord1.res.xml</filename>
             </response>
         </test>
         <!-- Stem matching on second word -->
             <uri>/cspace-services/personauthorities/_ALL_/items?pt=${createPersonAuthority1.word2PartialTermStem}</uri>
             <response>
                 <expected level="TEXT"/>
-                <filename>authority/res/personauthorityWord2.res.xml</filename>
+                <filename>authority/res/personItemsContainingWord2.res.xml</filename>
             </response>
         </test>
         <!-- Middle-of-term matching on second word -->
             <uri>/cspace-services/personauthorities/_ALL_/items?pt=${createPersonAuthority1.word2PartialTermMid}</uri>
             <response>
                 <expected level="TEXT"/>
-                <filename>authority/res/personauthorityWord2.res.xml</filename>
+                <filename>authority/res/personItemsContainingWord2.res.xml</filename>
             </response>
         </test>
                 
             <uri>/cspace-services/personauthorities/_ALL_/items?as=persons_common%3AdisplayName%20ILIKE%20%27%25${createPersonAuthority1.word1}%25%27</uri>
             <response>
                 <expected level="TEXT"/>
-                <filename>authority/res/personauthorityWord1.res.xml</filename>
+                <filename>authority/res/personItemsContainingWord1.res.xml</filename>
             </response>
         </test>
         <!-- On second word -->
             <uri>/cspace-services/personauthorities/_ALL_/items?as=persons_common%3AdisplayName%20ILIKE%20%27%25${createPersonAuthority1.word2}%25%27</uri>
             <response>
                 <expected level="TEXT"/>
-                <filename>authority/res/personauthorityWord2.res.xml</filename>
+                <filename>authority/res/personItemsContainingWord2.res.xml</filename>
             </response>
         </test>
         <!-- In a field other than display name -->
             <uri>/cspace-services/personauthorities/_ALL_/items?as=persons_common%3AforeName%20ILIKE%20%27%25${createPersonAuthority1.word2}%25%27</uri>
             <response>
                 <expected level="TEXT"/>
-                <filename>authority/res/personauthorityWord2.res.xml</filename>
+                <filename>authority/res/personItemsContainingWord2.res.xml</filename>
             </response>
         </test>
         
         <!-- Verify that tests work in an authority other than Person Authority -->
         
-        <!--
+        <test ID="getPersonItems">
+            <expectedCodes>200</expectedCodes>
+            <method>GET</method>
+            <uri>/cspace-services/locationauthorities/_ALL_/items?pgSz=1&amp;pgNum=0</uri>
+            <response>
+                <expected level="TEXT"/>
+                <filename>authority/res/locationItems.res.xml</filename>
+            </response>
+        </test>
         <test ID="kwSearchLocationItems">
             <expectedCodes>200</expectedCodes>
             <method>GET</method>
             <uri>/cspace-services/locationauthorities/_ALL_/items?kw=${createPersonAuthority1.word1}</uri>
             <response>
                 <expected level="TEXT"/>
-                <filename>authority/res/locationauthorityWord1.res.xml</filename>
+                <filename>authority/res/locationItemsContainingWord1.res.xml</filename>
             </response>
         </test>
         <test ID="ptStemSearchLocationItems">
             <uri>/cspace-services/locationauthorities/_ALL_/items?pt=${createPersonAuthority1.word1PartialTermStem}</uri>
             <response>
                 <expected level="TEXT"/>
-                <filename>authority/res/locationauthorityWord1.res.xml</filename>
+                <filename>authority/res/locationItemsContainingWord1.res.xml</filename>
             </response>
         </test>
          <test ID="advSearchLocationItems">
             <uri>/cspace-services/locationauthorities/_ALL_/items?as=locations_common%3AdisplayName%20ILIKE%20%27%25${createPersonAuthority1.word1}%25%27</uri>
             <response>
                 <expected level="TEXT"/>
-                <filename>authority/res/locationauthorityWord1.res.xml</filename>
+                <filename>authority/res/locationItemsContainingWord1.res.xml</filename>
             </response>
         </test>   
         <test ID="advSearchLocationItems">
             <expectedCodes>200</expectedCodes>
             <method>GET</method>
-            <uri>/cspace-services/locationauthorities/_ALL_/items?as=locations_common%3Adescription%20ILIKE%20%27%25${createPersonAuthority1.word1}%25%27</uri>
+            <uri>/cspace-services/locationauthorities/_ALL_/items?as=locations_common%3AaccessNote%20ILIKE%20%27%25${createPersonAuthority1.word1}%25%27</uri>
             <response>
                 <expected level="TEXT"/>
-                <filename>authority/res/locationauthorityWord1.res.xml</filename>
+                <filename>authority/res/locationItemsContainingWord1.res.xml</filename>
             </response>
         </test>
-        -->
         
     </testGroup>
     
index c5a13e2fc155e0096549a6022e091a8f4e6419fe..56e370a69471e3f57365006eccbaafe93803b4dd 100644 (file)
@@ -2,8 +2,8 @@
 <document name="locations">
     <ns2:locations_common xmlns:ns2="http://collectionspace.org/services/location" xmlns:ns3="http://collectionspace.org/services/jaxb">
         <displayName>${itemDisplayName}</displayName>
+        <displayNameComputed>false</displayNameComputed>
         <shortIdentifier>${itemShortIdentifier}</shortIdentifier>
-        <description>This is a test Location Authority item, whose description contains: ${itemDisplayName}</description>
+        <accessNote>This is a test Location Authority item, whose access note contains: ${itemDisplayName}</accessNote>
     </ns2:locations_common>
 </document>
-
index 633411f7dfc13a7a764cddd48d2db8aba5118d13..87f820af0c42d7e1f3f81398b9378f90dd099584 100644 (file)
@@ -2,6 +2,7 @@
 <document name="persons">\r
     <ns2:persons_common xmlns:ns2="http://collectionspace.org/services/person" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
         <displayName>${itemDisplayName}</displayName>\r
+        <displayNameComputed>false</displayNameComputed>\r
         <shortIdentifier>${itemShortIdentifier}</shortIdentifier>\r
         <bioNote>A bio note for this Person.</bioNote>\r
         <foreName>${itemDisplayName}</foreName>\r
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/locationItems.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/locationItems.res.xml
new file mode 100644 (file)
index 0000000..2459909
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
+<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">\r
+    <pageNum>0</pageNum>\r
+    <pageSize>1</pageSize>\r
+    <itemsInPage>1</itemsInPage>\r
+</ns2:abstract-common-list>\r
+\r
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/personItems.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/personItems.res.xml
new file mode 100644 (file)
index 0000000..61a80fd
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
+<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">\r
+    <pageNum>0</pageNum>\r
+    <pageSize>3</pageSize>\r
+    <itemsInPage>3</itemsInPage>\r
+</ns2:abstract-common-list>\r
+\r
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/personItemsContainingWord1.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/personItemsContainingWord1.res.xml
new file mode 100644 (file)
index 0000000..45892e4
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
+<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">\r
+    <totalItems>3</totalItems>\r
+    <!--\r
+      Note that tests verifying this specific response may either fail, or\r
+      return a non-fatal NESTED_ERROR, if the order of the list items below\r
+      changes. (This response assumes that items are both returned in reverse\r
+      chronological order by update timestamp (collectionspace_core:updatedAt),\r
+      and that they are created in timestamp order by the order of tests in\r
+      the control file.)\r
+      \r
+      If the list items order changes, you can: reorder the following\r
+      list-items appropriately; remove those items entirely, relying solely\r
+      on the <totalItems> value and not on the actual items returned; or\r
+      rewrite the test and/or response using more sophisticated techniques.\r
+    -->\r
+    <list-item>\r
+        <shortIdentifier>${createPersonAuthority1.word1}item3</shortIdentifier>\r
+    </list-item>\r
+    <list-item>\r
+        <shortIdentifier>${createPersonAuthority1.word1}item2</shortIdentifier>\r
+    </list-item>\r
+    <list-item>\r
+        <shortIdentifier>${createPersonAuthority1.word1}item1</shortIdentifier>\r
+    </list-item>\r
+</ns2:abstract-common-list>\r
+\r
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/personItemsContainingWord2.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/personItemsContainingWord2.res.xml
new file mode 100644 (file)
index 0000000..e0c4354
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
+<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">\r
+    <totalItems>2</totalItems>\r
+    <!--\r
+      Note that tests verifying this specific response may either fail, or\r
+      return a non-fatal NESTED_ERROR, if the order of the list items below\r
+      changes. (This response assumes that items are both returned in reverse\r
+      chronological order by update timestamp (collectionspace_core:updatedAt),\r
+      and that they are created in timestamp order by the order of tests in\r
+      the control file.)\r
+      \r
+      If the list items order changes, you can: reorder the following\r
+      list-items appropriately; remove those items entirely, relying solely\r
+      on the <totalItems> value and not on the actual items returned; or\r
+      rewrite the test and/or response using more sophisticated techniques.\r
+    -->\r
+    <list-item>\r
+        <shortIdentifier>${createPersonAuthority1.word1}item3</shortIdentifier>\r
+    </list-item>\r
+    <list-item>\r
+        <shortIdentifier>${createPersonAuthority1.word1}item1</shortIdentifier>\r
+    </list-item>\r
+</ns2:abstract-common-list>\r
+\r
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/personauthorityWord1.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/personauthorityWord1.res.xml
deleted file mode 100644 (file)
index 5a5e13d..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">\r
-    <totalItems>3</totalItems>\r
-    <!--\r
-      Note that tests verifying this specific response may fail if the order\r
-      of list items below - which assumes reverse chronological order by\r
-      update timestamp (collectionspace_core:updatedAt) - changes.\r
-    -->\r
-    <list-item>\r
-        <shortIdentifier>${createPersonAuthority1.word1}item3</shortIdentifier>\r
-    </list-item>\r
-    <list-item>\r
-        <shortIdentifier>${createPersonAuthority1.word1}item2</shortIdentifier>\r
-    </list-item>\r
-    <list-item>\r
-        <shortIdentifier>${createPersonAuthority1.word1}item1</shortIdentifier>\r
-    </list-item>\r
-</ns2:abstract-common-list>\r
-\r
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/personauthorityWord2.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/authority/res/personauthorityWord2.res.xml
deleted file mode 100644 (file)
index ed45b35..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
-<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">\r
-    <totalItems>2</totalItems>\r
-    <!--\r
-      Note that tests verifying this specific response may fail if the order\r
-      of list items below - which assumes reverse chronological order by\r
-      update timestamp (collectionspace_core:updatedAt) - changes.\r
-    -->\r
-    <list-item>\r
-        <shortIdentifier>${createPersonAuthority1.word1}item3</shortIdentifier>\r
-    </list-item>\r
-    <list-item>\r
-        <shortIdentifier>${createPersonAuthority1.word1}item1</shortIdentifier>\r
-    </list-item>\r
-</ns2:abstract-common-list>\r
-\r