@@ -118,54 +118,55 @@
</html>
</html>
</xsl:template>
</xsl:template>
<!-- this is the stylesheet css to use for nearly everything -->
<!-- this is the stylesheet css to use for nearly everything -->
<xsl:template name="stylesheet.css">
<xsl:template name="stylesheet.css">
body {
body {
font:normal 68% verdana,arial,helvetica;
font:normal 68% verdana,arial,helvetica;
color:#000000;
color:#000000;
}
}
td {
font-size: 68%
table tr td, table tr th {
font-size: 68%;
}
table.details tr th{
font-weight: bold;
text-align:left;
background:#a6caf0;
}
table.details tr td{
background:#eeeee0;
}
}
p {
p {
line-height:1.5em;
line-height:1.5em;
margin-top:0.5em; margin-bottom:1.0em;
margin-top:0.5em; margin-bottom:1.0em;
}
}
h1 {
h1 {
margin: 0px 0px 5px;
font: 165% verdana,arial,helvetica
margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
}
}
h2 {
h2 {
margin-top: 1em;
margin-bottom: 0.5em;
font: bold 125% verdana,arial,helvetica
margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
}
}
h3 {
h3 {
margin-bottom: 0.5em;
font: bold 115% verdana,arial,helvetica
margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
}
}
h4 {
h4 {
margin-bottom: 0.5em;
font: bold 100% verdana,arial,helvetica
margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
}
}
h5 {
h5 {
margin-bottom: 0.5em;
font: bold 100% verdana,arial,helvetica
margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
}
}
h6 {
h6 {
margin-bottom: 0.5em;
font: bold 100% verdana,arial,helvetica
margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
}
}
.Error {
.Error {
font-weight:bold;
color:red;
font-weight:bold; color:red;
}
}
.Failure {
.Failure {
font-weight:bold;
color:purple;
font-weight:bold; color:purple;
}
.Properties {
text-align:right;
}
}
</xsl:template>
</xsl:template>
@@ -181,29 +182,87 @@ h6 {
<xsl:call-template name="create.stylesheet.link">
<xsl:call-template name="create.stylesheet.link">
<xsl:with-param name="package.name" select="$package.name"/>
<xsl:with-param name="package.name" select="$package.name"/>
</xsl:call-template>
</xsl:call-template>
<script language="JavaScript">
var TestCases = new Array();
var cur;
<xsl:apply-templates select="properties"/>
</script>
<script language="JavaScript"><![CDATA[
function displayProperties (name) {
var win = window.open('','JUnitSystemProperties','scrollbars=1,resizable=1');
var doc = win.document.open();
doc.write("<html><head><title>Properties of " + name + "</title>");
doc.write("<style>")
doc.write("body {font:normal 68% verdana,arial,helvetica; color:#000000; }");
doc.write("table tr td, table tr th { font-size: 68%; }");
doc.write("table.properties { border-collapse:collapse; border-left:solid 1 #cccccc; border-top:solid 1 #cccccc; padding:5px; }");
doc.write("table.properties th { text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#eeeeee; }");
doc.write("table.properties td { font:normal; text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#fffffff; }");
doc.write("h3 { margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica }");
doc.write("</style>");
doc.write("</head><body>");
doc.write("<h3>Properties of " + name + "</h3>");
doc.write("<div align=\"right\"><a href=\"javascript:window.close();\">Close</a></div>");
doc.write("<table class='properties'>");
doc.write("<tr><th>Name</th><th>Value</th></tr>");
for (prop in TestCases[name]) {
doc.write("<tr><th>" + prop + "</th><td>" + TestCases[name][prop] + "</td></tr>");
}
doc.write("</table>");
doc.write("</body></html>");
doc.close();
win.focus();
}
]]>
</script>
</head>
</head>
<body>
<body>
<xsl:call-template name="pageHeader"/>
<xsl:call-template name="pageHeader"/>
<h3>Class <xsl:if test="not($package.name = '')"><xsl:value-of select="$package.name"/>.</xsl:if><xsl:value-of select="@name"/></h3>
<h3>Class <xsl:if test="not($package.name = '')"><xsl:value-of select="$package.name"/>.</xsl:if><xsl:value-of select="@name"/></h3>
<table border="0" cellpadding="5" cellspacing="2" width="95%">
<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
<xsl:call-template name="testsuite.test.header"/>
<xsl:call-template name="testsuite.test.header"/>
<xsl:apply-templates select="." mode="print.test"/>
<xsl:apply-templates select="." mode="print.test"/>
</table>
</table>
<h2>Tests</h2>
<h2>Tests</h2>
<p>
<p>
<table border="0" cellpadding="5" cellspacing="2" width="95%">
<xsl:call-template name="testcase.test.header"/>
<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
<!--
test can even not be started at all (failure to load the class)
so report the error directly
-->
<xsl:if test="./error">
<tr class="Error">
<td colspan="4"><xsl:apply-templates select="./error"/></td>
</tr>
</xsl:if>
<xsl:apply-templates select="./testcase" mode="print.test"/>
<xsl:apply-templates select="./testcase" mode="print.test"/>
</table>
</table>
</p>
</p>
<div class="Properties">
<a>
<xsl:attribute name="href">javascript:displayProperties('<xsl:value-of select="@package"/>.<xsl:value-of select="@name"/>');</xsl:attribute>
Properties >>
</a>
</div>
</body>
</body>
</html>
</html>
</xsl:template>
</xsl:template>
<!--
Write properties into a JavaScript data structure.
This is based on the original idea by Erik Hatcher (erik@hatcher.net)
-->
<xsl:template match="properties">
cur = TestCases['<xsl:value-of select="../@package"/>.<xsl:value-of select="../@name"/>'] = new Array();
<xsl:for-each select="property">
<xsl:sort select="@name"/>
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>
<!-- ======================================================================
<!-- ======================================================================
This page is created for every package.
This page is created for every package.
@@ -340,15 +399,15 @@ h6 {
<xsl:variable name="failureCount" select="sum(testsuite/@failures)"/>
<xsl:variable name="failureCount" select="sum(testsuite/@failures)"/>
<xsl:variable name="timeCount" select="sum(testsuite/@time)"/>
<xsl:variable name="timeCount" select="sum(testsuite/@time)"/>
<xsl:variable name="successRate" select="($testCount - $failureCount - $errorCount) div $testCount"/>
<xsl:variable name="successRate" select="($testCount - $failureCount - $errorCount) div $testCount"/>
<table border="0" cellpadding="5" cellspacing="2" width="95%">
<tr bgcolor="#A6CAF0" valign="top">
<td><strong>Tests</strong></td >
<td><strong>Failures</strong></td >
<td><strong>Errors</strong></td >
<td><strong>Success rate</strong></td >
<td><strong>Time</strong></td >
<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
<tr valign="top">
<th>Tests</th >
<th>Failures</th >
<th>Errors</th >
<th>Success rate</th >
<th>Time</th >
</tr>
</tr>
<tr bgcolor="#EEEEE" valign="top">
<tr valign="top">
<xsl:attribute name="class">
<xsl:attribute name="class">
<xsl:choose>
<xsl:choose>
<xsl:when test="$errorCount > 0">Error</xsl:when>
<xsl:when test="$errorCount > 0">Error</xsl:when>
@@ -381,13 +440,13 @@ h6 {
</table>
</table>
<h2>Packages</h2>
<h2>Packages</h2>
<table border="0" cellpadding="5" cellspacing="2" width="95%">
<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
<xsl:call-template name="testsuite.test.header"/>
<xsl:call-template name="testsuite.test.header"/>
<xsl:for-each select="testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
<xsl:for-each select="testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
<xsl:sort select="@package" order="ascending"/>
<xsl:sort select="@package" order="ascending"/>
<!-- get the node set containing all testsuites that have the same package -->
<!-- get the node set containing all testsuites that have the same package -->
<xsl:variable name="insamepackage" select="/testsuites/testsuite[./@package = current()/@package]"/>
<xsl:variable name="insamepackage" select="/testsuites/testsuite[./@package = current()/@package]"/>
<tr bgcolor="#EEEEE" valign="top">
<tr valign="top">
<!-- display a failure if there is any failure/error in the package -->
<!-- display a failure if there is any failure/error in the package -->
<xsl:attribute name="class">
<xsl:attribute name="class">
<xsl:choose>
<xsl:choose>
@@ -435,7 +494,7 @@ h6 {
<xsl:if test="count($insamepackage) > 0">
<xsl:if test="count($insamepackage) > 0">
<h2>Classes</h2>
<h2>Classes</h2>
<p>
<p>
<table border="0" cellpadding="5" cellspacing="2" width="95%">
<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
<xsl:call-template name="testsuite.test.header"/>
<xsl:call-template name="testsuite.test.header"/>
<xsl:apply-templates select="$insamepackage" mode="print.test">
<xsl:apply-templates select="$insamepackage" mode="print.test">
<xsl:sort select="@name"/>
<xsl:sort select="@name"/>
@@ -487,29 +546,29 @@ h6 {
<!-- class header -->
<!-- class header -->
<xsl:template name="testsuite.test.header">
<xsl:template name="testsuite.test.header">
<tr bgcolor="#A6CAF0" valign="top">
<td width="80%"><strong>Name</strong></td >
<td><strong>Tests</strong></td >
<td><strong>Errors</strong></td >
<td><strong>Failures</strong></td >
<td nowrap="nowrap"><strong>Time(s)</strong></td >
<tr valign="top">
<th width="80%">Name</th >
<th>Tests</th >
<th>Errors</th >
<th>Failures</th >
<th nowrap="nowrap">Time(s)</th >
</tr>
</tr>
</xsl:template>
</xsl:template>
<!-- method header -->
<!-- method header -->
<xsl:template name="testcase.test.header">
<xsl:template name="testcase.test.header">
<tr bgcolor="#A6CAF0" valign="top">
<td><strong>Name</strong></td >
<td><strong>Status</strong></td >
<td width="80%"><strong>Type</strong></td >
<td nowrap="nowrap"><strong>Time(s)</strong></td >
<tr valign="top">
<th>Name</th >
<th>Status</th >
<th width="80%">Type</th >
<th nowrap="nowrap">Time(s)</th >
</tr>
</tr>
</xsl:template>
</xsl:template>
<!-- class information -->
<!-- class information -->
<xsl:template match="testsuite" mode="print.test">
<xsl:template match="testsuite" mode="print.test">
<tr bgcolor="#EEEEE" valign="top">
<tr valign="top">
<xsl:attribute name="class">
<xsl:attribute name="class">
<xsl:choose>
<xsl:choose>
<xsl:when test="@errors[.> 0]">Error</xsl:when>
<xsl:when test="@errors[.> 0]">Error</xsl:when>
@@ -529,7 +588,7 @@ h6 {
</xsl:template>
</xsl:template>
<xsl:template match="testcase" mode="print.test">
<xsl:template match="testcase" mode="print.test">
<tr bgcolor="#EEEEE" valign="top">
<tr valign="top">
<xsl:attribute name="class">
<xsl:attribute name="class">
<xsl:choose>
<xsl:choose>
<xsl:when test="error">Error</xsl:when>
<xsl:when test="error">Error</xsl:when>
@@ -590,6 +649,28 @@ h6 {
<!--pre><xsl:value-of select="."/></pre-->
<!--pre><xsl:value-of select="."/></pre-->
</xsl:template>
</xsl:template>
<xsl:template name="JS-escape">
<xsl:param name="string"/>
<xsl:choose><!-- something isn't right here, basically all single quotes need to be replaced with backslash-single-quote
<xsl:when test="contains($string,''')">
<xsl:value-of select="substring-before($string,''')"/>
\'
<xsl:call-template name="JS-escape">
<xsl:with-param name="string" select="substring-after($string,''')"/>
</xsl:call-template>
</xsl:when> -->
<xsl:when test="contains($string,'\')">
<xsl:value-of select="substring-before($string,'\')"/>\\<xsl:call-template name="JS-escape">
<xsl:with-param name="string" select="substring-after($string,'\')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$string"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!--
<!--
template that will convert a carriage return into a br tag
template that will convert a carriage return into a br tag
@param word the text from which to convert CR to BR tag
@param word the text from which to convert CR to BR tag