@@ -1,6 +1,6 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:lxslt="http://xml.apache.org/xslt"
xmlns:stringutils="xalan://org.apache.tools.ant.util.StringUtils">
xmlns:lxslt="http://xml.apache.org/xslt"
xmlns:stringutils="xalan://org.apache.tools.ant.util.StringUtils">
<xsl:output method="html" indent="yes" encoding="US-ASCII"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" />
<xsl:decimal-format decimal-separator="." grouping-separator="," />
@@ -19,17 +19,14 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
Sample stylesheet to be used with An JUnitReport output.
It creates a non-framed report that can be useful to send via
e-mail or such.
@author Stephane Bailliez <a href="mailto:sbailliez@apache.org"/>
@author Erik Hatcher <a href="mailto:ehatcher@apache.org"/>
-->
<xsl:template match="testsuites">
<html>
@@ -51,7 +48,7 @@
table.details tr td{
background:#eeeee0;
}
p {
line-height:1.5em;
margin-top:0.5em; margin-bottom:1.0em;
@@ -87,7 +84,7 @@
<script type="text/javascript" language="JavaScript">
var TestCases = new Array();
var cur;
<xsl:for-each select="./testsuite">
<xsl:for-each select="./testsuite">
<xsl:apply-templates select="properties"/>
</xsl:for-each>
@@ -118,39 +115,39 @@
doc.close();
win.focus();
}
]]>
]]>
</script>
</head>
<body>
<a name="top"></a>
<xsl:call-template name="pageHeader"/>
<xsl:call-template name="pageHeader"/>
<!-- Summary part -->
<xsl:call-template name="summary"/>
<hr size="1" width="95%" align="left"/>
<!-- Package List part -->
<xsl:call-template name="packagelist"/>
<hr size="1" width="95%" align="left"/>
<!-- For each package create its part -->
<xsl:call-template name="packages"/>
<hr size="1" width="95%" align="left"/>
<!-- For each class create the part -->
<xsl:call-template name="classes"/>
</body>
</html>
</xsl:template>
<!-- ================================================================== -->
<!-- Write a list of all packages with an hyperlink to the anchor of -->
<!-- of the package name. -->
<!-- ================================================================== -->
<xsl:template name="packagelist">
<xsl:template name="packagelist">
<h2>Packages</h2>
Note: package statistics are not computed recursively, they only sum up all of its testsuites numbers.
<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
@@ -163,7 +160,7 @@
<xsl:variable name="errorCount" select="sum($testsuites-in-package/@errors)"/>
<xsl:variable name="failureCount" select="sum($testsuites-in-package/@failures)"/>
<xsl:variable name="timeCount" select="sum($testsuites-in-package/@time)"/>
<!-- write a summary for the package -->
<tr valign="top">
<!-- set a nice color depending if there is an error/failure -->
@@ -182,12 +179,14 @@
<xsl:with-param name="value" select="$timeCount"/>
</xsl:call-template>
</td>
<td><xsl:value-of select="$testsuites-in-package/@timestamp"/></td>
<td><xsl:value-of select="$testsuites-in-package/@hostname"/></td>
</tr>
</xsl:for-each>
</table>
</table>
</xsl:template>
<!-- ================================================================== -->
<!-- Write a package level report -->
<!-- It creates a table with values from the document: -->
@@ -199,10 +198,10 @@
<xsl:sort select="@package"/>
<a name="{@package}"></a>
<h3>Package <xsl:value-of select="@package"/></h3>
<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
<xsl:call-template name="testsuite.test.header"/>
<!-- match the testsuites of this package -->
<xsl:apply-templates select="/testsuites/testsuite[./@package = current()/@package]" mode="print.test"/>
</table>
@@ -211,14 +210,14 @@
<p/>
</xsl:for-each>
</xsl:template>
<xsl:template name="classes">
<xsl:for-each select="testsuite">
<xsl:sort select="@name"/>
<!-- create an anchor to this class name -->
<a name="{@name}"></a>
<h3>TestCase <xsl:value-of select="@name"/></h3>
<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
<xsl:call-template name="testcase.test.header"/>
<!--
@@ -239,11 +238,11 @@
</a>
</div>
<p/>
<a href="#top">Back to top</a>
</xsl:for-each>
</xsl:template>
<xsl:template name="summary">
<h2>Summary</h2>
<xsl:variable name="testCount" select="sum(testsuite/@tests)"/>
@@ -290,7 +289,7 @@
</tr>
</table>
</xsl:template>
<!--
Write properties into a JavaScript data structure.
This is based on the original idea by Erik Hatcher (ehatcher@apache.org)
@@ -302,7 +301,7 @@
cur['<xsl:value-of select="@name"/>'] = '<xsl:call-template name="JS-escape"><xsl:with-param name="string" select="@value"/></xsl:call-template>';
</xsl:for-each>
</xsl:template>
<!-- Page HEADER -->
<xsl:template name="pageHeader">
<h1>Unit Test Results</h1>
@@ -333,6 +332,8 @@
<th>Errors</th>
<th>Failures</th>
<th nowrap="nowrap">Time(s)</th>
<th nowrap="nowrap">Time Stamp</th>
<th>Host</th>
</tr>
</xsl:template>
@@ -357,7 +358,7 @@
<xsl:when test="@errors[.> 0]">Error</xsl:when>
</xsl:choose>
</xsl:attribute>
<!-- print testsuite information -->
<td><a href="#{@name}"><xsl:value-of select="@name"/></a></td>
<td><xsl:value-of select="@tests"/></td>
@@ -368,6 +369,8 @@
<xsl:with-param name="value" select="@time"/>
</xsl:call-template>
</td>
<td><xsl:apply-templates select="@timestamp"/></td>
<td><xsl:apply-templates select="@hostname"/></td>
</tr>
</xsl:template>
@@ -458,4 +461,3 @@
</xsl:template>
</xsl:stylesheet>