From a0b499c0709864af30706f94fa7637b898b01e00 Mon Sep 17 00:00:00 2001 From: Aron Roberts Date: Tue, 25 Sep 2012 12:38:22 -0700 Subject: [PATCH] CSPACE-5552: Add initial tests to verify that updating a display name field in a structured object also update display names in the refName fields in collectionspace_core and in associated relationship records. --- .../collectionobject-displayname-update.xml | 141 ++++++++++++++++++ .../res/collectionspace-core-refname.res.xml | 8 + .../res/relationship-refname.res.xml | 20 +++ 3 files changed, 169 insertions(+) create mode 100644 services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/collectionobject-displayname-update.xml create mode 100644 services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/res/collectionspace-core-refname.res.xml create mode 100644 services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/res/relationship-refname.res.xml diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/collectionobject-displayname-update.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/collectionobject-displayname-update.xml new file mode 100644 index 000000000..7acbdb1ea --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/collectionobject-displayname-update.xml @@ -0,0 +1,141 @@ + + + + + + + + + + + POST + /cspace-services/collectionobjects + collectionobject/hierarchy/1-collectionobject-create.xml + + CSPACE-5504-MotherElephant + + 201 + + + GET + /cspace-services/collectionobjects/${CreateMotherElephant.CSID} + 200 + + + collectionobject/hierarchy/res/collectionobject.res.xml + + ${CreateMotherElephant.objectNumber} + + + + + + POST + /cspace-services/collectionobjects + collectionobject/hierarchy/2-collectionobject-create-with-parent-csid.xml + + CSPACE-5504-BabyElephant + ${CreateMotherElephant.CSID} + + 201 + + + GET + /cspace-services/collectionobjects/${CreateBabyElephant.CSID} + 200 + + + collectionobject/hierarchy/res/collectionobject.res.xml + + ${CreateBabyElephant.objectNumber} + + + + + + + PUT + /cspace-services/collectionobjects/${CreateBabyElephant.CSID} + + collectionobject/hierarchy/1-collectionobject-create.xml + + CSPACE-5504-BabyElephant-With-Ears + + 200 + + + GET + /cspace-services/collectionobjects/${CreateBabyElephant.CSID} + 200 + + + collectionobject/hierarchy/res/collectionobject.res.xml + + ${UpdateBabyElephantDisplayName.objectNumber} + + + + + + + + GET + /cspace-services/collectionobjects/${CreateBabyElephant.CSID} + 200 + + + collectionobject/res/collectionspace-core-refname.res.xml + + ${CreateBabyElephant.CSID} + ${UpdateBabyElephantDisplayName.objectNumber} + + /document/*[local-name()='collectionspace_core'] + + + + + + + GET + /cspace-services/relations?sbj=${CreateBabyElephant.CSID}&obj=${CreateMotherElephant.CSID} + 200 + + + collectionobject/res/relationship-refname.res.xml + + ${CreateBabyElephant.CSID} + ${CreateMotherElephant.CSID} + ${UpdateBabyElephantDisplayName.objectNumber} + + + + + + + + GET + /cspace-services/relations?obj=${CreateMotherElephant.CSID} + 200 + + + DELETE + /cspace-services/relations/${GetRelationsToMotherElephantAsObject.got("//relation-list-item[1]/csid")} + + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/res/collectionspace-core-refname.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/res/collectionspace-core-refname.res.xml new file mode 100644 index 000000000..b48b9a5d5 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/res/collectionspace-core-refname.res.xml @@ -0,0 +1,8 @@ + + + + + urn:cspace:core.collectionspace.org:collectionobjects:id(${itemCSID})'${updatedDisplayName}' + + + \ No newline at end of file diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/res/relationship-refname.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/res/relationship-refname.res.xml new file mode 100644 index 000000000..1f909bb71 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/res/relationship-refname.res.xml @@ -0,0 +1,20 @@ + + + 0 + 1 + 1 + + + hasBroader + + ${childCSID} + urn:cspace:core.collectionspace.org:collectionobjects:id(${childCSID})'${updatedDisplayName}' + CollectionObject + + + ${parentCSID} + CollectionObject + + + + -- 2.47.3