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