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