]> git.argeo.org Git - gpl/argeo-slc.git/commitdiff
Don't close empty test results
authorMathieu Baudier <mbaudier@argeo.org>
Sun, 29 Jun 2008 21:41:28 +0000 (21:41 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Sun, 29 Jun 2008 21:41:28 +0000 (21:41 +0000)
Add warnIfAlreadyClosed property

git-svn-id: https://svn.argeo.org/slc/trunk@1344 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

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

index 418ab62b4ae1fb4d4c26413dfb5868b9a32a6d31..3e365afe0822c6f28b51f3f835d89189a6fd7328 100644 (file)
@@ -35,7 +35,9 @@ public class TreeTestResult implements TestResult, StructureAware<TreeSPath>,
 \r
        private Date closeDate;\r
 \r
-       private boolean isClosed = false;\r
+       private Boolean isClosed = false;\r
+\r
+       private Boolean warnIfAlreadyClosed = true;\r
 \r
        private String uuid;\r
 \r
@@ -111,9 +113,17 @@ public class TreeTestResult implements TestResult, StructureAware<TreeSPath>,
        }\r
 \r
        public void close() {\r
+               if (resultParts.size() == 0) {\r
+                       if (log.isTraceEnabled())\r
+                               log.trace("Test Result #" + getUuid()\r
+                                               + " contains no results, no need to close it.");\r
+                       return;\r
+               }\r
+\r
                if (isClosed) {\r
-                       log.warn("Test Result #" + getUuid()\r
-                                       + " already closed. Doing nothing.");\r
+                       if (warnIfAlreadyClosed)\r
+                               log.warn("Test Result #" + getUuid()\r
+                                               + " already closed. Doing nothing.");\r
                        return;\r
                }\r
 \r
@@ -201,4 +211,9 @@ public class TreeTestResult implements TestResult, StructureAware<TreeSPath>,
        public void setAttributes(Map<String, String> attributes) {\r
                this.attributes = attributes;\r
        }\r
+\r
+       public void setWarnIfAlreadyClosed(Boolean warnIfAlreadyClosed) {\r
+               this.warnIfAlreadyClosed = warnIfAlreadyClosed;\r
+       }\r
+\r
 }\r