NIHVIVO-222 Use a condensed table to replace a lot of space-consuming output.
This commit is contained in:
parent
8abffc78ee
commit
d47b5211c3
2 changed files with 95 additions and 94 deletions
|
@ -59,10 +59,8 @@ public class OutputSummaryFormatter {
|
||||||
writeHeader(writer);
|
writeHeader(writer);
|
||||||
writeStatsSection(writer);
|
writeStatsSection(writer);
|
||||||
writeErrorMessagesSection(writer);
|
writeErrorMessagesSection(writer);
|
||||||
writeFailureSection(writer);
|
writeCondensedTable(writer);
|
||||||
writeIgnoreSection(writer);
|
writeIgnoreSection(writer);
|
||||||
writeSuitesSection(writer);
|
|
||||||
writeAllTestsSection(writer);
|
|
||||||
writeSuiteErrorMessagesSection(writer);
|
writeSuiteErrorMessagesSection(writer);
|
||||||
writeFooter(writer);
|
writeFooter(writer);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -190,102 +188,47 @@ public class OutputSummaryFormatter {
|
||||||
w.println();
|
w.println();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeFailureSection(PrintWriter w) {
|
private void writeCondensedTable(PrintWriter w) {
|
||||||
String errorClass = Status.ERROR.getHtmlClass();
|
w.println(" <div class=section>Condensed List</div>");
|
||||||
Collection<TestData> failingTests = dataModel.getFailingTests();
|
|
||||||
|
|
||||||
w.println(" <div class=section>Failures</div>");
|
|
||||||
w.println();
|
w.println();
|
||||||
w.println(" <table cellspacing=\"0\">");
|
w.println(" <table class=\"condensed\" cellspacing=\"0\">");
|
||||||
w.println(" <tr><th>Suite name</th><th>Test name</th></tr>\n");
|
for (SuiteData s : dataModel.getAllSuites()) {
|
||||||
if (failingTests.isEmpty()) {
|
String sReason = "";
|
||||||
w.println(" <tr><td colspan=\"2\">No tests failed.</td>"
|
if (s.getStatus() == Status.IGNORED) {
|
||||||
+ "</tr>");
|
sReason = dataModel.getReasonForIgnoring(s.getName(), "*");
|
||||||
} else {
|
} else if (s.getFailureMessages() != null) {
|
||||||
Map<String, SuiteData> failedSuiteMap = dataModel
|
sReason = s.getFailureMessages().getErrout();
|
||||||
.getSuitesWithFailureMessages();
|
} else if (s.getStatus() == Status.PENDING) {
|
||||||
for (SuiteData s : failedSuiteMap.values()) {
|
sReason = Status.PENDING.toString();
|
||||||
w.println(" <tr class=\"" + errorClass + "\">");
|
|
||||||
w.println(" <td>" + s.getName() + "</td>");
|
|
||||||
w.println(" <td>" + outputLink(s) + "</td>");
|
|
||||||
w.println(" </tr>");
|
|
||||||
}
|
}
|
||||||
for (TestData t : failingTests) {
|
|
||||||
if (!failedSuiteMap.containsKey(t.getSuiteName())) {
|
w.println(" <tr>");
|
||||||
w.println(" <tr class=\"" + errorClass + "\">");
|
w.println(" <td class=\"" + s.getStatus().getHtmlClass()
|
||||||
w.println(" <td>" + t.getSuiteName() + "</td>");
|
+ "\">");
|
||||||
w.println(" <td>" + outputLink(t) + "</td>");
|
w.println(" <div class=\"suite\">" + outputLink(s)
|
||||||
w.println(" </tr>");
|
+ "</div>");
|
||||||
|
if (!sReason.isEmpty()) {
|
||||||
|
// The entire class is either failed or pending or ignored.
|
||||||
|
w.println(" <div class=\"reason\">" + sReason + "</div>");
|
||||||
|
} else {
|
||||||
|
// Show the individual tests.
|
||||||
|
for (TestData t : s.getTestMap().values()) {
|
||||||
|
String tClass = t.getStatus().getHtmlClass();
|
||||||
|
String tReason = dataModel.getReasonForIgnoring(
|
||||||
|
s.getName(), t.getTestName());
|
||||||
|
|
||||||
|
w.println(" <div class=\"test " + tClass + "\">");
|
||||||
|
w.println(" " + outputLink(t));
|
||||||
|
if (!tReason.isEmpty()) {
|
||||||
|
w.println(" <div class=\"tReason\">" + tReason
|
||||||
|
+ "</div>");
|
||||||
|
}
|
||||||
|
w.println(" </div>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
w.println(" </td>");
|
||||||
w.println(" </table>");
|
|
||||||
w.println();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void writeIgnoreSection(PrintWriter w) {
|
|
||||||
String warnClass = Status.IGNORED.getHtmlClass();
|
|
||||||
Collection<IgnoredTestInfo> ignoredTests = dataModel
|
|
||||||
.getIgnoredTestInfo();
|
|
||||||
|
|
||||||
w.println(" <div class=section>Ignored</div>");
|
|
||||||
w.println();
|
|
||||||
w.println(" <table cellspacing=\"0\">");
|
|
||||||
w.println(" <tr><th>Suite name</th><th>Test name</th>"
|
|
||||||
+ "<th>Reason for ignoring</th></tr>\n");
|
|
||||||
if (ignoredTests.isEmpty()) {
|
|
||||||
w.println(" <tr><td colspan=\"3\">No tests ignored.</td>"
|
|
||||||
+ "</tr>");
|
|
||||||
} else {
|
|
||||||
for (IgnoredTestInfo info : ignoredTests) {
|
|
||||||
String suiteName = info.suiteName;
|
|
||||||
String testName = info.testName;
|
|
||||||
String reason = dataModel.getReasonForIgnoring(suiteName,
|
|
||||||
testName);
|
|
||||||
|
|
||||||
w.println(" <tr class=\"" + warnClass + "\">");
|
|
||||||
w.println(" <td>" + suiteName + "</td>");
|
|
||||||
w.println(" <td>" + testName + "</td>");
|
|
||||||
w.println(" <td>" + reason + "</td>");
|
|
||||||
w.println(" </tr>");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
w.println(" </table>");
|
|
||||||
w.println();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void writeSuitesSection(PrintWriter w) {
|
|
||||||
w.println(" <div class=section>Suites Summary</div>");
|
|
||||||
w.println();
|
|
||||||
w.println(" <table cellspacing=\"0\">");
|
|
||||||
|
|
||||||
for (SuiteData s : dataModel.getAllSuites()) {
|
|
||||||
w.println(" <tr class=\"" + s.getStatus().getHtmlClass() + "\">");
|
|
||||||
w.println(" <td>" + outputLink(s) + "</td>");
|
|
||||||
w.println(" <td>" + s.getStatus() + "</td>");
|
|
||||||
w.println(" </tr>");
|
w.println(" </tr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
w.println(" </table>");
|
|
||||||
w.println();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void writeAllTestsSection(PrintWriter w) {
|
|
||||||
Collection<TestData> allTests = dataModel.getAllTests();
|
|
||||||
|
|
||||||
w.println(" <div class=section>All tests</div>");
|
|
||||||
w.println();
|
|
||||||
w.println(" <table cellspacing=\"0\">");
|
|
||||||
|
|
||||||
w.println(" <tr><th>Suite name</th><th>Test name</th><th> </th></tr>\n");
|
|
||||||
for (TestData t : allTests) {
|
|
||||||
w.println(" <tr class=\"" + t.getStatus().getHtmlClass() + "\">");
|
|
||||||
w.println(" <td>" + t.getSuiteName() + "</td>");
|
|
||||||
w.println(" <td>" + outputLink(t) + "</td>");
|
|
||||||
w.println(" <td>" + t.getStatus() + "</td>");
|
|
||||||
w.println(" </tr>");
|
|
||||||
}
|
|
||||||
|
|
||||||
w.println(" </table>");
|
w.println(" </table>");
|
||||||
w.println();
|
w.println();
|
||||||
}
|
}
|
||||||
|
@ -321,6 +264,37 @@ public class OutputSummaryFormatter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void writeIgnoreSection(PrintWriter w) {
|
||||||
|
String warnClass = Status.IGNORED.getHtmlClass();
|
||||||
|
Collection<IgnoredTestInfo> ignoredTests = dataModel
|
||||||
|
.getIgnoredTestInfo();
|
||||||
|
|
||||||
|
w.println(" <div class=section>Ignored</div>");
|
||||||
|
w.println();
|
||||||
|
w.println(" <table cellspacing=\"0\">");
|
||||||
|
w.println(" <tr><th>Suite name</th><th>Test name</th>"
|
||||||
|
+ "<th>Reason for ignoring</th></tr>\n");
|
||||||
|
if (ignoredTests.isEmpty()) {
|
||||||
|
w.println(" <tr><td colspan=\"3\">No tests ignored.</td>"
|
||||||
|
+ "</tr>");
|
||||||
|
} else {
|
||||||
|
for (IgnoredTestInfo info : ignoredTests) {
|
||||||
|
String suiteName = info.suiteName;
|
||||||
|
String testName = info.testName;
|
||||||
|
String reason = dataModel.getReasonForIgnoring(suiteName,
|
||||||
|
testName);
|
||||||
|
|
||||||
|
w.println(" <tr class=\"" + warnClass + "\">");
|
||||||
|
w.println(" <td>" + suiteName + "</td>");
|
||||||
|
w.println(" <td>" + testName + "</td>");
|
||||||
|
w.println(" <td>" + reason + "</td>");
|
||||||
|
w.println(" </tr>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
w.println(" </table>");
|
||||||
|
w.println();
|
||||||
|
}
|
||||||
|
|
||||||
private void writeFooter(PrintWriter w) {
|
private void writeFooter(PrintWriter w) {
|
||||||
w.println(" <div class=section>Log</div>");
|
w.println(" <div class=section>Log</div>");
|
||||||
w.println(" <pre>");
|
w.println(" <pre>");
|
||||||
|
|
|
@ -76,4 +76,31 @@ table.tallys td.total {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 15px 0px 0px 0px;
|
margin: 15px 0px 0px 0px;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table.condensed td {
|
||||||
|
border: 1px solid grey;
|
||||||
|
padding: 10px 5px 10px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.condensed div.suite {
|
||||||
|
font-size: 85%;
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 3px 3px 3px 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.condensed div.reason {
|
||||||
|
font-size: 70%;
|
||||||
|
font-style: italic;
|
||||||
|
padding: 3px 3px 3px 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.condensed div.test {
|
||||||
|
font-size: 70%;
|
||||||
|
padding: 3px 3px 3px 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.condensed div.test div.tReason{
|
||||||
|
font-style: italic;
|
||||||
|
padding: 3px 3px 3px 10px;
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue