</test>\r
\r
<!-- The currentLocation value of this Movement record, which -->\r
- <!-- has the most recent locationDate value, should thus be -->\r
+ <!-- has the most recent locationDate value, should also be -->\r
<!-- reflected in the computedCurrentLocation value in the -->\r
<!-- CollectionObject record after invoking the batch job. -->\r
<test ID="createMovement2">\r
<uri>/cspace-services/collectionobjects/${createCollectionObject.CSID}</uri>\r
<filename>batch/updateobjloc.xml</filename>\r
<response>\r
- <expected level="TEXT" />\r
+ <expected level="ADDOK" />\r
<filename>batch/res/collectionobject.res.xml</filename>\r
<vars>\r
<var ID="computedCurrentLocationValue">${createMovement2.currentLocation}</var>\r
<!-- Tests with Movement->CollectionObject relations -->\r
\r
<!-- The currentLocation value of this new Movement record, which now -->\r
- <!-- has the most recent locationDate value, should thus be -->\r
+ <!-- has the most recent locationDate value, should also be -->\r
<!-- reflected in the computedCurrentLocation value in the -->\r
<!-- CollectionObject record after invoking the batch job a second time. -->\r
<test ID="createMovement4">\r
<uri>/cspace-services/collectionobjects/${createCollectionObject.CSID}</uri>\r
<filename>batch/updateobjloc.xml</filename>\r
<response>\r
- <expected level="TEXT" />\r
+ <expected level="ADDOK" />\r
<filename>batch/res/collectionobject.res.xml</filename>\r
<vars>\r
<var ID="computedCurrentLocationValue">${createMovement4.currentLocation}</var>\r
try {
Document document = builder.build(new StringReader(payload.toXML()));
Element root = document.getRootElement();
+ // The part element is always expected to have an explicit namespace.
Element part = root.getChild(partLabel, partNamespace);
+ // Try getting the field element both with and without a namespace.
+ // Even though a field element that lacks a namespace prefix
+ // may yet inherit its namespace from a parent, JDOM may require that
+ // the getChild() call be made without a namespace.
Element field = part.getChild(fieldPath, partNamespace);
- value = field.getText();
+ if (field == null) {
+ field = part.getChild(fieldPath);
+ }
+ if (field != null) {
+ value = field.getText();
+ }
} catch (Exception e) {
logger.error("Error getting value from field path " + fieldPath
+ " in schema part " + partLabel);