]> git.argeo.org Git - gpl/argeo-slc.git/commitdiff
Make tree test result less restrictive (warn instead of throwing an exception)
authorMathieu Baudier <mbaudier@argeo.org>
Sun, 29 Jun 2008 20:09:07 +0000 (20:09 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Sun, 29 Jun 2008 20:09:07 +0000 (20:09 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@1338 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

org.argeo.slc.core/src/main/java/org/argeo/slc/core/test/tree/TreeTestResult.java

index 781c6eee2a1cc29124f4cf4eee44d82d29133633..418ab62b4ae1fb4d4c26413dfb5868b9a32a6d31 100644 (file)
@@ -50,9 +50,12 @@ public class TreeTestResult implements TestResult, StructureAware<TreeSPath>,
        }\r
 \r
        public void addResultPart(TestResultPart part) {\r
-               if (currentPath == null) {\r
+               if (isClosed)\r
+                       throw new SlcException("Cannot result parts to a closed result");\r
+\r
+               if (currentPath == null)\r
                        throw new SlcException("No current path set.");\r
-               }\r
+\r
                PartSubList subList = resultParts.get(currentPath);\r
                if (subList == null) {\r
                        subList = new PartSubList();\r
@@ -109,9 +112,11 @@ public class TreeTestResult implements TestResult, StructureAware<TreeSPath>,
 \r
        public void close() {\r
                if (isClosed) {\r
-                       throw new SlcException("Test Result #" + getUuid()\r
-                                       + " already closed.");\r
+                       log.warn("Test Result #" + getUuid()\r
+                                       + " already closed. Doing nothing.");\r
+                       return;\r
                }\r
+\r
                closeDate = new Date();\r
 \r
                synchronized (listeners) {\r