]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5518: Completed adding XmlReplay-based tests of structured objects that use...
authorAron Roberts <aron@socrates.berkeley.edu>
Fri, 14 Sep 2012 01:45:05 +0000 (18:45 -0700)
committerAron Roberts <aron@socrates.berkeley.edu>
Fri, 14 Sep 2012 01:45:05 +0000 (18:45 -0700)
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/collectionobject-hierarchy-csid.xml [moved from services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/collectionobject-hierarchy.xml with 98% similarity]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/collectionobject-hierarchy-refname.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/4-collectionobject-update-with-parent-child-csids.xml [moved from services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/5-collectionobject-update-with-parent-child-csids.xml with 100% similarity]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/4-collectionobject-update-with-parent-csid.xml [deleted file]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/5-collectionobject-create-with-parent-refname.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/6-collectionobject-create-with-parent-child-refnames.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/7-collectionobject-update-with-parent-child-refnames.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-master.xml

@@ -4,14 +4,15 @@
     <testGroup ID="CreateUpdateReadStructuredObjects" autoDeletePOSTS="true">
         
         <!--
-            Create and test a structured set of ten (10) CollectionObjects,
+            Using CSIDs and the 'id' form of identifiers, create
+            and test a structured set of ten (10) CollectionObjects,
             with these hierarchical relationsips to one another:
         
             ChessSetBox
             |__ ChessBoard
             |__ BagOfWhiteChessPieces
-                |__ White Rook
-                |__ White Bishop
+                |__ WhiteRook
+                |__ WhiteBishop
             |__ BagOfBlackChessPieces
                 |__ BlackQueen
                 |__ BlackRook
         
         <!-- Bag of black chess pieces -->
         <!-- (child of chess set box, sibling of chess board and bag -->
-        <!-- of white chess pieces, parents of black chess pieces) --> 
+        <!-- of white chess pieces, parent of black chess pieces) --> 
         
         <!--
             This piece is created along with relations to:
             * Its children (black rook fragment1, black rook fragment2)
         -->
         
-        <test ID="UpdateBlackRootWithRelations">
+        <test ID="UpdateBlackRookWithRelations">
             <method>PUT</method>
             <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
-            <filename>collectionobject/hierarchy/5-collectionobject-update-with-parent-child-csids.xml</filename>
+            <filename>collectionobject/hierarchy/4-collectionobject-update-with-parent-child-csids.xml</filename>
             <vars>
                 <var ID="distinguishingFeatures">This black rook is nearly intact, save for two tiny fragments.</var>
                 <var ID="currentItemCSID">${CreateBlackRook.CSID}</var>
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/collectionobject-hierarchy-refname.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/collectionobject-hierarchy-refname.xml
new file mode 100644 (file)
index 0000000..4af2f19
--- /dev/null
@@ -0,0 +1,522 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xmlReplay>
+    
+    <testGroup ID="CreateUpdateReadStructuredObjects" autoDeletePOSTS="true">
+        
+        <!--
+            Using refNames with the 'id' form of identifiers, create
+            and test a structured set of ten (10) CollectionObjects,
+            with these hierarchical relationsips to one another:
+        
+            ChessSetBox
+            |__ ChessBoard
+            |__ BagOfWhiteChessPieces
+                |__ WhiteRook
+                |__ WhiteBishop
+            |__ BagOfBlackChessPieces
+                |__ BlackQueen
+                |__ BlackRook
+                    |__ BlackRookFragment1
+                    |__ BlackRookFragment2
+         -->
+        
+        <!-- Chess set box -->
+        <!-- (parent of chess board, bag of white chess pieces, and bag of black chess pieces) -->
+        <test ID="CreateChessSetBox">
+            <method>POST</method>
+            <uri>/cspace-services/collectionobjects</uri>
+            <filename>collectionobject/hierarchy/1-collectionobject-create.xml</filename>
+            <vars>
+                <var ID="objectNumber">CSPACE-5518-ChessSetBox</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        <!-- Verify the contents of the first CollectionObject record created. -->
+        <!-- Other create requests, below, just check the result code.) -->
+        <test ID="ReadChessSetBox">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
+            <response>
+                <expected level="TEXT" />
+                <filename>collectionobject/hierarchy/res/collectionobject.res.xml</filename>
+                <vars>
+                    <var ID="objectNumber">${CreateChessSetBox.objectNumber}</var>
+                </vars>
+            </response>
+        </test>
+        
+        <!-- Chess board -->
+        <!-- (child of chess set box, sibling of bag of white chess pieces and bag of black chess pieces) -->
+        <test ID="CreateChessBoard">
+            <method>POST</method>
+            <uri>/cspace-services/collectionobjects</uri>
+            <filename>collectionobject/hierarchy/5-collectionobject-create-with-parent-refname.xml</filename>
+            <vars>
+                <var ID="objectNumber">CSPACE-5518-ChessBoard</var>
+                <var ID="parentCSID">${CreateChessSetBox.CSID}</var>
+                <var ID="parentObjectNumber">${CreateChessSetBox.objectNumber}</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        <test ID="ReadChessBoard">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateChessBoard.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <!-- Bag of white chess pieces -->
+        <!-- (child of chess set box, sibling of chess board and bag -->
+        <!-- of black chess pieces, parent of white chess pieces) --> 
+        
+        <test ID="CreateBagOfWhiteChessPieces">
+            <method>POST</method>
+            <uri>/cspace-services/collectionobjects</uri>
+            <filename>collectionobject/hierarchy/5-collectionobject-create-with-parent-refname.xml</filename>
+            <vars>
+                <var ID="objectNumber">CSPACE-5518-BagOfWhiteChessPieces</var>
+                <var ID="parentCSID">${CreateChessSetBox.CSID}</var>
+                <var ID="parentObjectNumber">${CreateChessSetBox.objectNumber}</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        <test ID="ReadBagOfWhiteChessPieces">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateBagOfWhiteChessPieces.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+
+        <!-- Individual chess pieces in the bag of white chess pieces, -->
+        <!-- each created along with relations to their parent -->
+        
+        <test ID="CreateWhiteRook">
+            <method>POST</method>
+            <uri>/cspace-services/collectionobjects</uri>
+            <filename>collectionobject/hierarchy/5-collectionobject-create-with-parent-refname.xml</filename>
+            <vars>
+                <var ID="objectNumber">CSPACE-5518-WhiteRook</var>
+                <var ID="parentCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
+                <var ID="parentObjectNumber">${CreateBagOfWhiteChessPieces.objectNumber}</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        <test ID="ReadWhiteRook">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateWhiteRook.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <test ID="CreateWhiteBishop">
+            <method>POST</method>
+            <uri>/cspace-services/collectionobjects</uri>
+            <filename>collectionobject/hierarchy/5-collectionobject-create-with-parent-refname.xml</filename>
+            <vars>
+                <var ID="objectNumber">CSPACE-5518-WhiteBishop</var>
+                <var ID="parentCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
+                <var ID="parentObjectNumber">${CreateBagOfWhiteChessPieces.objectNumber}</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        <test ID="ReadWhiteBishop">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateWhiteBishop.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+
+        
+        <!-- Individual chess pieces in the bag of black chess pieces, -->
+        <!-- each created initially without any relations. -->
+                
+        <test ID="CreateBlackQueen">
+            <method>POST</method>
+            <uri>/cspace-services/collectionobjects</uri>
+            <filename>collectionobject/hierarchy/1-collectionobject-create.xml</filename>
+            <vars>
+                <var ID="objectNumber">CSPACE-5518-BlackQueen</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        <test ID="ReadBlackQueen">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateBlackQueen.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <test ID="CreateBlackRook">
+            <method>POST</method>
+            <uri>/cspace-services/collectionobjects</uri>
+            <filename>collectionobject/hierarchy/1-collectionobject-create.xml</filename>
+            <vars>
+                <var ID="objectNumber">CSPACE-5518-BlackRook</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        <test ID="ReadBlackRook">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <test ID="CreateBlackRookFragment1">
+            <method>POST</method>
+            <uri>/cspace-services/collectionobjects</uri>
+            <filename>collectionobject/hierarchy/1-collectionobject-create.xml</filename>
+            <vars>
+                <var ID="objectNumber">CSPACE-5518-BlackRookFragment1</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        <test ID="ReadBlackRookFragment1">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateBlackRookFragment1.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <test ID="CreateBlackRookFragment2">
+            <method>POST</method>
+            <uri>/cspace-services/collectionobjects</uri>
+            <filename>collectionobject/hierarchy/1-collectionobject-create.xml</filename>
+            <vars>
+                <var ID="objectNumber">CSPACE-5518-BlackRookFragment2</var>
+            </vars>
+            <expectedCodes>201</expectedCodes>
+        </test>
+        <test ID="ReadBlackRookFragment2">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateBlackRookFragment2.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        
+        <!-- Bag of black chess pieces -->
+        <!-- (child of chess set box, sibling of chess board and bag -->
+        <!-- of white chess pieces, parents of black chess pieces) --> 
+        
+        <!--
+            This piece is created along with relations to:
+            * Its parent (the chess set box)
+            * One of its children (the black queen), created previously above
+        -->
+                
+        <test ID="CreateBagOfBlackChessPieces">
+            <method>POST</method>
+            <uri>/cspace-services/collectionobjects</uri>
+            <filename>collectionobject/hierarchy/6-collectionobject-create-with-parent-child-refnames.xml</filename>
+            <vars>
+                <var ID="objectNumber">CSPACE-5518-BagOfBlackChessPieces</var>
+                <var ID="parentCSID">${CreateChessSetBox.CSID}</var>
+                <var ID="parentObjectNumber">${CreateChessSetBox.objectNumber}</var>
+                <var ID="childCSID">${CreateBlackQueen.CSID}</var>
+                <var ID="childObjectNumber">${CreateBlackQueen.objectNumber}</var>
+            </vars>
+        </test>
+        <test ID="ReadBagOfBlackChessPieces">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+
+        <!-- Update one of the existing chess pieces, and add hierarchical -->
+        <!-- relationships between that piece and both its parent and child. -->
+        
+        <!--
+            This piece is updated along with adding relations to:
+            * Its parent (the bag of black chess pieces)
+            * Its children (black rook fragment1, black rook fragment2)
+        -->
+        
+        <test ID="UpdateBlackRookWithRelations">
+            <method>PUT</method>
+            <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
+            <filename>collectionobject/hierarchy/7-collectionobject-update-with-parent-child-refNames.xml</filename>
+            <vars>
+                <var ID="distinguishingFeatures">This black rook is nearly intact, save for two tiny fragments.</var>
+                <var ID="currentItemCSID">${CreateBlackRook.CSID}</var>
+                <var ID="currentItemObjectNumber">${CreateBlackRook.objectNumber}</var>
+                <var ID="parentCSID">${CreateBagOfBlackChessPieces.CSID}</var>
+                <var ID="parentObjectNumber">${CreateBagOfBlackChessPieces.objectNumber}</var>
+                <var ID="child1CSID">${CreateBlackRookFragment1.CSID}</var>
+                <var ID="child1ObjectNumber">${CreateBlackRookFragment1.objectNumber}</var>
+                <var ID="child2CSID">${CreateBlackRookFragment2.CSID}</var>
+                <var ID="child2ObjectNumber">${CreateBlackRookFragment2.objectNumber}</var>
+            </vars>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+    
+        <!--
+            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="ShowRelationsForTopLevelItem">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showRelations=true</uri>
+            <response>
+                <expected level="ADDOK" />
+                <filename>collectionobject/hierarchy/res/show-relations-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>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <test ID="ShowRelationsForMidLevelItem">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showRelations=true</uri>
+            <response>
+                <expected level="ADDOK" />
+                <filename>collectionobject/hierarchy/res/show-relations-mid-level.res.xml</filename>
+                <vars>
+                    <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
+                    <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
+                    <var ID="blackQueenCSID">${CreateBlackQueen.CSID}</var>
+                    <var ID="blackRookCSID">${CreateBlackRook.CSID}</var>
+                </vars>
+                <startElement>/document/*[local-name()='relations-common-list']</startElement>
+            </response>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <test ID="ShowRelationsForBottomLevelItem">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateBlackRookFragment1.CSID}?showRelations=true</uri>
+            <response>
+                <expected level="ADDOK" />
+                <filename>collectionobject/hierarchy/res/show-relations-bottom-level.res.xml</filename>
+                <vars>
+                    <var ID="blackRookCSID">${CreateBlackRook.CSID}</var>
+                    <var ID="blackRookFragment1CSID">${CreateBlackRookFragment1.CSID}</var>
+                </vars>
+                <startElement>/document/*[local-name()='relations-common-list']</startElement>
+            </response>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        
+        <!-- Read hierarchical relationships via 'showSiblings', -->
+        <!-- which returns sibling relations. -->
+
+        <test ID="ShowSiblingsForTopLevelItem">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showSiblings=true</uri>
+            <expectedCodes>200</expectedCodes>
+            <response>
+                <expected level="ADDOK" />
+                <filename>collectionobject/hierarchy/res/show-siblings-top-level.res.xml</filename>
+                <startElement>/document/*[local-name()='relations-common-list']</startElement>
+            </response>
+        </test>
+        
+        <test ID="ShowSiblingsForMidLevelItem">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showSiblings=true</uri>
+            <expectedCodes>200</expectedCodes>
+            <response>
+                <expected level="ADDOK" />
+                <filename>collectionobject/hierarchy/res/show-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="ShowSiblingsForBottomLevelItem">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateBlackRookFragment1.CSID}?showSiblings=true</uri>
+            <expectedCodes>200</expectedCodes>
+            <response>
+                <expected level="ADDOK" />
+                <filename>collectionobject/hierarchy/res/show-siblings-bottom-level.res.xml</filename>
+                <vars>
+                    <var ID="blackRookCSID">${CreateBlackRook.CSID}</var>
+                    <var ID="blackRookFragment2CSID">${CreateBlackRookFragment2.CSID}</var>
+                </vars>
+                <startElement>/document/*[local-name()='relations-common-list']</startElement>
+            </response>
+        </test>
+        
+        <!-- Read hierarchical relationships via 'showAllRelations', -->
+        <!-- which returns parent, child, and sibling relationships. -->
+
+        <test ID="ShowAllRelationsForTopLevelItem">
+            <method>GET</method>
+            <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showAllRelations=true</uri>
+            <expectedCodes>200</expectedCodes>
+            <response>
+                <expected level="ADDOK" />
+                <filename>collectionobject/hierarchy/res/show-all-relations-top-level.res.xml</filename>
+                <startElement>/document/*[local-name()='relations-common-list']</startElement>
+            </response>
+        </test>
+        
+        <!-- The following tests -->
+        
+        <!-- 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.) -->
+                
+        <!-- Zero (0) total items are expected for the top-level item as a subject, -->
+        <!-- since the tests above created relation records with this top-level -->
+        <!-- solely as an object of those relations. -->
+        <test ID="GetRelationsAsSubjectForTopLevelItem">
+            <method>GET</method>
+            <uri>/cspace-services/relations?sbj=${CreateChessSetBox.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
+            <response>
+                <expected level="ADDOK" />
+                <filename>collectionobject/hierarchy/res/relations-pagination-header.res.xml</filename>
+                <vars>
+                    <var ID="totalItems">0</var>
+                </vars>
+            </response>
+        </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/relations-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>     
+    
+        <!-- Clean up any remaining records that were NOT automatically deleted by autoDeletePOSTS -->
+        
+        <!-- Delete the records of relations to ChessSetBox, from its three children -->
+               
+        <test ID="GetRelationsToChessSetBoxAsObject">
+            <method>GET</method>
+            <uri>/cspace-services/relations?obj=${CreateChessSetBox.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        <test ID="DeleteChildRelation1ToChessSetBox">
+            <method>DELETE</method>
+            <uri>/cspace-services/relations/${GetRelationsToChessSetBoxAsObject.got("//relation-list-item[1]/csid")}</uri>
+        </test>
+        <test ID="DeleteChildRelation2ToChessSetBox">
+            <method>DELETE</method>
+            <uri>/cspace-services/relations/${GetRelationsToChessSetBoxAsObject.got("//relation-list-item[2]/csid")}</uri>
+        </test>
+        <test ID="DeleteChildRelation3ToChessSetBox">
+            <method>DELETE</method>
+            <uri>/cspace-services/relations/${GetRelationsToChessSetBoxAsObject.got("//relation-list-item[3]/csid")}</uri>
+        </test>
+        
+        <!-- Delete the records of relations to BagOfWhiteChessPieces, from its two children -->
+        
+        <test ID="GetRelationsToBagOfWhiteChessPiecesAsObject">
+            <method>GET</method>
+            <uri>/cspace-services/relations?obj=${CreateBagOfWhiteChessPieces.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        <test ID="DeleteChildRelation1ToBagOfWhiteChessPieces">
+            <method>DELETE</method>
+            <uri>/cspace-services/relations/${GetRelationsToBagOfWhiteChessPiecesAsObject.got("//relation-list-item[1]/csid")}</uri>
+        </test>
+        <test ID="DeleteChildRelation2ToBagOfWhiteChessPieces">
+            <method>DELETE</method>
+            <uri>/cspace-services/relations/${GetRelationsToBagOfWhiteChessPiecesAsObject.got("//relation-list-item[2]/csid")}</uri>
+        </test>
+        
+        <!-- Delete the records of relations to BagOfBlackChessPieces, from its two children -->
+        
+        <test ID="GetRelationsToBagOfBlackChessPiecesAsObject">
+            <method>GET</method>
+            <uri>/cspace-services/relations?obj=${CreateBagOfBlackChessPieces.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        <test ID="DeleteChildRelation1ToBagOfBlackChessPieces">
+            <method>DELETE</method>
+            <uri>/cspace-services/relations/${GetRelationsToBagOfBlackChessPiecesAsObject.got("//relation-list-item[1]/csid")}</uri>
+        </test>
+        <test ID="DeleteChildRelation2ToBagOfBlackChessPieces">
+            <method>DELETE</method>
+            <uri>/cspace-services/relations/${GetRelationsToBagOfBlackChessPiecesAsObject.got("//relation-list-item[2]/csid")}</uri>
+        </test>
+        
+        <!-- Delete the records of a relation to BlackRook, from its teo children -->
+        
+        <test ID="GetRelationsToBlackRookAsObject">
+            <method>GET</method>
+            <uri>/cspace-services/relations?obj=${CreateBlackRook.CSID}</uri>
+            <expectedCodes>200</expectedCodes>
+        </test>
+        <test ID="DeleteChildRelation1ToBlackRook">
+            <method>DELETE</method>
+            <uri>/cspace-services/relations/${GetRelationsToBlackRookAsObject.got("//relation-list-item[1]/csid")}</uri>
+        </test>
+        <test ID="DeleteChildRelation2ToBlackRook">
+            <method>DELETE</method>
+            <uri>/cspace-services/relations/${GetRelationsToBlackRookAsObject.got("//relation-list-item[2]/csid")}</uri>
+        </test>
+                       
+    </testGroup>
+    
+</xmlReplay>
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/4-collectionobject-update-with-parent-csid.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/4-collectionobject-update-with-parent-csid.xml
deleted file mode 100644 (file)
index 52a1920..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?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 relationship between an item
-            and its parent, via an update that also adds a new field
-            value to the item itself.
-        -->
-       
-        <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>
-
-
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/5-collectionobject-create-with-parent-refname.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/5-collectionobject-create-with-parent-refname.xml
new file mode 100644 (file)
index 0000000..793ab41
--- /dev/null
@@ -0,0 +1,42 @@
+<?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>
+    </ns2:collectionobjects_common>
+
+    <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation"
+                               xmlns:ns2="http://collectionspace.org/services/jaxb">
+        
+        <!-- Create a hierarchical relationship between an item -->
+        <!-- and its parent -->
+        
+        <!-- 
+             ${itemCSID} is a convention understood by the Relations service,
+             which is replaced by the CSID of the item being created.  (This
+             applies to all items, including object and procedural records,
+             not just to authority item records).
+             
+             As such, ${itemCSID} does NOT get expanded by XmlReplay. 
+             It passes through, and then the service deals with it.
+        -->
+        <relation-list-item>
+            <!-- The item being created, above ... -->
+            <subject>
+                <csid>${itemCSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </subject>
+            <!-- ... has a hasBroader relationship to ... -->
+            <predicate>hasBroader</predicate>
+            <!-- ... its parent item -->
+            <object>
+                <refName>urn:cspace:core.collectionspace.org:collectionobjects:id(${parentCSID})'${parentObjectNumber}'</refName>
+                <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/6-collectionobject-create-with-parent-child-refnames.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/6-collectionobject-create-with-parent-child-refnames.xml
new file mode 100644 (file)
index 0000000..aaadd9d
--- /dev/null
@@ -0,0 +1,60 @@
+<?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>
+    </ns2:collectionobjects_common>
+
+    <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation"
+                               xmlns:ns2="http://collectionspace.org/services/jaxb">
+        
+        <!-- Create a hierarchical relationship between an item, -->
+        <!-- its parent, and one child -->
+        
+        <!-- 
+             ${itemCSID} is a convention understood by the Relations service,
+             which is replaced by the CSID of the item being created.  (This
+             applies to all items, including object and procedural records,
+             not just to authority item records).
+             
+             As such, ${itemCSID} does NOT get expanded by XmlReplay. 
+             It passes through, and then the service deals with it.
+        -->
+        
+        <!-- Create a relationship between this item and its parent -->
+        <relation-list-item>
+            <!-- The item being created, above ... -->
+            <subject>
+                <csid>${itemCSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </subject>
+            <!-- ... has a hasBroader relationship to ... -->
+            <predicate>hasBroader</predicate>
+            <!-- ... its parent item -->
+            <object>
+                <refName>urn:cspace:core.collectionspace.org:collectionobjects:id(${parentCSID})'${parentObjectNumber}'</refName>
+                <documentType>CollectionObject</documentType>
+            </object>
+        </relation-list-item>
+        
+        <!-- Create a relationship between this item and a child -->
+        <relation-list-item>
+            <!-- A child item ... -->
+            <subject>
+                <refName>urn:cspace:core.collectionspace.org:collectionobjects:id(${childCSID})'${childObjectNumber}'</refName>
+                <documentType>CollectionObject</documentType>
+            </subject>
+            <!-- ... has a hasBroader relationship to ... -->
+            <predicate>hasBroader</predicate>
+            <!-- ... its parent item: the item being created above -->
+            <object>
+                <csid>${itemCSID}</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/7-collectionobject-update-with-parent-child-refnames.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/7-collectionobject-update-with-parent-child-refnames.xml
new file mode 100644 (file)
index 0000000..dee12f7
--- /dev/null
@@ -0,0 +1,73 @@
+<?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 relationship between an item,
+            its parent, and two children, via an update that also
+            adds a new field value to the item itself.
+        -->
+        
+        <!-- Create a relationship between this item and its parent -->
+        <!-- Both subject and object are identified by refNames -->
+        <relation-list-item>
+            <!-- The current item being updated above ... -->
+            <subject>
+                <refName>urn:cspace:core.collectionspace.org:collectionobjects:id(${currentItemCSID})'${currentItemObjectNumber}'</refName>
+                <documentType>CollectionObject</documentType>
+            </subject>
+            <!-- ... has a hasBroader relationship to ... -->
+            <predicate>hasBroader</predicate>
+            <!-- ... its parent item -->
+            <object>
+                <refName>urn:cspace:core.collectionspace.org:collectionobjects:id(${parentCSID})'${parentObjectNumber}'</refName>
+                <documentType>CollectionObject</documentType>
+            </object>
+        </relation-list-item>
+        
+        <!-- Create a relationship between this item and a child -->
+        <!-- Subject ia identified by a CSID and object by a refName -->
+        <relation-list-item>
+            <!-- A child item ... -->
+            <subject>
+                <csid>${child1CSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </subject>
+            <!-- ... has a hasBroader relationship to ... -->
+            <predicate>hasBroader</predicate>
+            <!-- ... its parent item: the current item being updated above -->
+            <object>
+                <refName>urn:cspace:core.collectionspace.org:collectionobjects:id(${currentItemCSID})'${currentItemObjectNumber}'</refName>
+                <documentType>CollectionObject</documentType>
+            </object>
+        </relation-list-item>
+        
+        <!-- And to a second child -->
+        <!-- Subject is identified by a refName and object by a CSID -->
+        <relation-list-item>
+            <!-- A child item ... -->
+            <subject>
+                <refName>urn:cspace:core.collectionspace.org:collectionobjects:id(${child2CSID})'${child2ObjectNumber}'</refName>
+                <documentType>CollectionObject</documentType>
+            </subject>
+            <!-- ... has a hasBroader relationship to ... -->
+            <predicate>hasBroader</predicate>
+            <!-- ... its parent item: the current item being updated above -->
+            <object>
+                <csid>${currentItemCSID}</csid>
+                <documentType>CollectionObject</documentType>
+            </object>
+        </relation-list-item>
+        
+    </ns3:relations-common-list>
+</document>
+
+
index 64bc4a853ff319ad12e5a232dc296b06d08e1390..59d7377dbf98a27fbfd66d84155986e09cd94f12 100644 (file)
@@ -37,7 +37,8 @@
     <run controlFile="authrefs/authrefsComplex.xml" testGroup="AuthRefsComplex" />\r
     <run controlFile="imports/imports.xml" testGroup="importsTestGroup" />\r
     \r
-    <run controlFile="collectionobject/collectionobject-hierarchy.xml" testGroup="CreateUpdateReadStructuredObjects" />\r
+    <run controlFile="collectionobject/collectionobject-hierarchy-csid.xml" testGroup="CreateUpdateReadStructuredObjects" />\r
+    <run controlFile="collectionobject/collectionobject-hierarchy-refname.xml" testGroup="CreateUpdateReadStructuredObjects" />\r
     \r
     <!-- Broken tests -->\r
     \r