1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
3 <testGroup ID="HierarchicCollectionObject" autoDeletePOSTS="true">
5 <!-- Create a set of CollectionObjects -->
8 <!-- (parent of chess board, bags of white and black chess pieces -->
9 <test ID="CreateChessSetBox" auth="admin@core.collectionspace.org">
11 <uri>/cspace-services/collectionobjects</uri>
12 <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
14 <var ID="objectNumber">CSPACE-5518-ChessSetBox</var>
17 <test ID="ReadChessSetBox" auth="admin@core.collectionspace.org">
19 <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}</uri>
23 <!-- (child of chess set box, sibling of bags of white and black chess pieces) -->
24 <test ID="CreateChessBoard" auth="admin@core.collectionspace.org">
26 <uri>/cspace-services/collectionobjects</uri>
27 <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
29 <var ID="objectNumber">CSPACE-5518-ChessBoard</var>
32 <test ID="ReadChessBoard" auth="admin@core.collectionspace.org">
34 <uri>/cspace-services/collectionobjects/${CreateChessBoard.CSID}</uri>
37 <!-- Bags of white and black chess pieces -->
38 <!-- (child of chess set box, sibling of chess board, parents of chess pieces) -->
39 <test ID="CreateBagOfWhiteChessPieces">
41 <uri>/cspace-services/collectionobjects</uri>
42 <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
44 <var ID="objectNumber">CSPACE-5518-BagOfWhiteChessPieces</var>
47 <test ID="ReadBagOfWhiteChessPieces" auth="admin@core.collectionspace.org">
49 <uri>/cspace-services/collectionobjects/${CreateBagOfWhiteChessPieces.CSID}</uri>
51 <test ID="CreateBagOfBlackChessPieces">
53 <uri>/cspace-services/collectionobjects</uri>
54 <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
56 <var ID="objectNumber">CSPACE-5518-BagOfBlackChessPieces</var>
59 <test ID="ReadBagOfBlackChessPieces" auth="admin@core.collectionspace.org">
61 <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}</uri>
64 <!-- Individual chess pieces in those bags -->
65 <test ID="CreateWhiteRook">
67 <uri>/cspace-services/collectionobjects</uri>
68 <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
70 <var ID="objectNumber">CSPACE-5518-WhiteRook</var>
73 <test ID="ReadWhiteRook" auth="admin@core.collectionspace.org">
75 <uri>/cspace-services/collectionobjects/${CreateWhiteRook.CSID}</uri>
77 <test ID="CreateWhiteBishop">
79 <uri>/cspace-services/collectionobjects</uri>
80 <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
82 <var ID="objectNumber">CSPACE-5518-WhiteBishop</var>
85 <test ID="ReadWhiteBishop" auth="admin@core.collectionspace.org">
87 <uri>/cspace-services/collectionobjects/${CreateWhiteBishop.CSID}</uri>
89 <test ID="CreateBlackQueen">
91 <uri>/cspace-services/collectionobjects</uri>
92 <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
94 <var ID="objectNumber">CSPACE-5518-BlackQueen</var>
97 <test ID="ReadBlackQueen" auth="admin@core.collectionspace.org">
99 <uri>/cspace-services/collectionobjects/${CreateBlackQueen.CSID}</uri>
101 <test ID="CreateBlackRook">
102 <method>POST</method>
103 <uri>/cspace-services/collectionobjects</uri>
104 <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
106 <var ID="objectNumber">CSPACE-5518-BlackRook</var>
109 <test ID="ReadBlackRook" auth="admin@core.collectionspace.org">
111 <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
114 <!-- Create hierarchical relationships -->
116 <!-- Post an update to one of the chess piece records, which includes -->
117 <!-- a list of hierarchical relationships to be created between the -->
118 <!-- various CollectionObjects created in tests above -->
119 <test ID="CreateHierarchy">
121 <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
122 <filename>collectionobject/hierarchy/2-collectionobjects_w_relations_CSID.xml</filename>
124 <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
125 <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
126 <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
127 <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
128 <var ID="whiteRookCSID">${CreateWhiteRook.CSID}</var>
129 <var ID="whiteBishopCSID">${CreateWhiteBishop.CSID}</var>
130 <var ID="blackQueenCSID">${CreateBlackQueen.CSID}</var>
131 <var ID="blackRookCSID">${CreateBlackRook.CSID}</var>
135 <!-- Read hierarchical relationships -->
137 <!-- Read hierarchical relationships via 'showRelations' -->
139 <test ID="ReadHierarchyForTopLevelItem">
141 <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showRelations=true</uri>
142 <!-- Also need to test response payload here -->
145 <test ID="ReadHierarchyForMidLevelItem">
147 <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showRelations=true</uri>
148 <!-- Also need to test response payload here -->
151 <test ID="ReadHierarchyForBottomLevelItem">
153 <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}?showRelations=true</uri>
154 <!-- Also need to test response payload here -->
157 <!-- Read hierarchical relationships via 'showSiblings' -->
159 <test ID="ReadSiblingsForTopLevelItem">
161 <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showSiblings=true</uri>
163 <expected level="ADDOK" />
164 <filename>collectionobject/hierarchy/res/read-siblings-top-level.res.xml</filename>
165 <startElement>/document/*[local-name()='relations-common-list']</startElement>
169 <test ID="ReadSiblingsForMidLevelItem">
171 <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showSiblings=true</uri>
173 <expected level="ADDOK" />
174 <filename>collectionobject/hierarchy/res/read-siblings-mid-level.res.xml</filename>
176 <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
177 <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
178 <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
180 <startElement>/document/*[local-name()='relations-common-list']</startElement>
184 <test ID="ReadSiblingsForBottomLevelItem">
186 <uri>/cspace-services/collectionobjects/${CreateBlackQueen.CSID}?showSiblings=true</uri>
188 <expected level="ADDOK" />
189 <filename>collectionobject/hierarchy/res/read-siblings-bottom-level.res.xml</filename>
191 <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
192 <var ID="blackRookCSID">${CreateBlackRook.CSID}</var>
194 <startElement>/document/*[local-name()='relations-common-list']</startElement>
198 <!-- Read hierarchical relationships via 'showAllRelations' -->
200 <test ID="ReadAllRelationsForTopLevelItem">
202 <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showAllRelations=true</uri>
204 <expected level="ADDOK" />
205 <filename>collectionobject/hierarchy/res/read-all-relations.res.xml</filename>
206 <startElement>/document/*[local-name()='relations-common-list']</startElement>
211 <!-- Read hierarchical relationships via the relations service -->
213 <test ID="GetRelationsAsSubject">
215 <uri>/cspace-services/relations?sbj=${CreateBagOfBlackChessPieces.CSID}</uri>
216 <!-- Also need to test response payload here -->
219 <test ID="GetRelationsAsObject">
221 <uri>/cspace-services/relations?obj=${CreateBagOfBlackChessPieces.CSID}</uri>
222 <!-- Also need to test response payload here -->
229 <test ID="DeleteHierarchy">
233 <!-- The following is likely unnecessary with 'autoDeletePOSTS="true"' -->
235 <test ID="DeleteBlackRook" auth="admin@core.collectionspace.org">
236 <method>DELETE</method>
237 <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
239 <test ID="DeleteBlackQueen" auth="admin@core.collectionspace.org">
240 <method>DELETE</method>
241 <uri>/cspace-services/collectionobjects/${CreateBlackQueen.CSID}</uri>
243 <test ID="DeleteWhiteBishop" auth="admin@core.collectionspace.org">
244 <method>DELETE</method>
245 <uri>/cspace-services/collectionobjects/${CreateWhiteBishop.CSID}</uri>
247 <test ID="DeleteWhiteRook" auth="admin@core.collectionspace.org">
248 <method>DELETE</method>
249 <uri>/cspace-services/collectionobjects/${CreateWhiteRook.CSID}</uri>
251 <test ID="DeleteBagOfBlackChessPieces" auth="admin@core.collectionspace.org">
252 <method>DELETE</method>
253 <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}</uri>
255 <test ID="DeleteBagOfWhiteChessPieces" auth="admin@core.collectionspace.org">
256 <method>DELETE</method>
257 <uri>/cspace-services/collectionobjects/${CreateBagOfWhiteChessPieces.CSID}</uri>
259 <test ID="DeleteChessBoard" auth="admin@core.collectionspace.org">
260 <method>DELETE</method>
261 <uri>/cspace-services/collectionobjects/${CreateChessBoard.CSID}</uri>
263 <test ID="DeleteChessSetBox" auth="admin@core.collectionspace.org">
264 <method>DELETE</method>
265 <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}</uri>