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