From c3d0e039eb5bd02a65940631bb8ca08d4afa2b32 Mon Sep 17 00:00:00 2001 From: Aron Roberts Date: Thu, 13 Sep 2012 12:37:53 -0700 Subject: [PATCH] CSPACE-5518: Create both parent and child relations, in both create and update tests, in preparation for creating 'name' form of tests. --- .../collectionobject-hierarchy.xml | 189 +++++++++++++----- ...ject.xml => 1-collectionobject-create.xml} | 0 ...lectionobject-create-with-parent-csid.xml} | 10 +- ...nobject-create-with-parent-child-csids.xml | 60 ++++++ ...lectionobject-update-with-parent-csid.xml} | 5 +- ...nobject-update-with-parent-child-csids.xml | 67 +++++++ .../res/show-relations-bottom-level.res.xml | 4 +- .../res/show-siblings-bottom-level.res.xml | 14 +- 8 files changed, 281 insertions(+), 68 deletions(-) rename services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/{1-collectionobject.xml => 1-collectionobject-create.xml} (100%) rename services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/{2-collectionobjects-with-relations-create.xml => 2-collectionobject-create-with-parent-csid.xml} (84%) create mode 100644 services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/3-collectionobject-create-with-parent-child-csids.xml rename services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/{3-collectionobjects-with-relations-update.xml => 4-collectionobject-update-with-parent-csid.xml} (86%) create mode 100644 services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/5-collectionobject-update-with-parent-child-csids.xml diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/collectionobject-hierarchy.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/collectionobject-hierarchy.xml index b9ed00e37..c2683db1b 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/collectionobject-hierarchy.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/collectionobject-hierarchy.xml @@ -3,14 +3,28 @@ - + - + POST /cspace-services/collectionobjects - collectionobject/hierarchy/1-collectionobject.xml + collectionobject/hierarchy/1-collectionobject-create.xml CSPACE-5518-ChessSetBox @@ -32,11 +46,11 @@ - + POST /cspace-services/collectionobjects - collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml + collectionobject/hierarchy/2-collectionobject-create-with-parent-csid.xml CSPACE-5518-ChessBoard ${CreateChessSetBox.CSID} @@ -49,13 +63,14 @@ 200 - - + + + POST /cspace-services/collectionobjects - collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml + collectionobject/hierarchy/2-collectionobject-create-with-parent-csid.xml CSPACE-5518-BagOfWhiteChessPieces ${CreateChessSetBox.CSID} @@ -68,30 +83,16 @@ 200 - - POST - /cspace-services/collectionobjects - collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml - - CSPACE-5518-BagOfBlackChessPieces - ${CreateChessSetBox.CSID} - - - - GET - /cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID} - 200 - - - + + POST /cspace-services/collectionobjects - collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml + collectionobject/hierarchy/2-collectionobject-create-with-parent-csid.xml CSPACE-5518-WhiteRook - ${CreateBagOfWhiteChessPieces.CSID} + ${CreateBagOfWhiteChessPieces.CSID} 201 @@ -104,7 +105,7 @@ POST /cspace-services/collectionobjects - collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml + collectionobject/hierarchy/2-collectionobject-create-with-parent-csid.xml CSPACE-5518-WhiteBishop ${CreateBagOfWhiteChessPieces.CSID} @@ -117,13 +118,15 @@ 200 + + + POST /cspace-services/collectionobjects - collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml + collectionobject/hierarchy/1-collectionobject-create.xml CSPACE-5518-BlackQueen - ${CreateBagOfBlackChessPieces.CSID} 201 @@ -132,14 +135,13 @@ /cspace-services/collectionobjects/${CreateBlackQueen.CSID} 200 - + POST /cspace-services/collectionobjects - collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml + collectionobject/hierarchy/1-collectionobject-create.xml CSPACE-5518-BlackRook - ${CreateBagOfBlackChessPieces.CSID} 201 @@ -148,20 +150,83 @@ /cspace-services/collectionobjects/${CreateBlackRook.CSID} 200 + + + POST + /cspace-services/collectionobjects + collectionobject/hierarchy/1-collectionobject-create.xml + + CSPACE-5518-BlackRookFragment1 + + 201 + + + GET + /cspace-services/collectionobjects/${CreateBlackRookFragment1.CSID} + 200 + + + + POST + /cspace-services/collectionobjects + collectionobject/hierarchy/1-collectionobject-create.xml + + CSPACE-5518-BlackRookFragment2 + + 201 + + + GET + /cspace-services/collectionobjects/${CreateBlackRookFragment2.CSID} + 200 + + + + + + + + + + POST + /cspace-services/collectionobjects + collectionobject/hierarchy/3-collectionobject-create-with-parent-child-csids.xml + + CSPACE-5518-BagOfBlackChessPieces + ${CreateChessSetBox.CSID} + ${CreateBlackQueen.CSID} + + + + GET + /cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID} + 200 + - - - + + + + PUT /cspace-services/collectionobjects/${CreateBlackRook.CSID} - collectionobject/hierarchy/3-collectionobjects-with-relations-update.xml + collectionobject/hierarchy/5-collectionobject-update-with-parent-child-csids.xml - This rook has two light brown striations on part of its base. - ${CreateBlackRook.CSID} - ${CreateBagOfBlackChessPieces.CSID} + This black rook is nearly intact, save for two tiny fragments. + ${CreateBlackRook.CSID} + ${CreateBagOfBlackChessPieces.CSID} + ${CreateBlackRookFragment1.CSID} + ${CreateBlackRookFragment2.CSID} 200 @@ -216,13 +281,13 @@ GET - /cspace-services/collectionobjects/${CreateBlackRook.CSID}?showRelations=true + /cspace-services/collectionobjects/${CreateBlackRookFragment1.CSID}?showRelations=true collectionobject/hierarchy/res/show-relations-bottom-level.res.xml - ${CreateBagOfBlackChessPieces.CSID} ${CreateBlackRook.CSID} + ${CreateBlackRookFragment1.CSID} /document/*[local-name()='relations-common-list'] @@ -261,14 +326,14 @@ GET - /cspace-services/collectionobjects/${CreateBlackRook.CSID}?showSiblings=true + /cspace-services/collectionobjects/${CreateBlackRookFragment1.CSID}?showSiblings=true 200 collectionobject/hierarchy/res/show-siblings-bottom-level.res.xml - ${CreateBagOfBlackChessPieces.CSID} - ${CreateBlackQueen.CSID} + ${CreateBlackRook.CSID} + ${CreateBlackRookFragment2.CSID} /document/*[local-name()='relations-common-list'] @@ -371,56 +436,72 @@ - + GET /cspace-services/relations?obj=${CreateChessSetBox.CSID} 200 DELETE - /cspace-services/relations/${GetRelationsAsObjectForChessSetBox.got("//relation-list-item[1]/csid")} + /cspace-services/relations/${GetRelationsToChessSetBoxAsObject.got("//relation-list-item[1]/csid")} DELETE - /cspace-services/relations/${GetRelationsAsObjectForChessSetBox.got("//relation-list-item[2]/csid")} + /cspace-services/relations/${GetRelationsToChessSetBoxAsObject.got("//relation-list-item[2]/csid")} DELETE - /cspace-services/relations/${GetRelationsAsObjectForChessSetBox.got("//relation-list-item[3]/csid")} + /cspace-services/relations/${GetRelationsToChessSetBoxAsObject.got("//relation-list-item[3]/csid")} - + GET /cspace-services/relations?obj=${CreateBagOfWhiteChessPieces.CSID} 200 DELETE - /cspace-services/relations/${GetRelationsAsObjectForBagOfWhiteChessPieces.got("//relation-list-item[1]/csid")} + /cspace-services/relations/${GetRelationsToBagOfWhiteChessPiecesAsObject.got("//relation-list-item[1]/csid")} DELETE - /cspace-services/relations/${GetRelationsAsObjectForBagOfWhiteChessPieces.got("//relation-list-item[2]/csid")} + /cspace-services/relations/${GetRelationsToBagOfWhiteChessPiecesAsObject.got("//relation-list-item[2]/csid")} - + GET /cspace-services/relations?obj=${CreateBagOfBlackChessPieces.CSID} 200 DELETE - /cspace-services/relations/${GetRelationsAsObjectForBagOfBlackChessPieces.got("//relation-list-item[1]/csid")} + /cspace-services/relations/${GetRelationsToBagOfBlackChessPiecesAsObject.got("//relation-list-item[1]/csid")} DELETE - /cspace-services/relations/${GetRelationsAsObjectForBagOfBlackChessPieces.got("//relation-list-item[2]/csid")} + /cspace-services/relations/${GetRelationsToBagOfBlackChessPiecesAsObject.got("//relation-list-item[2]/csid")} + + + + GET + /cspace-services/relations?obj=${CreateBlackRook.CSID} + 200 + + + DELETE + /cspace-services/relations/${GetRelationsToBlackRookAsObject.got("//relation-list-item[1]/csid")} + + + DELETE + /cspace-services/relations/${GetRelationsToBlackRookAsObject.got("//relation-list-item[2]/csid")} + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/1-collectionobject.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/1-collectionobject-create.xml similarity index 100% rename from services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/1-collectionobject.xml rename to services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/1-collectionobject-create.xml diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/2-collectionobject-create-with-parent-csid.xml similarity index 84% rename from services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml rename to services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/2-collectionobject-create-with-parent-csid.xml index a7a875090..a50a5e848 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/2-collectionobject-create-with-parent-csid.xml @@ -9,9 +9,8 @@ - - - + + - hasBroader + ${itemCSID} CollectionObject + + hasBroader + ${parentCSID} CollectionObject diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/3-collectionobject-create-with-parent-child-csids.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/3-collectionobject-create-with-parent-child-csids.xml new file mode 100644 index 000000000..26fe85060 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/3-collectionobject-create-with-parent-child-csids.xml @@ -0,0 +1,60 @@ + + + + + ${objectNumber} + + + + + + + + + + + + + + ${itemCSID} + CollectionObject + + + hasBroader + + + ${parentCSID} + CollectionObject + + + + + + + + ${childCSID} + CollectionObject + + + hasBroader + + + ${itemCSID} + CollectionObject + + + + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/3-collectionobjects-with-relations-update.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/4-collectionobject-update-with-parent-csid.xml similarity index 86% rename from services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/3-collectionobjects-with-relations-update.xml rename to services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/4-collectionobject-update-with-parent-csid.xml index e5b7756e6..52a19209b 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/3-collectionobjects-with-relations-update.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/4-collectionobject-update-with-parent-csid.xml @@ -11,8 +11,9 @@ xmlns:ns2="http://collectionspace.org/services/jaxb"> diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/5-collectionobject-update-with-parent-child-csids.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/5-collectionobject-update-with-parent-child-csids.xml new file mode 100644 index 000000000..b8c2620e2 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/5-collectionobject-update-with-parent-child-csids.xml @@ -0,0 +1,67 @@ + + + + + ${objectNumber} + ${distinguishingFeatures} + + + + + + + + + + + + ${currentItemCSID} + CollectionObject + + + hasBroader + + + ${parentCSID} + CollectionObject + + + + + + + + ${child1CSID} + CollectionObject + + + hasBroader + + + ${currentItemCSID} + CollectionObject + + + + + + + + ${child2CSID} + CollectionObject + + + hasBroader + + + ${currentItemCSID} + CollectionObject + + + + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-relations-bottom-level.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-relations-bottom-level.res.xml index 82d417c3a..87e8937ee 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-relations-bottom-level.res.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-relations-bottom-level.res.xml @@ -17,11 +17,11 @@ hasBroader - ${blackRookCSID} + ${blackRookFragment1CSID} CollectionObject - ${bagOfBlackChessPiecesCSID} + ${blackRookCSID} CollectionObject diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-siblings-bottom-level.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-siblings-bottom-level.res.xml index 1bcc3bdc6..2f677441a 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-siblings-bottom-level.res.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-siblings-bottom-level.res.xml @@ -4,24 +4,26 @@ 0 1 1 + - ${blackQueenCSID} - ${bagOfBlackChessPiecesCSID} hasBroader - ${blackQueenCSID} + ${blackRookFragment2CSID} + CollectionObject - ${bagOfBlackChessPiecesCSID} + ${blackRookCSID} + CollectionObject + -- 2.47.3