junit-noframes.xsl revision 0
9512fe850e98fdd448c638ca63fdd92a8a510255ahl<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
9512fe850e98fdd448c638ca63fdd92a8a510255ahl xmlns:stringutils="xalan://org.apache.tools.ant.util.StringUtils">
9512fe850e98fdd448c638ca63fdd92a8a510255ahl<xsl:output method="html" indent="yes" encoding="US-ASCII"
9512fe850e98fdd448c638ca63fdd92a8a510255ahl doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" />
9512fe850e98fdd448c638ca63fdd92a8a510255ahl<xsl:decimal-format decimal-separator="." grouping-separator="," />
9512fe850e98fdd448c638ca63fdd92a8a510255ahl Copyright 2001-2004 The Apache Software Foundation
9512fe850e98fdd448c638ca63fdd92a8a510255ahl Licensed under the Apache License, Version 2.0 (the "License");
9512fe850e98fdd448c638ca63fdd92a8a510255ahl you may not use this file except in compliance with the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl You may obtain a copy of the License at
9512fe850e98fdd448c638ca63fdd92a8a510255ahl Unless required by applicable law or agreed to in writing, software
9512fe850e98fdd448c638ca63fdd92a8a510255ahl distributed under the License is distributed on an "AS IS" BASIS,
9512fe850e98fdd448c638ca63fdd92a8a510255ahl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl See the License for the specific language governing permissions and
9512fe850e98fdd448c638ca63fdd92a8a510255ahl limitations under the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl Sample stylesheet to be used with Ant JUnitReport output.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl It creates a non-framed report that can be useful to send via
9512fe850e98fdd448c638ca63fdd92a8a510255ahl e-mail or such.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl @author Stephane Bailliez <a href="mailto:sbailliez@apache.org"/>
9512fe850e98fdd448c638ca63fdd92a8a510255ahl @author Erik Hatcher <a href="mailto:ehatcher@apache.org"/>
9512fe850e98fdd448c638ca63fdd92a8a510255ahl<xsl:template match="testsuites">
9512fe850e98fdd448c638ca63fdd92a8a510255ahl <title>Unit Test Results</title>
9512fe850e98fdd448c638ca63fdd92a8a510255ahl <style type="text/css">
9512fe850e98fdd448c638ca63fdd92a8a510255ahl font:normal 68% verdana,arial,helvetica;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl color:#000000;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl table tr td, table tr th {
9512fe850e98fdd448c638ca63fdd92a8a510255ahl font-size: 68%;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl font-weight: bold;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl text-align:left;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl background:#a6caf0;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl background:#eeeee0;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl line-height:1.5em;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl margin-top:0.5em; margin-bottom:1.0em;
9512fe850e98fdd448c638ca63fdd92a8a510255ahl margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
9512fe850e98fdd448c638ca63fdd92a8a510255ahl margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
9512fe850e98fdd448c638ca63fdd92a8a510255ahl margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
<script type="text/javascript" language="JavaScript">
<script type="text/javascript" language="JavaScript"><![CDATA[
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("<table class='properties'>");
doc.write("<tr><th>Name</th><th>Value</th></tr>");
doc.write("<tr><th>" + prop + "</th><td>" + TestCases[name][prop] + "</td></tr>");
doc.write("</table>");
doc.write("</body></html>");
doc.close();
win.focus();
Note: package statistics are not computed recursively, they only sum up all of its testsuites numbers.
<xsl:call-template name="testsuite.test.header"/>
<xsl:variable name="testsuites-in-package" select="/testsuites/testsuite[./@package = current()/@package]"/>
<!-- set a nice color depending if there is an error/failure -->
<xsl:for-each select="/testsuites/testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
<xsl:call-template name="testsuite.test.header"/>
<xsl:apply-templates select="/testsuites/testsuite[./@package = current()/@package]" mode="print.test"/>
<xsl:call-template name="testcase.test.header"/>
<xsl:apply-templates select="./testcase" mode="print.test"/>
<xsl:attribute name="href">javascript:displayProperties('<xsl:value-of select="@package"/>.<xsl:value-of select="@name"/>');</xsl:attribute>
<xsl:variable name="successRate" select="($testCount - $failureCount - $errorCount) div $testCount"/>
Note: <i>failures</i> are anticipated and checked for with assertions while <i>errors</i> are unanticipated.
cur = TestCases['<xsl:value-of select="../@package"/>.<xsl:value-of select="../@name"/>'] = new Array();
cur['<xsl:value-of select="@name"/>'] = '<xsl:call-template name="JS-escape"><xsl:with-param name="string" select="@value"/></xsl:call-template>';
<td align="right">Designed for use with <a href='http://www.junit.org'>JUnit</a> and <a href='http://jakarta.apache.org/ant'>Ant</a>.</td>
<xsl:template name="testsuite.test.header">
<xsl:template name="testcase.test.header">
<xsl:template match="testsuite" mode="print.test">
<!-- set a nice color depending if there is an error/failure -->
<xsl:template match="testcase" mode="print.test">