<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xmlReplay>
- <testGroup ID="CreateCollectionObjects" autoDeletePOSTS="true">
+
+ <testGroup ID="CreateCollectionObjects"> <!-- autoDeletePOSTS="true" -->
<!-- Create a set of CollectionObjects -->
</test>
<!--
- <test ID="CreateBlackRook">
+ <test ID="CreateBlackRookWithRelations">
<method>POST</method>
<uri>/cspace-services/collectionobjects</uri>
<filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
</test>
<test ID="ReadBlackRook" auth="admin@core.collectionspace.org">
<method>GET</method>
- <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
+ <uri>/cspace-services/collectionobjects/${CreateBlackRookWithRelations.CSID}</uri>
<expectedCodes>200</expectedCodes>
</test>
-->
- </testGroup>
-
- <testGroup ID="CreateStructuredObjectsWithHierarchicalRelations" autoDeletePOSTS="true">
<!-- Create a new chess piece, and include in the create payload -->
<!-- a list of hierarchical relationships to be created between -->
<!-- the various CollectionObjects previously created, in tests above -->
-
- <!-- This test is currently failing with a 400 status code -->
- <!-- due to one or more Exceptions in RemoteDocumentModelHandlerImpl.updateRelations() -->
- <!-- ADR 2012-09-06 -->
<!-- Note also that it *might* not be necessary to set these variables; the original -->
<!-- values of CSIDs saved from previous posts, e.g. {CreateChessSetBox.CSID} -->
<expectedCodes>200</expectedCodes>
</test>
- </testGroup>
-
- <testGroup ID="UpdateStructuredObjectsWithHierarchicalRelations" autoDeletePOSTS="true">
-
+ <test ID="ReadHierarchyForTopLevelItem">
+ <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>
+
<!-- Update one of the existing chess pieces, and add yet one more -->
<!-- hierarchical relationship, between that piece and another -->
<!-- existing CollectionObject. -->
<test ID="UpdateBlackRootWithRelations">
<method>PUT</method>
- <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
+ <uri>/cspace-services/collectionobjects/${CreateBlackRookWithRelations.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>
<expectedCodes>200</expectedCodes>
</test>
- </testGroup>
- <!-- Read hierarchical relations via the various query parameters now -->
- <!-- supported for structured objects and procedures -->
-
- <testGroup ID="ReadRelationsOnStructuredObjects" autoDeletePOSTS="true">
-
+ <!-- Read hierarchical relations via the various query parameters now -->
+ <!-- supported for structured objects and procedures -->
+
<!-- Read hierarchical relationships via 'showRelations', -->
<!-- which returns direct parent and child relations. -->
<test ID="ReadHierarchyForBottomLevelItem">
<method>GET</method>
- <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}?showRelations=true</uri>
+ <uri>/cspace-services/collectionobjects/${CreateBlackRookWithRelations.CSID}?showRelations=true</uri>
<response>
<expected level="ADDOK" />
<filename>collectionobject/hierarchy/res/show-relations-bottom-level.res.xml</filename>
<test ID="ReadSiblingsForBottomLevelItem">
<method>GET</method>
- <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}?showSiblings=true</uri>
+ <uri>/cspace-services/collectionobjects/${CreateBlackRookWithRelations.CSID}?showSiblings=true</uri>
<expectedCodes>200</expectedCodes>
<response>
<expected level="ADDOK" />
<startElement>/document/*[local-name()='relations-common-list']</startElement>
</response>
</test>
-
- </testGroup>
-
- <!-- Read hierarchical relationships via the relations service. -->
- <!-- (This can also serve as a cross-check on the additional read mechanisms, above.) -->
-
- <testGroup ID="ReadRelations" autoDeletePOSTS="true">
-
- <test ID="GetRelationsAsObjectForTopLevelItem">
+
+ <!-- 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?obj=${CreateChessSetBox.CSID}</uri>
+ <uri>/cspace-services/relations?sbj=${CreateChessSetBox.CSID}</uri>
<expectedCodes>200</expectedCodes>
<response>
<expected level="TEXT" />
- <filename>collectionobject/hierarchy/res/relations-as-object-top-level.res.xml</filename>
+ <filename>collectionobject/hierarchy/res/relations-pagination-header.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>
+ <var ID="totalItems">0</var>
</vars>
- <startElement>/document/*[local-name()='relations-common-list']</startElement>
</response>
</test>
- <!-- 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">
+ <test ID="GetRelationsAsObjectForTopLevelItem">
<method>GET</method>
- <uri>/cspace-services/relations?sbj=${CreateChessSetBox.CSID}</uri>
+ <uri>/cspace-services/relations?obj=${CreateChessSetBox.CSID}</uri>
<expectedCodes>200</expectedCodes>
<response>
<expected level="TEXT" />
- <filename>collectionobject/hierarchy/res/relations-pagination-header.res.xml</filename>
+ <filename>collectionobject/hierarchy/res/relations-as-object-top-level.res.xml</filename>
<vars>
- <var ID="totalItems">0</var>
+ <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="DeleteBlackRook" auth="admin@core.collectionspace.org">
<method>DELETE</method>
- <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
+ <uri>/cspace-services/collectionobjects/${CreateBlackRookWithRelations.CSID}</uri>
</test>
<test ID="DeleteBlackQueen" auth="admin@core.collectionspace.org">
<method>DELETE</method>