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>
16 <expectedCodes>201</expectedCodes>
18 <test ID="ReadChessSetBox" auth="admin@core.collectionspace.org">
20 <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}</uri>
21 <expectedCodes>200</expectedCodes>
25 (child of chess set box, sibling of bags of white and black chess pieces)
26 <test ID="CreateChessBoard" auth="admin@core.collectionspace.org">
28 <uri>/cspace-services/collectionobjects</uri>
29 <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
31 <var ID="objectNumber">CSPACE-5518-ChessBoard</var>
33 <expectedCodes>201</expectedCodes>
35 <test ID="ReadChessBoard" auth="admin@core.collectionspace.org">
37 <uri>/cspace-services/collectionobjects/${CreateChessBoard.CSID}</uri>
38 <expectedCodes>200</expectedCodes>
41 Bags of white and black chess pieces
42 (child of chess set box, sibling of chess board, parents of chess pieces)
43 <test ID="CreateBagOfWhiteChessPieces">
45 <uri>/cspace-services/collectionobjects</uri>
46 <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
48 <var ID="objectNumber">CSPACE-5518-BagOfWhiteChessPieces</var>
50 <expectedCodes>201</expectedCodes>
52 <test ID="ReadBagOfWhiteChessPieces" auth="admin@core.collectionspace.org">
54 <uri>/cspace-services/collectionobjects/${CreateBagOfWhiteChessPieces.CSID}</uri>
55 <expectedCodes>200</expectedCodes>
58 <test ID="CreateBagOfBlackChessPieces">
60 <uri>/cspace-services/collectionobjects</uri>
61 <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
63 <var ID="objectNumber">CSPACE-5518-BagOfBlackChessPieces</var>
66 <test ID="ReadBagOfBlackChessPieces" auth="admin@core.collectionspace.org">
68 <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}</uri>
69 <expectedCodes>200</expectedCodes>
72 Individual chess pieces in those bags
73 <test ID="CreateWhiteRook">
75 <uri>/cspace-services/collectionobjects</uri>
76 <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
78 <var ID="objectNumber">CSPACE-5518-WhiteRook</var>
80 <expectedCodes>201</expectedCodes>
82 <test ID="ReadWhiteRook" auth="admin@core.collectionspace.org">
84 <uri>/cspace-services/collectionobjects/${CreateWhiteRook.CSID}</uri>
85 <expectedCodes>200</expectedCodes>
87 <test ID="CreateWhiteBishop">
89 <uri>/cspace-services/collectionobjects</uri>
90 <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
92 <var ID="objectNumber">CSPACE-5518-WhiteBishop</var>
94 <expectedCodes>201</expectedCodes>
96 <test ID="ReadWhiteBishop" auth="admin@core.collectionspace.org">
98 <uri>/cspace-services/collectionobjects/${CreateWhiteBishop.CSID}</uri>
99 <expectedCodes>200</expectedCodes>
101 <test ID="CreateBlackQueen">
102 <method>POST</method>
103 <uri>/cspace-services/collectionobjects</uri>
104 <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
106 <var ID="objectNumber">CSPACE-5518-BlackQueen</var>
108 <expectedCodes>201</expectedCodes>
110 <test ID="ReadBlackQueen" auth="admin@core.collectionspace.org">
112 <uri>/cspace-services/collectionobjects/${CreateBlackQueen.CSID}</uri>
113 <expectedCodes>200</expectedCodes>
117 <test ID="CreateBlackRook">
118 <method>POST</method>
119 <uri>/cspace-services/collectionobjects</uri>
120 <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
122 <var ID="objectNumber">CSPACE-5518-BlackRook</var>
124 <expectedCodes>201</expectedCodes>
126 <test ID="ReadBlackRook" auth="admin@core.collectionspace.org">
128 <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
129 <expectedCodes>200</expectedCodes>
133 <!-- Create hierarchical relationships -->
135 <test ID="CreateBlackRookWithRelations">
136 <method>POST</method>
137 <uri>/cspace-services/collectionobjects</uri>
138 <filename>collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml</filename>
140 <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
141 <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
142 <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
143 <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
144 <var ID="whiteRookCSID">${CreateWhiteRook.CSID}</var>
145 <var ID="whiteBishopCSID">${CreateWhiteBishop.CSID}</var>
146 <var ID="blackQueenCSID">${CreateBlackQueen.CSID}</var>
148 <expectedCodes>201</expectedCodes>
151 <test ID="ReadBlackRook" auth="admin@core.collectionspace.org">
153 <uri>/cspace-services/collectionobjects/${CreateBlackRookWithRelations.CSID}</uri>
154 <expectedCodes>200</expectedCodes>
158 <!-- Update one of the chess piece records, while including -->
159 <!-- a list of hierarchical relationships to be created between the -->
160 <!-- various CollectionObjects created in tests above -->
163 <test ID="UpdateBlackRootWithRelations">
165 <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
166 <filename>collectionobject/hierarchy/3-collectionobjects-with-relations-update.xml</filename>
168 <var ID="distinguishingFeatures">This rook has two light brown striations on part of its base.</var>
169 <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
170 <var ID="blackRookCSID">${CreateBlackRookWithRelations.CSID}</var>
172 <expectedCodes>200</expectedCodes>
178 <testGroup ID="HierarchicCollectionObjectMore" autoDeletePOSTS="true">
180 <!-- Read hierarchical relationships -->
182 <!-- Read hierarchical relationships via 'showRelations' -->
184 <test ID="ReadHierarchyForTopLevelItem">
186 <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showRelations=true</uri>
187 <expectedCodes>200</expectedCodes>
188 <!-- Also need to test response payload here -->
191 <test ID="GetRelationsAsObjectForTopLevelItem">
193 <uri>/cspace-services/relations?obj=${CreateChessSetBox.CSID}</uri>
194 <expectedCodes>200</expectedCodes>
196 <expected level="TEXT" />
197 <filename>collectionobject/hierarchy/res/read-as-object-top-level.res.xml</filename>
199 <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
200 <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
201 <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
202 <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
204 <startElement>/document/*[local-name()='relations-common-list']</startElement>
208 <test ID="ReadHierarchyForMidLevelItem">
210 <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showRelations=true</uri>
211 <expectedCodes>200</expectedCodes>
212 <!-- Also need to test response payload here -->
215 <test ID="ReadHierarchyForBottomLevelItem">
217 <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}?showRelations=true</uri>
218 <expectedCodes>200</expectedCodes>
219 <!-- Also need to test response payload here -->
222 <!-- Read hierarchical relationships via 'showSiblings' -->
224 <test ID="ReadSiblingsForTopLevelItem">
226 <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showSiblings=true</uri>
227 <expectedCodes>200</expectedCodes>
229 <expected level="ADDOK" />
230 <filename>collectionobject/hierarchy/res/read-siblings-top-level.res.xml</filename>
231 <startElement>/document/*[local-name()='relations-common-list']</startElement>
235 <test ID="ReadSiblingsForMidLevelItem">
237 <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showSiblings=true</uri>
238 <expectedCodes>200</expectedCodes>
240 <expected level="ADDOK" />
241 <filename>collectionobject/hierarchy/res/read-siblings-mid-level.res.xml</filename>
243 <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
244 <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
245 <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
247 <startElement>/document/*[local-name()='relations-common-list']</startElement>
251 <test ID="ReadSiblingsForBottomLevelItem">
253 <uri>/cspace-services/collectionobjects/${CreateBlackQueen.CSID}?showSiblings=true</uri>
254 <expectedCodes>200</expectedCodes>
256 <expected level="ADDOK" />
257 <filename>collectionobject/hierarchy/res/read-siblings-bottom-level.res.xml</filename>
259 <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
260 <var ID="blackRookCSID">${CreateBlackRook.CSID}</var>
262 <startElement>/document/*[local-name()='relations-common-list']</startElement>
266 <!-- Read hierarchical relationships via 'showAllRelations' -->
268 <test ID="ReadAllRelationsForTopLevelItem">
270 <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showAllRelations=true</uri>
271 <expectedCodes>200</expectedCodes>
273 <expected level="ADDOK" />
274 <filename>collectionobject/hierarchy/res/read-all-relations.res.xml</filename>
275 <startElement>/document/*[local-name()='relations-common-list']</startElement>
279 <!-- Read hierarchical relationships via the relations service -->
281 <test ID="GetRelationsAsSubjectForTopLevelItem">
283 <uri>/cspace-services/relations?sbj=${CreateChessSetBox.CSID}</uri>
284 <expectedCodes>200</expectedCodes>
285 <!-- Also need to test response payload here -->
288 <test ID="GetRelationsAsObjectForTopLevelItem">
290 <uri>/cspace-services/relations?obj=${CreateChessSetBox.CSID}</uri>
291 <expectedCodes>200</expectedCodes>
293 <expected level="ADDOK" />
294 <filename>collectionobject/hierarchy/res/read-as-object-top-level.res.xml</filename>
296 <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
297 <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
298 <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
299 <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
301 <startElement>/document/*[local-name()='relations-common-list']</startElement>
309 <test ID="DeleteHierarchy">
313 <!-- The following is likely unnecessary with 'autoDeletePOSTS="true"' -->
315 <test ID="DeleteBlackRook" auth="admin@core.collectionspace.org">
316 <method>DELETE</method>
317 <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
319 <test ID="DeleteBlackQueen" auth="admin@core.collectionspace.org">
320 <method>DELETE</method>
321 <uri>/cspace-services/collectionobjects/${CreateBlackQueen.CSID}</uri>
323 <test ID="DeleteWhiteBishop" auth="admin@core.collectionspace.org">
324 <method>DELETE</method>
325 <uri>/cspace-services/collectionobjects/${CreateWhiteBishop.CSID}</uri>
327 <test ID="DeleteWhiteRook" auth="admin@core.collectionspace.org">
328 <method>DELETE</method>
329 <uri>/cspace-services/collectionobjects/${CreateWhiteRook.CSID}</uri>
331 <test ID="DeleteBagOfBlackChessPieces" auth="admin@core.collectionspace.org">
332 <method>DELETE</method>
333 <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}</uri>
335 <test ID="DeleteBagOfWhiteChessPieces" auth="admin@core.collectionspace.org">
336 <method>DELETE</method>
337 <uri>/cspace-services/collectionobjects/${CreateBagOfWhiteChessPieces.CSID}</uri>
339 <test ID="DeleteChessBoard" auth="admin@core.collectionspace.org">
340 <method>DELETE</method>
341 <uri>/cspace-services/collectionobjects/${CreateChessBoard.CSID}</uri>
343 <test ID="DeleteChessSetBox" auth="admin@core.collectionspace.org">
344 <method>DELETE</method>
345 <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}</uri>