]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
253074284c76a75e3d7ad1d056bcf04a04eccdfa
[tmp/jakarta-migration.git] /
1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 <xmlReplay>
3     
4     <testGroup ID="CreateUpdateReadStructuredObjects" autoDeletePOSTS="true">
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         <!-- Read hierarchical relations via the various query parameters now -->
187         <!-- supported for structured objects and procedures -->
188                     
189         <!-- Read hierarchical relationships via 'showRelations', -->
190         <!-- which returns direct parent and child relations. -->
191         
192         <test ID="ReadHierarchyForTopLevelItem">
193             <method>GET</method>
194             <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showRelations=true</uri>
195             <response>
196                 <expected level="ADDOK" />
197                 <filename>collectionobject/hierarchy/res/show-relations-top-level.res.xml</filename>
198                 <vars>
199                     <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
200                     <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
201                     <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
202                     <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
203                 </vars>
204                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
205             </response>
206             <expectedCodes>200</expectedCodes>
207         </test>
208         
209         <test ID="ReadHierarchyForMidLevelItem">
210             <method>GET</method>
211             <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showRelations=true</uri>
212             <response>
213                 <expected level="ADDOK" />
214                 <filename>collectionobject/hierarchy/res/show-relations-mid-level.res.xml</filename>
215                 <vars>
216                     <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
217                     <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
218                     <var ID="blackQueenCSID">${CreateBlackQueen.CSID}</var>
219                     <var ID="blackRookCSID">${CreateBlackRook.CSID}</var>
220                 </vars>
221                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
222             </response>
223             <expectedCodes>200</expectedCodes>
224         </test>
225         
226         <test ID="ReadHierarchyForBottomLevelItem">
227             <method>GET</method>
228             <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}?showRelations=true</uri>
229             <response>
230                 <expected level="ADDOK" />
231                 <filename>collectionobject/hierarchy/res/show-relations-bottom-level.res.xml</filename>
232                 <vars>
233                     <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
234                     <var ID="blackRookCSID">${CreateBlackRook.CSID}</var>
235                 </vars>
236                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
237             </response>
238             <expectedCodes>200</expectedCodes>
239         </test>
240         
241         <!-- Read hierarchical relationships via 'showSiblings', -->
242         <!-- which shows sibling relations. -->
243
244         <test ID="ReadSiblingsForTopLevelItem">
245             <method>GET</method>
246             <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showSiblings=true</uri>
247             <expectedCodes>200</expectedCodes>
248             <response>
249                 <expected level="ADDOK" />
250                 <filename>collectionobject/hierarchy/res/show-siblings-top-level.res.xml</filename>
251                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
252             </response>
253         </test>
254         
255         <test ID="ReadSiblingsForMidLevelItem">
256             <method>GET</method>
257             <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showSiblings=true</uri>
258             <expectedCodes>200</expectedCodes>
259             <response>
260                 <expected level="ADDOK" />
261                 <filename>collectionobject/hierarchy/res/show-siblings-mid-level.res.xml</filename>
262                 <vars>
263                     <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
264                     <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
265                     <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
266                 </vars>
267                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
268             </response>
269         </test>
270         
271         <test ID="ReadSiblingsForBottomLevelItem">
272             <method>GET</method>
273             <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}?showSiblings=true</uri>
274             <expectedCodes>200</expectedCodes>
275             <response>
276                 <expected level="ADDOK" />
277                 <filename>collectionobject/hierarchy/res/show-siblings-bottom-level.res.xml</filename>
278                 <vars>
279                     <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
280                     <var ID="blackQueenCSID">${CreateBlackQueen.CSID}</var>
281                 </vars>
282                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
283             </response>
284         </test>
285         
286         <!-- Read hierarchical relationships via 'showAllRelations' -->
287
288         <test ID="ReadAllRelationsForTopLevelItem">
289             <method>GET</method>
290             <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showAllRelations=true</uri>
291             <expectedCodes>200</expectedCodes>
292             <response>
293                 <expected level="ADDOK" />
294                 <filename>collectionobject/hierarchy/res/show-all-relations-top-level.res.xml</filename>
295                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
296             </response>
297         </test>
298             
299         <!-- Read hierarchical relationships via the relations service. -->
300         <!-- (This can also serve as a cross-check on the additional read mechanisms, above.) -->
301                 
302         <!-- Zero (0) total items are expected for the top-level item as a subject, -->
303         <!-- since the tests above created relation records with this top-level -->
304         <!-- solely as an object of those relations. -->
305         <test ID="GetRelationsAsSubjectForTopLevelItem">
306             <method>GET</method>
307             <uri>/cspace-services/relations?sbj=${CreateChessSetBox.CSID}</uri>
308             <expectedCodes>200</expectedCodes>
309             <response>
310                 <expected level="ADDOK" />
311                 <filename>collectionobject/hierarchy/res/relations-pagination-header.res.xml</filename>
312                 <vars>
313                     <var ID="totalItems">0</var>
314                 </vars>
315             </response>
316         </test>
317         
318         <test ID="GetRelationsAsObjectForTopLevelItem">
319             <method>GET</method>
320             <uri>/cspace-services/relations?obj=${CreateChessSetBox.CSID}</uri>
321             <expectedCodes>200</expectedCodes>
322             <response>
323                 <expected level="ADDOK" />
324                 <filename>collectionobject/hierarchy/res/relations-as-object-top-level.res.xml</filename>
325                 <vars>
326                     <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
327                     <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
328                     <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
329                     <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
330                 </vars>
331                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
332             </response>
333         </test>
334         
335     </testGroup>
336     
337     <!-- Clean up any records that were not automatically deleted by autoDeletePOSTS -->
338        
339     <testGroup ID="Cleanup">
340
341         <!-- Cleanup-->
342         
343         <!--
344         <test ID="DeleteHierarchy">
345         </test>
346         -->
347         
348         <!-- The following is likely unnecessary with 'autoDeletePOSTS="true"' -->
349         <!--
350         <test ID="DeleteBlackRook" auth="admin@core.collectionspace.org">
351             <method>DELETE</method>
352             <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
353         </test>
354         <test ID="DeleteBlackQueen" auth="admin@core.collectionspace.org">
355             <method>DELETE</method>
356             <uri>/cspace-services/collectionobjects/${CreateBlackQueen.CSID}</uri>
357         </test>
358         <test ID="DeleteWhiteBishop" auth="admin@core.collectionspace.org">
359             <method>DELETE</method>
360             <uri>/cspace-services/collectionobjects/${CreateWhiteBishop.CSID}</uri>
361         </test>
362         <test ID="DeleteWhiteRook" auth="admin@core.collectionspace.org">
363             <method>DELETE</method>
364             <uri>/cspace-services/collectionobjects/${CreateWhiteRook.CSID}</uri>
365         </test>
366         <test ID="DeleteBagOfBlackChessPieces" auth="admin@core.collectionspace.org">
367             <method>DELETE</method>
368             <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}</uri>
369         </test>
370         <test ID="DeleteBagOfWhiteChessPieces" auth="admin@core.collectionspace.org">
371             <method>DELETE</method>
372             <uri>/cspace-services/collectionobjects/${CreateBagOfWhiteChessPieces.CSID}</uri>
373         </test>
374         <test ID="DeleteChessBoard" auth="admin@core.collectionspace.org">
375             <method>DELETE</method>
376             <uri>/cspace-services/collectionobjects/${CreateChessBoard.CSID}</uri>
377         </test>
378         <test ID="DeleteChessSetBox" auth="admin@core.collectionspace.org">
379             <method>DELETE</method>
380             <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}</uri>
381         </test>
382         -->
383         
384     </testGroup>
385     
386 </xmlReplay>