]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc.core/src/main/java/org/argeo/slc/core/test/tree/htmlreport/ResultPage.java
Various changes
[gpl/argeo-slc.git] / org.argeo.slc.core / src / main / java / org / argeo / slc / core / test / tree / htmlreport / ResultPage.java
index 8249c767685dc67aa63111c041373b61e869a4ba..69bba492e40caa7a7d488e41d5321daaee0b58cd 100644 (file)
@@ -40,11 +40,11 @@ class ResultPage {
         * @param result\r
         *            the result to dump\r
         */\r
-       protected void generate(StructureRegistry registry) {\r
+       protected void generate(StructureRegistry<TreeSPath> registry) {\r
                StringBuffer buf = new StringBuffer("");\r
                buf.append("<html>\n");\r
                buf.append("<header>");\r
-               buf.append("<title>Result #").append(result.getTestResultId());\r
+               buf.append("<title>Result #").append(result.getUuid());\r
                buf.append("</title>\n");\r
                report.addStyles(buf);\r
                buf.append("</header>\n");\r
@@ -53,8 +53,7 @@ class ResultPage {
 \r
                // Header\r
                buf.append("<a name=\"top\"/>\n");\r
-               buf.append("<h1>Result #").append(result.getTestResultId()).append(\r
-                               "</h1>\n");\r
+               buf.append("<h1>Result #").append(result.getUuid()).append("</h1>\n");\r
                Date closeDate = result.getCloseDate();\r
                if (closeDate == null) {\r
                        buf.append("[Not closed]");\r
@@ -78,7 +77,8 @@ class ResultPage {
                }\r
        }\r
 \r
-       private void generateToc(StringBuffer buf, StructureRegistry registry) {\r
+       private void generateToc(StringBuffer buf,\r
+                       StructureRegistry<TreeSPath> registry) {\r
                buf.append("<h2>Overview</h2>\n");\r
                SortedMap<TreeSPath, Integer> toc = new TreeMap<TreeSPath, Integer>();\r
                for (TreeSPath path : result.getResultParts().keySet()) {\r
@@ -114,7 +114,7 @@ class ResultPage {
                        if (registry != null) {\r
                                StructureElement element = registry.getElement(path);\r
                                if (element != null) {\r
-                                       buf.append(element.getDescription());\r
+                                       buf.append(element.getLabel());\r
                                } else {\r
                                        buf.append(path.getName());\r
                                }\r
@@ -128,7 +128,8 @@ class ResultPage {
                buf.append("<hr/>\n");\r
        }\r
 \r
-       private void generatePartsList(StringBuffer buf, StructureRegistry registry) {\r
+       private void generatePartsList(StringBuffer buf,\r
+                       StructureRegistry<TreeSPath> registry) {\r
                for (TreeSPath path : result.getResultParts().keySet()) {\r
                        buf.append("<p>\n");\r
                        buf.append("<a name=\"").append(anchor(path)).append("\"></a>");\r
@@ -142,6 +143,8 @@ class ResultPage {
                        int displayedIndex = 1;// for display only\r
                        for (TestResultPart part : subList.getParts()) {\r
                                SimpleResultPart sPart = (SimpleResultPart) part;\r
+                               buf.append("Related Test Run Id:").append(\r
+                                               sPart.getTestRunUuid()).append("<br/>\n");\r
                                String clss = "";\r
                                if (sPart.getStatus().equals(TestStatus.PASSED)) {\r
                                        clss = "passed";\r
@@ -157,15 +160,7 @@ class ResultPage {
                                if (sPart.getStatus().equals(TestStatus.ERROR)) {\r
                                        buf\r
                                                        .append("<p><b>An unexpected error prevented the test to run properly.</b>");\r
-                                       Throwable exception = sPart.getException();\r
-                                       if (exception != null) {\r
-                                               StringWriter writer = new StringWriter();\r
-                                               exception.printStackTrace(new PrintWriter(writer));\r
-                                               buf.append("<br/><pre>");\r
-                                               buf.append(writer.toString());\r
-                                               buf.append("</pre>");\r
-                                               IOUtils.closeQuietly(writer);\r
-                                       }\r
+                                       buf.append(sPart.getExceptionMessage());\r
                                        buf.append("</p>");\r
                                }\r
                                buf.append("</td>");\r
@@ -198,8 +193,8 @@ class ResultPage {
                return path.getAsUniqueString().replace(path.getSeparator(), '_');\r
        }\r
 \r
-       private void describedPath(TreeSPath path, StructureRegistry registry,\r
-                       StringBuffer buf) {\r
+       private void describedPath(TreeSPath path,\r
+                       StructureRegistry<TreeSPath> registry, StringBuffer buf) {\r
                // StringBuffer buf = new StringBuffer("");\r
                if (path.getParent() != null) {\r
                        describedPath(path.getParent(), registry, buf);\r
@@ -208,7 +203,7 @@ class ResultPage {
                if (registry != null) {\r
                        StructureElement element = registry.getElement(path);\r
                        if (element != null) {\r
-                               description = element.getDescription();\r
+                               description = element.getLabel();\r
                        }\r
                }\r
                buf.append('/').append(description);\r