junit-frames.xsl revision 809
3567N/A<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
3349N/A xmlns:lxslt="http://xml.apache.org/xslt"
3349N/A xmlns:redirect="http://xml.apache.org/xalan/redirect"
3349N/A xmlns:stringutils="xalan://org.apache.tools.ant.util.StringUtils"
3349N/A<xsl:param name="output.dir" select="'.'"/>
3349N/A <!-- create the index.html -->
3349N/A <xsl:call-template name="index.html"/>
3349N/A <!-- create the stylesheet.css -->
3349N/A <xsl:call-template name="stylesheet.css"/>
3349N/A <!-- create the overview-packages.html at the root -->
3349N/A <xsl:apply-templates select="." mode="overview.packages"/>
3349N/A <!-- create the all-packages.html at the root -->
3349N/A <xsl:apply-templates select="." mode="all.packages"/>
3349N/A <!-- create the all-classes.html at the root -->
3349N/A <xsl:apply-templates select="." mode="all.classes"/>
3349N/A <!-- create the all-tests.html at the root -->
3349N/A <!-- create the alltests-fails.html at the root -->
3349N/A <!-- create the alltests-errors.html at the root -->
3349N/A <xsl:for-each select="./testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
3349N/A <xsl:variable name="package.dir">
3349N/A <!--Processing package <xsl:value-of select="@name"/> in <xsl:value-of select="$output.dir"/> -->
3349N/A <!-- create a classes-list.html in the package directory -->
3349N/A <xsl:call-template name="classes.list">
3349N/A <!-- create a package-summary.html in the package directory -->
3349N/A <xsl:call-template name="package.summary">
3349N/A <!-- @bug there will be a problem with inner classes having the same name, it will be overwritten -->
3349N/A <xsl:for-each select="/testsuites/testsuite[@package = $name]">
3349N/A <xsl:apply-templates select="." mode="class.details"/>
3349N/A <xsl:apply-templates select="." mode="class.details">
3349N/A <xsl:apply-templates select="." mode="class.details">
3349N/A<xsl:template name="index.html">
3349N/A <frame src="overview-frame.html" name="packageListFrame"/>
3349N/A <frame src="allclasses-frame.html" name="classListFrame"/>
3349N/A <frame src="overview-summary.html" name="classFrame"/>
3349N/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.
3349N/A<xsl:template name="stylesheet.css">
3349N/Atable.details tr th{
3349N/Atable.details tr td{
3349N/A<!-- Create list of all/failed/errored tests -->
3349N/A <xsl:call-template name="create.stylesheet.link">
3349N/A <xsl:with-param name="package.name"/>
3349N/A <xsl:attribute name="onload">open('allclasses-frame.html','classListFrame')</xsl:attribute>
3349N/A <xsl:call-template name="testcase.test.header">
3349N/A <xsl:with-param name="show.class" select="'yes'"/>
3349N/A <xsl:apply-templates select=".//testcase[failure]" mode="print.test">
3349N/A <xsl:with-param name="show.class" select="'yes'"/>
3349N/A <xsl:apply-templates select=".//testcase[error]" mode="print.test">
3349N/A <xsl:with-param name="show.class" select="'yes'"/>
3349N/A <xsl:apply-templates select=".//testcase" mode="print.test">
3349N/A <xsl:with-param name="show.class" select="'yes'"/>
3349N/A<xsl:template match="testsuite" mode="class.details">
3349N/A <xsl:variable name="package.name" select="@package"/>
3349N/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>
3349N/A <title>Unit Test Results: <xsl:value-of select="$class.name"/></title>
3349N/A <xsl:call-template name="create.stylesheet.link">
3349N/A <script type="text/javascript" language="JavaScript">
3349N/A <script type="text/javascript" language="JavaScript"><![CDATA[
3349N/A var win = window.open('','JUnitSystemProperties','scrollbars=1,resizable=1');
3349N/A var doc = win.document;
3349N/A doc.write("table.properties { border-collapse:collapse; border-left:solid 1 #cccccc; border-top:solid 1 #cccccc; padding:5px; }");
3349N/A doc.write("table.properties th { text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#eeeeee; }");
3349N/A doc.write("table.properties td { font:normal; text-align:left; border-right:solid 1 #cccccc; border-bottom:solid 1 #cccccc; background-color:#fffffff; }");
3349N/A <h3>Class <xsl:value-of select="$class.name"/></h3>
3349N/A <xsl:call-template name="testsuite.test.header"/>
3349N/A <xsl:apply-templates select="." mode="print.test"/>
3349N/A <xsl:call-template name="testcase.test.header"/>
3349N/A <xsl:apply-templates select="./testcase[failure]" mode="print.test"/>
3349N/A <xsl:apply-templates select="./testcase[error]" mode="print.test"/>
3349N/A <xsl:apply-templates select="./testcase" mode="print.test"/>
3349N/A <xsl:attribute name="href">javascript:displayProperties('<xsl:value-of select="@package"/>.<xsl:value-of select="@name"/>');</xsl:attribute>
3349N/A <xsl:attribute name="href">./<xsl:value-of select="@id"/>_<xsl:value-of select="@name"/>-out.txt</xsl:attribute>
3349N/A System.out »
3349N/A <xsl:attribute name="href">./<xsl:value-of select="@id"/>_<xsl:value-of select="@name"/>-err.txt</xsl:attribute>
3349N/A System.err »
3349N/A cur = TestCases['<xsl:value-of select="../@package"/>.<xsl:value-of select="../@name"/>'] = new Array();
3349N/A cur['<xsl:value-of select="@name"/>'] = '<xsl:call-template name="JS-escape"><xsl:with-param name="string" select="@value"/></xsl:call-template>';
3349N/A<xsl:template name="classes.list">
3349N/A <xsl:call-template name="create.stylesheet.link">
3349N/A <xsl:with-param name="package.name" select="$name"/>
3349N/A <h2><a href="package-summary.html" target="classFrame">
3349N/A <xsl:for-each select="/testsuites/testsuite[./@package = $name]">
3349N/A<xsl:template match="testsuites" mode="all.classes">
3349N/A <xsl:call-template name="create.stylesheet.link">
3349N/A <xsl:with-param name="package.name"/>
3349N/A <xsl:apply-templates select="testsuite" mode="all.classes">
3349N/A<xsl:template match="testsuite" mode="all.classes">
3349N/A <xsl:variable name="package.name" select="@package"/>
3349N/A <xsl:if test="not($package.name='')">
3349N/A <xsl:value-of select="translate($package.name,'.','/')"/><xsl:text>/</xsl:text>
3349N/A </xsl:if><xsl:value-of select="@id"/>_<xsl:value-of select="@name"/><xsl:text>.html</xsl:text>
3349N/A Creates an html file that contains a link to all package-summary.html files on
3349N/A<xsl:template match="testsuites" mode="all.packages">
3349N/A <xsl:call-template name="create.stylesheet.link">
3349N/A <xsl:with-param name="package.name"/>
3349N/A <h2><a href="overview-summary.html" target="classFrame">Home</a></h2>
3349N/A <xsl:apply-templates select="testsuite[not(./@package = preceding-sibling::testsuite/@package)]" mode="all.packages">
3349N/A<xsl:template match="testsuite" mode="all.packages">
3349N/A <a href="./{translate(@package,'.','/')}/package-summary.html" target="classFrame">
3349N/A<xsl:template match="testsuites" mode="overview.packages">
3349N/A <xsl:call-template name="create.stylesheet.link">
3349N/A <xsl:with-param name="package.name"/>
3349N/A <xsl:attribute name="onload">open('allclasses-frame.html','classListFrame')</xsl:attribute>
3349N/A <xsl:variable name="successRate" select="($testCount - $failureCount - $errorCount) div $testCount"/>
3349N/A <td><a title="Display all tests" href="all-tests.html"><xsl:value-of select="$testCount"/></a></td>
3349N/A <td><a title="Display all failures" href="alltests-fails.html"><xsl:value-of select="$failureCount"/></a></td>
3349N/A <td><a title="Display all errors" href="alltests-errors.html"><xsl:value-of select="$errorCount"/></a></td>
3349N/A Note: <em>failures</em> are anticipated and checked for with assertions while <em>errors</em> are unanticipated.
3349N/A <xsl:call-template name="testsuite.test.header"/>
3349N/A <xsl:variable name="insamepackage" select="/testsuites/testsuite[./@package = current()/@package]"/>
3349N/A <!-- display a failure if there is any failure/error in the package -->
3349N/A <td><a href="./{translate(@package,'.','/')}/package-summary.html">
3349N/A<xsl:template name="package.summary">
3349N/A <xsl:call-template name="create.stylesheet.link">
3349N/A <xsl:with-param name="package.name" select="$name"/>
3349N/A <xsl:attribute name="onload">open('package-frame.html','classListFrame')</xsl:attribute>
3349N/A <xsl:call-template name="class.metrics.header"/>
3349N/A <xsl:apply-templates select="." mode="print.metrics"/>
3349N/A <xsl:variable name="insamepackage" select="/testsuites/testsuite[./@package = $name]"/>
3349N/A <xsl:call-template name="testsuite.test.header"/>
3349N/A <xsl:apply-templates select="$insamepackage" mode="print.test">
3349N/A <xsl:with-param name="path"><xsl:value-of select="substring-after($path,'.')"/></xsl:with-param>
3349N/A<xsl:template name="create.stylesheet.link">
3349N/A <xsl:param name="package.name"/>
3349N/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>
3349N/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>
3349N/A<xsl:template name="testsuite.test.header">
3349N/A<xsl:template name="testcase.test.header">
3349N/A <xsl:param name="show.class" select="''"/>
3349N/A <xsl:if test="boolean($show.class)">
3349N/A<xsl:template match="testsuite" mode="print.test">
3349N/A <td><a title="Display all tests" href="{@id}_{@name}.html"><xsl:value-of select="@name"/></a></td>
3349N/A <td><a title="Display all tests" href="{@id}_{@name}.html"><xsl:apply-templates select="@tests"/></a></td>
3349N/A <a title="Display only errors" href="{@id}_{@name}-errors.html"><xsl:apply-templates select="@errors"/></a>
3349N/A <a title="Display only failures" href="{@id}_{@name}-fails.html"><xsl:apply-templates select="@failures"/></a>
3349N/A<xsl:template match="testcase" mode="print.test">
3349N/A <xsl:param name="show.class" select="''"/>
3349N/A <xsl:variable name="class.href">
3349N/A <xsl:value-of select="concat(translate(../@package,'.','/'), '/', ../@id, '_', ../@name, '.html')"/>
3349N/A <xsl:if test="boolean($show.class)">
3349N/A <td><a href="{$class.href}"><xsl:value-of select="../@name"/></a></td>
3349N/A <xsl:when test="boolean($show.class)">
3349N/A <a href="{concat($class.href, '#', @name)}"><xsl:value-of select="@name"/></a>
3349N/A <xsl:param name="tmp2" select="stringutils:replace(string($tmp1),"'","\'")"/>