From 010281c54ddf64bf15b935a0ceb1e099e1448fab Mon Sep 17 00:00:00 2001 From: Aron Roberts Date: Mon, 13 May 2013 20:36:48 -0700 Subject: [PATCH] CSPACE-5304: Initial attempt at writing an XmlReplay-based test of the contents of a generated report. This is still a placeholder, basically just verifying that, with a report returned using the 'application/xml' MIME type, the resultant document can be parsed by an XML parser, in XmlReplay's context. Attempts to verify additional fidelity to an expected document have failed so far. --- .../report/{ac1.xml => acquisition1.xml} | 32 ++--- .../test-data/xmlreplay/report/report.xml | 131 +++++++----------- .../test-data/xmlreplay/report/report1.xml | 17 --- .../report/report1InvContextStandalone.xml | 10 +- .../xmlreplay/report/report1Record.xml | 17 +++ .../xmlreplay/report/res/report1.res.xml | 5 + 6 files changed, 95 insertions(+), 117 deletions(-) rename services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/{ac1.xml => acquisition1.xml} (91%) delete mode 100644 services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/report1.xml create mode 100644 services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/report1Record.xml create mode 100644 services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/res/report1.res.xml diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/ac1.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/acquisition1.xml similarity index 91% rename from services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/ac1.xml rename to services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/acquisition1.xml index 99747809b..7fafcf38f 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/ac1.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/acquisition1.xml @@ -1,16 +1,16 @@ - - - - Ac2011.1.2 - usd - 2011-07-04 - 2011-07-04 - usd - Bargain - purchase - 1 - usd - urn:cspace:org.collectionspace.demo:personauthority:id(4c300397-746f-48f0-bc29):person:id(fadd6312-486e-4ada-92c9)'Patrick+Schmitz' - - - + + + + ${acquisitionReferenceNumber} + usd + 2011-07-04 + 2011-07-04 + usd + Bargain + purchase + 1 + usd + urn:cspace:org.collectionspace.demo:personauthority:id(4c300397-746f-48f0-bc29):person:id(fadd6312-486e-4ada-92c9)'Patrick+Schmitz' + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/report.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/report.xml index ae99dd207..951c8d4d7 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/report.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/report.xml @@ -1,83 +1,56 @@ - - - YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= - - - - POST - /cspace-services/reports/ - report/report1.xml - - - GET - /cspace-services/reports/${createReport1.CSID} - - - POST - /cspace-services/acquisitions/ - report/ac1.xml - - - - - + + + + YWRtaW5AY29yZS5jb2xsZWN0aW9uc3BhY2Uub3JnOkFkbWluaXN0cmF0b3I= + + + + + + POST + /cspace-services/reports/ + report/report1Record.xml + 201 + + + GET + /cspace-services/reports/${createReport1.CSID} + + + + POST + /cspace-services/acquisitions/ + report/acquisition1.xml + + Ac2011.1.2-jdlmbsoq + + 201 + + + + POST + /cspace-services/reports/${createReport1.CSID} + report/report1InvContextStandalone.xml + + ${createAcquisition1.CSID} + + + + report/res/report1.res.xml + + ${createAcquisition1.acquisitionReferenceNumber} + + + 200 + + + + + + + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/report1.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/report1.xml deleted file mode 100644 index 1f1d813ef..000000000 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/report1.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - Acquisition Summary - Just a few fields about a single acquisition - - Acquisition - - true - false - false - true - acq_basic.jasper - application/pdf - - diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/report1InvContextStandalone.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/report1InvContextStandalone.xml index ffed4b3ff..ba95d818f 100644 --- a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/report1InvContextStandalone.xml +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/report1InvContextStandalone.xml @@ -1,10 +1,10 @@ - single - Acquisition - 605e9252-598d-4459-8380 + xmlns:ns2="http://collectionspace.org/services/common/invocable" + xmlns:ns3="http://collectionspace.org/services/jaxb"> + single + Acquisition + ${acquisitionCSID} diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/report1Record.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/report1Record.xml new file mode 100644 index 000000000..33f1bb8da --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/report1Record.xml @@ -0,0 +1,17 @@ + + + + Acquisition Summary Test + Just a few fields about a single acquisition + + Acquisition + + true + false + false + true + acq_basic.jasper + application/xml + + diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/res/report1.res.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/res/report1.res.xml new file mode 100644 index 000000000..d7d04d5a5 --- /dev/null +++ b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/report/res/report1.res.xml @@ -0,0 +1,5 @@ + + + + + -- 2.47.3