]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5122: Added tests for showAllRelations calls for mid-level and bottom-level...
authorAron Roberts <aron@socrates.berkeley.edu>
Tue, 11 Sep 2012 02:05:23 +0000 (19:05 -0700)
committerAron Roberts <aron@socrates.berkeley.edu>
Tue, 11 Sep 2012 02:05:23 +0000 (19:05 -0700)
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/collectionobject-hierarchy.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-all-relations-bottom-level.res.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-all-relations-mid-level.res.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-all-relations-top-level.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-relations-bottom-level.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-relations-mid-level.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-siblings-mid-level.res.xml

index 253074284c76a75e3d7ad1d056bcf04a04eccdfa..7a9c7a0cddd364ace7a1052af522e2da081e4806 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <xmlReplay>
     
-    <testGroup ID="CreateUpdateReadStructuredObjects" autoDeletePOSTS="true">
+    <testGroup ID="CreateUpdateReadStructuredObjects" autoDeletePOSTS="false">
         
         <!-- Create a set of CollectionObjects -->
         
         </test>
         
     
-        <!-- Read hierarchical relations via the various query parameters now -->
-        <!-- supported for structured objects and procedures -->
+        <!--
+            Read hierarchical relations via three query parameters now
+            supported for structured objects and procedures, as well as
+            for authority terms:
+            
+            * showRelations
+            * showSiblings
+            * showAllRelations
+        -->
                     
         <!-- Read hierarchical relationships via 'showRelations', -->
         <!-- which returns direct parent and child relations. -->
         
-        <test ID="ReadHierarchyForTopLevelItem">
+        <test ID="ShowRelationsForTopLevelItem">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showRelations=true</uri>
             <response>
             <expectedCodes>200</expectedCodes>
         </test>
         
-        <test ID="ReadHierarchyForMidLevelItem">
+        <test ID="ShowRelationsForMidLevelItem">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showRelations=true</uri>
             <response>
             <expectedCodes>200</expectedCodes>
         </test>
         
-        <test ID="ReadHierarchyForBottomLevelItem">
+        <test ID="ShowRelationsForBottomLevelItem">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}?showRelations=true</uri>
             <response>
         </test>
         
         <!-- Read hierarchical relationships via 'showSiblings', -->
-        <!-- which shows sibling relations. -->
+        <!-- which returns sibling relations. -->
 
-        <test ID="ReadSiblingsForTopLevelItem">
+        <test ID="ShowSiblingsForTopLevelItem">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showSiblings=true</uri>
             <expectedCodes>200</expectedCodes>
             </response>
         </test>
         
-        <test ID="ReadSiblingsForMidLevelItem">
+        <test ID="ShowSiblingsForMidLevelItem">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showSiblings=true</uri>
             <expectedCodes>200</expectedCodes>
             </response>
         </test>
         
-        <test ID="ReadSiblingsForBottomLevelItem">
+        <test ID="ShowSiblingsForBottomLevelItem">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}?showSiblings=true</uri>
             <expectedCodes>200</expectedCodes>
             </response>
         </test>
         
-        <!-- Read hierarchical relationships via 'showAllRelations' -->
+        <!-- Read hierarchical relationships via 'showAllRelations', -->
+        <!-- which returns parent, child, and sibling relationships. -->
 
-        <test ID="ReadAllRelationsForTopLevelItem">
+        <test ID="ShowAllRelationsForTopLevelItem">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showAllRelations=true</uri>
             <expectedCodes>200</expectedCodes>
                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
             </response>
         </test>
+        
+        <!-- Currently returns only three relations (parent, two children), -->
+        <!-- rather than five (parent, two children, two siblings). - ADR 2012-09-10 -->
+        <!--
+        <test ID="ShowAllRelationsForMidLevelItem">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateBagOfWhiteChessPieces.CSID}?showAllRelations=true</uri>
+            <expectedCodes>200</expectedCodes>
+            <response>
+                <expected level="ADDOK" />
+                <filename>collectionobject/hierarchy/res/show-all-relations-mid-level.res.xml</filename>
+                <vars>
+                    <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
+                    <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
+                    <var ID="whiteRookCSID">${CreateWhiteRook.CSID}</var>
+                    <var ID="whiteBishopCSID">${CreateWhiteBishop.CSID}</var>
+                </vars>
+                <startElement>/document/*[local-name()='relations-common-list']</startElement>
+            </response>
+        </test>
+        -->
+        
+        <!-- Currently returns only one relation (parent), rather than -->
+        <!-- two (parent, sibling). - ADR 2012-09-10 -->
+        <!--
+        <test ID="ShowAllRelationsForBottomLevelItem">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateWhiteBishop.CSID}?showAllRelations=true</uri>
+            <expectedCodes>200</expectedCodes>
+            <response>
+                <expected level="ADDOK" />
+                <filename>collectionobject/hierarchy/res/show-all-relations-bottom-level.res.xml</filename>
+                <vars>
+                    <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
+                    <var ID="whiteRookCSID">${CreateWhiteRook.CSID}</var>
+                    <var ID="whiteBishopCSID">${CreateWhiteBishop.CSID}</var>
+                </vars>
+                <startElement>/document/*[local-name()='relations-common-list']</startElement>
+            </response>
+        </test>
+        -->
             
         <!-- Read hierarchical relationships via the relations service. -->
         <!-- (This can also serve as a cross-check on the additional read mechanisms, above.) -->
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-all-relations-bottom-level.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-all-relations-bottom-level.res.xml
new file mode 100644 (file)
index 0000000..52c8241
--- /dev/null
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="collectionobjects">  
+    <!-- Contents of the specified CollectionObject record itself are -->
+    <!-- ignored here; we are interested only in the relations list below. -->
+    
+    <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">
+        <pageNum>0</pageNum>
+        <itemsInPage>2</itemsInPage>
+        <totalItems>2</totalItems>
+        
+        <!-- Parent relationships -->
+        
+        <relation-list-item>
+            <predicate>hasBroader</predicate>
+            <subject>
+                <csid>${whiteBishopCSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </subject>
+            <object>
+                <csid>${bagOfWhiteChessPiecesCSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </object>
+        </relation-list-item>
+        
+        <!-- Sibling relationships -->
+
+        <relation-list-item>
+            <predicate>hasBroader</predicate>
+            <subject>
+                <csid>${whiteRookCSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </subject>
+            <object>
+                <csid>${bagOfWhiteChessPiecesCSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </object>
+        </relation-list-item>
+        
+    </ns3:relations-common-list>
+</document>
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-all-relations-mid-level.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-all-relations-mid-level.res.xml
new file mode 100644 (file)
index 0000000..ca32a1a
--- /dev/null
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="collectionobjects">  
+    <!-- Contents of the specified CollectionObject record itself are -->
+    <!-- ignored here; we are interested only in the relations list below. -->
+    
+    <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">
+        <pageNum>0</pageNum>
+        <itemsInPage>5</itemsInPage>
+        <totalItems>5</totalItems>
+        
+        <!-- Parent relationships -->
+        
+        <relation-list-item>
+            <predicate>hasBroader</predicate>
+            <subject>
+                <csid>${bagOfWhiteChessPiecesCSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </subject>
+            <object>
+                <csid>${chessSetBoxCSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </object>
+        </relation-list-item>
+        
+        <!-- Sibling relationships -->
+        
+        <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>${bagOfBlackChessPiecesCSID}</subjectCsid>
+            <objectCsid>${chessSetBoxCSID}</objectCsid>
+            <predicate>hasBroader</predicate>
+            <subject>
+                <csid>${bagOfBlackChessPiecesCSID}</csid>
+            </subject>
+            <object>
+                <csid>${chessSetBoxCSID}</csid>
+            </object>
+        </relation-list-item>
+        
+        <!-- Child relationships -->
+        
+        <relation-list-item>
+            <predicate>hasBroader</predicate>
+            <subject>
+                <csid>${whiteBishopCSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </subject>
+            <object>
+                <csid>${bagOfWhiteChessPiecesCSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </object>
+        </relation-list-item>
+        
+        <relation-list-item>
+            <predicate>hasBroader</predicate>
+            <subject>
+                <csid>${whiteRookCSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </subject>
+            <object>
+                <csid>${bagOfWhiteChessPiecesCSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </object>
+        </relation-list-item>
+
+        
+    </ns3:relations-common-list>
+</document>
index ff05e17484a65210a0cedf7df54cc4c6236a36eb..12c979ff6e27cd0a2e69fcd3dd80bd481406ba42 100644 (file)
@@ -8,6 +8,8 @@
         <itemsInPage>3</itemsInPage>
         <totalItems>3</totalItems>
         
+        <!-- Child relationships -->
+        
         <relation-list-item>
             <predicate>hasBroader</predicate>
             <subject>
@@ -43,5 +45,6 @@
                 <documentType>CollectionObject</documentType>
             </object>
         </relation-list-item>
+        
     </ns3:relations-common-list>
 </document>
index c42a6efe3fce51780a35cf03e4d3b3aca1d61dad..82d417c3aa4e49b617356253f3576bd2960d0649 100644 (file)
@@ -12,6 +12,8 @@
         <itemsInPage>1</itemsInPage>
         <totalItems>1</totalItems>
         
+        <!-- Parent relationships -->
+        
         <relation-list-item>
             <predicate>hasBroader</predicate>
             <subject>
index 685b5b043de2e254e3f2d8d9e19109aac5ebb38b..40f76efa35888c841b8fe108561cd9c4ab4a5fe6 100644 (file)
@@ -14,6 +14,8 @@
         <itemsInPage>3</itemsInPage>
         <totalItems>3</totalItems>
         
+        <!-- Parent relationships -->
+        
         <relation-list-item>
             <predicate>hasBroader</predicate>
             <subject>
@@ -26,6 +28,8 @@
             </object>
         </relation-list-item>
         
+        <!-- Child relationships -->
+        
         <relation-list-item>
             <predicate>hasBroader</predicate>
             <subject>
index 3e1f6c3e103486f06ad32e7da8071aa4d700c0fd..a488806da93ce25e09a8088c5d035e98445ee51e 100644 (file)
@@ -12,6 +12,7 @@
         <pageNum>0</pageNum>
         <itemsInPage>2</itemsInPage>
         <totalItems>2</totalItems>
+        
         <relation-list-item>
             <subjectCsid>${chessBoardCSID}</subjectCsid>
             <objectCsid>${chessSetBoxCSID}</objectCsid>
@@ -23,6 +24,7 @@
                 <csid>${chessSetBoxCSID}</csid>
             </object>
         </relation-list-item>
+        
         <relation-list-item>
             <subjectCsid>${bagOfWhiteChessPiecesCSID}</subjectCsid>
             <objectCsid>${chessSetBoxCSID}</objectCsid>
@@ -34,6 +36,7 @@
                 <csid>${chessSetBoxCSID}</csid>
             </object>
         </relation-list-item>
+        
     </ns3:relations-common-list>
 </document>