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