From 3909db5ab8bcead6c0438d8f484c538ca40c190b Mon Sep 17 00:00:00 2001 From: Laramie Crocker Date: Tue, 3 May 2011 00:40:43 +0000 Subject: [PATCH] CSPACE-3739 Added tests to XmlReplay to ensure that Organization and Location behave identically to the Person service regarding hierarchic authority behavior. Tested creating item, child items, parent item, relating all through POST of item, and getting lists of relations and siblings --- .../location/hierarchy/1-authority.xml | 10 ++ .../xmlreplay/location/hierarchy/2-item.xml | 22 +++ .../hierarchy/3-locations_w_relations.xml | 67 +++++++++ .../hierarchy/res/Get_allRelations.res.xml | 66 +++++++++ .../hierarchy/res/Get_siblings.res.xml | 34 +++++ .../xmlreplay/location/location-hierarchy.xml | 136 ++++++++++++++++++ .../organization/hierarchy/1-authority.xml | 11 ++ .../organization/hierarchy/2-item.xml | 18 +++ .../hierarchy/3-organizations_w_relations.xml | 67 +++++++++ .../hierarchy/res/Get_allRelations.res.xml | 66 +++++++++ .../hierarchy/res/Get_siblings.res.xml | 34 +++++ .../organization/organization-hierarchy.xml | 136 ++++++++++++++++++ 12 files changed, 667 insertions(+) create mode 100644 services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/1-authority.xml create mode 100644 services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/2-item.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/3-locations_w_relations.xml create mode 100644 services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/res/Get_allRelations.res.xml create mode 100644 services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/res/Get_siblings.res.xml create mode 100644 services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/location-hierarchy.xml create mode 100644 services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/hierarchy/1-authority.xml create mode 100644 services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/hierarchy/2-item.xml create mode 100755 services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/hierarchy/3-organizations_w_relations.xml create mode 100644 services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/hierarchy/res/Get_allRelations.res.xml create mode 100644 services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/hierarchy/res/Get_siblings.res.xml create mode 100644 services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/organization-hierarchy.xml diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/1-authority.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/1-authority.xml new file mode 100644 index 000000000..e59d787d3 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/1-authority.xml @@ -0,0 +1,10 @@ + + + + ${displayName} + ${shortIdentifier} + urn:cspace:org.collectionspace.demo:locationauthority:name(${shortIdentifier})'${displayName}' + LocationAuthority + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/2-item.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/2-item.xml new file mode 100644 index 000000000..b30f6ed68 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/2-item.xml @@ -0,0 +1,22 @@ + + + + ${shortIdentifier} + urn:cspace:org.collectionspace.demo:locationauthority:name(${authShortIdentifier}):location:name(${shortIdentifier}) + Approved + true + false + ${name} + + + Basically clean + June 11, 1979 + + + Kind of safe + Only right-thinkers may see +
123 Main Street, Anytown USA
+ Shelf +
+
+ diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/3-locations_w_relations.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/3-locations_w_relations.xml new file mode 100755 index 000000000..53d565663 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/3-locations_w_relations.xml @@ -0,0 +1,67 @@ + + + + ${inAuthority} + ${shortIdentifier} + urn:cspace:org.collectionspace.demo:locationauthority:name(${authShortIdentifier}):location:name(${shortIdentifier})'${name}' + ${name} + false + true + + + + + hasBroader + + ${itemCSID} + Location + + + ${parentCSID} + ${parentUri} + Location + + + + hasBroader + + ${childCSID} + ${childUri} + Location + + + ${itemCSID} + Location + + + + hasBroader + + ${child2Uri} + ${child2CSID} + Location + + + ${itemCSID} + Location + + + + hasBroader + + ${child3Uri} + ${child3CSID} + Location + + + ${itemCSID} + Location + + + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/res/Get_allRelations.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/res/Get_allRelations.res.xml new file mode 100644 index 000000000..d3773ec53 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/res/Get_allRelations.res.xml @@ -0,0 +1,66 @@ + + + + 4 + + + + + ${Location1.CSID} + ${LocationParent.CSID} + hasBroader + + ${Location1.CSID} + + + ${LocationParent.CSID} + + + + + ${LocationChild1.CSID} + ${Location1.CSID} + hasBroader + + ${LocationChild1.CSID} + + + ${Location1.CSID} + + + + + ${LocationChild2.CSID} + ${Location1.CSID} + hasBroader + + ${LocationChild2.CSID} + + + ${Location1.CSID} + + + + + ${LocationChild3.CSID} + ${Location1.CSID} + hasBroader + + ${LocationChild3.CSID} + + + ${Location1.CSID} + + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/res/Get_siblings.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/res/Get_siblings.res.xml new file mode 100644 index 000000000..ff3b5122f --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/res/Get_siblings.res.xml @@ -0,0 +1,34 @@ + + + johnWayneActorChild + + + 0 + 2 + 2 + subjectCsid|relationshipType|predicateDisplayName|objectCsid|uri|csid|subject|object + + ${child2CSID} + hasBroader + ${locationCSID} + + ${child2CSID} + + + ${locationCSID} + + + + ${child3CSID} + hasBroader + ${locationCSID} + + ${child3CSID} + + + ${locationCSID} + + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/location-hierarchy.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/location-hierarchy.xml new file mode 100644 index 000000000..cffe39885 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/location-hierarchy.xml @@ -0,0 +1,136 @@ + + + + + + POST + /cspace-services/locationauthorities/ + location/hierarchy/1-authority.xml + + CSPACE3739LocationAuthority + + + + POST + /cspace-services/locationauthorities/${LocationAuth1.CSID}/items/ + location/hierarchy/2-item.xml + + ${LocationAuth1.CSID} + CSPACE3739LocationAuthority + Shelf1 + Shelf 1 + + + + POST + /cspace-services/locationauthorities/${LocationAuth1.CSID}/items/ + location/hierarchy/2-item.xml + + ${LocationAuth1.CSID} + CSPACE3739LocationAuthority + Shelf2 + Shelf 2 + + + + POST + /cspace-services/locationauthorities/${LocationAuth1.CSID}/items/ + location/hierarchy/2-item.xml + + ${LocationAuth1.CSID} + CSPACE3739LocationAuthority + Shelf3 + Shelf 3 + + + + + POST + /cspace-services/locationauthorities/urn:cspace:name(CSPACE3739LocationAuthority)/items/ + location/hierarchy/2-item.xml + + ${LocationAuth1.CSID} + CSPACE3739LocationAuthority + Aisle3 + Aisle 3 + + + + + POST + /cspace-services/locationauthorities/urn:cspace:name(CSPACE3739LocationAuthority)/items/ + location/hierarchy/3-locations_w_relations.xml + + ${LocationAuth1.CSID} + CSPACE3739LocationAuthority + Cabinet1 + Cabinet 1 + ${LocationParent.CSID} + /cspace-services/locationauthorities/urn:cspace:name(CSPACE3739LocationAuthority)/items/${LocationParent.CSID} + ${LocationChild1.CSID} + /cspace-services/locationauthorities/urn:cspace:name(CSPACE3739LocationAuthority)/items/${LocationChild1.CSID} + ${LocationChild2.CSID} + /cspace-services/locationauthorities/urn:cspace:name(CSPACE3739LocationAuthority)/items/${LocationChild2.CSID} + ${LocationChild3.CSID} + /cspace-services/locationauthorities/urn:cspace:name(CSPACE3739LocationAuthority)/items/${LocationChild3.CSID} + + + + + GET + /cspace-services/locationauthorities/${LocationAuth1.CSID}/items/${Location1.CSID}?showRelations=true + + + + + GET + /cspace-services/locationauthorities/${LocationAuth1.CSID}/items/${LocationChild1.CSID}?showSiblings=true + + + location/hierarchy/res/Get_siblings.res.xml + + ${Location1.CSID} + ${LocationChild1.CSID} + ${LocationChild2.CSID} + + /document/*[local-name()='relations-common-list'] + + + + + GET + /cspace-services/locationauthorities/${LocationAuth1.CSID}/items/${Location1.CSID}?showAllRelations=true + + + location/hierarchy/res/Get_allRelations.res.xml + + /document/*[local-name()='relations-common-list'] + + + + + + GET + /cspace-services/relations/ + + + + GET + /cspace-services/relations?sbj=${Location1.CSID} + + + + GET + /cspace-services/relations?obj=${Location1.CSID} + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/hierarchy/1-authority.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/hierarchy/1-authority.xml new file mode 100644 index 000000000..c58cf0ce6 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/hierarchy/1-authority.xml @@ -0,0 +1,11 @@ + + + + ${shortIdentifier} + ${displayName} + urn:cspace:org.collectionspace.demo:orgauthority:name(${shortIdentifier})'${displayName}' + OrgAuthority + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/hierarchy/2-item.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/hierarchy/2-item.xml new file mode 100644 index 000000000..efb3fba28 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/hierarchy/2-item.xml @@ -0,0 +1,18 @@ + + + + ${shortIdentifier} + urn:cspace:org.collectionspace.demo:orgauthority:name(${authShortIdentifier}):organization:name(${shortIdentifier}) + true + true + + + Test Organization Name + Test Organization-1304380224057 + + + Anytown, USA + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/hierarchy/3-organizations_w_relations.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/hierarchy/3-organizations_w_relations.xml new file mode 100755 index 000000000..ed27f0139 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/hierarchy/3-organizations_w_relations.xml @@ -0,0 +1,67 @@ + + + + ${inAuthority} + ${shortIdentifier} + urn:cspace:org.collectionspace.demo:organizationauthority:name(${authShortIdentifier}):organization:name(${shortIdentifier})'${name}' + ${name} + false + true + + + + + hasBroader + + ${itemCSID} + Organization + + + ${parentCSID} + ${parentUri} + Organization + + + + hasBroader + + ${childCSID} + ${childUri} + Organization + + + ${itemCSID} + Organization + + + + hasBroader + + ${child2Uri} + ${child2CSID} + Organization + + + ${itemCSID} + Organization + + + + hasBroader + + ${child3Uri} + ${child3CSID} + Organization + + + ${itemCSID} + Organization + + + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/hierarchy/res/Get_allRelations.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/hierarchy/res/Get_allRelations.res.xml new file mode 100644 index 000000000..b400c4e49 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/hierarchy/res/Get_allRelations.res.xml @@ -0,0 +1,66 @@ + + + + 4 + + + + + ${Organization1.CSID} + ${OrganizationParent.CSID} + hasBroader + + ${Organization1.CSID} + + + ${OrganizationParent.CSID} + + + + + ${OrganizationChild1.CSID} + ${Organization1.CSID} + hasBroader + + ${OrganizationChild1.CSID} + + + ${Organization1.CSID} + + + + + ${OrganizationChild2.CSID} + ${Organization1.CSID} + hasBroader + + ${OrganizationChild2.CSID} + + + ${Organization1.CSID} + + + + + ${OrganizationChild3.CSID} + ${Organization1.CSID} + hasBroader + + ${OrganizationChild3.CSID} + + + ${Organization1.CSID} + + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/hierarchy/res/Get_siblings.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/hierarchy/res/Get_siblings.res.xml new file mode 100644 index 000000000..07425c06b --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/hierarchy/res/Get_siblings.res.xml @@ -0,0 +1,34 @@ + + + johnWayneActorChild + + + 0 + 2 + 2 + subjectCsid|relationshipType|predicateDisplayName|objectCsid|uri|csid|subject|object + + ${child2CSID} + hasBroader + ${organizationCSID} + + ${child2CSID} + + + ${organizationCSID} + + + + ${child3CSID} + hasBroader + ${organizationCSID} + + ${child3CSID} + + + ${organizationCSID} + + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/organization-hierarchy.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/organization-hierarchy.xml new file mode 100644 index 000000000..724908b4c --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/organization/organization-hierarchy.xml @@ -0,0 +1,136 @@ + + + + + + POST + /cspace-services/orgauthorities/ + organization/hierarchy/1-authority.xml + + CSPACE3739OrganizationAuthority + + + + POST + /cspace-services/orgauthorities/${OrganizationAuth1.CSID}/items/ + organization/hierarchy/2-item.xml + + ${OrganizationAuth1.CSID} + CSPACE3739OrganizationAuthority + Shelf1 + Shelf 1 + + + + POST + /cspace-services/orgauthorities/${OrganizationAuth1.CSID}/items/ + organization/hierarchy/2-item.xml + + ${OrganizationAuth1.CSID} + CSPACE3739OrganizationAuthority + Shelf2 + Shelf 2 + + + + POST + /cspace-services/orgauthorities/${OrganizationAuth1.CSID}/items/ + organization/hierarchy/2-item.xml + + ${OrganizationAuth1.CSID} + CSPACE3739OrganizationAuthority + Shelf3 + Shelf 3 + + + + + POST + /cspace-services/orgauthorities/urn:cspace:name(CSPACE3739OrganizationAuthority)/items/ + organization/hierarchy/2-item.xml + + ${OrganizationAuth1.CSID} + CSPACE3739OrganizationAuthority + Aisle3 + Aisle 3 + + + + + POST + /cspace-services/orgauthorities/urn:cspace:name(CSPACE3739OrganizationAuthority)/items/ + organization/hierarchy/3-organizations_w_relations.xml + + ${OrganizationAuth1.CSID} + CSPACE3739OrganizationAuthority + Cabinet1 + Cabinet 1 + ${OrganizationParent.CSID} + /cspace-services/orgauthorities/urn:cspace:name(CSPACE3739OrganizationAuthority)/items/${OrganizationParent.CSID} + ${OrganizationChild1.CSID} + /cspace-services/orgauthorities/urn:cspace:name(CSPACE3739OrganizationAuthority)/items/${OrganizationChild1.CSID} + ${OrganizationChild2.CSID} + /cspace-services/orgauthorities/urn:cspace:name(CSPACE3739OrganizationAuthority)/items/${OrganizationChild2.CSID} + ${OrganizationChild3.CSID} + /cspace-services/orgauthorities/urn:cspace:name(CSPACE3739OrganizationAuthority)/items/${OrganizationChild3.CSID} + + + + + GET + /cspace-services/orgauthorities/${OrganizationAuth1.CSID}/items/${Organization1.CSID}?showRelations=true + + + + + GET + /cspace-services/orgauthorities/${OrganizationAuth1.CSID}/items/${OrganizationChild1.CSID}?showSiblings=true + + + organization/hierarchy/res/Get_siblings.res.xml + + ${Organization1.CSID} + ${OrganizationChild1.CSID} + ${OrganizationChild2.CSID} + + /document/*[local-name()='relations-common-list'] + + + + + GET + /cspace-services/orgauthorities/${OrganizationAuth1.CSID}/items/${Organization1.CSID}?showAllRelations=true + + + organization/hierarchy/res/Get_allRelations.res.xml + + /document/*[local-name()='relations-common-list'] + + + + + + GET + /cspace-services/relations/ + + + + GET + /cspace-services/relations?sbj=${Organization1.CSID} + + + + GET + /cspace-services/relations?obj=${Organization1.CSID} + + + + -- 2.47.3