Mercurial > hg > ThermostatQA
changeset 100:6c2a5f90b3f3
Improvement of the reporter - now non-breaking spaces are
used in SUMMARY lines to preserve proper formatting of
HTML report pages (to separate all/passed/failed/errors).
author | Pavel Tisnovsky <ptisnovs@redhat.com> |
---|---|
date | Thu, 26 Sep 2013 10:44:39 +0200 |
parents | 6ebca48f4353 |
children | f3437c7ad3da |
files | ChangeLog src/org/thermostat/qa/reporter/LogPagesGenerator.java src/org/thermostat/qa/reporter/StringUtils.java |
diffstat | 3 files changed, 23 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Wed Sep 25 09:59:49 2013 +0200 +++ b/ChangeLog Thu Sep 26 10:44:39 2013 +0200 @@ -1,3 +1,12 @@ +2013-09-26 Pavel Tisnovsky <ptisnovs@redhat.com> + + * src/org/thermostat/qa/reporter/LogPagesGenerator.java: + Improvement of the reporter - now non-breaking spaces are + used in SUMMARY lines to preserve proper formatting of + HTML report pages (to separate all/passed/failed/errors). + * src/org/thermostat/qa/reporter/StringUtils.java: + Added new helper method. + 2013-09-25 Jana Fabrikova <jfabriko@redhat.com> * src/org/thermostat/qa/testsuites/GuiClientDBModificationsSmokeTest.java:
--- a/src/org/thermostat/qa/reporter/LogPagesGenerator.java Wed Sep 25 09:59:49 2013 +0200 +++ b/src/org/thermostat/qa/reporter/LogPagesGenerator.java Thu Sep 26 10:44:39 2013 +0200 @@ -179,6 +179,7 @@ resultLines.add("</pre></td><td> </td></tr>"); failed = false; } + testLine = StringUtils.replaceSpacesWithNbsps(testLine); resultLines.add("<tr><td class='error-text' colspan='2'>" + testLine + "</td></tr>"); } else if (failed) @@ -190,7 +191,7 @@ } return resultLines; } - + /** * @param testSuite * @return
--- a/src/org/thermostat/qa/reporter/StringUtils.java Wed Sep 25 09:59:49 2013 +0200 +++ b/src/org/thermostat/qa/reporter/StringUtils.java Thu Sep 26 10:44:39 2013 +0200 @@ -167,4 +167,16 @@ return temporaryName; } + /** + * Replace two consecutive spaces by " " (non breaking spaces) to + * preserve proper formatting of HTML report pages. + * + * @param string + * given input string (usually read from .log file) + * @return string with the given characters replaced. + */ + public static String replaceSpacesWithNbsps(String string) { + return string.replaceAll(" ", " "); + } + }