]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
bd3868c8adfe3050107e84acd15e7b5fc6d20226
[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         <!--
7             Using CSIDs and the 'id' form of identifiers, create
8             and test a structured set of ten (10) CollectionObjects,
9             with these hierarchical relationsips to one another:
10         
11             ChessSetBox
12             |__ ChessBoard
13             |__ BagOfWhiteChessPieces
14                 |__ WhiteRook
15                 |__ WhiteBishop
16             |__ BagOfBlackChessPieces
17                 |__ BlackQueen
18                 |__ BlackRook
19                     |__ BlackRookFragment1
20                     |__ BlackRookFragment2
21          -->
22         
23         <!-- Chess set box -->
24         <!-- (parent of chess board, bag of white chess pieces, and bag of black chess pieces) -->
25         <test ID="CreateChessSetBox">
26             <method>POST</method>
27             <uri>/cspace-services/collectionobjects</uri>
28             <filename>collectionobject/hierarchy/1-collectionobject-create.xml</filename>
29             <vars>
30                 <var ID="objectNumber">CSPACE-5518-ChessSetBox</var>
31             </vars>
32             <expectedCodes>201</expectedCodes>
33         </test>
34         <!-- Verify the contents of the first CollectionObject record created. -->
35         <!-- Other create requests, below, just check the result code.) -->
36         <test ID="ReadChessSetBox">
37             <method>GET</method>
38             <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}</uri>
39             <expectedCodes>200</expectedCodes>
40             <response>
41                 <expected level="TEXT" />
42                 <filename>collectionobject/hierarchy/res/collectionobject.res.xml</filename>
43                 <vars>
44                     <var ID="objectNumber">${CreateChessSetBox.objectNumber}</var>
45                 </vars>
46             </response>
47         </test>
48         
49         <!-- Chess board -->
50         <!-- (child of chess set box, sibling of bag of white chess pieces and bag of black chess pieces) -->
51         <test ID="CreateChessBoard">
52             <method>POST</method>
53             <uri>/cspace-services/collectionobjects</uri>
54             <filename>collectionobject/hierarchy/2-collectionobject-create-with-parent-csid.xml</filename>
55             <vars>
56                 <var ID="objectNumber">CSPACE-5518-ChessBoard</var>
57                 <var ID="parentCSID">${CreateChessSetBox.CSID}</var>
58             </vars>
59             <expectedCodes>201</expectedCodes>
60         </test>
61         <test ID="ReadChessBoard">
62             <method>GET</method>
63             <uri>/cspace-services/collectionobjects/${CreateChessBoard.CSID}</uri>
64             <expectedCodes>200</expectedCodes>
65         </test>
66         
67         <!-- Bag of white chess pieces -->
68         <!-- (child of chess set box, sibling of chess board and bag -->
69         <!-- of black chess pieces, parent of white chess pieces) --> 
70         
71         <test ID="CreateBagOfWhiteChessPieces">
72             <method>POST</method>
73             <uri>/cspace-services/collectionobjects</uri>
74             <filename>collectionobject/hierarchy/2-collectionobject-create-with-parent-csid.xml</filename>
75             <vars>
76                 <var ID="objectNumber">CSPACE-5518-BagOfWhiteChessPieces</var>
77                 <var ID="parentCSID">${CreateChessSetBox.CSID}</var>
78             </vars>
79             <expectedCodes>201</expectedCodes>
80         </test>
81         <test ID="ReadBagOfWhiteChessPieces">
82             <method>GET</method>
83             <uri>/cspace-services/collectionobjects/${CreateBagOfWhiteChessPieces.CSID}</uri>
84             <expectedCodes>200</expectedCodes>
85         </test>
86         
87         <!-- Individual chess pieces in the bag of white chess pieces, -->
88         <!-- each created along with relations to their parent -->
89         
90         <test ID="CreateWhiteRook">
91             <method>POST</method>
92             <uri>/cspace-services/collectionobjects</uri>
93             <filename>collectionobject/hierarchy/2-collectionobject-create-with-parent-csid.xml</filename>
94             <vars>
95                 <var ID="objectNumber">CSPACE-5518-WhiteRook</var>
96                 <var ID="parentCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
97            </vars>
98             <expectedCodes>201</expectedCodes>
99         </test>
100         <test ID="ReadWhiteRook">
101             <method>GET</method>
102             <uri>/cspace-services/collectionobjects/${CreateWhiteRook.CSID}</uri>
103             <expectedCodes>200</expectedCodes>
104         </test>
105         
106         <test ID="CreateWhiteBishop">
107             <method>POST</method>
108             <uri>/cspace-services/collectionobjects</uri>
109             <filename>collectionobject/hierarchy/2-collectionobject-create-with-parent-csid.xml</filename>
110             <vars>
111                 <var ID="objectNumber">CSPACE-5518-WhiteBishop</var>
112                 <var ID="parentCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
113             </vars>
114             <expectedCodes>201</expectedCodes>
115         </test>
116         <test ID="ReadWhiteBishop">
117             <method>GET</method>
118             <uri>/cspace-services/collectionobjects/${CreateWhiteBishop.CSID}</uri>
119             <expectedCodes>200</expectedCodes>
120         </test>
121         
122         <!-- Individual chess pieces in the bag of black chess pieces, -->
123         <!-- each created initially without any relations. -->
124                 
125         <test ID="CreateBlackQueen">
126             <method>POST</method>
127             <uri>/cspace-services/collectionobjects</uri>
128             <filename>collectionobject/hierarchy/1-collectionobject-create.xml</filename>
129             <vars>
130                 <var ID="objectNumber">CSPACE-5518-BlackQueen</var>
131             </vars>
132             <expectedCodes>201</expectedCodes>
133         </test>
134         <test ID="ReadBlackQueen">
135             <method>GET</method>
136             <uri>/cspace-services/collectionobjects/${CreateBlackQueen.CSID}</uri>
137             <expectedCodes>200</expectedCodes>
138         </test>
139         
140         <test ID="CreateBlackRook">
141             <method>POST</method>
142             <uri>/cspace-services/collectionobjects</uri>
143             <filename>collectionobject/hierarchy/1-collectionobject-create.xml</filename>
144             <vars>
145                 <var ID="objectNumber">CSPACE-5518-BlackRook</var>
146             </vars>
147             <expectedCodes>201</expectedCodes>
148         </test>
149         <test ID="ReadBlackRook">
150             <method>GET</method>
151             <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
152             <expectedCodes>200</expectedCodes>
153         </test>
154         
155         <test ID="CreateBlackRookFragment1">
156             <method>POST</method>
157             <uri>/cspace-services/collectionobjects</uri>
158             <filename>collectionobject/hierarchy/1-collectionobject-create.xml</filename>
159             <vars>
160                 <var ID="objectNumber">CSPACE-5518-BlackRookFragment1</var>
161             </vars>
162             <expectedCodes>201</expectedCodes>
163         </test>
164         <test ID="ReadBlackRookFragment">
165             <method>GET</method>
166             <uri>/cspace-services/collectionobjects/${CreateBlackRookFragment1.CSID}</uri>
167             <expectedCodes>200</expectedCodes>
168         </test>
169         
170         <test ID="CreateBlackRookFragment2">
171             <method>POST</method>
172             <uri>/cspace-services/collectionobjects</uri>
173             <filename>collectionobject/hierarchy/1-collectionobject-create.xml</filename>
174             <vars>
175                 <var ID="objectNumber">CSPACE-5518-BlackRookFragment2</var>
176             </vars>
177             <expectedCodes>201</expectedCodes>
178         </test>
179         <test ID="ReadBlackRookFragment2">
180             <method>GET</method>
181             <uri>/cspace-services/collectionobjects/${CreateBlackRookFragment2.CSID}</uri>
182             <expectedCodes>200</expectedCodes>
183         </test>
184         
185         <!-- Bag of black chess pieces -->
186         <!-- (child of chess set box, sibling of chess board and bag -->
187         <!-- of white chess pieces, parent of black chess pieces) --> 
188         
189         <!--
190             This piece is created along with relations to:
191             * Its parent (the chess set box)
192             * One of its children (the black queen), created previously above
193         -->
194                 
195         <test ID="CreateBagOfBlackChessPieces">
196             <method>POST</method>
197             <uri>/cspace-services/collectionobjects</uri>
198             <filename>collectionobject/hierarchy/3-collectionobject-create-with-parent-child-csids.xml</filename>
199             <vars>
200                 <var ID="objectNumber">CSPACE-5518-BagOfBlackChessPieces</var>
201                 <var ID="parentCSID">${CreateChessSetBox.CSID}</var>
202                 <var ID="childCSID">${CreateBlackQueen.CSID}</var>
203             </vars>
204         </test>
205         <test ID="ReadBagOfBlackChessPieces">
206             <method>GET</method>
207             <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}</uri>
208             <expectedCodes>200</expectedCodes>
209         </test>
210
211
212         <!-- Update one of the existing chess pieces, and add hierarchical -->
213         <!-- relationships between that piece and both its parent and child. -->
214         
215         <!--
216             This piece is updated along with adding relations to:
217             * Its parent (the bag of black chess pieces)
218             * Its children (black rook fragment1, black rook fragment2)
219         -->
220         
221         <test ID="UpdateBlackRookWithRelations">
222             <method>PUT</method>
223             <uri>/cspace-services/collectionobjects/${CreateBlackRook.CSID}</uri>
224             <filename>collectionobject/hierarchy/4-collectionobject-update-with-parent-child-csids.xml</filename>
225             <vars>
226                 <var ID="distinguishingFeatures">This black rook is nearly intact, save for two tiny fragments.</var>
227                 <var ID="currentItemCSID">${CreateBlackRook.CSID}</var>
228                 <var ID="parentCSID">${CreateBagOfBlackChessPieces.CSID}</var>
229                 <var ID="child1CSID">${CreateBlackRookFragment1.CSID}</var>
230                 <var ID="child2CSID">${CreateBlackRookFragment2.CSID}</var>
231             </vars>
232             <expectedCodes>200</expectedCodes>
233         </test>
234         
235     
236         <!--
237             Read hierarchical relations via three query parameters now
238             supported for structured objects and procedures, as well as
239             for authority terms:
240             
241             * showRelations
242             * showSiblings
243             * showAllRelations
244         -->
245                     
246         <!-- Read hierarchical relationships via 'showRelations', -->
247         <!-- which returns direct parent and child relations. -->
248         
249         <test ID="ShowRelationsForTopLevelItem">
250             <method>GET</method>
251             <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showRelations=true</uri>
252             <response>
253                 <expected level="ADDOK" />
254                 <filename>collectionobject/hierarchy/res/show-relations-top-level.res.xml</filename>
255                 <vars>
256                     <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
257                     <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
258                     <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
259                     <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
260                 </vars>
261                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
262             </response>
263             <expectedCodes>200</expectedCodes>
264         </test>
265         
266         <test ID="ShowRelationsForMidLevelItem">
267             <method>GET</method>
268             <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showRelations=true</uri>
269             <response>
270                 <expected level="ADDOK" />
271                 <filename>collectionobject/hierarchy/res/show-relations-mid-level.res.xml</filename>
272                 <vars>
273                     <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
274                     <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
275                     <var ID="blackQueenCSID">${CreateBlackQueen.CSID}</var>
276                     <var ID="blackRookCSID">${CreateBlackRook.CSID}</var>
277                 </vars>
278                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
279             </response>
280             <expectedCodes>200</expectedCodes>
281         </test>
282         
283         <test ID="ShowRelationsForBottomLevelItem">
284             <method>GET</method>
285             <uri>/cspace-services/collectionobjects/${CreateBlackRookFragment1.CSID}?showRelations=true</uri>
286             <response>
287                 <expected level="ADDOK" />
288                 <filename>collectionobject/hierarchy/res/show-relations-bottom-level.res.xml</filename>
289                 <vars>
290                     <var ID="blackRookCSID">${CreateBlackRook.CSID}</var>
291                     <var ID="blackRookFragment1CSID">${CreateBlackRookFragment1.CSID}</var>
292                 </vars>
293                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
294             </response>
295             <expectedCodes>200</expectedCodes>
296         </test>
297         
298         <!-- Read hierarchical relationships via 'showSiblings', -->
299         <!-- which returns sibling relations. -->
300
301         <test ID="ShowSiblingsForTopLevelItem">
302             <method>GET</method>
303             <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showSiblings=true</uri>
304             <expectedCodes>200</expectedCodes>
305             <response>
306                 <expected level="ADDOK" />
307                 <filename>collectionobject/hierarchy/res/show-siblings-top-level.res.xml</filename>
308                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
309             </response>
310         </test>
311         
312         <test ID="ShowSiblingsForMidLevelItem">
313             <method>GET</method>
314             <uri>/cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showSiblings=true</uri>
315             <expectedCodes>200</expectedCodes>
316             <response>
317                 <expected level="ADDOK" />
318                 <filename>collectionobject/hierarchy/res/show-siblings-mid-level.res.xml</filename>
319                 <vars>
320                     <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
321                     <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
322                     <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
323                 </vars>
324                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
325             </response>
326         </test>
327         
328         <test ID="ShowSiblingsForBottomLevelItem">
329             <method>GET</method>
330             <uri>/cspace-services/collectionobjects/${CreateBlackRookFragment1.CSID}?showSiblings=true</uri>
331             <expectedCodes>200</expectedCodes>
332             <response>
333                 <expected level="ADDOK" />
334                 <filename>collectionobject/hierarchy/res/show-siblings-bottom-level.res.xml</filename>
335                 <vars>
336                     <var ID="blackRookCSID">${CreateBlackRook.CSID}</var>
337                     <var ID="blackRookFragment2CSID">${CreateBlackRookFragment2.CSID}</var>
338                 </vars>
339                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
340             </response>
341         </test>
342         
343         <!-- Read hierarchical relationships via 'showAllRelations', -->
344         <!-- which returns parent, child, and sibling relationships. -->
345
346         <test ID="ShowAllRelationsForTopLevelItem">
347             <method>GET</method>
348             <uri>/cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showAllRelations=true</uri>
349             <expectedCodes>200</expectedCodes>
350             <response>
351                 <expected level="ADDOK" />
352                 <filename>collectionobject/hierarchy/res/show-all-relations-top-level.res.xml</filename>
353                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
354             </response>
355         </test>
356         
357         <!-- The following tests -->
358         
359         <!-- Currently returns only three relations (parent, two children), -->
360         <!-- rather than five (parent, two children, two siblings). - ADR 2012-09-10 -->
361         <!--
362         <test ID="ShowAllRelationsForMidLevelItem">
363             <method>GET</method>
364             <uri>/cspace-services/collectionobjects/${CreateBagOfWhiteChessPieces.CSID}?showAllRelations=true</uri>
365             <expectedCodes>200</expectedCodes>
366             <response>
367                 <expected level="ADDOK" />
368                 <filename>collectionobject/hierarchy/res/show-all-relations-mid-level.res.xml</filename>
369                 <vars>
370                     <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
371                     <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
372                     <var ID="whiteRookCSID">${CreateWhiteRook.CSID}</var>
373                     <var ID="whiteBishopCSID">${CreateWhiteBishop.CSID}</var>
374                 </vars>
375                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
376             </response>
377         </test>
378         -->
379         
380         <!-- Currently returns only one relation (parent), rather than -->
381         <!-- two (parent, sibling). - ADR 2012-09-10 -->
382         <!--
383         <test ID="ShowAllRelationsForBottomLevelItem">
384             <method>GET</method>
385             <uri>/cspace-services/collectionobjects/${CreateWhiteBishop.CSID}?showAllRelations=true</uri>
386             <expectedCodes>200</expectedCodes>
387             <response>
388                 <expected level="ADDOK" />
389                 <filename>collectionobject/hierarchy/res/show-all-relations-bottom-level.res.xml</filename>
390                 <vars>
391                     <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
392                     <var ID="whiteRookCSID">${CreateWhiteRook.CSID}</var>
393                     <var ID="whiteBishopCSID">${CreateWhiteBishop.CSID}</var>
394                 </vars>
395                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
396             </response>
397         </test>
398         -->
399             
400         <!-- Read hierarchical relationships via the relations service. -->
401         <!-- (This can also serve as a cross-check on the additional read mechanisms, above.) -->
402                 
403         <!-- Zero (0) total items are expected for the top-level item as a subject, -->
404         <!-- since the tests above created relation records with this top-level -->
405         <!-- solely as an object of those relations. -->
406         <test ID="GetRelationsAsSubjectForTopLevelItem">
407             <method>GET</method>
408             <uri>/cspace-services/relations?sbj=${CreateChessSetBox.CSID}</uri>
409             <expectedCodes>200</expectedCodes>
410             <response>
411                 <expected level="ADDOK" />
412                 <filename>collectionobject/hierarchy/res/relations-pagination-header.res.xml</filename>
413                 <vars>
414                     <var ID="totalItems">0</var>
415                 </vars>
416             </response>
417         </test>
418         
419         <test ID="GetRelationsAsObjectForTopLevelItem">
420             <method>GET</method>
421             <uri>/cspace-services/relations?obj=${CreateChessSetBox.CSID}</uri>
422             <expectedCodes>200</expectedCodes>
423             <response>
424                 <expected level="ADDOK" />
425                 <filename>collectionobject/hierarchy/res/relations-as-object-top-level.res.xml</filename>
426                 <vars>
427                     <var ID="chessSetBoxCSID">${CreateChessSetBox.CSID}</var>
428                     <var ID="chessBoardCSID">${CreateChessBoard.CSID}</var>
429                     <var ID="bagOfWhiteChessPiecesCSID">${CreateBagOfWhiteChessPieces.CSID}</var>
430                     <var ID="bagOfBlackChessPiecesCSID">${CreateBagOfBlackChessPieces.CSID}</var>
431                 </vars>
432                 <startElement>/document/*[local-name()='relations-common-list']</startElement>
433             </response>
434         </test>     
435     
436         <!-- Clean up any remaining records that were NOT automatically deleted by autoDeletePOSTS -->
437         
438         <!-- Delete the records of relations to ChessSetBox, from its three children -->
439                
440         <test ID="GetRelationsToChessSetBoxAsObject">
441             <method>GET</method>
442             <uri>/cspace-services/relations?obj=${CreateChessSetBox.CSID}</uri>
443             <expectedCodes>200</expectedCodes>
444         </test>
445         <test ID="DeleteChildRelation1ToChessSetBox">
446             <method>DELETE</method>
447             <uri>/cspace-services/relations/${GetRelationsToChessSetBoxAsObject.got("//relation-list-item[1]/csid")}</uri>
448         </test>
449         <test ID="DeleteChildRelation2ToChessSetBox">
450             <method>DELETE</method>
451             <uri>/cspace-services/relations/${GetRelationsToChessSetBoxAsObject.got("//relation-list-item[2]/csid")}</uri>
452         </test>
453         <test ID="DeleteChildRelation3ToChessSetBox">
454             <method>DELETE</method>
455             <uri>/cspace-services/relations/${GetRelationsToChessSetBoxAsObject.got("//relation-list-item[3]/csid")}</uri>
456         </test>
457         
458         <!-- Delete the records of relations to BagOfWhiteChessPieces, from its two children -->
459         
460         <test ID="GetRelationsToBagOfWhiteChessPiecesAsObject">
461             <method>GET</method>
462             <uri>/cspace-services/relations?obj=${CreateBagOfWhiteChessPieces.CSID}</uri>
463             <expectedCodes>200</expectedCodes>
464         </test>
465         <test ID="DeleteChildRelation1ToBagOfWhiteChessPieces">
466             <method>DELETE</method>
467             <uri>/cspace-services/relations/${GetRelationsToBagOfWhiteChessPiecesAsObject.got("//relation-list-item[1]/csid")}</uri>
468         </test>
469         <test ID="DeleteChildRelation2ToBagOfWhiteChessPieces">
470             <method>DELETE</method>
471             <uri>/cspace-services/relations/${GetRelationsToBagOfWhiteChessPiecesAsObject.got("//relation-list-item[2]/csid")}</uri>
472         </test>
473         
474         <!-- Delete the records of relations to BagOfBlackChessPieces, from its two children -->
475         
476         <test ID="GetRelationsToBagOfBlackChessPiecesAsObject">
477             <method>GET</method>
478             <uri>/cspace-services/relations?obj=${CreateBagOfBlackChessPieces.CSID}</uri>
479             <expectedCodes>200</expectedCodes>
480         </test>
481         <test ID="DeleteChildRelation1ToBagOfBlackChessPieces">
482             <method>DELETE</method>
483             <uri>/cspace-services/relations/${GetRelationsToBagOfBlackChessPiecesAsObject.got("//relation-list-item[1]/csid")}</uri>
484         </test>
485         <test ID="DeleteChildRelation2ToBagOfBlackChessPieces">
486             <method>DELETE</method>
487             <uri>/cspace-services/relations/${GetRelationsToBagOfBlackChessPiecesAsObject.got("//relation-list-item[2]/csid")}</uri>
488         </test>
489         
490         <!-- Delete the records of a relation to BlackRook, from its teo children -->
491         
492         <test ID="GetRelationsToBlackRookAsObject">
493             <method>GET</method>
494             <uri>/cspace-services/relations?obj=${CreateBlackRook.CSID}</uri>
495             <expectedCodes>200</expectedCodes>
496         </test>
497         <test ID="DeleteChildRelation1ToBlackRook">
498             <method>DELETE</method>
499             <uri>/cspace-services/relations/${GetRelationsToBlackRookAsObject.got("//relation-list-item[1]/csid")}</uri>
500         </test>
501          <test ID="DeleteChildRelation2ToBlackRook">
502             <method>DELETE</method>
503             <uri>/cspace-services/relations/${GetRelationsToBlackRookAsObject.got("//relation-list-item[2]/csid")}</uri>
504         </test>
505                        
506     </testGroup>
507     
508 </xmlReplay>