]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5518: Created initial tests, placeholder response payload files for testing...
authorAron Roberts <aron@socrates.berkeley.edu>
Thu, 6 Sep 2012 23:12:59 +0000 (16:12 -0700)
committerAron Roberts <aron@socrates.berkeley.edu>
Thu, 6 Sep 2012 23:12:59 +0000 (16:12 -0700)
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/collectionobject-hierarchy.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/2-collectionobjects_w_relations_CSID.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/read-all-relations.res.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/read-siblings-bottom-level.res.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/read-siblings-mid-level.res.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/read-siblings-top-level.res.xml [new file with mode: 0644]

index ab5d6ff30032fb0d351b27ea7858671369f21a7b..4a4cb5a581edc8cbbce2d71a9ebe1734b87eb352 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <xmlReplay>
     <testGroup ID="HierarchicCollectionObject" autoDeletePOSTS="true">
         
         
         <!-- Read hierarchical relationships -->
         
+        <!-- Read hierarchical relationships via 'showRelations' -->
+        
         <test ID="ReadHierarchyForTopLevelItem">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showRelations=true</uri>
-            <!-- Need to test response payload here -->
+            <!-- Also need to test response payload here -->
         </test>
         
         <test ID="ReadHierarchyForMidLevelItem">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showRelations=true</uri>
-            <!-- Need to test response payload here -->
+            <!-- Also need to test response payload here -->
         </test>
         
         <test ID="ReadHierarchyForBottomLevelItem">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}?showRelations=true</uri>
-            <!-- Need to test response payload here -->
+            <!-- Also need to test response payload here -->
         </test>
         
-        <test ID="ReadAllRelations">
-             <method>GET</method>
-             <uri>/cspace-services/relations</uri>
-             <!-- Need to test response payload here -->
-         </test>
-         
-         <test ID="GetRelationsAsSubject">
+        <!-- Read hierarchical relationships via 'showSiblings' -->
+
+        <test ID="ReadSiblingsForTopLevelItem">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showSiblings=true</uri>
+            <response>
+                <expected level="ADDOK" />
+                <filename>collectionobject/hierarchy/res/read-siblings-top-level.res.xml</filename>
+                <startElement>/document/*[local-name()='relations-common-list']</startElement>
+            </response>
+        </test>
+        
+        <test ID="ReadSiblingsForMidLevelItem">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showSiblings=true</uri>
+            <response>
+                <expected level="ADDOK" />
+                <filename>collectionobject/hierarchy/res/read-siblings-mid-level.res.xml</filename>
+                <vars>
+                    <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
+                    <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
+                    <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
+                </vars>
+                <startElement>/document/*[local-name()='relations-common-list']</startElement>
+            </response>
+        </test>
+        
+        <test ID="ReadSiblingsForBottomLevelItem">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateBlackQueen.CSID}?showSiblings=true</uri>
+            <response>
+                <expected level="ADDOK" />
+                <filename>collectionobject/hierarchy/res/read-siblings-bottom-level.res.xml</filename>
+                <vars>
+                    <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
+                    <var ID="blackRookCSID">${CreateBlackRook.CSID}</var>
+                </vars>
+                <startElement>/document/*[local-name()='relations-common-list']</startElement>
+            </response>
+        </test>
+        
+        <!-- Read hierarchical relationships via 'showAllRelations' -->
+
+        <test ID="ReadAllRelationsForTopLevelItem">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showAllRelations=true</uri>
+            <response>
+                <expected level="ADDOK" />
+                <filename>collectionobject/hierarchy/res/read-all-relations.res.xml</filename>
+                <startElement>/document/*[local-name()='relations-common-list']</startElement>
+             </response>
+             
+        </test>
+        
+        <!-- Read hierarchical relationships via the relations service -->
+
+        <test ID="GetRelationsAsSubject">
              <method>GET</method>
              <uri>/cspace-services/relations?sbj=${CreateBagOfBlackChessPieces.CSID}</uri>
-             <!-- Need to test response payload here -->
+             <!-- Also need to test response payload here -->
         </test>
          
         <test ID="GetRelationsAsObject">
             <method>GET</method>
             <uri>/cspace-services/relations?obj=${CreateBagOfBlackChessPieces.CSID}</uri>
-            <!-- Need to test response payload here -->
-       </test>
-            
+            <!-- Also need to test response payload here -->
+        </test>
+       
         
         <!-- Cleanup-->
+        
         <!--
         <test ID="DeleteHierarchy">
         </test>
         -->
+        
         <!-- The following is likely unnecessary with 'autoDeletePOSTS="true"' -->
         <!--
         <test ID="DeleteBlackRook" auth="admin@core.collectionspace.org">
         </test>
         -->
         
-        
-        
-        
-        <!--
-        <test ID="LocationChild3">
-            <method>POST</method>
-            <uri>/cspace-services/collectionobjects/${LocationAuth1.CSID}/items/</uri>
-            <filename>collectionobject/hierarchy/2-item.xml</filename>
-            <vars>
-                <var ID="inAuthority">${LocationAuth1.CSID}</var>
-                <var ID="authShortIdentifier">CSPACE3739LocationAuthority</var>
-                <var ID="shortIdentifier">Shelf3</var>
-                <var ID="name">Shelf 3</var>
-            </vars>
-        </test>
-        
-        <test ID="LocationParent">
-            <method>POST</method>
-            <uri>/cspace-services/collectionobjects/urn:cspace:name(CSPACE3739LocationAuthority)/items/</uri>
-            <filename>collectionobject/hierarchy/2-item.xml</filename>
-            <vars>
-                <var ID="inAuthority">${LocationAuth1.CSID}</var>
-                <var ID="authShortIdentifier">CSPACE3739LocationAuthority</var>
-                <var ID="shortIdentifier">Aisle3</var>
-                <var ID="name">Aisle 3</var>
-            </vars>
-        </test>
-
-                <test ID="Location1_old">
-            <method>POST</method>
-            <uri>/cspace-services/collectionobjects/urn:cspace:name(CSPACE3739LocationAuthority)/items/</uri>
-            <filename>collectionobject/hierarchy/3-locations_w_relations_CSID.xml</filename>
-            <vars>
-                            <var ID="name">Cabinet 1</var>
-                <var ID="parentCSID">${LocationParent.CSID}</var>
-                <var ID="childCSID">${LocationChild1.CSID}</var>
-                <var ID="child2CSID">${LocationChild2.CSID}</var>
-                <var ID="child3CSID">${LocationChild3.CSID}</var>
-            </vars>
-        </test>
-        
-        <test ID="Location1">
-            <method>POST</method>
-            <uri>/cspace-services/collectionobjects/urn:cspace:name(CSPACE3739LocationAuthority)/items/</uri>
-            <filename>collectionobject/hierarchy/5-locations_w_relations_RefNames.xml</filename>
-            <vars>
-                <var ID="shortIdentifier">Cabinet1a</var>
-                            <var ID="name">Cabinet 1a</var>
-                <var ID="childCSID">${LocationChild1.CSID}</var>
-                <var ID="child2CSID">${LocationChild2.CSID}</var>
-                <var ID="child3CSID">${LocationChild3.CSID}</var>
-            </vars>
-        </test>
-        
-        <test ID="GetLocation">
-            <method>GET</method>
-            <uri>/cspace-services/collectionobjects/${LocationAuth1.CSID}/items/${Location1.CSID}?showRelations=true</uri>
-        </test>
-        
-        -->
-        
-        <!-- NOTE: item  on url is .../items/${LocationChild1.CSID} so this looks for
-                   siblings of Child1, which would be child2 and child3.
-        -->
-        
-        <!--
-        <test ID="Get_siblings">
-            <method>GET</method>
-            <uri>/cspace-services/collectionobjects/${LocationAuth1.CSID}/items/${LocationChild1.CSID}?showSiblings=true</uri>
-            <response>
-                <expected level="ADDOK" />
-                <filename>collectionobject/hierarchy/res/Get_siblings.res.xml</filename>
-                <vars>
-                    <var ID="locationCSID">${Location1.CSID}</var>
-                    <var ID="child1CSID">${LocationChild1.CSID}</var>
-                    <var ID="child2CSID">${LocationChild2.CSID}</var>
-                </vars>
-                <startElement>/document/*[local-name()='relations-common-list']</startElement>
-         </response>
-        </test>
-        -->
-        <!--
-        <test ID="Get_allRelations">
-            <method>GET</method>
-            <uri>/cspace-services/collectionobjects/${LocationAuth1.CSID}/items/${Location1.CSID}?showAllRelations=true</uri>
-            <response>
-                <expected level="ADDOK" />
-                <filename>collectionobject/hierarchy/res/Get_allRelations.res.xml</filename>
-        -->
-                <!-- NOTE: vars are referenced in showAllRelations.res.xml
-                     from tests in this test group, e.g. 
-                     LocationParent.CSID :: ${LocationParent.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=${Location1.CSID}</uri>
-         </test>
-         
-        <test ID="relations_obj">
-            <method>GET</method>
-            <uri>/cspace-services/relations?obj=${Location1.CSID}</uri>
-        </test>
-        -->
-        
     </testGroup>
 </xmlReplay>
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/2-collectionobjects_w_relations_CSID.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/2-collectionobjects_w_relations_CSID.xml
new file mode 100644 (file)
index 0000000..20c014d
--- /dev/null
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="collectionobjects">
+
+    <ns2:collectionobjects_common
+        xmlns:ns2="http://collectionspace.org/services/collectionobject">
+        <objectNumber>${objectNumber}</objectNumber>
+        <distinguishingFeatures>${distinguishingFeatures}</distinguishingFeatures>
+    </ns2:collectionobjects_common>
+
+    <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation"
+                               xmlns:ns2="http://collectionspace.org/services/jaxb">
+        
+        <!-- Create hierarchical relationships between the chess set box -->
+        <!-- and its three children: the chess board, and the bags of white -->
+        <!-- and black chess pieces -->
+        
+        <relation-list-item>
+            <predicate>hasBroader</predicate>
+            <subject>
+                <csid>${chessBoardCSID}</csid>
+            </subject>
+            <object>
+                <csid>${chessSetBoxCSID}</csid>
+            </object>
+        </relation-list-item>
+        
+        <relation-list-item>
+            <predicate>hasBroader</predicate>
+            <subject>
+                <csid>${bagOfWhiteChessPiecesCSID}</csid>
+            </subject>
+            <object>
+                <csid>${chessSetBoxCSID}</csid>
+            </object>
+        </relation-list-item>
+        
+        <relation-list-item>
+            <predicate>hasBroader</predicate>
+            <subject>
+                <csid>${bagOfBlackChessPiecesCSID}</csid>
+            </subject>
+            <object>
+                <csid>${chessSetBoxCSID}</csid>
+            </object>
+        </relation-list-item>
+        
+        <!-- Create hierarchical relationships between the bags of white -->
+        <!-- and black chess pieces, and the pieces they contain. -->
+        
+        <relation-list-item>
+            <predicate>hasBroader</predicate>
+            <subject>
+                <csid>${whiteRookCSID}</csid>
+            </subject>
+            <object>
+                <csid>${bagOfWhiteChessPiecesCSID}</csid>
+            </object>
+        </relation-list-item>
+
+        <relation-list-item>
+            <predicate>hasBroader</predicate>
+            <subject>
+                <csid>${whiteBishopCSID}</csid>
+            </subject>
+            <object>
+                <csid>${bagOfWhiteChessPiecesCSID}</csid>
+            </object>
+        </relation-list-item>
+
+        <relation-list-item>
+            <predicate>hasBroader</predicate>
+            <subject>
+                <csid>${blackQueenCSID}</csid>
+            </subject>
+            <object>
+                <csid>${bagOfBlackChessPiecesCSID}</csid>
+            </object>
+        </relation-list-item>
+
+        <relation-list-item>
+            <predicate>hasBroader</predicate>
+            <subject>
+                <csid>${blackRookCSID}</csid>
+            </subject>
+            <object>
+                <csid>${bagOfBlackChessPiecesCSID}</csid>
+            </object>
+        </relation-list-item>
+        
+    </ns3:relations-common-list>
+</document>
+
+
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/read-all-relations.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/read-all-relations.res.xml
new file mode 100644 (file)
index 0000000..17f06f6
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="collectionobjects">  
+    <ns2:relations-common-list xmlns:ns2="http://collectionspace.org/services/relation" xmlns:ns3="http://collectionspace.org/services/jaxb">
+        <!-- Need to add expected pagination header elements, relation list items here -->
+    </ns2:relations-common-list>
+</document>
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/read-siblings-bottom-level.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/read-siblings-bottom-level.res.xml
new file mode 100644 (file)
index 0000000..70d7217
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="collectionobjects">
+    <!--
+        Siblings of the black queen:
+        1. black rook
+    -->
+    <ns2:relations-common-list xmlns:ns2="http://collectionspace.org/services/relation" xmlns:ns3="http://collectionspace.org/services/jaxb">
+        <!--
+        <pageNum>0</pageNum>
+        <itemsInPage>1</itemsInPage>
+        <totalItems>1</totalItems>
+        <relation-list-item>
+            <subjectCsid>${blackRookCSID}</subjectCsid>
+            <objectCsid>${bagOfBlackChessPiecesCSID}</objectCsid>
+            <predicate>hasBroader</predicate>
+            <subject>
+                <csid>${blackRookCSID}</csid>
+            </subject>
+            <object>
+                <csid>${bagOfBlackChessPiecesCSID}</csid>
+            </object>
+        </relation-list-item>
+        -->
+    </ns2:relations-common-list>
+</document>
+
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/read-siblings-mid-level.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/read-siblings-mid-level.res.xml
new file mode 100644 (file)
index 0000000..ec997fd
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="collectionobjects">
+    <!--
+        Siblings of the bag of black chess pieces:
+        1. chess board
+        2. bag of white chess pieces
+    -->
+    <ns2:relations-common-list xmlns:ns2="http://collectionspace.org/services/relation" xmlns:ns3="http://collectionspace.org/services/jaxb">
+        <!--
+        <pageNum>0</pageNum>
+        <itemsInPage>2</itemsInPage>
+        <totalItems>2</totalItems>
+        <relation-list-item>
+            <subjectCsid>${chessBoardCSID}</subjectCsid>
+            <objectCsid>${chessSetBoxCSID}</objectCsid>
+            <predicate>hasBroader</predicate>
+            <subject>
+                <csid>${chessBoardCSID}</csid>
+            </subject>
+            <object>
+                <csid>${chessSetBoxCSID}</csid>
+            </object>
+        </relation-list-item>
+        <relation-list-item>
+            <subjectCsid>${bagOfWhiteChessPiecesCSID}</subjectCsid>
+            <objectCsid>${chessSetBoxCSID}</objectCsid>
+            <predicate>hasBroader</predicate>
+            <subject>
+                <csid>${bagOfWhiteChessPiecesCSID}</csid>
+            </subject>
+            <object>
+                <csid>${chessSetBoxCSID}</csid>
+            </object>
+        </relation-list-item>
+        -->
+    </ns2:relations-common-list>
+</document>
+
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/read-siblings-top-level.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/read-siblings-top-level.res.xml
new file mode 100644 (file)
index 0000000..9a724a6
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="collectionobjects">
+    <!--
+        Siblings of the chess board box:
+        (none)
+    -->
+    <ns2:relations-common-list xmlns:ns2="http://collectionspace.org/services/relation" xmlns:ns3="http://collectionspace.org/services/jaxb">
+        <!--
+        <pageNum>0</pageNum>
+        <itemsInPage>0</itemsInPage>
+        <totalItems>0</totalItems>
+        -->
+    </ns2:relations-common-list>
+</document>
+