]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
1b47e4e088713a1fdae1c45164534db819c9199d
[tmp/jakarta-migration.git] /
1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 <xmlReplay>
3
4     <testGroup ID="HierarchicCollectionObject" autoDeletePOSTS="false">
5     
6     <testGroup ID="CreateCollectionObjects"> <!-- autoDeletePOSTS="true" -->
7         
8         <!-- Create a set of CollectionObjects -->
9         
10         <!-- Chess set box -->
11         <!-- (parent of chess board, bags of white and black chess pieces) -->
12         <test ID="CreateChessSetBox" auth="admin@core.collectionspace.org">
13             <method>POST</method>
14             <uri>/cspace-services/collectionobjects</uri>
15             <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
16             <vars>
17                 <var ID="objectNumber">CSPACE-5518-ChessSetBox</var>
18             </vars>
19             <expectedCodes>201</expectedCodes>
20         </test>
21         <!-- Verify the contents of the first CollectionObject record created. -->
22         <!-- Other create requests, below, just check the result code.) -->
23         <test ID="ReadChessSetBox" auth="admin@core.collectionspace.org">
24             <method>GET</method>
25             <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}</uri>
26             <expectedCodes>200</expectedCodes>
27             <response>
28                 <expected level="TEXT" />
29                 <filename>collectionobject/hierarchy/res/collectionobject.res.xml</filename>
30                 <vars>
31                     <var ID="objectNumber">${CreateChessSetBox.objectNumber}</var>
32                 </vars>
33             </response>
34         </test>
35         
36         <!-- Chess board -->
37         <!-- (child of chess set box, sibling of bags of white and black chess pieces) --> 
38         <test ID="CreateChessBoard" auth="admin@core.collectionspace.org">
39             <method>POST</method>
40             <uri>/cspace-services/collectionobjects</uri>
41             <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
42             <vars>
43                 <var ID="objectNumber">CSPACE-5518-ChessBoard</var>
44             </vars>
45             <expectedCodes>201</expectedCodes>
46         </test>
47         <test ID="ReadChessBoard" auth="admin@core.collectionspace.org">
48             <method>GET</method>
49             <uri>/cspace-services/collectionobjects/${CreateChessBoard.CSID}</uri>
50             <expectedCodes>200</expectedCodes>
51         </test>
52         
53         <!-- Bags of white and black chess pieces -->
54         <!-- (child of chess set box, sibling of chess board, parents of chess pieces) --> 
55         <test ID="CreateBagOfWhiteChessPieces">
56             <method>POST</method>
57             <uri>/cspace-services/collectionobjects</uri>
58             <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
59             <vars>
60                 <var ID="objectNumber">CSPACE-5518-BagOfWhiteChessPieces</var>
61             </vars>
62             <expectedCodes>201</expectedCodes>
63         </test>
64         <test ID="ReadBagOfWhiteChessPieces" auth="admin@core.collectionspace.org">
65             <method>GET</method>
66             <uri>/cspace-services/collectionobjects/${CreateBagOfWhiteChessPieces.CSID}</uri>
67             <expectedCodes>200</expectedCodes>
68         </test>
69         
70         <test ID="CreateBagOfBlackChessPieces">
71             <method>POST</method>
72             <uri>/cspace-services/collectionobjects</uri>
73             <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
74             <vars>
75                 <var ID="objectNumber">CSPACE-5518-BagOfBlackChessPieces</var>
76             </vars>
77         </test>
78         <test ID="ReadBagOfBlackChessPieces" auth="admin@core.collectionspace.org">
79             <method>GET</method>
80             <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}</uri>
81             <expectedCodes>200</expectedCodes>
82         </test>
83         
84         <!-- Individual chess pieces in those bags -->
85         <test ID="CreateWhiteRook">
86             <method>POST</method>
87             <uri>/cspace-services/collectionobjects</uri>
88             <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
89             <vars>
90                 <var ID="objectNumber">CSPACE-5518-WhiteRook</var>
91             </vars>
92             <expectedCodes>201</expectedCodes>
93         </test>
94         <test ID="ReadWhiteRook" auth="admin@core.collectionspace.org">
95             <method>GET</method>
96             <uri>/cspace-services/collectionobjects/${CreateWhiteRook.CSID}</uri>
97             <expectedCodes>200</expectedCodes>
98         </test>
99         <test ID="CreateWhiteBishop">
100             <method>POST</method>
101             <uri>/cspace-services/collectionobjects</uri>
102             <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
103             <vars>
104                 <var ID="objectNumber">CSPACE-5518-WhiteBishop</var>
105             </vars>
106             <expectedCodes>201</expectedCodes>
107         </test>
108         <test ID="ReadWhiteBishop" auth="admin@core.collectionspace.org">
109             <method>GET</method>
110             <uri>/cspace-services/collectionobjects/${CreateWhiteBishop.CSID}</uri>
111             <expectedCodes>200</expectedCodes>
112         </test>
113         <test ID="CreateBlackQueen">
114             <method>POST</method>
115             <uri>/cspace-services/collectionobjects</uri>
116             <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
117             <vars>
118                 <var ID="objectNumber">CSPACE-5518-BlackQueen</var>
119             </vars>
120             <expectedCodes>201</expectedCodes>
121         </test>
122         <test ID="ReadBlackQueen" auth="admin@core.collectionspace.org">
123             <method>GET</method>
124             <uri>/cspace-services/collectionobjects/${CreateBlackQueen.CSID}</uri>
125             <expectedCodes>200</expectedCodes>
126         </test>
127         
128         <!--
129         <test ID="CreateBlackRookWithRelations">
130             <method>POST</method>
131             <uri>/cspace-services/collectionobjects</uri>
132             <filename>collectionobject/hierarchy/1-collectionobject.xml</filename>
133             <vars>
134                 <var ID="objectNumber">CSPACE-5518-BlackRook</var>
135             </vars>
136             <expectedCodes>201</expectedCodes>
137         </test>
138         <test ID="ReadBlackRook" auth="admin@core.collectionspace.org">
139             <method>GET</method>
140             <uri>/cspace-services/collectionobjects/${CreateBlackRookWithRelations.CSID}</uri>
141             <expectedCodes>200</expectedCodes>
142         </test>
143         -->
144        
145         <!-- Create a new chess piece, and include in the create payload -->
146         <!-- a list of hierarchical relationships to be created between -->
147         <!-- the various CollectionObjects previously created, in tests above -->
148        
149         <!-- Note also that it *might* not be necessary to set these variables; the original -->
150         <!-- values of CSIDs saved from previous posts, e.g. {CreateChessSetBox.CSID} -->
151         <!-- might still be available for use in request payloads. -->
152        
153         <test ID="CreateBlackRookWithRelations">
154             <method>POST</method>
155             <uri>/cspace-services/collectionobjects</uri>
156             <filename>collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml</filename>
157             <vars>
158                 <var ID="objectNumber">CSPACE-5518-BlackRook</var>
159                 <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
160                 <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
161                 <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
162                 <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
163                 <var ID="whiteRookCSID">${CreateWhiteRook.CSID}</var>
164                 <var ID="whiteBishopCSID">${CreateWhiteBishop.CSID}</var>
165                 <var ID="blackQueenCSID">${CreateBlackQueen.CSID}</var>
166             </vars>
167             <expectedCodes>201</expectedCodes>
168         </test>
169         <test ID="ReadBlackRook" auth="admin@core.collectionspace.org">
170             <method>GET</method>
171             <uri>/cspace-services/collectionobjects/${CreateBlackRookWithRelations.CSID}</uri>
172             <expectedCodes>200</expectedCodes>
173         </test>
174         
175         <test ID="ReadHierarchyForTopLevelItem">
176             <method>GET</method>
177             <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showRelations=true</uri>
178             <response>
179                 <expected level="ADDOK" />
180                 <filename>collectionobject/hierarchy/res/show-relations-top-level.res.xml</filename>
181                 <vars>
182                     <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
183                     <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
184                     <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
185                     <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
186                 </vars>
187                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
188             </response>
189             <expectedCodes>200</expectedCodes>
190         </test>
191
192         <!-- Update one of the existing chess pieces, and add yet one more -->
193         <!-- hierarchical relationship, between that piece and another -->
194         <!-- existing CollectionObject. -->
195         
196         <test ID="UpdateBlackRootWithRelations">
197             <method>PUT</method>
198             <uri>/cspace-services/collectionobjects/${CreateBlackRookWithRelations.CSID}</uri>
199             <filename>collectionobject/hierarchy/3-collectionobjects-with-relations-update.xml</filename>
200             <vars>
201                 <var ID="distinguishingFeatures">This rook has two light brown striations on part of its base.</var>
202                 <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
203                 <var ID="blackRookCSID">${CreateBlackRookWithRelations.CSID}</var>
204             </vars>
205             <expectedCodes>200</expectedCodes>
206         </test>
207         
208     
209         <!-- Read hierarchical relations via the various query parameters now -->
210         <!-- supported for structured objects and procedures -->
211                     
212         <!-- Read hierarchical relationships via 'showRelations', -->
213         <!-- which returns direct parent and child relations. -->
214         
215         <test ID="ReadHierarchyForTopLevelItem">
216             <method>GET</method>
217             <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showRelations=true</uri>
218             <response>
219                 <expected level="ADDOK" />
220                 <filename>collectionobject/hierarchy/res/show-relations-top-level.res.xml</filename>
221                 <vars>
222                     <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
223                     <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
224                     <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
225                     <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
226                 </vars>
227                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
228             </response>
229             <expectedCodes>200</expectedCodes>
230         </test>
231         
232         <test ID="ReadHierarchyForMidLevelItem">
233             <method>GET</method>
234             <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showRelations=true</uri>
235             <response>
236                 <expected level="ADDOK" />
237                 <filename>collectionobject/hierarchy/res/show-relations-mid-level.res.xml</filename>
238                 <vars>
239                     <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
240                     <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
241                     <var ID="blackQueenCSID">${CreateBlackQueen.CSID}</var>
242                     <var ID="blackRookCSID">${CreateBlackRookWithRelations.CSID}</var>
243                 </vars>
244                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
245             </response>
246             <expectedCodes>200</expectedCodes>
247         </test>
248         
249         <test ID="ReadHierarchyForBottomLevelItem">
250             <method>GET</method>
251             <uri>/cspace-services/collectionobjects/${CreateBlackRookWithRelations.CSID}?showRelations=true</uri>
252             <response>
253                 <expected level="ADDOK" />
254                 <filename>collectionobject/hierarchy/res/show-relations-bottom-level.res.xml</filename>
255                 <vars>
256                     <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
257                     <var ID="blackRookCSID">${CreateBlackRookWithRelations.CSID}</var>
258                 </vars>
259                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
260             </response>
261             <expectedCodes>200</expectedCodes>
262         </test>
263         
264         <!-- Read hierarchical relationships via 'showSiblings', -->
265         <!-- which shows sibling relations. -->
266
267         <test ID="ReadSiblingsForTopLevelItem">
268             <method>GET</method>
269             <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showSiblings=true</uri>
270             <expectedCodes>200</expectedCodes>
271             <response>
272                 <expected level="ADDOK" />
273                 <filename>collectionobject/hierarchy/res/show-siblings-top-level.res.xml</filename>
274                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
275             </response>
276         </test>
277         
278         <test ID="ReadSiblingsForMidLevelItem">
279             <method>GET</method>
280             <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showSiblings=true</uri>
281             <expectedCodes>200</expectedCodes>
282             <response>
283                 <expected level="ADDOK" />
284                 <filename>collectionobject/hierarchy/res/show-siblings-mid-level.res.xml</filename>
285                 <vars>
286                     <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
287                     <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
288                     <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
289                 </vars>
290                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
291             </response>
292         </test>
293         
294         <test ID="ReadSiblingsForBottomLevelItem">
295             <method>GET</method>
296             <uri>/cspace-services/collectionobjects/${CreateBlackRookWithRelations.CSID}?showSiblings=true</uri>
297             <expectedCodes>200</expectedCodes>
298             <response>
299                 <expected level="ADDOK" />
300                 <filename>collectionobject/hierarchy/res/show-siblings-bottom-level.res.xml</filename>
301                 <vars>
302                     <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
303                     <var ID="blackQueenCSID">${CreateBlackQueen.CSID}</var>
304                 </vars>
305                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
306             </response>
307         </test>
308         
309         <!-- Read hierarchical relationships via 'showAllRelations' -->
310
311         <test ID="ReadAllRelationsForTopLevelItem">
312             <method>GET</method>
313             <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showAllRelations=true</uri>
314             <expectedCodes>200</expectedCodes>
315             <response>
316                 <expected level="ADDOK" />
317                 <filename>collectionobject/hierarchy/res/show-all-relations-top-level.res.xml</filename>
318                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
319             </response>
320         </test>
321             
322         <!-- Read hierarchical relationships via the relations service. -->
323         <!-- (This can also serve as a cross-check on the additional read mechanisms, above.) -->
324                 
325         <!-- Zero (0) total items are expected for the top-level item as a subject, -->
326         <!-- since the tests above created relation records with this top-level -->
327         <!-- solely as an object of those relations. -->
328         <test ID="GetRelationsAsSubjectForTopLevelItem">
329             <method>GET</method>
330             <uri>/cspace-services/relations?sbj=${CreateChessSetBox.CSID}</uri>
331             <expectedCodes>200</expectedCodes>
332             <response>
333                 <expected level="TEXT" />
334                 <filename>collectionobject/hierarchy/res/relations-pagination-header.res.xml</filename>
335                 <vars>
336                     <var ID="totalItems">0</var>
337                 </vars>
338             </response>
339         </test>
340         
341         <test ID="GetRelationsAsObjectForTopLevelItem">
342             <method>GET</method>
343             <uri>/cspace-services/relations?obj=${CreateChessSetBox.CSID}</uri>
344             <expectedCodes>200</expectedCodes>
345             <response>
346                 <expected level="TEXT" />
347                 <filename>collectionobject/hierarchy/res/relations-as-object-top-level.res.xml</filename>
348                 <vars>
349                     <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
350                     <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
351                     <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
352                     <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
353                 </vars>
354                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
355             </response>
356         </test>
357         
358     </testGroup>
359     
360     <!-- Clean up any records that were not automatically deleted by autoDeletePOSTS -->
361        
362     <testGroup ID="Cleanup">
363
364         <!-- Cleanup-->
365         
366         <!--
367         <test ID="DeleteHierarchy">
368         </test>
369         -->
370         
371         <!-- The following is likely unnecessary with 'autoDeletePOSTS="true"' -->
372         <!--
373         <test ID="DeleteBlackRook" auth="admin@core.collectionspace.org">
374             <method>DELETE</method>
375             <uri>/cspace-services/collectionobjects/${CreateBlackRookWithRelations.CSID}</uri>
376         </test>
377         <test ID="DeleteBlackQueen" auth="admin@core.collectionspace.org">
378             <method>DELETE</method>
379             <uri>/cspace-services/collectionobjects/${CreateBlackQueen.CSID}</uri>
380         </test>
381         <test ID="DeleteWhiteBishop" auth="admin@core.collectionspace.org">
382             <method>DELETE</method>
383             <uri>/cspace-services/collectionobjects/${CreateWhiteBishop.CSID}</uri>
384         </test>
385         <test ID="DeleteWhiteRook" auth="admin@core.collectionspace.org">
386             <method>DELETE</method>
387             <uri>/cspace-services/collectionobjects/${CreateWhiteRook.CSID}</uri>
388         </test>
389         <test ID="DeleteBagOfBlackChessPieces" auth="admin@core.collectionspace.org">
390             <method>DELETE</method>
391             <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}</uri>
392         </test>
393         <test ID="DeleteBagOfWhiteChessPieces" auth="admin@core.collectionspace.org">
394             <method>DELETE</method>
395             <uri>/cspace-services/collectionobjects/${CreateBagOfWhiteChessPieces.CSID}</uri>
396         </test>
397         <test ID="DeleteChessBoard" auth="admin@core.collectionspace.org">
398             <method>DELETE</method>
399             <uri>/cspace-services/collectionobjects/${CreateChessBoard.CSID}</uri>
400         </test>
401         <test ID="DeleteChessSetBox" auth="admin@core.collectionspace.org">
402             <method>DELETE</method>
403             <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}</uri>
404         </test>
405         -->
406         
407     </testGroup>
408     
409 </xmlReplay>