]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5518: Refined relation obj test, added response payload.
authorAron Roberts <aron@socrates.berkeley.edu>
Fri, 7 Sep 2012 00:12:14 +0000 (17:12 -0700)
committerAron Roberts <aron@socrates.berkeley.edu>
Fri, 7 Sep 2012 00:12:14 +0000 (17:12 -0700)
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/collectionobject-hierarchy.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/read-as-object-top-level.res.xml [new file with mode: 0644]

index 4a4cb5a581edc8cbbce2d71a9ebe1734b87eb352..23a7b64dd9ce0f70db90bd3bb643eab5b71c001d 100644 (file)
                 <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">
+        <test ID="GetRelationsAsSubjectForTopLevelItem">
              <method>GET</method>
-             <uri>/cspace-services/relations?sbj=${CreateBagOfBlackChessPieces.CSID}</uri>
+             <uri>/cspace-services/relations?sbj=${CreateChessSetBox.CSID}</uri>
              <!-- Also need to test response payload here -->
         </test>
          
-        <test ID="GetRelationsAsObject">
+        <test ID="GetRelationsAsObjectForTopLevelItem">
             <method>GET</method>
-            <uri>/cspace-services/relations?obj=${CreateBagOfBlackChessPieces.CSID}</uri>
-            <!-- Also need to test response payload here -->
+            <uri>/cspace-services/relations?obj=${CreateChessSetBox.CSID}</uri>
+            <response>
+                <expected level="ADDOK" />
+                <filename>collectionobject/hierarchy/res/read-as-object-top-level.res.xml</filename>
+                <vars>
+                    <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
+                    <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
+                    <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
+                    <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
+                </vars>
+                <startElement>/document/*[local-name()='relations-common-list']</startElement>
+            </response>
         </test>
        
         
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/read-as-object-top-level.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/read-as-object-top-level.res.xml
new file mode 100644 (file)
index 0000000..57bbf6d
--- /dev/null
@@ -0,0 +1,49 @@
+<?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>3</itemsInPage>
+        <totalItems>3</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>
+        <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>
+        -->
+    </ns2:relations-common-list>
+</document>
+