]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5518: Committing latest state of XmlReplay tests for structured (hierarchical...
authorAron Roberts <aron@socrates.berkeley.edu>
Fri, 7 Sep 2012 04:15:58 +0000 (21:15 -0700)
committerAron Roberts <aron@socrates.berkeley.edu>
Fri, 7 Sep 2012 04:15:58 +0000 (21:15 -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-with-relations-create.xml [moved from services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/2-collectionobjects_w_relations_CSID.xml with 69% similarity]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/3-collectionobjects-with-relations-update.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/read-as-object-top-level.res.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/dev-master.xml

index 23a7b64dd9ce0f70db90bd3bb643eab5b71c001d..f3495aa0f862c2aba9cc8fafa79211fc819d0e3f 100644 (file)
@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <xmlReplay>
-    <testGroup ID="HierarchicCollectionObject" autoDeletePOSTS="true">
+    <testGroup ID="HierarchicCollectionObject"> <!-- autoDeletePOSTS="true" -->
         
         <!-- Create a set of CollectionObjects -->
         
-        <!-- Chess set box -->
-        <!-- (parent of chess board, bags of white and black chess pieces -->
+         Chess set box 
+         (parent of chess board, bags of white and black chess pieces 
         <test ID="CreateChessSetBox" auth="admin@core.collectionspace.org">
             <method>POST</method>
             <uri>/cspace-services/collectionobjects</uri>
             <vars>
                 <var ID="objectNumber">CSPACE-5518-ChessSetBox</var>
             </vars>
+            <expectedCodes>201</expectedCodes>
         </test>
         <test ID="ReadChessSetBox" auth="admin@core.collectionspace.org">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
         </test>
         
-        <!-- Chess board -->
-        <!-- (child of chess set box, sibling of bags of white and black chess pieces) -->
+         Chess board 
+         (child of chess set box, sibling of bags of white and black chess pieces) 
         <test ID="CreateChessBoard" auth="admin@core.collectionspace.org">
             <method>POST</method>
             <uri>/cspace-services/collectionobjects</uri>
             <vars>
                 <var ID="objectNumber">CSPACE-5518-ChessBoard</var>
             </vars>
+            <expectedCodes>201</expectedCodes>
         </test>
         <test ID="ReadChessBoard" auth="admin@core.collectionspace.org">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateChessBoard.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
         </test>
         
-        <!-- Bags of white and black chess pieces -->
-        <!-- (child of chess set box, sibling of chess board, parents of chess pieces) -->
+         Bags of white and black chess pieces 
+         (child of chess set box, sibling of chess board, parents of chess pieces) 
         <test ID="CreateBagOfWhiteChessPieces">
             <method>POST</method>
             <uri>/cspace-services/collectionobjects</uri>
             <vars>
                 <var ID="objectNumber">CSPACE-5518-BagOfWhiteChessPieces</var>
             </vars>
+            <expectedCodes>201</expectedCodes>
         </test>
         <test ID="ReadBagOfWhiteChessPieces" auth="admin@core.collectionspace.org">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateBagOfWhiteChessPieces.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
         </test>
+        
         <test ID="CreateBagOfBlackChessPieces">
             <method>POST</method>
             <uri>/cspace-services/collectionobjects</uri>
         <test ID="ReadBagOfBlackChessPieces" auth="admin@core.collectionspace.org">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
         </test>
         
-        <!-- Individual chess pieces in those bags -->
+         Individual chess pieces in those bags 
         <test ID="CreateWhiteRook">
             <method>POST</method>
             <uri>/cspace-services/collectionobjects</uri>
             <vars>
                 <var ID="objectNumber">CSPACE-5518-WhiteRook</var>
             </vars>
+            <expectedCodes>201</expectedCodes>
         </test>
         <test ID="ReadWhiteRook" auth="admin@core.collectionspace.org">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateWhiteRook.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
         </test>
         <test ID="CreateWhiteBishop">
             <method>POST</method>
             <vars>
                 <var ID="objectNumber">CSPACE-5518-WhiteBishop</var>
             </vars>
+            <expectedCodes>201</expectedCodes>
         </test>
         <test ID="ReadWhiteBishop" auth="admin@core.collectionspace.org">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateWhiteBishop.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
         </test>
-       <test ID="CreateBlackQueen">
+        <test ID="CreateBlackQueen">
             <method>POST</method>
             <uri>/cspace-services/collectionobjects</uri>
             <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
             <vars>
                 <var ID="objectNumber">CSPACE-5518-BlackQueen</var>
             </vars>
+            <expectedCodes>201</expectedCodes>
         </test>
         <test ID="ReadBlackQueen" auth="admin@core.collectionspace.org">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateBlackQueen.CSID}</uri>
-        </test>  
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <!--
         <test ID="CreateBlackRook">
             <method>POST</method>
             <uri>/cspace-services/collectionobjects</uri>
             <vars>
                 <var ID="objectNumber">CSPACE-5518-BlackRook</var>
             </vars>
+            <expectedCodes>201</expectedCodes>
         </test>
         <test ID="ReadBlackRook" auth="admin@core.collectionspace.org">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
         </test>
+        -->
         
         <!-- Create hierarchical relationships -->
-        
-        <!-- Post an update to one of the chess piece records, which includes -->
-        <!-- a list of hierarchical relationships to be created between the -->
-        <!-- various CollectionObjects created in tests above -->
-        <test ID="CreateHierarchy">
-            <method>PUT</method>
-            <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
-            <filename>collectionobject/hierarchy/2-collectionobjects_w_relations_CSID.xml</filename>
+       
+        <test ID="CreateBlackRookWithRelations">
+            <method>POST</method>
+            <uri>/cspace-services/collectionobjects</uri>
+            <filename>collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml</filename>
             <vars>
                 <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
                 <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
                 <var ID="whiteRookCSID">${CreateWhiteRook.CSID}</var>
                 <var ID="whiteBishopCSID">${CreateWhiteBishop.CSID}</var>
                 <var ID="blackQueenCSID">${CreateBlackQueen.CSID}</var>
-                <var ID="blackRookCSID">${CreateBlackRook.CSID}</var>
             </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        <!--
+        <test ID="ReadBlackRook" auth="admin@core.collectionspace.org">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateBlackRookWithRelations.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        -->
+        
+        <!-- Update one of the chess piece records, while including -->
+        <!-- a list of hierarchical relationships to be created between the -->
+        <!-- various CollectionObjects created in tests above -->
+        
+        <!--
+        <test ID="UpdateBlackRootWithRelations">
+            <method>PUT</method>
+            <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
+            <filename>collectionobject/hierarchy/3-collectionobjects-with-relations-update.xml</filename>
+            <vars>
+                <var ID="distinguishingFeatures">This rook has two light brown striations on part of its base.</var>
+                <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
+                <var ID="blackRookCSID">${CreateBlackRookWithRelations.CSID}</var>
+            </vars>
+            <expectedCodes>200</expectedCodes>
         </test>
+        -->
+        
+    </testGroup>
+    
+    <testGroup ID="HierarchicCollectionObjectMore" autoDeletePOSTS="true">
         
         <!-- Read hierarchical relationships -->
         
         <test ID="ReadHierarchyForTopLevelItem">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showRelations=true</uri>
+            <expectedCodes>200</expectedCodes>
             <!-- Also need to test response payload here -->
         </test>
         
+        <test ID="GetRelationsAsObjectForTopLevelItem">
+            <method>GET</method>
+            <uri>/cspace-services/relations?obj=${CreateChessSetBox.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
+            <response>
+                <expected level="TEXT" />
+                <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>
+        
         <test ID="ReadHierarchyForMidLevelItem">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showRelations=true</uri>
+            <expectedCodes>200</expectedCodes>
             <!-- Also need to test response payload here -->
         </test>
         
         <test ID="ReadHierarchyForBottomLevelItem">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}?showRelations=true</uri>
+            <expectedCodes>200</expectedCodes>
             <!-- Also need to test response payload here -->
         </test>
         
         <test ID="ReadSiblingsForTopLevelItem">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showSiblings=true</uri>
+            <expectedCodes>200</expectedCodes>
             <response>
                 <expected level="ADDOK" />
                 <filename>collectionobject/hierarchy/res/read-siblings-top-level.res.xml</filename>
         <test ID="ReadSiblingsForMidLevelItem">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showSiblings=true</uri>
+            <expectedCodes>200</expectedCodes>
             <response>
                 <expected level="ADDOK" />
                 <filename>collectionobject/hierarchy/res/read-siblings-mid-level.res.xml</filename>
         <test ID="ReadSiblingsForBottomLevelItem">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateBlackQueen.CSID}?showSiblings=true</uri>
+            <expectedCodes>200</expectedCodes>
             <response>
                 <expected level="ADDOK" />
                 <filename>collectionobject/hierarchy/res/read-siblings-bottom-level.res.xml</filename>
         <test ID="ReadAllRelationsForTopLevelItem">
             <method>GET</method>
             <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showAllRelations=true</uri>
+            <expectedCodes>200</expectedCodes>
             <response>
                 <expected level="ADDOK" />
                 <filename>collectionobject/hierarchy/res/read-all-relations.res.xml</filename>
                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
-             </response>
+            </response>
         </test>
         
         <!-- Read hierarchical relationships via the relations service -->
 
         <test ID="GetRelationsAsSubjectForTopLevelItem">
-             <method>GET</method>
-             <uri>/cspace-services/relations?sbj=${CreateChessSetBox.CSID}</uri>
-             <!-- Also need to test response payload here -->
+            <method>GET</method>
+            <uri>/cspace-services/relations?sbj=${CreateChessSetBox.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
+            <!-- Also need to test response payload here -->
         </test>
          
         <test ID="GetRelationsAsObjectForTopLevelItem">
             <method>GET</method>
             <uri>/cspace-services/relations?obj=${CreateChessSetBox.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
             <response>
                 <expected level="ADDOK" />
                 <filename>collectionobject/hierarchy/res/read-as-object-top-level.res.xml</filename>
@@ -4,7 +4,6 @@
     <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"
             <predicate>hasBroader</predicate>
             <subject>
                 <csid>${chessBoardCSID}</csid>
+                <documentType>CollectionObject</documentType>
             </subject>
             <object>
                 <csid>${chessSetBoxCSID}</csid>
+                <documentType>CollectionObject</documentType>
             </object>
         </relation-list-item>
         
             <predicate>hasBroader</predicate>
             <subject>
                 <csid>${bagOfWhiteChessPiecesCSID}</csid>
-            </subject>
+                <documentType>CollectionObject</documentType>
+           </subject>
             <object>
                 <csid>${chessSetBoxCSID}</csid>
-            </object>
+                <documentType>CollectionObject</documentType>
+           </object>
         </relation-list-item>
         
         <relation-list-item>
             <predicate>hasBroader</predicate>
             <subject>
                 <csid>${bagOfBlackChessPiecesCSID}</csid>
+                <documentType>CollectionObject</documentType>
             </subject>
             <object>
                 <csid>${chessSetBoxCSID}</csid>
+                <documentType>CollectionObject</documentType>
             </object>
         </relation-list-item>
         
-        <!-- Create hierarchical relationships between the bags of white -->
-        <!-- and black chess pieces, and the pieces they contain. -->
+        <!--
+            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>
+                <documentType>CollectionObject</documentType>
+           </subject>
             <object>
                 <csid>${bagOfWhiteChessPiecesCSID}</csid>
+                <documentType>CollectionObject</documentType>
             </object>
         </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>
 
             <predicate>hasBroader</predicate>
             <subject>
                 <csid>${blackQueenCSID}</csid>
+                <documentType>CollectionObject</documentType>
             </subject>
             <object>
                 <csid>${bagOfBlackChessPiecesCSID}</csid>
+                <documentType>CollectionObject</documentType>
             </object>
         </relation-list-item>
-
-        <relation-list-item>
-            <predicate>hasBroader</predicate>
-            <subject>
-                <csid>${blackRookCSID}</csid>
-            </subject>
-            <object>
-                <csid>${bagOfBlackChessPiecesCSID}</csid>
-            </object>
-        </relation-list-item>
+        
+        <!-- The relationship between the bag of black pieces -->
+        <!-- and the black rook is set in a separate payload. -->
         
     </ns3:relations-common-list>
 </document>
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/3-collectionobjects-with-relations-update.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/3-collectionobjects-with-relations-update.xml
new file mode 100644 (file)
index 0000000..e5b7756
--- /dev/null
@@ -0,0 +1,33 @@
+<?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 a hierarchical relationships between the bag of 
+            black chess pieces, and the remaining piece it contains.
+        -->
+       
+        <relation-list-item>
+            <predicate>hasBroader</predicate>
+            <subject>
+                <csid>${blackRookCSID}</csid>
+                <documentType>CollectionObject</documentType>
+           </subject>
+            <object>
+                <csid>${bagOfBlackChessPiecesCSID}</csid>
+                <documentType>CollectionObject</documentType>
+           </object>
+        </relation-list-item>
+        
+    </ns3:relations-common-list>
+</document>
+
+
index 57bbf6de9e62c51ddb157da1afa42d9f0e839daf..dea17357e61ce16ecd6664d2921eb3cf7145a2ce 100644 (file)
@@ -6,7 +6,6 @@
         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>
@@ -43,7 +42,6 @@
                 <csid>${chessSetBoxCSID}</csid>
             </object>
         </relation-list-item>
-        -->
     </ns2:relations-common-list>
 </document>
 
index 437b4058d580832ce904c35ff52a1e9160badc37..5a8f528caae3faba4b88d292cf80db39012a4923 100644 (file)
     <protoHostPort>http://localhost:8180</protoHostPort>\r
     \r
     <!-- legal values for dumpServiceResult=[minimal,detailed,full,auto] -->\r
-    <dump payloads="false" dumpServiceResult="detailed" />\r
+    <dump payloads="true" dumpServiceResult="full" />\r
     \r
     <auths default="admin@core.collectionspace.org">\r
        <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>\r
     </auths>\r
     \r
-       <!-- EXAMPLES. JUST UNCOMMENT THEM, AND RUN AS SHOWN ABOVE.\r
-       <run controlFile="person/person.xml" testGroup="PersonAddRelsDeleteRels" />\r
-       <run controlFile="location/location-hierarchy.xml" testGroup="HierarchicLocation" />\r
-    -->\r
+    <run controlFile="collectionobject/collectionobject-hierarchy.xml" testGroup="HierarchicCollectionObject" />\r
 </xmlReplayMaster>\r
 \r