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 <!-- This test is currently failing with a 400 status code -->
136 <!-- due to one or more Exceptions in RemoteDocumentModelHandlerImpl.updateRelations() -->
137 <!-- ADR 2012-09-06 -->
139 <!-- Note also that it *might* not be necessary to set these variables; the original -->
140 <!-- values of CSIDs saved from previous posts, e.g. {CreateChessSetBox.CSID} -->
141 <!-- might still be available for use in request payloads. -->
143 <test ID="CreateBlackRookWithRelations">
144 <method>POST</method>
145 <uri>/cspace-services/collectionobjects</uri>
146 <filename>collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml</filename>
148 <var ID="objectNumber">CSPACE-5518-BlackRook</var>
149 <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
150 <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
151 <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
152 <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
153 <var ID="whiteRookCSID">${CreateWhiteRook.CSID}</var>
154 <var ID="whiteBishopCSID">${CreateWhiteBishop.CSID}</var>
155 <var ID="blackQueenCSID">${CreateBlackQueen.CSID}</var>
157 <expectedCodes>201</expectedCodes>
160 <test ID="ReadBlackRook" auth="admin@core.collectionspace.org">
162 <uri>/cspace-services/collectionobjects/${CreateBlackRookWithRelations.CSID}</uri>
163 <expectedCodes>200</expectedCodes>
167 <!-- Update one of the chess piece records, while including -->
168 <!-- a list of hierarchical relationships to be created between the -->
169 <!-- various CollectionObjects created in tests above -->
172 <test ID="UpdateBlackRootWithRelations">
174 <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
175 <filename>collectionobject/hierarchy/3-collectionobjects-with-relations-update.xml</filename>
177 <var ID="distinguishingFeatures">This rook has two light brown striations on part of its base.</var>
178 <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
179 <var ID="blackRookCSID">${CreateBlackRookWithRelations.CSID}</var>
181 <expectedCodes>200</expectedCodes>
187 <!-- Additional tests that we can start moving into the test group above, -->
188 <!-- once create and update tests are succeeding. -->
190 <testGroup ID="HierarchicCollectionObjectMore" autoDeletePOSTS="true">
192 <!-- Read hierarchical relationships -->
194 <!-- Read hierarchical relationships via 'showRelations' -->
196 <test ID="ReadHierarchyForTopLevelItem">
198 <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showRelations=true</uri>
199 <expectedCodes>200</expectedCodes>
200 <!-- Also need to test response payload here -->
203 <test ID="GetRelationsAsObjectForTopLevelItem">
205 <uri>/cspace-services/relations?obj=${CreateChessSetBox.CSID}</uri>
206 <expectedCodes>200</expectedCodes>
208 <expected level="TEXT" />
209 <filename>collectionobject/hierarchy/res/read-as-object-top-level.res.xml</filename>
211 <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
212 <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
213 <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
214 <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
216 <startElement>/document/*[local-name()='relations-common-list']</startElement>
220 <test ID="ReadHierarchyForMidLevelItem">
222 <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showRelations=true</uri>
223 <expectedCodes>200</expectedCodes>
224 <!-- Also need to test response payload here -->
227 <test ID="ReadHierarchyForBottomLevelItem">
229 <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}?showRelations=true</uri>
230 <expectedCodes>200</expectedCodes>
231 <!-- Also need to test response payload here -->
234 <!-- Read hierarchical relationships via 'showSiblings' -->
236 <test ID="ReadSiblingsForTopLevelItem">
238 <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showSiblings=true</uri>
239 <expectedCodes>200</expectedCodes>
241 <expected level="ADDOK" />
242 <filename>collectionobject/hierarchy/res/read-siblings-top-level.res.xml</filename>
243 <startElement>/document/*[local-name()='relations-common-list']</startElement>
247 <test ID="ReadSiblingsForMidLevelItem">
249 <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showSiblings=true</uri>
250 <expectedCodes>200</expectedCodes>
252 <expected level="ADDOK" />
253 <filename>collectionobject/hierarchy/res/read-siblings-mid-level.res.xml</filename>
255 <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
256 <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
257 <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
259 <startElement>/document/*[local-name()='relations-common-list']</startElement>
263 <test ID="ReadSiblingsForBottomLevelItem">
265 <uri>/cspace-services/collectionobjects/${CreateBlackQueen.CSID}?showSiblings=true</uri>
266 <expectedCodes>200</expectedCodes>
268 <expected level="ADDOK" />
269 <filename>collectionobject/hierarchy/res/read-siblings-bottom-level.res.xml</filename>
271 <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
272 <var ID="blackRookCSID">${CreateBlackRook.CSID}</var>
274 <startElement>/document/*[local-name()='relations-common-list']</startElement>
278 <!-- Read hierarchical relationships via 'showAllRelations' -->
280 <test ID="ReadAllRelationsForTopLevelItem">
282 <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showAllRelations=true</uri>
283 <expectedCodes>200</expectedCodes>
285 <expected level="ADDOK" />
286 <filename>collectionobject/hierarchy/res/read-all-relations.res.xml</filename>
287 <startElement>/document/*[local-name()='relations-common-list']</startElement>
291 <!-- Read hierarchical relationships via the relations service -->
293 <test ID="GetRelationsAsSubjectForTopLevelItem">
295 <uri>/cspace-services/relations?sbj=${CreateChessSetBox.CSID}</uri>
296 <expectedCodes>200</expectedCodes>
297 <!-- Also need to test response payload here -->
300 <test ID="GetRelationsAsObjectForTopLevelItem">
302 <uri>/cspace-services/relations?obj=${CreateChessSetBox.CSID}</uri>
303 <expectedCodes>200</expectedCodes>
305 <expected level="ADDOK" />
306 <filename>collectionobject/hierarchy/res/read-as-object-top-level.res.xml</filename>
308 <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
309 <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
310 <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
311 <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
313 <startElement>/document/*[local-name()='relations-common-list']</startElement>
321 <test ID="DeleteHierarchy">
325 <!-- The following is likely unnecessary with 'autoDeletePOSTS="true"' -->
327 <test ID="DeleteBlackRook" auth="admin@core.collectionspace.org">
328 <method>DELETE</method>
329 <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
331 <test ID="DeleteBlackQueen" auth="admin@core.collectionspace.org">
332 <method>DELETE</method>
333 <uri>/cspace-services/collectionobjects/${CreateBlackQueen.CSID}</uri>
335 <test ID="DeleteWhiteBishop" auth="admin@core.collectionspace.org">
336 <method>DELETE</method>
337 <uri>/cspace-services/collectionobjects/${CreateWhiteBishop.CSID}</uri>
339 <test ID="DeleteWhiteRook" auth="admin@core.collectionspace.org">
340 <method>DELETE</method>
341 <uri>/cspace-services/collectionobjects/${CreateWhiteRook.CSID}</uri>
343 <test ID="DeleteBagOfBlackChessPieces" auth="admin@core.collectionspace.org">
344 <method>DELETE</method>
345 <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}</uri>
347 <test ID="DeleteBagOfWhiteChessPieces" auth="admin@core.collectionspace.org">
348 <method>DELETE</method>
349 <uri>/cspace-services/collectionobjects/${CreateBagOfWhiteChessPieces.CSID}</uri>
351 <test ID="DeleteChessBoard" auth="admin@core.collectionspace.org">
352 <method>DELETE</method>
353 <uri>/cspace-services/collectionobjects/${CreateChessBoard.CSID}</uri>
355 <test ID="DeleteChessSetBox" auth="admin@core.collectionspace.org">
356 <method>DELETE</method>
357 <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}</uri>