]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
c45d2138e1569de8b1312e42be801f0080c12088
[tmp/jakarta-migration.git] /
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xmlReplay>
3     <auths>
4         <!-- IMPORTANT: THESE ARE STICKY :: THEY STICK AROUND UNTIL RESET, IN EXEC ORDER OF THIS FILE. -->
5         <auth ID="admin@core.collectionspace.org">YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I=</auth>
6     </auths>
7         
8     <!-- This tests the UpdateObjectLocationOnMoveEventListener -->
9         
10     <testGroup ID="updateObjectLocationOnMoveEventListener" autoDeletePOSTS="true">
11         
12         <test ID="createCollectionObject1">
13             <method>POST</method>
14             <uri>/cspace-services/collectionobjects</uri>
15             <filename>listener/collectionobject.xml</filename>
16             <expectedCodes>201</expectedCodes>
17         </test>
18         
19         <test ID="createCollectionObject2">
20             <method>POST</method>
21             <uri>/cspace-services/collectionobjects</uri>
22             <filename>listener/collectionobject.xml</filename>
23             <expectedCodes>201</expectedCodes>
24         </test>
25         
26         <test ID="createMovement1">
27             <method>POST</method>
28             <uri>/cspace-services/movements</uri>
29             <filename>listener/movement.xml</filename>
30             <vars>
31                 <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Seattle1358215545509)'Seattle, WA, USA'</var>
32                 <var ID="locationDate">1650-01-01</var>
33             </vars>
34             <expectedCodes>201</expectedCodes>
35         </test>
36         
37         <test ID="createMovement2">
38             <method>POST</method>
39             <uri>/cspace-services/movements</uri>
40             <filename>listener/movement.xml</filename>
41             <vars>
42                 <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Portland1358215545512)'Portland, OR, USA'</var>
43                 <var ID="locationDate">1700-01-01</var>
44             </vars>
45             <expectedCodes>201</expectedCodes>
46         </test>
47         
48         <test ID="createMovement3">
49             <method>POST</method>
50             <uri>/cspace-services/movements</uri>
51             <filename>listener/movement.xml</filename>
52             <vars>
53                 <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Victoria1358215545515)'Victoria, BC, Canada'</var>
54                 <var ID="locationDate">1800-01-01</var>
55             </vars>
56             <expectedCodes>201</expectedCodes>
57         </test>
58         
59         <test ID="createMovement4">
60             <method>POST</method>
61             <uri>/cspace-services/movements</uri>
62             <filename>listener/movement.xml</filename>
63             <vars>
64                 <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Vancouver1358215545518)'Vancouver, BC, Canada'</var>
65                 <var ID="locationDate">1900-01-01</var>
66             </vars>
67             <expectedCodes>201</expectedCodes>
68         </test>
69         
70         <test ID="createMovement5">
71             <method>POST</method>
72             <uri>/cspace-services/movements</uri>
73             <filename>listener/movement.xml</filename>
74             <vars>
75                 <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Olympia1358215545521)'Olympia, WA, USA'</var>
76                 <var ID="locationDate">2000-01-01</var>
77             </vars>
78             <expectedCodes>201</expectedCodes>
79         </test>
80         
81         <test ID="relateCollectionObject1ToMovement1">
82             <method>POST</method>
83             <uri>/cspace-services/relations</uri>
84             <filename>listener/relation.xml</filename>
85             <vars>
86                 <var ID="subjectCsid">${createCollectionObject1.CSID}</var>
87                 <var ID="subjectDocumentType">CollectionObject</var>
88                 <var ID="objectCsid">${createMovement1.CSID}</var>
89                 <var ID="objectDocumentType">Movement</var>
90             </vars>
91             <expectedCodes>201</expectedCodes>
92         </test>
93         
94         <test ID="relateCollectionObject2ToMovement1">
95             <method>POST</method>
96             <uri>/cspace-services/relations</uri>
97             <filename>listener/relation.xml</filename>
98             <vars>
99                 <var ID="subjectCsid">${createCollectionObject2.CSID}</var>
100                 <var ID="subjectDocumentType">CollectionObject</var>
101                 <var ID="objectCsid">${createMovement1.CSID}</var>
102                 <var ID="objectDocumentType">Movement</var>
103             </vars>
104             <expectedCodes>201</expectedCodes>
105         </test>
106         
107         <!-- Computed current location doesn't appear to be updated -->
108         <!-- merely upon a Relation being created; some intervening action -->
109         <!-- invoking the listener must also occur. This appears to be -->
110         <!-- because newly-created relations aren't being returned in results -->
111         <!-- from the first query - which returns a list of Relation document -->
112         <!-- models - that is made in AbstractUpdateObjectLocationValues.handleEvent() --> 
113         <test ID="updateMovement1">
114             <method>PUT</method>
115             <uri>/cspace-services/movements/${createMovement1.CSID}</uri>
116             <filename>listener/movement.xml</filename>
117             <vars>
118                 <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Seattle1358215545509)'Seattle, WA, USA'</var>
119                 <var ID="locationDate">1650-02-01</var>
120             </vars>
121             <expectedCodes>200</expectedCodes>
122         </test>
123         
124         <test ID="readCollectionObject1AfterMovement1Update">
125             <method>GET</method>
126             <uri>/cspace-services/collectionobjects/${createCollectionObject1.CSID}</uri>
127             <response>
128                 <expected level="ADDOK" />
129                 <filename>listener/res/collectionobject.res.xml</filename>
130                 <vars>
131                     <var ID="computedCurrentLocationValue">${createMovement1.currentLocation}</var>
132                 </vars>
133             </response>
134             <expectedCodes>200</expectedCodes>
135         </test>
136         
137         <test ID="readCollectionObject2AfterMovement1Update">
138             <method>GET</method>
139             <uri>/cspace-services/collectionobjects/${createCollectionObject2.CSID}</uri>
140             <response>
141                 <expected level="ADDOK" />
142                 <filename>listener/res/collectionobject.res.xml</filename>
143                 <vars>
144                     <var ID="computedCurrentLocationValue">${createMovement1.currentLocation}</var>
145                 </vars>
146             </response>
147             <expectedCodes>200</expectedCodes>
148         </test>
149         
150         <test ID="relateMovement2ToCollectionObject1">
151             <method>POST</method>
152             <uri>/cspace-services/relations</uri>
153             <filename>listener/relation.xml</filename>
154             <vars>
155                 <var ID="subjectCsid">${createMovement2.CSID}</var>
156                 <var ID="subjectDocumentType">Movement</var>
157                 <var ID="objectCsid">${createCollectionObject1.CSID}</var>
158                 <var ID="objectDocumentType">CollectionObject</var>
159             </vars>
160             <expectedCodes>201</expectedCodes>
161         </test>
162         
163         <test ID="updateMovement2">
164             <method>PUT</method>
165             <uri>/cspace-services/movements/${createMovement2.CSID}</uri>
166             <filename>listener/movement.xml</filename>
167             <vars>
168                 <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Portland1358215545512)'Portland, OR, USA'</var>
169                 <var ID="locationDate">1700-02-01</var>
170             </vars>
171             <expectedCodes>200</expectedCodes>
172         </test>
173
174         <test ID="readCollectionObject1AfterMovement2Update">
175             <method>GET</method>
176             <uri>/cspace-services/collectionobjects/${createCollectionObject1.CSID}</uri>
177             <response>
178                 <expected level="ADDOK" />
179                 <filename>listener/res/collectionobject.res.xml</filename>
180                 <vars>
181                     <var ID="computedCurrentLocationValue">${createMovement2.currentLocation}</var>
182                 </vars>
183             </response>
184             <expectedCodes>200</expectedCodes>
185         </test>
186         
187         <test ID="relateMovement3ToCollectionObject1">
188             <method>POST</method>
189             <uri>/cspace-services/relations</uri>
190             <filename>listener/relation.xml</filename>
191             <vars>
192                 <var ID="subjectCsid">${createMovement3.CSID}</var>
193                 <var ID="subjectDocumentType">Movement</var>
194                 <var ID="objectCsid">${createCollectionObject1.CSID}</var>
195                 <var ID="objectDocumentType">CollectionObject</var>
196             </vars>
197             <expectedCodes>201</expectedCodes>
198         </test>
199         
200         <test ID="updateMovement3">
201             <method>PUT</method>
202             <uri>/cspace-services/movements/${createMovement2.CSID}</uri>
203             <filename>listener/movement.xml</filename>
204             <vars>
205                 <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Victoria1358215545515)'Victoria, BC, Canada'</var>
206                 <var ID="locationDate">1800-02-01</var>
207             </vars>
208             <expectedCodes>200</expectedCodes>
209         </test>
210         
211         <test ID="readCollectionObject1AfterMovement3Update">
212             <method>GET</method>
213             <uri>/cspace-services/collectionobjects/${createCollectionObject1.CSID}</uri>
214             <response>
215                 <expected level="ADDOK" />
216                 <filename>listener/res/collectionobject.res.xml</filename>
217                 <vars>
218                     <var ID="computedCurrentLocationValue">${createMovement3.currentLocation}</var>
219                 </vars>
220             </response>
221             <expectedCodes>200</expectedCodes>
222         </test>
223         
224         <test ID="relateCollectionObject1ToMovement4">
225             <method>POST</method>
226             <uri>/cspace-services/relations</uri>
227             <filename>listener/relation.xml</filename>
228             <vars>
229                 <var ID="subjectCsid">${createCollectionObject1.CSID}</var>
230                 <var ID="subjectDocumentType">CollectionObject</var>
231                 <var ID="objectCsid">${createMovement4.CSID}</var>
232                 <var ID="objectDocumentType">Movement</var>
233             </vars>
234             <expectedCodes>201</expectedCodes>
235         </test>
236         
237         <test ID="relateCollectionObject1ToMovement5">
238             <method>POST</method>
239             <uri>/cspace-services/relations</uri>
240             <filename>listener/relation.xml</filename>
241             <vars>
242                 <var ID="subjectCsid">${createCollectionObject1.CSID}</var>
243                 <var ID="subjectDocumentType">CollectionObject</var>
244                 <var ID="objectCsid">${createMovement5.CSID}</var>
245                 <var ID="objectDocumentType">Movement</var>
246             </vars>
247             <expectedCodes>201</expectedCodes>
248         </test>
249         
250         <test ID="updateMovement5">
251             <method>PUT</method>
252             <uri>/cspace-services/movements/${createMovement5.CSID}</uri>
253             <filename>listener/movement.xml</filename>
254             <vars>
255                 <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Olympia1358215545521)'Olympia, WA, USA'</var>
256                 <var ID="locationDate">2000-02-02</var>
257             </vars>
258             <expectedCodes>200</expectedCodes>
259         </test>
260         
261         <test ID="readCollectionObject1AfterMovement5Update">
262             <method>GET</method>
263             <uri>/cspace-services/collectionobjects/${createCollectionObject1.CSID}</uri>
264             <response>
265                 <expected level="ADDOK" />
266                 <filename>listener/res/collectionobject.res.xml</filename>
267                 <vars>
268                     <var ID="computedCurrentLocationValue">${createMovement5.currentLocation}</var>
269                 </vars>
270             </response>
271             <expectedCodes>200</expectedCodes>
272         </test>
273         
274         <test ID="softDeleteRelationBetweenCollectionObject1AndMovement5">
275             <method>PUT</method>
276             <uri>/cspace-services/relations/${relateCollectionObject1ToMovement5.CSID}/workflow/delete</uri>
277             <expectedCodes>200</expectedCodes>
278             <filename>relation/res/workflowState.res.xml</filename>
279             <vars>
280                 <var ID="workflowState">deleted</var>
281             </vars>
282         </test>
283         
284         <test ID="updateMovement4">
285             <method>PUT</method>
286             <uri>/cspace-services/movements/${createMovement4.CSID}</uri>
287             <filename>listener/movement.xml</filename>
288             <vars>
289                 <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Vancouver1358215545518)'Vancouver, BC, Canada'</var>
290                 <var ID="locationDate">1900-02-01</var>
291             </vars>
292             <expectedCodes>200</expectedCodes>
293         </test>
294         
295         <test ID="readCollectionObject1AfterRelationSoftDelete">
296             <method>GET</method>
297             <uri>/cspace-services/collectionobjects/${createCollectionObject1.CSID}</uri>
298             <response>
299                 <expected level="ADDOK" />
300                 <filename>listener/res/collectionobject.res.xml</filename>
301                 <vars>
302                     <var ID="computedCurrentLocationValue">${createMovement4.currentLocation}</var>
303                 </vars>
304             </response>
305             <expectedCodes>200</expectedCodes>
306         </test>
307         
308         <test ID="softDeleteMovement4">
309             <method>PUT</method>
310             <uri>/cspace-services/movements/${createMovement4.CSID}/workflow/delete</uri>
311             <expectedCodes>200</expectedCodes>
312             <!-- XmlReplay appears to require a filename on PUT. -->
313             <!-- If not present, throws "java.io.FileNotFoundException: File '' does not exist" -->
314             <!-- The contents of that file, sent in the PUT payload, will be ignored by the services. -->
315             <!-- Note that the filename below is in a different module than -->
316             <!-- the present XmlReplay control file. -->
317             <filename>relation/res/workflowState.res.xml</filename>
318             <vars>
319                 <var ID="workflowState">deleted</var>
320             </vars>
321         </test>
322         
323         <test ID="readCollectionObject1AfterMovement4SoftDelete">
324             <method>GET</method>
325             <uri>/cspace-services/collectionobjects/${createCollectionObject1.CSID}</uri>
326             <response>
327                 <expected level="ADDOK" />
328                 <filename>listener/res/collectionobject.res.xml</filename>
329                 <vars>
330                     <var ID="computedCurrentLocationValue">${createMovement3.currentLocation}</var>
331                 </vars>
332             </response>
333             <expectedCodes>200</expectedCodes>
334         </test>
335         
336         <test ID="updateMovement3WithBlankCurrentLocation">
337             <method>PUT</method>
338             <uri>/cspace-services/movements/${createMovement2.CSID}</uri>
339             <filename>listener/movement.xml</filename>
340             <vars>
341                 <var ID="currentLocation"></var>
342                 <var ID="locationDate">1800-02-01</var>
343             </vars>
344             <expectedCodes>200</expectedCodes>
345         </test>
346         
347         <!--
348             This test verifies that the computedCurrentLocation field
349             value has been set to null, because that field will *not*
350             be emitted in the response payload when it has a null value.
351             
352             This is an inherently fragile test, in comparing tree structures,
353             and will break if there are any changes to any of the relevant
354             schemas, including collectionspace_core, collectionobjects_common,
355             and account_permission.
356             
357             Uncomment only when working on the computed current location
358             event listener / handler. - ADR - 2013-02-14
359         -->
360         <!--
361         <test ID="readCollectionObject1AfterMovement3BlankCurrentLocationUpdate">
362             <method>GET</method>
363             <uri>/cspace-services/collectionobjects/${createCollectionObject1.CSID}</uri>
364             <response>
365                 <filename>listener/res/collectionobject-without-current-location.res.xml</filename>
366                 <expected level="TREE" />
367                 <parts>
368                     <part>
369                         <label>collectionobjects_common</label>
370                     </part>
371                 </parts>
372             </response>
373             <expectedCodes>200</expectedCodes>
374         </test>
375         -->
376         
377         <test ID="updateMovement3WithNonBlankCurrentLocation">
378             <method>PUT</method>
379             <uri>/cspace-services/movements/${createMovement2.CSID}</uri>
380             <filename>listener/movement.xml</filename>
381             <vars>
382                 <var ID="currentLocation">urn:cspace:core.collectionspace.org:locationauthorities:name(offsite_sla):item:name(Ottawa1358215545567)'Ottawa, ON, Canada'</var>
383                 <var ID="locationDate">1800-02-01</var>
384             </vars>
385             <expectedCodes>200</expectedCodes>
386         </test>
387
388         <test ID="readCollectionObject1AfterMovement3BlankCurrentLocationUpdate">
389             <method>GET</method>
390             <uri>/cspace-services/collectionobjects/${createCollectionObject1.CSID}</uri>
391             <response>
392                 <expected level="ADDOK" />
393                 <filename>listener/res/collectionobject.res.xml</filename>
394                 <vars>
395                     <var ID="computedCurrentLocationValue">${updateMovement3WithNonBlankCurrentLocation.currentLocation}</var>
396                 </vars>
397             </response>
398             <expectedCodes>200</expectedCodes>
399         </test>
400         
401     </testGroup>
402     
403     <!-- Some of the following tests pertain to CSPACE-5793, not yet -->
404     <!-- resolved as of this writing. - ADR 2013-02-14 -->
405     
406     <testGroup ID="TestsStillUnderDevelopment">
407         
408         <test ID="deleteRelationBetweenCollectionObject1AndMovement4">
409             <method>DELETE</method>
410             <uri>/cspace-services/relations/${relateCollectionObject1ToMovement4.CSID}</uri>
411             <expectedCodes>200</expectedCodes>
412         </test>
413         
414         <test ID="readCollectionObject1AfterRelationDelete">
415             <method>GET</method>
416             <uri>/cspace-services/collectionobjects/${createCollectionObject1.CSID}</uri>
417             <response>
418                 <expected level="ADDOK" />
419                 <filename>listener/res/collectionobject.res.xml</filename>
420                 <vars>
421                     <var ID="computedCurrentLocationValue">${createMovement3.currentLocation}</var>
422                 </vars>
423             </response>
424             <expectedCodes>200</expectedCodes>
425         </test>
426         
427         <test ID="softDeleteMovement3">
428             <method>PUT</method>
429             <uri>/cspace-services/movements/${createMovement3.CSID}/workflow/delete</uri>
430             <expectedCodes>200</expectedCodes>
431             <!-- XmlReplay appears to require a filename on PUT. -->
432             <!-- If not present, throws "java.io.FileNotFoundException: File '' does not exist" -->
433             <!-- The contents of that file, sent in the PUT payload, will be ignored by the services. -->
434             <!-- Note that the filename below is in a different module than -->
435             <!-- the present XmlReplay control file. -->
436             <filename>relation/res/workflowState.res.xml</filename>
437             <vars>
438                 <var ID="workflowState">deleted</var>
439             </vars>
440         </test>
441         
442         <test ID="readCollectionObject1AfterMovement3SoftDelete">
443             <method>GET</method>
444             <uri>/cspace-services/collectionobjects/${createCollectionObject1.CSID}</uri>
445             <response>
446                 <expected level="ADDOK" />
447                 <filename>listener/res/collectionobject.res.xml</filename>
448                 <vars>
449                     <var ID="computedCurrentLocationValue">${createMovement2.currentLocation}</var>
450                 </vars>
451             </response>
452             <expectedCodes>200</expectedCodes>
453         </test>
454         
455         <test ID="deleteMovement2">
456             <method>DELETE</method>
457             <uri>/cspace-services/movements/${createMovement2.CSID}</uri>
458             <expectedCodes>200</expectedCodes>
459         </test>
460         
461         <test ID="readCollectionObject1AfterMovement2Delete">
462             <method>GET</method>
463             <uri>/cspace-services/collectionobjects/${createCollectionObject1.CSID}</uri>
464             <response>
465                 <expected level="ADDOK" />
466                 <filename>listener/res/collectionobject.res.xml</filename>
467                 <vars>
468                     <var ID="computedCurrentLocationValue">${createMovement1.currentLocation}</var>
469                 </vars>
470             </response>
471             <expectedCodes>200</expectedCodes>
472         </test>
473         
474     </testGroup>
475     
476 </xmlReplay>
477