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