Fix bug when test are in error
authorBruno Sinou <bsinou@argeo.org>
Thu, 17 Jan 2013 21:46:25 +0000 (21:46 +0000)
committerBruno Sinou <bsinou@argeo.org>
Thu, 17 Jan 2013 21:46:25 +0000 (21:46 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@6041 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/JcrTestResult.java

index a27217811938bc95310773dad8324abd74f19c42..45de6597aacdfb30313a5cd88c7eb1600699e765 100644 (file)
@@ -127,15 +127,22 @@ public class JcrTestResult implements TestResult, SlcNames, AttachmentsEnabled {
 
        public void addResultPart(TestResultPart testResultPart) {
                Node node = getNode();
+               
                try {
+               
+                       // error
+            if (testResultPart.getExceptionMessage() != null)
+                    JcrUtils.discardQuietly(node.getSession());
+                       node.getSession().save();
+                       
                        // add the new result part, retrieving status information
                        Node resultPartNode = node.addNode(SlcNames.SLC_RESULT_PART,
                                        SlcTypes.SLC_CHECK);
                        resultPartNode.setProperty(SLC_SUCCESS,
                                        testResultPart.getStatus() == TestStatus.PASSED);
-                       if (testResultPart.getMessage() != null)
-                               resultPartNode.setProperty(SLC_MESSAGE,
-                                               testResultPart.getMessage());
+                       // if (testResultPart.getMessage() != null)
+                       // resultPartNode.setProperty(SLC_MESSAGE,
+                       // testResultPart.getMessage());
                        if (testResultPart.getStatus() == TestStatus.ERROR) {
                                resultPartNode.setProperty(SLC_ERROR_MESSAGE,
                                                (testResultPart.getExceptionMessage() == null) ? ""