]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
7acbdb1eaa76330bbbee2b699058d16987422bb1
[tmp/jakarta-migration.git] /
1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 <xmlReplay>
3     
4     <testGroup ID="DisplayNameChangesReflectedInRefNames" autoDeletePOSTS="true">
5         
6         <!--
7             Tests that updates of the display name field for CollectionObject
8             records are reflected
9             
10             By default in the current demo tenants, the the objectNumber field
11             is configured in services tenant bindings as the display name field:
12             
13             <service:DocHandlerParams xmlns:service="http://collectionspace.org/services/config/service">
14                 <service:params>
15                         <service:SupportsHierarchy>true</service:SupportsHierarchy>
16                         <service:RefnameDisplayNameField>
17                         <service:element>objectNumber</service:element>
18                         
19             This test reuses some payloads from one or more existing tests.
20         -->
21         
22         <!-- Create two CollectionObject records, and a parent/child relation between them -->
23         
24         <test ID="CreateMotherElephant">
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-5504-MotherElephant</var>
30             </vars>
31             <expectedCodes>201</expectedCodes>
32         </test>
33         <test ID="ReadMotherElephant">
34             <method>GET</method>
35             <uri>/cspace-services/collectionobjects/${CreateMotherElephant.CSID}</uri>
36             <expectedCodes>200</expectedCodes>
37             <response>
38                 <expected level="TEXT" />
39                 <filename>collectionobject/hierarchy/res/collectionobject.res.xml</filename>
40                 <vars>
41                     <var ID="objectNumber">${CreateMotherElephant.objectNumber}</var>
42                 </vars>
43             </response>
44         </test>
45         
46         <test ID="CreateBabyElephant">
47             <method>POST</method>
48             <uri>/cspace-services/collectionobjects</uri>
49             <filename>collectionobject/hierarchy/2-collectionobject-create-with-parent-csid.xml</filename>
50             <vars>
51                 <var ID="objectNumber">CSPACE-5504-BabyElephant</var>
52                 <var ID="parentCSID">${CreateMotherElephant.CSID}</var>
53             </vars>
54             <expectedCodes>201</expectedCodes>
55         </test>
56         <test ID="ReadBabyElephant">
57             <method>GET</method>
58             <uri>/cspace-services/collectionobjects/${CreateBabyElephant.CSID}</uri>
59             <expectedCodes>200</expectedCodes>
60             <response>
61                 <expected level="TEXT" />
62                 <filename>collectionobject/hierarchy/res/collectionobject.res.xml</filename>
63                 <vars>
64                     <var ID="objectNumber">${CreateBabyElephant.objectNumber}</var>
65                 </vars>
66             </response>
67         </test>
68         
69         <!-- Update one of the records' display names -->
70         <test ID="UpdateBabyElephantDisplayName">
71             <method>PUT</method>
72             <uri>/cspace-services/collectionobjects/${CreateBabyElephant.CSID}</uri>
73             <!-- This 'create' payload is also suitable for use with an update request -->
74             <filename>collectionobject/hierarchy/1-collectionobject-create.xml</filename>
75             <vars>
76                 <var ID="objectNumber">CSPACE-5504-BabyElephant-With-Ears</var>
77             </vars>
78             <expectedCodes>200</expectedCodes>
79         </test>
80         <test ID="ReadUpdatedBabyElephantDisplayName">
81             <method>GET</method>
82             <uri>/cspace-services/collectionobjects/${CreateBabyElephant.CSID}</uri>
83             <expectedCodes>200</expectedCodes>
84             <response>
85                 <expected level="TEXT" />
86                 <filename>collectionobject/hierarchy/res/collectionobject.res.xml</filename>
87                 <vars>
88                     <var ID="objectNumber">${UpdateBabyElephantDisplayName.objectNumber}</var>
89                 </vars>
90             </response>
91         </test>
92         
93         <!-- Verify that the updated display name is present in the refName -->
94         <!-- in the collectionspace_core metadata for this record. -->
95         <test ID="VerifyUpdatedDisplayNameInCollectionSpaceCore">
96             <method>GET</method>
97             <uri>/cspace-services/collectionobjects/${CreateBabyElephant.CSID}</uri>
98             <expectedCodes>200</expectedCodes>
99             <response>
100                 <expected level="TEXT" />
101                 <filename>collectionobject/res/collectionspace-core-refname.res.xml</filename>
102                 <vars>
103                     <var ID="itemCSID">${CreateBabyElephant.CSID}</var>
104                     <var ID="updatedDisplayName">${UpdateBabyElephantDisplayName.objectNumber}</var>
105                 </vars>
106                 <startElement>/document/*[local-name()='collectionspace_core']</startElement>
107             </response>
108         </test>
109         
110         <!-- Verify that the updated display name is present in the relevant -->
111         <!-- refName in the relations record linking these two records. -->
112         <test ID="VerifyUpdatedDisplayNameInRelation">
113             <method>GET</method>
114             <uri>/cspace-services/relations?sbj=${CreateBabyElephant.CSID}&amp;obj=${CreateMotherElephant.CSID}</uri>
115             <expectedCodes>200</expectedCodes>
116             <response>
117                 <expected level="TEXT" />
118                 <filename>collectionobject/res/relationship-refname.res.xml</filename>
119                 <vars>
120                     <var ID="childCSID">${CreateBabyElephant.CSID}</var>
121                     <var ID="parentCSID">${CreateMotherElephant.CSID}</var>
122                     <var ID="updatedDisplayName">${UpdateBabyElephantDisplayName.objectNumber}</var>
123                 </vars>
124             </response>
125         </test>
126         
127        <!-- Clean up any remaining records that were NOT automatically deleted by autoDeletePOSTS -->
128                        
129         <test ID="GetRelationsToMotherElephantAsObject">
130             <method>GET</method>
131             <uri>/cspace-services/relations?obj=${CreateMotherElephant.CSID}</uri>
132             <expectedCodes>200</expectedCodes>
133         </test>
134         <test ID="DeleteChildRelationToMotherElephant">
135             <method>DELETE</method>
136             <uri>/cspace-services/relations/${GetRelationsToMotherElephantAsObject.got("//relation-list-item[1]/csid")}</uri>
137         </test>
138                        
139     </testGroup>
140     
141 </xmlReplay>