From 2058250a21df9fe2b30ba05635fe64b12cbad01e Mon Sep 17 00:00:00 2001 From: Aron Roberts Date: Mon, 10 Sep 2012 16:20:26 -0700 Subject: [PATCH] CSPACE-5520: Corrected XmlReplay-based tests of structured objects to create parent/child relationships with each create request. As Richard observed, when sending a relations-common-list payload with a record to be created, that payload must only include relations where that record is either a subject or object of the relationship. --- .../collectionobject-hierarchy.xml | 81 +++++++------------ ...ollectionobjects-with-relations-create.xml | 79 +++--------------- .../res/show-siblings-top-level.res.xml | 7 +- 3 files changed, 42 insertions(+), 125 deletions(-) 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 c68322b37..253074284 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 @@ -1,7 +1,7 @@ - + @@ -32,13 +32,14 @@ - + POST /cspace-services/collectionobjects - collectionobject/hierarchy/1-collectionobject.xml + collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml CSPACE-5518-ChessBoard + ${CreateChessSetBox.CSID} 201 @@ -50,12 +51,14 @@ + POST /cspace-services/collectionobjects - collectionobject/hierarchy/1-collectionobject.xml + collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml CSPACE-5518-BagOfWhiteChessPieces + ${CreateChessSetBox.CSID} 201 @@ -68,9 +71,10 @@ POST /cspace-services/collectionobjects - collectionobject/hierarchy/1-collectionobject.xml + collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml CSPACE-5518-BagOfBlackChessPieces + ${CreateChessSetBox.CSID} @@ -80,13 +84,15 @@ + POST /cspace-services/collectionobjects - collectionobject/hierarchy/1-collectionobject.xml + collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml CSPACE-5518-WhiteRook - + ${CreateBagOfWhiteChessPieces.CSID} + 201 @@ -94,12 +100,14 @@ /cspace-services/collectionobjects/${CreateWhiteRook.CSID} 200 + POST /cspace-services/collectionobjects - collectionobject/hierarchy/1-collectionobject.xml + collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml CSPACE-5518-WhiteBishop + ${CreateBagOfWhiteChessPieces.CSID} 201 @@ -108,12 +116,14 @@ /cspace-services/collectionobjects/${CreateWhiteBishop.CSID} 200 + POST /cspace-services/collectionobjects - collectionobject/hierarchy/1-collectionobject.xml + collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml CSPACE-5518-BlackQueen + ${CreateBagOfBlackChessPieces.CSID} 201 @@ -122,51 +132,20 @@ /cspace-services/collectionobjects/${CreateBlackQueen.CSID} 200 - - - - - - - - - - - + POST /cspace-services/collectionobjects collectionobject/hierarchy/2-collectionobjects-with-relations-create.xml CSPACE-5518-BlackRook - ${CreateChessSetBox.CSID} - ${CreateChessBoard.CSID} - ${CreateBagOfWhiteChessPieces.CSID} - ${CreateBagOfBlackChessPieces.CSID} - ${CreateWhiteRook.CSID} - ${CreateWhiteBishop.CSID} - ${CreateBlackQueen.CSID} + ${CreateBagOfBlackChessPieces.CSID} 201 GET - /cspace-services/collectionobjects/${CreateBlackRookWithRelations.CSID} + /cspace-services/collectionobjects/${CreateBlackRook.CSID} 200 @@ -193,12 +172,12 @@ PUT - /cspace-services/collectionobjects/${CreateBlackRookWithRelations.CSID} + /cspace-services/collectionobjects/${CreateBlackRook.CSID} collectionobject/hierarchy/3-collectionobjects-with-relations-update.xml This rook has two light brown striations on part of its base. + ${CreateBlackRook.CSID} ${CreateBagOfBlackChessPieces.CSID} - ${CreateBlackRookWithRelations.CSID} 200 @@ -237,7 +216,7 @@ ${CreateChessSetBox.CSID} ${CreateBagOfBlackChessPieces.CSID} ${CreateBlackQueen.CSID} - ${CreateBlackRookWithRelations.CSID} + ${CreateBlackRook.CSID} /document/*[local-name()='relations-common-list'] @@ -246,13 +225,13 @@ GET - /cspace-services/collectionobjects/${CreateBlackRookWithRelations.CSID}?showRelations=true + /cspace-services/collectionobjects/${CreateBlackRook.CSID}?showRelations=true collectionobject/hierarchy/res/show-relations-bottom-level.res.xml ${CreateBagOfBlackChessPieces.CSID} - ${CreateBlackRookWithRelations.CSID} + ${CreateBlackRook.CSID} /document/*[local-name()='relations-common-list'] @@ -264,7 +243,7 @@ GET - /cspace-services/collectionobjects/${CreateBagOfBlackChessPieces.CSID}?showSiblings=true + /cspace-services/collectionobjects/${CreateChessSetBox.CSID}?showSiblings=true 200 @@ -291,7 +270,7 @@ GET - /cspace-services/collectionobjects/${CreateBlackRookWithRelations.CSID}?showSiblings=true + /cspace-services/collectionobjects/${CreateBlackRook.CSID}?showSiblings=true 200 @@ -370,7 +349,7 @@ - - hasBroader - - ${chessBoardCSID} - CollectionObject - - - ${chessSetBoxCSID} - CollectionObject - - - - - hasBroader - - ${bagOfWhiteChessPiecesCSID} - CollectionObject - - - ${chessSetBoxCSID} - CollectionObject - - - - - hasBroader - - ${bagOfBlackChessPiecesCSID} - CollectionObject - - - ${chessSetBoxCSID} - CollectionObject - - - - - - - hasBroader - - ${whiteRookCSID} - CollectionObject - - - ${bagOfWhiteChessPiecesCSID} - CollectionObject - - - - - hasBroader - - ${whiteBishopCSID} - CollectionObject - - - ${bagOfWhiteChessPiecesCSID} - CollectionObject - - - hasBroader - ${blackQueenCSID} + ${itemCSID} CollectionObject - ${bagOfBlackChessPiecesCSID} + ${parentCSID} CollectionObject - - - diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-siblings-top-level.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-siblings-top-level.res.xml index 037092af7..5be49bd9a 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-siblings-top-level.res.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/collectionobject/hierarchy/res/show-siblings-top-level.res.xml @@ -7,10 +7,7 @@ Siblings of the chess board box: (none) --> - - 0 - 0 - 0 - + + -- 2.47.3