From: remillet Date: Wed, 24 Jan 2018 07:37:09 +0000 (-0800) Subject: DRYD-202: XMLReplay test cleanup. X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=8b0915d2b3ee764bd1c8cdc7cc4d858065403eb1;p=tmp%2Fjakarta-migration.git DRYD-202: XMLReplay test cleanup. --- diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/object-exit.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/object-exit.xml index 244dbaeef..c9628f926 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/object-exit.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/object-exit.xml @@ -12,14 +12,14 @@ http://nightly.collectionspace.org:8180/cspace-services/objectexit/d781aed4-2e2c-45e2-ad8d/authorityrefs --> - + POST /cspace-services/personauthorities/ objectexit/oe9.xml POST - /cspace-services/personauthorities/${oe9.CSID}/items/ + /cspace-services/personauthorities/${oe9_authrefs.CSID}/items/ objectexit/oe11.xml @@ -37,7 +37,7 @@ - + POST /cspace-services/objectexit/ @@ -58,7 +58,7 @@ - + POST /cspace-services/objectexit/ @@ -66,7 +66,7 @@ GET - /cspace-services/objectexit/${oe1.CSID} + /cspace-services/objectexit/${oe1x.CSID} objectexit/res/oe2.res.xml @@ -95,37 +95,19 @@ ${oe35.CSID} //list-item[./exitNumber='checkList-1234'] - - - DELETE - /cspace-services/objectexit/065aa56e-a4f5-44b7-955e - - - DELETE - /cspace-services/objectexit/1735327c-f9bb-42c7-959b - - - DELETE - /cspace-services/objectexit/106cb53d-ee79-44e3-8665 - - - - + POST /cspace-services/objectexit/ - - - objectexit/oe1.xml - + objectexit/oe1.xml GET @@ -145,10 +127,7 @@ POST /cspace-services/objectexit/ - - - objectexit/oeRepeat.xml - + objectexit/oeRepeat.xml @@ -158,10 +137,7 @@ POST /cspace-services/objectexit/ - - - objectexit/oe1.xml - + objectexit/oe1.xml GET @@ -174,26 +150,17 @@ POST /cspace-services/objectexit/ - - - objectexit/oe3.xml - + objectexit/oe3.xml POST /cspace-services/objectexit/ - - - objectexit/oe4.xml - + objectexit/oe4.xml POST /cspace-services/objectexit/ - - - objectexit/oe5.xml - + objectexit/oe5.xml - + objectexit/oe23.xml 404 @@ -354,7 +300,6 @@ DELETE /cspace-services/objectexit/${oe5.CSID} - @@ -363,34 +308,22 @@ POST /cspace-services/objectexit/ - - - objectexit/oe1.xml - + objectexit/oe1.xml POST /cspace-services/objectexit/ - - - objectexit/oe3.xml - + objectexit/oe3.xml POST /cspace-services/objectexit/ - - - objectexit/oe4.xml - + objectexit/oe4.xml POST /cspace-services/objectexit/ - - - objectexit/oe5.xml - + objectexit/oe5.xml GET diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe1.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe1.xml index 1e94f2838..e0274d2ee 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe1.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe1.xml @@ -1,10 +1,7 @@ - + urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum' objectexitNumber-1290026472360 - diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe13.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe13.xml index 6dfd4603d..903212b8c 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe13.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe13.xml @@ -1,2 +1,17 @@ -7f441679-ab83-4832-85f9davenportDepositorurn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor)truetrueDavenportDepositor - + + + + davenportDepositor + Davenport + Depositor + + + John Wayneoe13 + false + John Wayneoe13 + oe13forename + oe13surname + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe23.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe23.xml index 01e31df12..be34b21da 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe23.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe23.xml @@ -1,2 +1,7 @@ -urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'updated-objectexitNumber-1290026472360 - + + + + urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum' + updated-objectexitNumber-1290026472360 + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe3.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe3.xml index 44d98316f..859e42af6 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe3.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe3.xml @@ -1,2 +1,7 @@ -urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'objectexitNumber-1290026473391 - + + + + urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum' + objectexitNumber-1290026473391 + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe35.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe35.xml index 988c995d4..8c6ad72eb 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe35.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe35.xml @@ -1,10 +1,7 @@ - + urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum' ${exitNumber} - diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe4.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe4.xml index 2554e2859..fb252720b 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe4.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe4.xml @@ -1,2 +1,7 @@ -urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'objectexitNumber-1290026473626 - + + + + urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum' + objectexitNumber-1290026473626 + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe5.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe5.xml index 5d82a1e2b..0a076ad8a 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe5.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe5.xml @@ -1,2 +1,7 @@ -urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum'objectexitNumber-1290026473860 - + + + + urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum' + objectexitNumber-1290026473860 + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe9.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe9.xml index ca8c61e8e..0b8559a84 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe9.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oe9.xml @@ -1,5 +1,5 @@ - + ObjectexitPersonAuth ObjectexitPersonAuth diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oeObject.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oeObject.xml index 2db2785ce..9a5a9d8cf 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oeObject.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oeObject.xml @@ -1,9 +1,9 @@ - - ${depositor} - ${currentOwner} - exitDate-1290026474563 - ${exitNumber} - + + + ${depositor} + ${currentOwner} + exitDate-1290026474563 + ${exitNumber} + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oeRepeat.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oeRepeat.xml index 38eeff9a3..5b61ce9a3 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oeRepeat.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/oeRepeat.xml @@ -1,11 +1,10 @@ - - urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum' - objectexitNumber-1290026472360 - - courier - - - + + + urn:cspace:org.collectionspace.demo:orgauthority:name(TestOrgAuth):organization:name(Northern Climes Museum)'Northern Climes Museum' + objectexitNumber-1290026472360 + + courier + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/oe6.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/oe6.res.xml index 0518b77ee..c9cab3aeb 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/oe6.res.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/objectexit/res/oe6.res.xml @@ -1,36 +1,31 @@ - - 0 - 40 - 4 - 4 - exitNumber|currentOwner|uri|csid + + 0 + 40 + 4 + 4 - - objectexitNumber-1290026473860 - /objectexit/${oe5.CSID} - ${oe5.CSID} - - - - objectexitNumber-1290026473391 - /objectexit/${oe3.CSID} - ${oe3.CSID} - - - - objectexitNumber-1290026473626 - /objectexit/${oe4.CSID} - ${oe4.CSID} - + + objectexitNumber-1290026473860 + /objectexit/${oe5.CSID} + ${oe5.CSID} + - - objectexitNumber-1290026472360 - /objectexit/${oe1.CSID} - ${oe1.CSID} - - + + objectexitNumber-1290026473391 + /objectexit/${oe3.CSID} + ${oe3.CSID} + + + objectexitNumber-1290026473626 + /objectexit/${oe4.CSID} + ${oe4.CSID} + + + objectexitNumber-1290026472360 + /objectexit/${oe1.CSID} + ${oe1.CSID} + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/res/authrefs-listAuthrefs.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/res/authrefs-listAuthrefs.xml deleted file mode 100644 index bc55d9643..000000000 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/res/authrefs-listAuthrefs.xml +++ /dev/null @@ -1,16 +0,0 @@ - - 0 - 40 - 1 - 1 - - objectexit_common:depositor - - urn:cspace:org.collectionspace.demo:personauthority:name(ObjectexitPersonAuth)'ObjectexitPersonAuth':person:name(davenportDepositor) - - ObjectexitPersonAuth - - /personauthorities/urn:cspace:name(ObjectexitPersonAuth)/items/urn:cspace:name(davenportDepositor) - - - \ No newline at end of file diff --git a/services/objectexit/client/src/test/java/org/collectionspace/services/client/test/ObjectExitAuthRefsTest.java b/services/objectexit/client/src/test/java/org/collectionspace/services/client/test/ObjectExitAuthRefsTest.java index ed4e8c4e4..5916fdf86 100644 --- a/services/objectexit/client/src/test/java/org/collectionspace/services/client/test/ObjectExitAuthRefsTest.java +++ b/services/objectexit/client/src/test/java/org/collectionspace/services/client/test/ObjectExitAuthRefsTest.java @@ -259,7 +259,8 @@ public class ObjectExitAuthRefsTest extends BaseServiceTest * may be expected to be deleted by certain tests. * @throws Exception */ - @AfterClass(alwaysRun = true) + @Override + @AfterClass(alwaysRun = true) public void cleanUp() throws Exception { String noTest = System.getProperty("noTestCleanup"); if (Boolean.TRUE.toString().equalsIgnoreCase(noTest)) { @@ -267,22 +268,30 @@ public class ObjectExitAuthRefsTest extends BaseServiceTest return; } logger.debug("Cleaning up temporary resources created for testing ..."); + // + // First delete the referring records + // + ObjectExitClient objectexitClient = new ObjectExitClient(); + for (String resourceId : objectexitIdsCreated) { + // Note: Any non-success responses are ignored and not reported. + objectexitClient.delete(resourceId).close(); + } + // + // Next, delete the terms + // PersonAuthorityClient personAuthClient = new PersonAuthorityClient(); // Delete Person resource(s) (before PersonAuthority resources). for (String resourceId : personIdsCreated) { // Note: Any non-success responses are ignored and not reported. personAuthClient.deleteItem(personAuthCSID, resourceId).close(); } - // Delete PersonAuthority resource(s). + // + // Lastly, delete PersonAuthority resource(s). // Note: Any non-success response is ignored and not reported. + // if (personAuthCSID != null) { personAuthClient.delete(personAuthCSID).close(); // Delete Loans In resource(s). - ObjectExitClient objectexitClient = new ObjectExitClient(); - for (String resourceId : objectexitIdsCreated) { - // Note: Any non-success responses are ignored and not reported. - objectexitClient.delete(resourceId).close(); - } } }