]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
b9ed00e37527e6fcc67bda32128812d1e8aadbde
[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">
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">
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">
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">
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">
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">
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">
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">
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">
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">
147             <method>GET</method>
148             <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
149             <expectedCodes>200</expectedCodes>
150         </test>
151
152
153         <!-- Update one of the existing chess pieces, and add yet one more -->
154         <!-- hierarchical relationship, between that piece and another -->
155         <!-- existing CollectionObject. -->
156         
157         <test ID="UpdateBlackRootWithRelations">
158             <method>PUT</method>
159             <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
160             <filename>collectionobject/hierarchy/3-collectionobjects-with-relations-update.xml</filename>
161             <vars>
162                 <var ID="distinguishingFeatures">This rook has two light brown striations on part of its base.</var>
163                 <var ID="blackRookCSID">${CreateBlackRook.CSID}</var>
164                 <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
165             </vars>
166             <expectedCodes>200</expectedCodes>
167         </test>
168         
169     
170         <!--
171             Read hierarchical relations via three query parameters now
172             supported for structured objects and procedures, as well as
173             for authority terms:
174             
175             * showRelations
176             * showSiblings
177             * showAllRelations
178         -->
179                     
180         <!-- Read hierarchical relationships via 'showRelations', -->
181         <!-- which returns direct parent and child relations. -->
182         
183         <test ID="ShowRelationsForTopLevelItem">
184             <method>GET</method>
185             <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showRelations=true</uri>
186             <response>
187                 <expected level="ADDOK" />
188                 <filename>collectionobject/hierarchy/res/show-relations-top-level.res.xml</filename>
189                 <vars>
190                     <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
191                     <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
192                     <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
193                     <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
194                 </vars>
195                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
196             </response>
197             <expectedCodes>200</expectedCodes>
198         </test>
199         
200         <test ID="ShowRelationsForMidLevelItem">
201             <method>GET</method>
202             <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showRelations=true</uri>
203             <response>
204                 <expected level="ADDOK" />
205                 <filename>collectionobject/hierarchy/res/show-relations-mid-level.res.xml</filename>
206                 <vars>
207                     <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
208                     <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
209                     <var ID="blackQueenCSID">${CreateBlackQueen.CSID}</var>
210                     <var ID="blackRookCSID">${CreateBlackRook.CSID}</var>
211                 </vars>
212                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
213             </response>
214             <expectedCodes>200</expectedCodes>
215         </test>
216         
217         <test ID="ShowRelationsForBottomLevelItem">
218             <method>GET</method>
219             <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}?showRelations=true</uri>
220             <response>
221                 <expected level="ADDOK" />
222                 <filename>collectionobject/hierarchy/res/show-relations-bottom-level.res.xml</filename>
223                 <vars>
224                     <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
225                     <var ID="blackRookCSID">${CreateBlackRook.CSID}</var>
226                 </vars>
227                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
228             </response>
229             <expectedCodes>200</expectedCodes>
230         </test>
231         
232         <!-- Read hierarchical relationships via 'showSiblings', -->
233         <!-- which returns sibling relations. -->
234
235         <test ID="ShowSiblingsForTopLevelItem">
236             <method>GET</method>
237             <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showSiblings=true</uri>
238             <expectedCodes>200</expectedCodes>
239             <response>
240                 <expected level="ADDOK" />
241                 <filename>collectionobject/hierarchy/res/show-siblings-top-level.res.xml</filename>
242                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
243             </response>
244         </test>
245         
246         <test ID="ShowSiblingsForMidLevelItem">
247             <method>GET</method>
248             <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showSiblings=true</uri>
249             <expectedCodes>200</expectedCodes>
250             <response>
251                 <expected level="ADDOK" />
252                 <filename>collectionobject/hierarchy/res/show-siblings-mid-level.res.xml</filename>
253                 <vars>
254                     <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
255                     <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
256                     <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
257                 </vars>
258                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
259             </response>
260         </test>
261         
262         <test ID="ShowSiblingsForBottomLevelItem">
263             <method>GET</method>
264             <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}?showSiblings=true</uri>
265             <expectedCodes>200</expectedCodes>
266             <response>
267                 <expected level="ADDOK" />
268                 <filename>collectionobject/hierarchy/res/show-siblings-bottom-level.res.xml</filename>
269                 <vars>
270                     <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
271                     <var ID="blackQueenCSID">${CreateBlackQueen.CSID}</var>
272                 </vars>
273                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
274             </response>
275         </test>
276         
277         <!-- Read hierarchical relationships via 'showAllRelations', -->
278         <!-- which returns parent, child, and sibling relationships. -->
279
280         <test ID="ShowAllRelationsForTopLevelItem">
281             <method>GET</method>
282             <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showAllRelations=true</uri>
283             <expectedCodes>200</expectedCodes>
284             <response>
285                 <expected level="ADDOK" />
286                 <filename>collectionobject/hierarchy/res/show-all-relations-top-level.res.xml</filename>
287                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
288             </response>
289         </test>
290         
291         <!-- The following tests -->
292         
293         <!-- Currently returns only three relations (parent, two children), -->
294         <!-- rather than five (parent, two children, two siblings). - ADR 2012-09-10 -->
295         <!--
296         <test ID="ShowAllRelationsForMidLevelItem">
297             <method>GET</method>
298             <uri>/cspace-services/collectionobjects/${CreateBagOfWhiteChessPieces.CSID}?showAllRelations=true</uri>
299             <expectedCodes>200</expectedCodes>
300             <response>
301                 <expected level="ADDOK" />
302                 <filename>collectionobject/hierarchy/res/show-all-relations-mid-level.res.xml</filename>
303                 <vars>
304                     <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
305                     <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
306                     <var ID="whiteRookCSID">${CreateWhiteRook.CSID}</var>
307                     <var ID="whiteBishopCSID">${CreateWhiteBishop.CSID}</var>
308                 </vars>
309                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
310             </response>
311         </test>
312         -->
313         
314         <!-- Currently returns only one relation (parent), rather than -->
315         <!-- two (parent, sibling). - ADR 2012-09-10 -->
316         <!--
317         <test ID="ShowAllRelationsForBottomLevelItem">
318             <method>GET</method>
319             <uri>/cspace-services/collectionobjects/${CreateWhiteBishop.CSID}?showAllRelations=true</uri>
320             <expectedCodes>200</expectedCodes>
321             <response>
322                 <expected level="ADDOK" />
323                 <filename>collectionobject/hierarchy/res/show-all-relations-bottom-level.res.xml</filename>
324                 <vars>
325                     <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
326                     <var ID="whiteRookCSID">${CreateWhiteRook.CSID}</var>
327                     <var ID="whiteBishopCSID">${CreateWhiteBishop.CSID}</var>
328                 </vars>
329                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
330             </response>
331         </test>
332         -->
333             
334         <!-- Read hierarchical relationships via the relations service. -->
335         <!-- (This can also serve as a cross-check on the additional read mechanisms, above.) -->
336                 
337         <!-- Zero (0) total items are expected for the top-level item as a subject, -->
338         <!-- since the tests above created relation records with this top-level -->
339         <!-- solely as an object of those relations. -->
340         <test ID="GetRelationsAsSubjectForTopLevelItem">
341             <method>GET</method>
342             <uri>/cspace-services/relations?sbj=${CreateChessSetBox.CSID}</uri>
343             <expectedCodes>200</expectedCodes>
344             <response>
345                 <expected level="ADDOK" />
346                 <filename>collectionobject/hierarchy/res/relations-pagination-header.res.xml</filename>
347                 <vars>
348                     <var ID="totalItems">0</var>
349                 </vars>
350             </response>
351         </test>
352         
353         <test ID="GetRelationsAsObjectForTopLevelItem">
354             <method>GET</method>
355             <uri>/cspace-services/relations?obj=${CreateChessSetBox.CSID}</uri>
356             <expectedCodes>200</expectedCodes>
357             <response>
358                 <expected level="ADDOK" />
359                 <filename>collectionobject/hierarchy/res/relations-as-object-top-level.res.xml</filename>
360                 <vars>
361                     <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
362                     <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
363                     <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
364                     <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
365                 </vars>
366                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
367             </response>
368         </test>     
369     
370         <!-- Clean up any remaining records that were NOT automatically deleted by autoDeletePOSTS -->
371         
372         <!-- Delete the records of relations to ChessSetBox, from its three children -->
373                
374         <test ID="GetRelationsAsObjectForChessSetBox">
375             <method>GET</method>
376             <uri>/cspace-services/relations?obj=${CreateChessSetBox.CSID}</uri>
377             <expectedCodes>200</expectedCodes>
378         </test>
379         <test ID="DeleteChildRelation1ToChessSetBox">
380             <method>DELETE</method>
381             <uri>/cspace-services/relations/${GetRelationsAsObjectForChessSetBox.got("//relation-list-item[1]/csid")}</uri>
382         </test>
383         <test ID="DeleteChildRelation2ToChessSetBox">
384             <method>DELETE</method>
385             <uri>/cspace-services/relations/${GetRelationsAsObjectForChessSetBox.got("//relation-list-item[2]/csid")}</uri>
386         </test>
387         <test ID="DeleteChildRelation3ToChessSetBox">
388             <method>DELETE</method>
389             <uri>/cspace-services/relations/${GetRelationsAsObjectForChessSetBox.got("//relation-list-item[3]/csid")}</uri>
390         </test>
391         
392         <!-- Delete the records of relations to BagOfWhiteChessPieces, from its two children -->
393         
394         <test ID="GetRelationsAsObjectForBagOfWhiteChessPieces">
395             <method>GET</method>
396             <uri>/cspace-services/relations?obj=${CreateBagOfWhiteChessPieces.CSID}</uri>
397             <expectedCodes>200</expectedCodes>
398         </test>
399         <test ID="DeleteChildRelation1ToBagOfWhiteChessPieces">
400             <method>DELETE</method>
401             <uri>/cspace-services/relations/${GetRelationsAsObjectForBagOfWhiteChessPieces.got("//relation-list-item[1]/csid")}</uri>
402         </test>
403         <test ID="DeleteChildRelation2ToBagOfWhiteChessPieces">
404             <method>DELETE</method>
405             <uri>/cspace-services/relations/${GetRelationsAsObjectForBagOfWhiteChessPieces.got("//relation-list-item[2]/csid")}</uri>
406         </test>
407         
408         <!-- Delete the records of relations to BagOfBlackChessPieces, from its two children -->
409         
410         <test ID="GetRelationsAsObjectForBagOfBlackChessPieces">
411             <method>GET</method>
412             <uri>/cspace-services/relations?obj=${CreateBagOfBlackChessPieces.CSID}</uri>
413             <expectedCodes>200</expectedCodes>
414         </test>
415         <test ID="DeleteChildRelation1ToBagOfBlackChessPieces">
416             <method>DELETE</method>
417             <uri>/cspace-services/relations/${GetRelationsAsObjectForBagOfBlackChessPieces.got("//relation-list-item[1]/csid")}</uri>
418         </test>
419         <test ID="DeleteChildRelation2ToBagOfBlackChessPieces">
420             <method>DELETE</method>
421             <uri>/cspace-services/relations/${GetRelationsAsObjectForBagOfBlackChessPieces.got("//relation-list-item[2]/csid")}</uri>
422         </test>
423         
424     </testGroup>
425     
426 </xmlReplay>