1 <?xml version="1.0" encoding="UTF-8"?>
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 <test ID="ReadHierarchyForTopLevelItem">
139 <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showRelations=true</uri>
140 <!-- Need to test response payload here -->
143 <test ID="ReadHierarchyForMidLevelItem">
145 <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showRelations=true</uri>
146 <!-- Need to test response payload here -->
149 <test ID="ReadHierarchyForBottomLevelItem">
151 <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}?showRelations=true</uri>
152 <!-- Need to test response payload here -->
155 <test ID="ReadAllRelations">
157 <uri>/cspace-services/relations</uri>
158 <!-- Need to test response payload here -->
161 <test ID="GetRelationsAsSubject">
163 <uri>/cspace-services/relations?sbj=${CreateBagOfBlackChessPieces.CSID}</uri>
164 <!-- Need to test response payload here -->
167 <test ID="GetRelationsAsObject">
169 <uri>/cspace-services/relations?obj=${CreateBagOfBlackChessPieces.CSID}</uri>
170 <!-- Need to test response payload here -->
176 <test ID="DeleteHierarchy">
179 <!-- The following is likely unnecessary with 'autoDeletePOSTS="true"' -->
181 <test ID="DeleteBlackRook" auth="admin@core.collectionspace.org">
182 <method>DELETE</method>
183 <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
185 <test ID="DeleteBlackQueen" auth="admin@core.collectionspace.org">
186 <method>DELETE</method>
187 <uri>/cspace-services/collectionobjects/${CreateBlackQueen.CSID}</uri>
189 <test ID="DeleteWhiteBishop" auth="admin@core.collectionspace.org">
190 <method>DELETE</method>
191 <uri>/cspace-services/collectionobjects/${CreateWhiteBishop.CSID}</uri>
193 <test ID="DeleteWhiteRook" auth="admin@core.collectionspace.org">
194 <method>DELETE</method>
195 <uri>/cspace-services/collectionobjects/${CreateWhiteRook.CSID}</uri>
197 <test ID="DeleteBagOfBlackChessPieces" auth="admin@core.collectionspace.org">
198 <method>DELETE</method>
199 <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}</uri>
201 <test ID="DeleteBagOfWhiteChessPieces" auth="admin@core.collectionspace.org">
202 <method>DELETE</method>
203 <uri>/cspace-services/collectionobjects/${CreateBagOfWhiteChessPieces.CSID}</uri>
205 <test ID="DeleteChessBoard" auth="admin@core.collectionspace.org">
206 <method>DELETE</method>
207 <uri>/cspace-services/collectionobjects/${CreateChessBoard.CSID}</uri>
209 <test ID="DeleteChessSetBox" auth="admin@core.collectionspace.org">
210 <method>DELETE</method>
211 <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}</uri>
219 <test ID="LocationChild3">
220 <method>POST</method>
221 <uri>/cspace-services/collectionobjects/${LocationAuth1.CSID}/items/</uri>
222 <filename>collectionobject/hierarchy/2-item.xml</filename>
224 <var ID="inAuthority">${LocationAuth1.CSID}</var>
225 <var ID="authShortIdentifier">CSPACE3739LocationAuthority</var>
226 <var ID="shortIdentifier">Shelf3</var>
227 <var ID="name">Shelf 3</var>
231 <test ID="LocationParent">
232 <method>POST</method>
233 <uri>/cspace-services/collectionobjects/urn:cspace:name(CSPACE3739LocationAuthority)/items/</uri>
234 <filename>collectionobject/hierarchy/2-item.xml</filename>
236 <var ID="inAuthority">${LocationAuth1.CSID}</var>
237 <var ID="authShortIdentifier">CSPACE3739LocationAuthority</var>
238 <var ID="shortIdentifier">Aisle3</var>
239 <var ID="name">Aisle 3</var>
243 <test ID="Location1_old">
244 <method>POST</method>
245 <uri>/cspace-services/collectionobjects/urn:cspace:name(CSPACE3739LocationAuthority)/items/</uri>
246 <filename>collectionobject/hierarchy/3-locations_w_relations_CSID.xml</filename>
248 <var ID="name">Cabinet 1</var>
249 <var ID="parentCSID">${LocationParent.CSID}</var>
250 <var ID="childCSID">${LocationChild1.CSID}</var>
251 <var ID="child2CSID">${LocationChild2.CSID}</var>
252 <var ID="child3CSID">${LocationChild3.CSID}</var>
256 <test ID="Location1">
257 <method>POST</method>
258 <uri>/cspace-services/collectionobjects/urn:cspace:name(CSPACE3739LocationAuthority)/items/</uri>
259 <filename>collectionobject/hierarchy/5-locations_w_relations_RefNames.xml</filename>
261 <var ID="shortIdentifier">Cabinet1a</var>
262 <var ID="name">Cabinet 1a</var>
263 <var ID="childCSID">${LocationChild1.CSID}</var>
264 <var ID="child2CSID">${LocationChild2.CSID}</var>
265 <var ID="child3CSID">${LocationChild3.CSID}</var>
269 <test ID="GetLocation">
271 <uri>/cspace-services/collectionobjects/${LocationAuth1.CSID}/items/${Location1.CSID}?showRelations=true</uri>
276 <!-- NOTE: item on url is .../items/${LocationChild1.CSID} so this looks for
277 siblings of Child1, which would be child2 and child3.
281 <test ID="Get_siblings">
283 <uri>/cspace-services/collectionobjects/${LocationAuth1.CSID}/items/${LocationChild1.CSID}?showSiblings=true</uri>
285 <expected level="ADDOK" />
286 <filename>collectionobject/hierarchy/res/Get_siblings.res.xml</filename>
288 <var ID="locationCSID">${Location1.CSID}</var>
289 <var ID="child1CSID">${LocationChild1.CSID}</var>
290 <var ID="child2CSID">${LocationChild2.CSID}</var>
292 <startElement>/document/*[local-name()='relations-common-list']</startElement>
297 <test ID="Get_allRelations">
299 <uri>/cspace-services/collectionobjects/${LocationAuth1.CSID}/items/${Location1.CSID}?showAllRelations=true</uri>
301 <expected level="ADDOK" />
302 <filename>collectionobject/hierarchy/res/Get_allRelations.res.xml</filename>
304 <!-- NOTE: vars are referenced in showAllRelations.res.xml
305 from tests in this test group, e.g.
306 LocationParent.CSID :: ${LocationParent.CSID}
307 These vars are all in the expression context while this group is active,
308 because we hang onto all ServiceResult objects for the duration of the group,
309 and ServiceObjects keep their vars.
313 <startElement>/document/*[local-name()='relations-common-list']</startElement>
319 <test ID="relationsGET">
321 <uri>/cspace-services/relations/</uri>
324 <test ID="relations_sbj">
326 <uri>/cspace-services/relations?sbj=${Location1.CSID}</uri>
329 <test ID="relations_obj">
331 <uri>/cspace-services/relations?obj=${Location1.CSID}</uri>