5713N/A<?xml version="1.0"?>
0N/A<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
0N/A xmlns:lxslt="http://xml.apache.org/xslt"
0N/A xmlns:redirect="org.apache.xalan.lib.Redirect"
0N/A xmlns:stringutils="xalan://org.apache.tools.ant.util.StringUtils"
0N/A extension-element-prefixes="redirect">
5713N/A<xsl:output method="html" indent="yes" encoding="UTF-8"/>
0N/A<xsl:decimal-format decimal-separator="." grouping-separator=","/>
0N/A<!--
809N/A Licensed to the Apache Software Foundation (ASF) under one or more
809N/A contributor license agreements. See the NOTICE file distributed with
809N/A this work for additional information regarding copyright ownership.
809N/A The ASF licenses this file to You under the Apache License, Version 2.0
809N/A (the "License"); you may not use this file except in compliance with
809N/A the License. You may obtain a copy of the License at
0N/A
0N/A http://www.apache.org/licenses/LICENSE-2.0
0N/A
0N/A Unless required by applicable law or agreed to in writing, software
0N/A distributed under the License is distributed on an "AS IS" BASIS,
0N/A WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0N/A See the License for the specific language governing permissions and
0N/A limitations under the License.
0N/A -->
0N/A
0N/A<!--
0N/A
0N/A Sample stylesheet to be used with Ant JUnitReport output.
0N/A
0N/A It creates a set of HTML files a la javadoc where you can browse easily
0N/A through all packages and classes.
0N/A
0N/A-->
0N/A<xsl:param name="output.dir" select="'.'"/>
0N/A
0N/A
0N/A<xsl:template match="testsuites">
0N/A <!-- create the index.html -->
0N/A <redirect:write file="{$output.dir}/index.html">
0N/A <xsl:call-template name="index.html"/>
0N/A </redirect:write>
0N/A
0N/A <!-- create the stylesheet.css -->
0N/A <redirect:write file="{$output.dir}/stylesheet.css">
0N/A <xsl:call-template name="stylesheet.css"/>
0N/A </redirect:write>
0N/A
0N/A <!-- create the overview-packages.html at the root -->
0N/A <redirect:write file="{$output.dir}/overview-summary.html">
0N/A <xsl:apply-templates select="." mode="overview.packages"/>
0N/A </redirect:write>
0N/A
0N/A <!-- create the all-packages.html at the root -->
0N/A <redirect:write file="{$output.dir}/overview-frame.html">
0N/A <xsl:apply-templates select="." mode="all.packages"/>
0N/A </redirect:write>
0N/A
0N/A <!-- create the all-classes.html at the root -->
0N/A <redirect:write file="{$output.dir}/allclasses-frame.html">
0N/A <xsl:apply-templates select="." mode="all.classes"/>
0N/A </redirect:write>
0N/A
0N/A <!-- process all packages -->
0N/A <xsl:for-each select="/testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
0N/A <xsl:call-template name="package">
0N/A <xsl:with-param name="name" select="@package"/>
0N/A </xsl:call-template>
0N/A </xsl:for-each>
0N/A</xsl:template>
0N/A
0N/A
0N/A<xsl:template name="package">
0N/A <xsl:param name="name"/>
0N/A <xsl:variable name="package.dir">
0N/A <xsl:if test="not($name = '')"><xsl:value-of select="translate($name,'.','/')"/></xsl:if>
0N/A <xsl:if test="$name = ''">.</xsl:if>
0N/A </xsl:variable>
0N/A <!--Processing package <xsl:value-of select="@name"/> in <xsl:value-of select="$output.dir"/> -->
0N/A <!-- create a classes-list.html in the package directory -->
0N/A <redirect:write file="{$output.dir}/{$package.dir}/package-frame.html">
0N/A <xsl:call-template name="classes.list">
0N/A <xsl:with-param name="name" select="$name"/>
0N/A </xsl:call-template>
0N/A </redirect:write>
0N/A
0N/A <!-- create a package-summary.html in the package directory -->
0N/A <redirect:write file="{$output.dir}/{$package.dir}/package-summary.html">
0N/A <xsl:call-template name="package.summary">
0N/A <xsl:with-param name="name" select="$name"/>
0N/A </xsl:call-template>
0N/A </redirect:write>
0N/A
0N/A <!-- for each class, creates a @name.html -->
0N/A <!-- @bug there will be a problem with inner classes having the same name, it will be overwritten -->
0N/A <xsl:for-each select="/testsuites/testsuite[@package = $name]">
0N/A <redirect:write file="{$output.dir}/{$package.dir}/{@name}.html">
0N/A <xsl:apply-templates select="." mode="class.details"/>
0N/A </redirect:write>
0N/A <xsl:if test="string-length(/system-out)!=0">
5713N/A <redirect:write file="{$output.dir}/{$package.dir}/{@name}-out.html">
5713N/A <html>
5713N/A <head>
5713N/A <title>Standard Output from <xsl:value-of select="@name"/></title>
5713N/A </head>
5713N/A <body>
5713N/A <pre><xsl:value-of select="/system-out"/></pre>
5713N/A </body>
5713N/A </html>
5713N/A </redirect:write>
0N/A </xsl:if>
0N/A <xsl:if test="string-length(/system-err)!=0">
5713N/A <redirect:write file="{$output.dir}/{$package.dir}/{@name}-err.html">
5713N/A <html>
5713N/A <head>
5713N/A <title>Standard Error from <xsl:value-of select="@name"/></title>
5713N/A </head>
5713N/A <body>
5713N/A <pre><xsl:value-of select="/system-err"/></pre>
5713N/A </body>
5713N/A </html>
5713N/A </redirect:write>
0N/A </xsl:if>
0N/A </xsl:for-each>
0N/A</xsl:template>
0N/A
0N/A<xsl:template name="index.html">
0N/A<html>
0N/A <head>
0N/A <title>Unit Test Results.</title>
0N/A </head>
0N/A <frameset cols="20%,80%">
0N/A <frameset rows="30%,70%">
0N/A <frame src="overview-frame.html" name="packageListFrame"/>
0N/A <frame src="allclasses-frame.html" name="classListFrame"/>
0N/A </frameset>
0N/A <frame src="overview-summary.html" name="classFrame"/>
0N/A <noframes>
0N/A <h2>Frame Alert</h2>
0N/A <p>
0N/A This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
0N/A </p>
0N/A </noframes>
0N/A </frameset>
0N/A</html>
0N/A</xsl:template>
0N/A
0N/A<!-- this is the stylesheet css to use for nearly everything -->
0N/A<xsl:template name="stylesheet.css">
0N/Abody {
0N/A font:normal 68% verdana,arial,helvetica;
0N/A color:#000000;
0N/A}
0N/Atable tr td, table tr th {
0N/A font-size: 68%;
0N/A}
0N/Atable.details tr th{
0N/A font-weight: bold;
0N/A text-align:left;
0N/A background:#a6caf0;
0N/A}
0N/Atable.details tr td{
0N/A background:#eeeee0;
0N/A}
0N/A
0N/Ap {
0N/A line-height:1.5em;
0N/A margin-top:0.5em; margin-bottom:1.0em;
0N/A}
0N/Ah1 {
0N/A margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
0N/A}
0N/Ah2 {
0N/A margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
0N/A}
0N/Ah3 {
0N/A margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
0N/A}
0N/Ah4 {
0N/A margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
0N/A}
0N/Ah5 {
0N/A margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
0N/A}
0N/Ah6 {
0N/A margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
0N/A}
0N/A.Error {
0N/A font-weight:bold; color:red;
0N/A}
0N/A.Failure {
0N/A font-weight:bold; color:purple;
0N/A}
0N/A.Properties {
0N/A text-align:right;
0N/A}
0N/A</xsl:template>
0N/A
0N/A
0N/A<!-- ======================================================================
0N/A This page is created for every testsuite class.
0N/A It prints a summary of the testsuite and detailed information about
0N/A testcase methods.
0N/A ====================================================================== -->
0N/A<xsl:template match="testsuite" mode="class.details">
0N/A <xsl:variable name="package.name" select="@package"/>
0N/A <xsl:variable name="class.name"><xsl:if test="not($package.name = '')"><xsl:value-of select="$package.name"/>.</xsl:if><xsl:value-of select="@name"/></xsl:variable>
0N/A <html>
0N/A <head>
0N/A <title>Unit Test Results: <xsl:value-of select="$class.name"/></title>
0N/A <xsl:call-template name="create.stylesheet.link">
0N/A <xsl:with-param name="package.name" select="$package.name"/>
0N/A </xsl:call-template>
0N/A <script type="text/javascript" language="JavaScript">
0N/A var TestCases = new Array();
0N/A var cur;
0N/A <xsl:apply-templates select="properties"/>
0N/A </script>
0N/A <script type="text/javascript" language="JavaScript"><![CDATA[
0N/A function displayProperties (name) {
0N/A var win = window.open('','JUnitSystemProperties','scrollbars=1,resizable=1');
809N/A var doc = win.document;
809N/A doc.open();
0N/A doc.write("<html><head><title>Properties of " + name + "</title>");
0N/A doc.write("<style type=\"text/css\">");
0N/A doc.write("body {font:normal 68% verdana,arial,helvetica; color:#000000; }");
0N/A doc.write("table tr td, table tr th { font-size: 68%; }");
0N/A doc.write("table.properties { border-collapse:collapse; border-left:solid 1 #cccccc; border-top:solid 1 #cccccc; padding:5px; }");
0N/A doc.write("table.properties th { text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#eeeeee; }");
0N/A doc.write("table.properties td { font:normal; text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#fffffff; }");
0N/A doc.write("h3 { margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica }");
0N/A doc.write("</style>");
0N/A doc.write("</head><body>");
0N/A doc.write("<h3>Properties of " + name + "</h3>");
0N/A doc.write("<div align=\"right\"><a href=\"javascript:window.close();\">Close</a></div>");
0N/A doc.write("<table class='properties'>");
0N/A doc.write("<tr><th>Name</th><th>Value</th></tr>");
0N/A for (prop in TestCases[name]) {
0N/A doc.write("<tr><th>" + prop + "</th><td>" + TestCases[name][prop] + "</td></tr>");
0N/A }
0N/A doc.write("</table>");
0N/A doc.write("</body></html>");
0N/A doc.close();
0N/A win.focus();
0N/A }
0N/A ]]>
0N/A </script>
0N/A </head>
0N/A <body>
0N/A <xsl:call-template name="pageHeader"/>
0N/A <h3>Class <xsl:value-of select="$class.name"/></h3>
0N/A
0N/A
0N/A <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
0N/A <xsl:call-template name="testsuite.test.header"/>
0N/A <xsl:apply-templates select="." mode="print.test"/>
0N/A </table>
0N/A
0N/A <h2>Tests</h2>
0N/A <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
0N/A <xsl:call-template name="testcase.test.header"/>
0N/A <!--
0N/A test can even not be started at all (failure to load the class)
0N/A so report the error directly
0N/A -->
0N/A <xsl:if test="/error">
0N/A <tr class="Error">
0N/A <td colspan="4"><xsl:apply-templates select="/error"/></td>
0N/A </tr>
0N/A </xsl:if>
0N/A <xsl:apply-templates select="/testcase" mode="print.test"/>
0N/A </table>
0N/A <div class="Properties">
0N/A <a>
0N/A <xsl:attribute name="href">javascript:displayProperties('<xsl:value-of select="@package"/>.<xsl:value-of select="@name"/>');</xsl:attribute>
0N/A Properties &#187;
0N/A </a>
0N/A </div>
0N/A <xsl:if test="string-length(/system-out)!=0">
0N/A <div class="Properties">
0N/A <a>
5713N/A <xsl:attribute name="href">./<xsl:value-of select="@name"/>-out.html</xsl:attribute>
0N/A System.out &#187;
0N/A </a>
0N/A </div>
0N/A </xsl:if>
0N/A <xsl:if test="string-length(/system-err)!=0">
0N/A <div class="Properties">
0N/A <a>
5713N/A <xsl:attribute name="href">./<xsl:value-of select="@name"/>-err.html</xsl:attribute>
0N/A System.err &#187;
0N/A </a>
0N/A </div>
0N/A </xsl:if>
0N/A </body>
0N/A </html>
0N/A</xsl:template>
0N/A
0N/A <!--
0N/A Write properties into a JavaScript data structure.
0N/A This is based on the original idea by Erik Hatcher (ehatcher@apache.org)
0N/A -->
0N/A <xsl:template match="properties">
0N/A cur = TestCases['<xsl:value-of select="../@package"/>.<xsl:value-of select="../@name"/>'] = new Array();
0N/A <xsl:for-each select="property">
0N/A <xsl:sort select="@name"/>
0N/A cur['<xsl:value-of select="@name"/>'] = '<xsl:call-template name="JS-escape"><xsl:with-param name="string" select="@value"/></xsl:call-template>';
0N/A </xsl:for-each>
0N/A </xsl:template>
0N/A
0N/A
0N/A<!-- ======================================================================
0N/A This page is created for every package.
0N/A It prints the name of all classes that belongs to this package.
0N/A @param name the package name to print classes.
0N/A ====================================================================== -->
0N/A<!-- list of classes in a package -->
0N/A<xsl:template name="classes.list">
0N/A <xsl:param name="name"/>
0N/A <html>
0N/A <head>
0N/A <title>Unit Test Classes: <xsl:value-of select="$name"/></title>
0N/A <xsl:call-template name="create.stylesheet.link">
0N/A <xsl:with-param name="package.name" select="$name"/>
0N/A </xsl:call-template>
0N/A </head>
0N/A <body>
0N/A <table width="100%">
0N/A <tr>
0N/A <td nowrap="nowrap">
0N/A <h2><a href="package-summary.html" target="classFrame">
0N/A <xsl:value-of select="$name"/>
0N/A <xsl:if test="$name = ''">&lt;none&gt;</xsl:if>
0N/A </a></h2>
0N/A </td>
0N/A </tr>
0N/A </table>
0N/A
0N/A <h2>Classes</h2>
0N/A <table width="100%">
0N/A <xsl:for-each select="/testsuites/testsuite[./@package = $name]">
0N/A <xsl:sort select="@name"/>
0N/A <tr>
0N/A <td nowrap="nowrap">
0N/A <a href="{@name}.html" target="classFrame"><xsl:value-of select="@name"/></a>
0N/A </td>
0N/A </tr>
0N/A </xsl:for-each>
0N/A </table>
0N/A </body>
0N/A </html>
0N/A</xsl:template>
0N/A
0N/A
0N/A<!--
0N/A Creates an all-classes.html file that contains a link to all package-summary.html
0N/A on each class.
0N/A-->
0N/A<xsl:template match="testsuites" mode="all.classes">
0N/A <html>
0N/A <head>
0N/A <title>All Unit Test Classes</title>
0N/A <xsl:call-template name="create.stylesheet.link">
0N/A <xsl:with-param name="package.name"/>
0N/A </xsl:call-template>
0N/A </head>
0N/A <body>
0N/A <h2>Classes</h2>
0N/A <table width="100%">
0N/A <xsl:apply-templates select="testsuite" mode="all.classes">
0N/A <xsl:sort select="@name"/>
0N/A </xsl:apply-templates>
0N/A </table>
0N/A </body>
0N/A </html>
0N/A</xsl:template>
0N/A
0N/A<xsl:template match="testsuite" mode="all.classes">
0N/A <xsl:variable name="package.name" select="@package"/>
0N/A <tr>
0N/A <td nowrap="nowrap">
0N/A <a target="classFrame">
0N/A <xsl:attribute name="href">
0N/A <xsl:if test="not($package.name='')">
0N/A <xsl:value-of select="translate($package.name,'.','/')"/><xsl:text>/</xsl:text>
0N/A </xsl:if><xsl:value-of select="@name"/><xsl:text>.html</xsl:text>
0N/A </xsl:attribute>
0N/A <xsl:value-of select="@name"/>
0N/A </a>
0N/A </td>
0N/A </tr>
0N/A</xsl:template>
0N/A
0N/A
0N/A<!--
0N/A Creates an html file that contains a link to all package-summary.html files on
0N/A each package existing on testsuites.
0N/A @bug there will be a problem here, I don't know yet how to handle unnamed package :(
0N/A-->
0N/A<xsl:template match="testsuites" mode="all.packages">
0N/A <html>
0N/A <head>
0N/A <title>All Unit Test Packages</title>
0N/A <xsl:call-template name="create.stylesheet.link">
0N/A <xsl:with-param name="package.name"/>
0N/A </xsl:call-template>
0N/A </head>
0N/A <body>
0N/A <h2><a href="overview-summary.html" target="classFrame">Home</a></h2>
0N/A <h2>Packages</h2>
0N/A <table width="100%">
0N/A <xsl:apply-templates select="testsuite[not(./@package = preceding-sibling::testsuite/@package)]" mode="all.packages">
0N/A <xsl:sort select="@package"/>
0N/A </xsl:apply-templates>
0N/A </table>
0N/A </body>
0N/A </html>
0N/A</xsl:template>
0N/A
0N/A<xsl:template match="testsuite" mode="all.packages">
0N/A <tr>
0N/A <td nowrap="nowrap">
0N/A <a href="./{translate(@package,'.','/')}/package-summary.html" target="classFrame">
0N/A <xsl:value-of select="@package"/>
0N/A <xsl:if test="@package = ''">&lt;none&gt;</xsl:if>
0N/A </a>
0N/A </td>
0N/A </tr>
0N/A</xsl:template>
0N/A
0N/A
0N/A<xsl:template match="testsuites" mode="overview.packages">
0N/A <html>
0N/A <head>
0N/A <title>Unit Test Results: Summary</title>
0N/A <xsl:call-template name="create.stylesheet.link">
0N/A <xsl:with-param name="package.name"/>
0N/A </xsl:call-template>
0N/A </head>
0N/A <body>
0N/A <xsl:attribute name="onload">open('allclasses-frame.html','classListFrame')</xsl:attribute>
0N/A <xsl:call-template name="pageHeader"/>
0N/A <h2>Summary</h2>
0N/A <xsl:variable name="testCount" select="sum(testsuite/@tests)"/>
0N/A <xsl:variable name="errorCount" select="sum(testsuite/@errors)"/>
0N/A <xsl:variable name="failureCount" select="sum(testsuite/@failures)"/>
0N/A <xsl:variable name="timeCount" select="sum(testsuite/@time)"/>
0N/A <xsl:variable name="successRate" select="($testCount - $failureCount - $errorCount) div $testCount"/>
0N/A <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
0N/A <tr valign="top">
0N/A <th>Tests</th>
0N/A <th>Failures</th>
0N/A <th>Errors</th>
0N/A <th>Success rate</th>
0N/A <th>Time</th>
0N/A </tr>
0N/A <tr valign="top">
0N/A <xsl:attribute name="class">
0N/A <xsl:choose>
0N/A <xsl:when test="$errorCount &gt; 0">Error</xsl:when>
0N/A <xsl:when test="$failureCount &gt; 0">Failure</xsl:when>
0N/A <xsl:otherwise>Pass</xsl:otherwise>
0N/A </xsl:choose>
0N/A </xsl:attribute>
0N/A <td><xsl:value-of select="$testCount"/></td>
0N/A <td><xsl:value-of select="$failureCount"/></td>
0N/A <td><xsl:value-of select="$errorCount"/></td>
0N/A <td>
0N/A <xsl:call-template name="display-percent">
0N/A <xsl:with-param name="value" select="$successRate"/>
0N/A </xsl:call-template>
0N/A </td>
0N/A <td>
0N/A <xsl:call-template name="display-time">
0N/A <xsl:with-param name="value" select="$timeCount"/>
0N/A </xsl:call-template>
0N/A </td>
0N/A </tr>
0N/A </table>
0N/A <table border="0" width="95%">
0N/A <tr>
0N/A <td style="text-align: justify;">
0N/A Note: <em>failures</em> are anticipated and checked for with assertions while <em>errors</em> are unanticipated.
0N/A </td>
0N/A </tr>
0N/A </table>
0N/A
0N/A <h2>Packages</h2>
0N/A <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
0N/A <xsl:call-template name="testsuite.test.header"/>
0N/A <xsl:for-each select="testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
0N/A <xsl:sort select="@package" order="ascending"/>
0N/A <!-- get the node set containing all testsuites that have the same package -->
0N/A <xsl:variable name="insamepackage" select="/testsuites/testsuite[./@package = current()/@package]"/>
0N/A <tr valign="top">
0N/A <!-- display a failure if there is any failure/error in the package -->
0N/A <xsl:attribute name="class">
0N/A <xsl:choose>
0N/A <xsl:when test="sum($insamepackage/@errors) &gt; 0">Error</xsl:when>
0N/A <xsl:when test="sum($insamepackage/@failures) &gt; 0">Failure</xsl:when>
0N/A <xsl:otherwise>Pass</xsl:otherwise>
0N/A </xsl:choose>
0N/A </xsl:attribute>
0N/A <td><a href="./{translate(@package,'.','/')}/package-summary.html">
0N/A <xsl:value-of select="@package"/>
0N/A <xsl:if test="@package = ''">&lt;none&gt;</xsl:if>
0N/A </a></td>
0N/A <td><xsl:value-of select="sum($insamepackage/@tests)"/></td>
0N/A <td><xsl:value-of select="sum($insamepackage/@errors)"/></td>
0N/A <td><xsl:value-of select="sum($insamepackage/@failures)"/></td>
0N/A <td>
0N/A <xsl:call-template name="display-time">
0N/A <xsl:with-param name="value" select="sum($insamepackage/@time)"/>
0N/A </xsl:call-template>
0N/A </td>
0N/A <td><xsl:value-of select="$insamepackage/@timestamp"/></td>
0N/A <td><xsl:value-of select="$insamepackage/@hostname"/></td>
0N/A </tr>
0N/A </xsl:for-each>
0N/A </table>
0N/A </body>
0N/A </html>
0N/A</xsl:template>
0N/A
0N/A
0N/A<xsl:template name="package.summary">
0N/A <xsl:param name="name"/>
0N/A <html>
0N/A <head>
0N/A <xsl:call-template name="create.stylesheet.link">
0N/A <xsl:with-param name="package.name" select="$name"/>
0N/A </xsl:call-template>
0N/A </head>
0N/A <body>
0N/A <xsl:attribute name="onload">open('package-frame.html','classListFrame')</xsl:attribute>
0N/A <xsl:call-template name="pageHeader"/>
0N/A <h3>Package <xsl:value-of select="$name"/></h3>
0N/A
0N/A <!--table border="0" cellpadding="5" cellspacing="2" width="95%">
0N/A <xsl:call-template name="class.metrics.header"/>
0N/A <xsl:apply-templates select="." mode="print.metrics"/>
0N/A </table-->
0N/A
0N/A <xsl:variable name="insamepackage" select="/testsuites/testsuite[./@package = $name]"/>
0N/A <xsl:if test="count($insamepackage) &gt; 0">
0N/A <h2>Classes</h2>
0N/A <p>
0N/A <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
0N/A <xsl:call-template name="testsuite.test.header"/>
0N/A <xsl:apply-templates select="$insamepackage" mode="print.test">
0N/A <xsl:sort select="@name"/>
0N/A </xsl:apply-templates>
0N/A </table>
0N/A </p>
0N/A </xsl:if>
0N/A </body>
0N/A </html>
0N/A</xsl:template>
0N/A
0N/A
0N/A<!--
0N/A transform string like a.b.c to ../../../
0N/A @param path the path to transform into a descending directory path
0N/A-->
0N/A<xsl:template name="path">
0N/A <xsl:param name="path"/>
0N/A <xsl:if test="contains($path,'.')">
0N/A <xsl:text>../</xsl:text>
0N/A <xsl:call-template name="path">
0N/A <xsl:with-param name="path"><xsl:value-of select="substring-after($path,'.')"/></xsl:with-param>
0N/A </xsl:call-template>
0N/A </xsl:if>
0N/A <xsl:if test="not(contains($path,'.')) and not($path = '')">
0N/A <xsl:text>../</xsl:text>
0N/A </xsl:if>
0N/A</xsl:template>
0N/A
0N/A
0N/A<!-- create the link to the stylesheet based on the package name -->
0N/A<xsl:template name="create.stylesheet.link">
0N/A <xsl:param name="package.name"/>
0N/A <link rel="stylesheet" type="text/css" title="Style"><xsl:attribute name="href"><xsl:if test="not($package.name = 'unnamed package')"><xsl:call-template name="path"><xsl:with-param name="path" select="$package.name"/></xsl:call-template></xsl:if>stylesheet.css</xsl:attribute></link>
0N/A</xsl:template>
0N/A
0N/A
0N/A<!-- Page HEADER -->
0N/A<xsl:template name="pageHeader">
0N/A <h1>Unit Test Results</h1>
0N/A <table width="100%">
0N/A <tr>
0N/A <td align="left"></td>
809N/A <td align="right">Designed for use with <a href="http://www.junit.org/">JUnit</a> and <a href="http://ant.apache.org/">Ant</a>.</td>
0N/A </tr>
0N/A </table>
0N/A <hr size="1"/>
0N/A</xsl:template>
0N/A
0N/A<!-- class header -->
0N/A<xsl:template name="testsuite.test.header">
0N/A <tr valign="top">
0N/A <th width="80%">Name</th>
0N/A <th>Tests</th>
0N/A <th>Errors</th>
0N/A <th>Failures</th>
0N/A <th nowrap="nowrap">Time(s)</th>
0N/A <th nowrap="nowrap">Time Stamp</th>
0N/A <th>Host</th>
0N/A </tr>
0N/A</xsl:template>
0N/A
0N/A<!-- method header -->
0N/A<xsl:template name="testcase.test.header">
0N/A <tr valign="top">
0N/A <th>Name</th>
0N/A <th>Status</th>
0N/A <th width="80%">Type</th>
0N/A <th nowrap="nowrap">Time(s)</th>
0N/A </tr>
0N/A</xsl:template>
0N/A
0N/A
0N/A<!-- class information -->
0N/A<xsl:template match="testsuite" mode="print.test">
0N/A <tr valign="top">
0N/A <xsl:attribute name="class">
0N/A <xsl:choose>
0N/A <xsl:when test="@errors[.&gt; 0]">Error</xsl:when>
0N/A <xsl:when test="@failures[.&gt; 0]">Failure</xsl:when>
0N/A <xsl:otherwise>Pass</xsl:otherwise>
0N/A </xsl:choose>
0N/A </xsl:attribute>
0N/A <td><a href="{@name}.html"><xsl:value-of select="@name"/></a></td>
0N/A <td><xsl:apply-templates select="@tests"/></td>
0N/A <td><xsl:apply-templates select="@errors"/></td>
0N/A <td><xsl:apply-templates select="@failures"/></td>
0N/A <td><xsl:call-template name="display-time">
0N/A <xsl:with-param name="value" select="@time"/>
0N/A </xsl:call-template>
0N/A </td>
0N/A <td><xsl:apply-templates select="@timestamp"/></td>
0N/A <td><xsl:apply-templates select="@hostname"/></td>
0N/A </tr>
0N/A</xsl:template>
0N/A
0N/A<xsl:template match="testcase" mode="print.test">
0N/A <tr valign="top">
0N/A <xsl:attribute name="class">
0N/A <xsl:choose>
0N/A <xsl:when test="error">Error</xsl:when>
0N/A <xsl:when test="failure">Failure</xsl:when>
0N/A <xsl:otherwise>TableRowColor</xsl:otherwise>
0N/A </xsl:choose>
0N/A </xsl:attribute>
0N/A <td><xsl:value-of select="@name"/></td>
0N/A <xsl:choose>
0N/A <xsl:when test="failure">
0N/A <td>Failure</td>
0N/A <td><xsl:apply-templates select="failure"/></td>
0N/A </xsl:when>
0N/A <xsl:when test="error">
0N/A <td>Error</td>
0N/A <td><xsl:apply-templates select="error"/></td>
0N/A </xsl:when>
0N/A <xsl:otherwise>
0N/A <td>Success</td>
0N/A <td></td>
0N/A </xsl:otherwise>
0N/A </xsl:choose>
0N/A <td>
0N/A <xsl:call-template name="display-time">
0N/A <xsl:with-param name="value" select="@time"/>
0N/A </xsl:call-template>
0N/A </td>
0N/A </tr>
0N/A</xsl:template>
0N/A
0N/A
0N/A<!-- Note : the below template error and failure are the same style
0N/A so just call the same style store in the toolkit template -->
0N/A<xsl:template match="failure">
0N/A <xsl:call-template name="display-failures"/>
0N/A</xsl:template>
0N/A
0N/A<xsl:template match="error">
0N/A <xsl:call-template name="display-failures"/>
0N/A</xsl:template>
0N/A
0N/A<!-- Style for the error and failure in the testcase template -->
0N/A<xsl:template name="display-failures">
0N/A <xsl:choose>
0N/A <xsl:when test="not(@message)">N/A</xsl:when>
0N/A <xsl:otherwise>
0N/A <xsl:value-of select="@message"/>
0N/A </xsl:otherwise>
0N/A </xsl:choose>
0N/A <!-- display the stacktrace -->
0N/A <br/><br/>
0N/A <code>
0N/A <xsl:call-template name="br-replace">
0N/A <xsl:with-param name="word" select="."/>
0N/A </xsl:call-template>
0N/A </code>
0N/A <!-- the latter is better but might be problematic for non-21" monitors... -->
0N/A <!--pre><xsl:value-of select="."/></pre-->
0N/A</xsl:template>
0N/A
0N/A<xsl:template name="JS-escape">
0N/A <xsl:param name="string"/>
0N/A <xsl:param name="tmp1" select="stringutils:replace(string($string),'\','\\')"/>
0N/A <xsl:param name="tmp2" select="stringutils:replace(string($tmp1),&quot;'&quot;,&quot;\&apos;&quot;)"/>
0N/A <xsl:value-of select="$tmp2"/>
0N/A</xsl:template>
0N/A
0N/A
0N/A<!--
0N/A template that will convert a carriage return into a br tag
0N/A @param word the text from which to convert CR to BR tag
0N/A-->
0N/A<xsl:template name="br-replace">
0N/A <xsl:param name="word"/>
0N/A <xsl:param name="br"><br/></xsl:param>
0N/A <xsl:value-of select='stringutils:replace(string($word),"&#xA;",$br)'/>
0N/A</xsl:template>
0N/A
0N/A<xsl:template name="display-time">
0N/A <xsl:param name="value"/>
0N/A <xsl:value-of select="format-number($value,'0.000')"/>
0N/A</xsl:template>
0N/A
0N/A<xsl:template name="display-percent">
0N/A <xsl:param name="value"/>
0N/A <xsl:value-of select="format-number($value,'0.00%')"/>
0N/A</xsl:template>
0N/A</xsl:stylesheet>