diff options
author | Jiri Vanek <[email protected]> | 2012-06-13 15:30:28 +0200 |
---|---|---|
committer | Jiri Vanek <[email protected]> | 2012-06-13 15:30:28 +0200 |
commit | cca5cd31d588c20c0333dec46dcebd1db203aac7 (patch) | |
tree | 58c5d45aff4c35f9282eeb613aaa69aeb440022a | |
parent | e7ccbbec330a177fb0a313c4258e2574fc51ec4b (diff) |
handle ignored tests in xml and html outputs correctly
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | tests/junit-runner/JunitLikeXmlOutputListener.java | 4 | ||||
-rw-r--r-- | tests/report-styles/jreport.xsl | 12 |
3 files changed, 22 insertions, 1 deletions
@@ -1,3 +1,10 @@ +2012-06-13 Jiri Vanek <[email protected]> + + * tests/junit-runner/JunitLikeXmlOutputListener.java: + Introduced TEST_IGNORED_ATTRIBUTE to mark test as ignored if should be. + * tests/report-styles/jreport.xsl: Applied correct text and style for + tests with attribute ignored. + 2012-06-12 Adam Domurad <[email protected]> Fixes PR722, javaws failing to run with unsigned content in META-INF/ diff --git a/tests/junit-runner/JunitLikeXmlOutputListener.java b/tests/junit-runner/JunitLikeXmlOutputListener.java index 7febaa1..fe17f19 100644 --- a/tests/junit-runner/JunitLikeXmlOutputListener.java +++ b/tests/junit-runner/JunitLikeXmlOutputListener.java @@ -51,6 +51,7 @@ public class JunitLikeXmlOutputListener extends RunListener { private static final String K2F = "known-to-fail"; private static final String TEST_NAME_ATTRIBUTE = "name"; private static final String TEST_TIME_ATTRIBUTE = "time"; + private static final String TEST_IGNORED_ATTRIBUTE = "ignored"; private static final String TEST_ERROR_ELEMENT = "error"; private static final String TEST_CLASS_ATTRIBUTE = "classname"; private static final String ERROR_MESSAGE_ATTRIBUTE = "message"; @@ -193,6 +194,9 @@ public class JunitLikeXmlOutputListener extends RunListener { testcaseAtts.put(TEST_TIME_ATTRIBUTE, stringedTime); testcaseAtts.put(TEST_CLASS_ATTRIBUTE, description.getClassName()); testcaseAtts.put(TEST_NAME_ATTRIBUTE, description.getMethodName()); + if (ignored){ + testcaseAtts.put(TEST_IGNORED_ATTRIBUTE, Boolean.TRUE.toString()); + } KnownToFail k2f=null; try { if (testClass != null && testMethod != null) { diff --git a/tests/report-styles/jreport.xsl b/tests/report-styles/jreport.xsl index a54d0f9..cf9c58a 100644 --- a/tests/report-styles/jreport.xsl +++ b/tests/report-styles/jreport.xsl @@ -201,6 +201,9 @@ If there is no need for linking, please use value "none" for this variable <div> <xsl:attribute name="class"> <xsl:choose> + <xsl:when test="@ignored"> + ignored + </xsl:when> <xsl:when test="error"> failed </xsl:when> @@ -246,7 +249,14 @@ If there is no need for linking, please use value "none" for this variable <xsl:choose> <xsl:when test="not(error)"> <div class="status"> - PASSED (<xsl:value-of select="@time"/>s) + <xsl:choose> + <xsl:when test="@ignored"> + IGNORED (<xsl:value-of select="@time"/>s) + </xsl:when> + <xsl:otherwise> + PASSED (<xsl:value-of select="@time"/>s) + </xsl:otherwise> + </xsl:choose> <xsl:choose> <xsl:when test="@known-to-fail"> <xsl:choose> |