]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
NOJIRA: Added additional logging and error reporting to Import service.
authorremillet <remillet@yahoo.com>
Tue, 17 Oct 2017 21:25:42 +0000 (14:25 -0700)
committerremillet <remillet@yahoo.com>
Tue, 17 Oct 2017 21:25:42 +0000 (14:25 -0700)
services/IntegrationTests/README.txt [new file with mode: 0644]
services/imports/service/src/main/java/org/collectionspace/services/imports/ImportsResource.java

diff --git a/services/IntegrationTests/README.txt b/services/IntegrationTests/README.txt
new file mode 100644 (file)
index 0000000..35443bc
--- /dev/null
@@ -0,0 +1,13 @@
+To See XMLReplay test reports, look in the source directory: ..\services\IntegrationTests\target\xml-replay-reports\index.xml-replay-master.xml.html
+
+### To run a subset of XMLReplay tests
+
+Modify the dev-master.xml file to include just the tests you are debugging:
+       ..\services\services\IntegrationTests\src\test\resources\test-data\xmlreplay\dev-master.xml
+
+Then run this command:
+
+       mvn test -Dtest=XmlReplayDevTest -Dmaven.surefire.debug=true
+
+Notes on Using XMLReplay with CollectionSpace Services - http://wiki.collectionspace.org/display/~remillet/Notes+on+Using+XMLReplay+with+CollectionSpace+Services
+
index adc5e8ed4889c0c7cd37c1af46882187be9240d2..361bb37a57d57738b810bd67a01d8625e791c7b5 100644 (file)
@@ -203,7 +203,7 @@ public class ImportsResource extends AbstractCollectionSpaceResourceImpl<PoxPayl
        public Response create(@Context UriInfo ui,
                        String xmlPayload) {
                String result = null;
-               ResponseBuilder rb = Response.serverError();
+               ResponseBuilder rb = Response.serverError(); // Assume we'll fail to successfully fulfill the request.
                
                try {
             ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext(ui);
@@ -213,6 +213,9 @@ public class ImportsResource extends AbstractCollectionSpaceResourceImpl<PoxPayl
                        // result = createFromInputSource(inputSource);
                        String inputFilename = payloadToFilename(xmlPayload);
                        result = createFromFilename(inputFilename, timeout);
+                       if (result.contains("ERROR") == false) {
+                               rb = Response.ok(); // SUCCESS
+                       }
                rb.entity(result);
                } catch (Exception e) {
                result = e.getMessage();