X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.core%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fcore%2Ftest%2Ftree%2Fhtmlreport%2FResultPage.java;h=4cbb820709e205cce8791d17942c34e37ecfc70a;hb=df5ca3e7e3e4949e53b7c02b45805cc1375559c3;hp=1ee32e479b438149196c86e46a77b52fcb3d70a3;hpb=77ed5d40c10f8e8e788382ed0da1f3e4a1c31958;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.core/src/main/java/org/argeo/slc/core/test/tree/htmlreport/ResultPage.java b/org.argeo.slc.core/src/main/java/org/argeo/slc/core/test/tree/htmlreport/ResultPage.java index 1ee32e479..4cbb82070 100644 --- a/org.argeo.slc.core/src/main/java/org/argeo/slc/core/test/tree/htmlreport/ResultPage.java +++ b/org.argeo.slc.core/src/main/java/org/argeo/slc/core/test/tree/htmlreport/ResultPage.java @@ -1,17 +1,13 @@ package org.argeo.slc.core.test.tree.htmlreport; import java.io.IOException; -import java.io.PrintWriter; -import java.io.StringWriter; import java.util.Date; import java.util.SortedMap; import java.util.TreeMap; import org.apache.commons.io.FileUtils; -import org.apache.commons.io.IOUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; - import org.argeo.slc.core.structure.StructureElement; import org.argeo.slc.core.structure.StructureRegistry; import org.argeo.slc.core.structure.tree.TreeSPath; @@ -40,11 +36,11 @@ class ResultPage { * @param result * the result to dump */ - protected void generate(StructureRegistry registry) { + protected void generate(StructureRegistry registry) { StringBuffer buf = new StringBuffer(""); buf.append("\n"); buf.append("
"); - buf.append("Result #").append(result.getTestResultId()); + buf.append("<title>Result #").append(result.getUuid()); buf.append("\n"); report.addStyles(buf); buf.append("
\n"); @@ -53,8 +49,7 @@ class ResultPage { // Header buf.append("\n"); - buf.append("

Result #").append(result.getTestResultId()).append( - "

\n"); + buf.append("

Result #").append(result.getUuid()).append("

\n"); Date closeDate = result.getCloseDate(); if (closeDate == null) { buf.append("[Not closed]"); @@ -78,7 +73,8 @@ class ResultPage { } } - private void generateToc(StringBuffer buf, StructureRegistry registry) { + private void generateToc(StringBuffer buf, + StructureRegistry registry) { buf.append("

Overview

\n"); SortedMap toc = new TreeMap(); for (TreeSPath path : result.getResultParts().keySet()) { @@ -128,7 +124,8 @@ class ResultPage { buf.append("
\n"); } - private void generatePartsList(StringBuffer buf, StructureRegistry registry) { + private void generatePartsList(StringBuffer buf, + StructureRegistry registry) { for (TreeSPath path : result.getResultParts().keySet()) { buf.append("

\n"); buf.append(""); @@ -142,6 +139,8 @@ class ResultPage { int displayedIndex = 1;// for display only for (TestResultPart part : subList.getParts()) { SimpleResultPart sPart = (SimpleResultPart) part; + buf.append("Related Test Run Id:").append( + sPart.getTestRunUuid()).append("
\n"); String clss = ""; if (sPart.getStatus().equals(TestStatus.PASSED)) { clss = "passed"; @@ -157,15 +156,7 @@ class ResultPage { if (sPart.getStatus().equals(TestStatus.ERROR)) { buf .append("

An unexpected error prevented the test to run properly."); - Throwable exception = sPart.getException(); - if (exception != null) { - StringWriter writer = new StringWriter(); - exception.printStackTrace(new PrintWriter(writer)); - buf.append("

");
-						buf.append(writer.toString());
-						buf.append("
"); - IOUtils.closeQuietly(writer); - } + buf.append(sPart.getExceptionMessage()); buf.append("

"); } buf.append(""); @@ -198,8 +189,8 @@ class ResultPage { return path.getAsUniqueString().replace(path.getSeparator(), '_'); } - private void describedPath(TreeSPath path, StructureRegistry registry, - StringBuffer buf) { + private void describedPath(TreeSPath path, + StructureRegistry registry, StringBuffer buf) { // StringBuffer buf = new StringBuffer(""); if (path.getParent() != null) { describedPath(path.getParent(), registry, buf);