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="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
149 <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
150 <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
151 <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
152 <var ID="whiteRookCSID">${CreateWhiteRook.CSID}</var>
153 <var ID="whiteBishopCSID">${CreateWhiteBishop.CSID}</var>
154 <var ID="blackQueenCSID">${CreateBlackQueen.CSID}</var>
156 <expectedCodes>201</expectedCodes>
159 <test ID="ReadBlackRook" auth="admin@core.collectionspace.org">
161 <uri>/cspace-services/collectionobjects/${CreateBlackRookWithRelations.CSID}</uri>
162 <expectedCodes>200</expectedCodes>
166 <!-- Update one of the chess piece records, while including -->
167 <!-- a list of hierarchical relationships to be created between the -->
168 <!-- various CollectionObjects created in tests above -->
171 <test ID="UpdateBlackRootWithRelations">
173 <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
174 <filename>collectionobject/hierarchy/3-collectionobjects-with-relations-update.xml</filename>
176 <var ID="distinguishingFeatures">This rook has two light brown striations on part of its base.</var>
177 <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
178 <var ID="blackRookCSID">${CreateBlackRookWithRelations.CSID}</var>
180 <expectedCodes>200</expectedCodes>
186 <!-- Additional tests that we can start moving into the test group above, -->
187 <!-- once create and update tests are succeeding. -->
189 <testGroup ID="HierarchicCollectionObjectMore" autoDeletePOSTS="true">
191 <!-- Read hierarchical relationships -->
193 <!-- Read hierarchical relationships via 'showRelations' -->
195 <test ID="ReadHierarchyForTopLevelItem">
197 <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showRelations=true</uri>
198 <expectedCodes>200</expectedCodes>
199 <!-- Also need to test response payload here -->
202 <test ID="GetRelationsAsObjectForTopLevelItem">
204 <uri>/cspace-services/relations?obj=${CreateChessSetBox.CSID}</uri>
205 <expectedCodes>200</expectedCodes>
207 <expected level="TEXT" />
208 <filename>collectionobject/hierarchy/res/read-as-object-top-level.res.xml</filename>
210 <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
211 <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
212 <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
213 <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
215 <startElement>/document/*[local-name()='relations-common-list']</startElement>
219 <test ID="ReadHierarchyForMidLevelItem">
221 <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showRelations=true</uri>
222 <expectedCodes>200</expectedCodes>
223 <!-- Also need to test response payload here -->
226 <test ID="ReadHierarchyForBottomLevelItem">
228 <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}?showRelations=true</uri>
229 <expectedCodes>200</expectedCodes>
230 <!-- Also need to test response payload here -->
233 <!-- Read hierarchical relationships via 'showSiblings' -->
235 <test ID="ReadSiblingsForTopLevelItem">
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-top-level.res.xml</filename>
242 <startElement>/document/*[local-name()='relations-common-list']</startElement>
246 <test ID="ReadSiblingsForMidLevelItem">
248 <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showSiblings=true</uri>
249 <expectedCodes>200</expectedCodes>
251 <expected level="ADDOK" />
252 <filename>collectionobject/hierarchy/res/read-siblings-mid-level.res.xml</filename>
254 <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
255 <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
256 <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
258 <startElement>/document/*[local-name()='relations-common-list']</startElement>
262 <test ID="ReadSiblingsForBottomLevelItem">
264 <uri>/cspace-services/collectionobjects/${CreateBlackQueen.CSID}?showSiblings=true</uri>
265 <expectedCodes>200</expectedCodes>
267 <expected level="ADDOK" />
268 <filename>collectionobject/hierarchy/res/read-siblings-bottom-level.res.xml</filename>
270 <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
271 <var ID="blackRookCSID">${CreateBlackRook.CSID}</var>
273 <startElement>/document/*[local-name()='relations-common-list']</startElement>
277 <!-- Read hierarchical relationships via 'showAllRelations' -->
279 <test ID="ReadAllRelationsForTopLevelItem">
281 <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showAllRelations=true</uri>
282 <expectedCodes>200</expectedCodes>
284 <expected level="ADDOK" />
285 <filename>collectionobject/hierarchy/res/read-all-relations.res.xml</filename>
286 <startElement>/document/*[local-name()='relations-common-list']</startElement>
290 <!-- Read hierarchical relationships via the relations service -->
292 <test ID="GetRelationsAsSubjectForTopLevelItem">
294 <uri>/cspace-services/relations?sbj=${CreateChessSetBox.CSID}</uri>
295 <expectedCodes>200</expectedCodes>
296 <!-- Also need to test response payload here -->
299 <test ID="GetRelationsAsObjectForTopLevelItem">
301 <uri>/cspace-services/relations?obj=${CreateChessSetBox.CSID}</uri>
302 <expectedCodes>200</expectedCodes>
304 <expected level="ADDOK" />
305 <filename>collectionobject/hierarchy/res/read-as-object-top-level.res.xml</filename>
307 <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
308 <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
309 <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
310 <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
312 <startElement>/document/*[local-name()='relations-common-list']</startElement>
320 <test ID="DeleteHierarchy">
324 <!-- The following is likely unnecessary with 'autoDeletePOSTS="true"' -->
326 <test ID="DeleteBlackRook" auth="admin@core.collectionspace.org">
327 <method>DELETE</method>
328 <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
330 <test ID="DeleteBlackQueen" auth="admin@core.collectionspace.org">
331 <method>DELETE</method>
332 <uri>/cspace-services/collectionobjects/${CreateBlackQueen.CSID}</uri>
334 <test ID="DeleteWhiteBishop" auth="admin@core.collectionspace.org">
335 <method>DELETE</method>
336 <uri>/cspace-services/collectionobjects/${CreateWhiteBishop.CSID}</uri>
338 <test ID="DeleteWhiteRook" auth="admin@core.collectionspace.org">
339 <method>DELETE</method>
340 <uri>/cspace-services/collectionobjects/${CreateWhiteRook.CSID}</uri>
342 <test ID="DeleteBagOfBlackChessPieces" auth="admin@core.collectionspace.org">
343 <method>DELETE</method>
344 <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}</uri>
346 <test ID="DeleteBagOfWhiteChessPieces" auth="admin@core.collectionspace.org">
347 <method>DELETE</method>
348 <uri>/cspace-services/collectionobjects/${CreateBagOfWhiteChessPieces.CSID}</uri>
350 <test ID="DeleteChessBoard" auth="admin@core.collectionspace.org">
351 <method>DELETE</method>
352 <uri>/cspace-services/collectionobjects/${CreateChessBoard.CSID}</uri>
354 <test ID="DeleteChessSetBox" auth="admin@core.collectionspace.org">
355 <method>DELETE</method>
356 <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}</uri>