ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sbaill...@apache.org
Subject cvs commit: jakarta-ant/src/etc junit-frames.xsl
Date Mon, 13 Aug 2001 19:39:03 GMT
sbailliez    01/08/13 12:39:02

  Modified:    src/etc  Tag: ANT_14_BRANCH junit-frames.xsl
  Log:
  Fix from Ingmar Stein <stein@xtramind.com> for colorization.
  Errors are now always red whereas warnings are purple. Errors have a
  higher priority, i.e. if a package has test classes that produced errors
  and warnings, it is colored red.
  
  Added a fix for package name sorting (it was incorrectly sorted by class name)
  
  Still need to clean up the html to use css like junit-noframes.xsl does.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +117 -105  jakarta-ant/src/etc/junit-frames.xsl
  
  Index: junit-frames.xsl
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/etc/junit-frames.xsl,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- junit-frames.xsl	2001/08/07 22:01:49	1.2
  +++ junit-frames.xsl	2001/08/13 19:39:01	1.2.2.1
  @@ -6,7 +6,7 @@
   
   <!-- ======================================================================
   
  -    Stylesheet to transform an XML file generated by the Ant MAudit task into
  +    Stylesheet to transform an XML file generated by the Ant JUnit task into
       a set of JavaDoc-like HTML page to make pages more convenient to be browsed.
       
       It use the Xalan redirect extension to write to multiple output files.
  @@ -14,8 +14,8 @@
       Note: HTML output can be made much more clean by removing non css attributes
   
       ====================================================================== -->
  -<xsl:output	method="html" indent="yes"/>
  -<xsl:decimal-format decimal-separator="." grouping-separator="," />
  +<xsl:output method="html" indent="yes"/>
  +<xsl:decimal-format decimal-separator="." grouping-separator=","/>
   
   <!--
       Xalan redirect extension writes relative file based on the parent directory
  @@ -27,7 +27,7 @@
       
       This has to be invoked as follows from the command line:
       
  -    java -classpath bsf.jar;xalan.jar;xerces.jar org.apache.xalan.xslt.Process -IN testsuites.xml
-XSL maudit.xsl -PARAM output.dir './report'
  +    java -classpath bsf.jar;xalan.jar;xerces.jar org.apache.xalan.xslt.Process -IN testsuites.xml
-XSL junit-frames.xsl -PARAM output.dir './report'
   -->
   <xsl:param name="output.dir" select="'.'"/>
   
  @@ -98,61 +98,72 @@
   </xsl:template>
   
   <xsl:template name="index.html">
  -<HTML>
  -	<HEAD><TITLE>Unit Test Results.</TITLE></HEAD>
  -	<FRAMESET cols="20%,80%">
  -		<FRAMESET rows="30%,70%">
  -			<FRAME src="overview-frame.html" name="packageListFrame"/>
  -			<FRAME src="allclasses-frame.html" name="classListFrame"/>
  -		</FRAMESET>
  -		<FRAME src="overview-summary.html" name="classFrame"/>
  -	</FRAMESET>
  +<html>
  +	<head>
  +		<title>Unit Test Results.</title>
  +	</head>
  +	<frameset cols="20%,80%">
  +		<frameset rows="30%,70%">
  +			<frame src="overview-frame.html" name="packageListFrame"/>
  +			<frame src="allclasses-frame.html" name="classListFrame"/>
  +		</frameset>
  +		<frame src="overview-summary.html" name="classFrame"/>
  +	</frameset>
   	<noframes>
  -		<H2>Frame Alert</H2>
  -		<P>
  +		<h2>Frame Alert</h2>
  +		<p>
   		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.
  -		</P>
  +		</p>
   	</noframes>
  -</HTML>
  +</html>
   </xsl:template>
   
   
   <!-- this is the stylesheet css to use for nearly everything -->
   <xsl:template name="stylesheet.css">
  -BODY {
  +body {
   	font:normal 68% verdana,arial,helvetica;
   	color:#000000;
   }
  -TD {
  -	FONT-SIZE: 68%
  +td {
  +	font-size: 68%
   }
  -P {
  +p {
   	line-height:1.5em;
   	margin-top:0.5em; margin-bottom:1.0em;
   }
  -H1 {
  -	MARGIN: 0px 0px 5px; FONT: 165% verdana,arial,helvetica
  +h1 {
  +	margin: 0px 0px 5px;
  +	font: 165% verdana,arial,helvetica
  +}
  +h2 {
  +	margin-top: 1em;
  +	margin-bottom: 0.5em;
  +	font: bold 125% verdana,arial,helvetica
  +}
  +h3 {
  +	margin-bottom: 0.5em;
  +	font: bold 115% verdana,arial,helvetica
  +}
  +h4 {
  +	margin-bottom: 0.5em;
  +	font: bold 100% verdana,arial,helvetica
  +}
  +h5 {
  +	margin-bottom: 0.5em;
  +	font: bold 100% verdana,arial,helvetica
  +}
  +h6 {
  +	margin-bottom: 0.5em;
  +	font: bold 100% verdana,arial,helvetica
   }
  -H2 {
  -	MARGIN-TOP: 1em; MARGIN-BOTTOM: 0.5em; FONT: bold 125% verdana,arial,helvetica
  -}
  -H3 {
  -	MARGIN-BOTTOM: 0.5em; FONT: bold 115% verdana,arial,helvetica
  -}
  -H4 {
  -	MARGIN-BOTTOM: 0.5em; FONT: bold 100% verdana,arial,helvetica
  -}
  -H5 {
  -	MARGIN-BOTTOM: 0.5em; FONT: bold 100% verdana,arial,helvetica
  -}
  -H6 {
  -	MARGIN-BOTTOM: 0.5em; FONT: bold 100% verdana,arial,helvetica
  -}
   .Error {
  -	font-weight:bold; color:red;
  +	font-weight:bold;
  +	color:red;
   }
   .Failure {
  -	font-weight:bold; color:purple;
  +	font-weight:bold;
  +	color:purple;
   }
   
   </xsl:template>
  @@ -165,15 +176,15 @@
        ====================================================================== -->
   <xsl:template match="testsuite" mode="class.details">
   	<xsl:variable name="package.name" select="@package"/>
  -	<HTML>
  -		<HEAD>
  +	<html>
  +		<head>
   			<xsl:call-template name="create.stylesheet.link">
   				<xsl:with-param name="package.name" select="$package.name"/>
   			</xsl:call-template>
  -		</HEAD>
  -		<BODY>
  +		</head>
  +		<body>
   			<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%">
  @@ -181,7 +192,7 @@
   				<xsl:apply-templates select="." mode="print.test"/>
   			</table>
   	
  -			<H2>Tests</H2>
  +			<h2>Tests</h2>
   			<p>
   			<table border="0" cellpadding="5" cellspacing="2" width="95%">
   				<xsl:call-template name="testcase.test.header"/>
  @@ -189,8 +200,8 @@
   			</table>
   			
   			</p>
  -		</BODY>
  -	</HTML>
  +		</body>
  +	</html>
   </xsl:template>
   
   
  @@ -202,24 +213,24 @@
   <!-- list of classes in a package -->
   <xsl:template name="classes.list">
   	<xsl:param name="name"/>
  -	<HTML>
  -		<HEAD>
  +	<html>
  +		<head>
   			<xsl:call-template name="create.stylesheet.link">
   				<xsl:with-param name="package.name" select="$name"/>
   			</xsl:call-template>
  -		</HEAD>
  -		<BODY>
  +		</head>
  +		<body>
   			<table width="100%">
   				<tr>
   					<td nowrap="nowrap">
  -						<H2><a href="package-summary.html" target="classFrame"><xsl:value-of
select="$name"/></a></H2>
  +						<h2><a href="package-summary.html" target="classFrame"><xsl:value-of
select="$name"/></a></h2>
   					</td>
   				</tr>
   			</table>
   	
  -			<H2>Classes</H2>
  +			<h2>Classes</h2>
   			<p>
  -			<TABLE WIDTH="100%">
  +			<table width="100%">
   				<xsl:for-each select="/testsuites/testsuite[./@package = $name]">
   					<xsl:sort select="@name"/>
   					<tr>
  @@ -228,10 +239,10 @@
   						</td>
   					</tr>
   				</xsl:for-each>
  -			</TABLE>
  +			</table>
   			</p>
  -		</BODY>
  -	</HTML>
  +		</body>
  +	</html>
   </xsl:template>
   
   
  @@ -260,8 +271,8 @@
   </xsl:template>
   
   <xsl:template match="testsuite" mode="all.classes">
  -    <!-- (ancestor::package)[last()] is buggy in MSXML3, fixed in SP1 ? -->
  -    <xsl:variable name="package.name" select="@package"/>
  +	<!-- (ancestor::package)[last()] is buggy in MSXML3, fixed in SP1? -->
  +	<xsl:variable name="package.name" select="@package"/>
   	<tr>
   		<td nowrap="nowrap">
   			<a target="classFrame">
  @@ -295,7 +306,7 @@
   			<p>
   				<table width="100%">
   					<xsl:apply-templates select="testsuite[not(./@package = preceding-sibling::testsuite/@package)]"
mode="all.packages">
  -						<xsl:sort select="@name"/>
  +						<xsl:sort select="@package"/>
   					</xsl:apply-templates>
   				</table>
   			</p>
  @@ -321,7 +332,7 @@
   				<xsl:with-param name="package.name"/>
   			</xsl:call-template>
   		</head>
  -		<body onload="open('allclasses-frame.html','classListFrame')">
  +		<body>
   		<xsl:call-template name="pageHeader"/>
   		<h2>Summary</h2>
   		<xsl:variable name="testCount" select="sum(testsuite/@tests)"/>
  @@ -331,20 +342,20 @@
   		<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><b>Tests</b></td>
  -			<td><b>Failures</b></td>
  -			<td><b>Errors</b></td>
  -			<td><b>Success rate</b></td>
  -			<td><b>Time</b></td>
  +			<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>
   		</tr>
   		<tr bgcolor="#EEEEE" valign="top">
  -            <xsl:attribute name="class">
  -                <xsl:choose>
  -                    <xsl:when test="$failureCount &gt; 0">Failure</xsl:when>
  -                    <xsl:when test="$errorCount &gt; 0">Error</xsl:when>
  -                    <xsl:otherwise>Pass</xsl:otherwise>
  -                </xsl:choose>
  -            </xsl:attribute>
  +			<xsl:attribute name="class">
  +				<xsl:choose>
  +					<xsl:when test="$errorCount &gt; 0">Error</xsl:when>
  +					<xsl:when test="$failureCount &gt; 0">Failure</xsl:when>
  +					<xsl:otherwise>Pass</xsl:otherwise>
  +				</xsl:choose>
  +			</xsl:attribute>
   			<td><xsl:value-of select="$testCount"/></td>
   			<td><xsl:value-of select="$failureCount"/></td>
   			<td><xsl:value-of select="$errorCount"/></td>
  @@ -364,7 +375,7 @@
   		<table border="0" width="95%">
   		<tr>
   		<td	style="text-align: justify;">
  -		Note: <i>failures</i> are anticipated and checked for with assertions while
<i>errors</i> are unanticipated.
  +		Note: <em>failures</em> are anticipated and checked for with assertions while
<em>errors</em> are unanticipated.
   		</td>
   		</tr>
   		</table>
  @@ -377,13 +388,14 @@
   				<!-- get the node set containing all testsuites that have the same package -->
   				<xsl:variable name="insamepackage" select="/testsuites/testsuite[./@package = current()/@package]"/>
   				<tr bgcolor="#EEEEE" valign="top">
  -				    <!-- display a failure if there is any failure/error in the package -->
  -                    <xsl:attribute name="class">
  -                        <xsl:choose>
  -                            <xsl:when test="sum($insamepackage/@errors) + sum($insamepackage/@failures)
&gt; 0">Failure</xsl:when>
  -                            <xsl:otherwise>Pass</xsl:otherwise>
  -                        </xsl:choose>
  -                    </xsl:attribute>
  +					<!-- display a failure if there is any failure/error in the package -->
  +					<xsl:attribute name="class">
  +						<xsl:choose>
  +							<xsl:when test="sum($insamepackage/@errors) &gt; 0">Error</xsl:when>
  +							<xsl:when test="sum($insamepackage/@failures) &gt; 0">Failure</xsl:when>
  +							<xsl:otherwise>Pass</xsl:otherwise>
  +						</xsl:choose>
  +					</xsl:attribute>
   					<td><a href="{translate(@package,'.','/')}/package-summary.html"><xsl:value-of
select="@package"/></a></td>
   					<td><xsl:value-of select="sum($insamepackage/@tests)"/></td>
   					<td><xsl:value-of select="sum($insamepackage/@errors)"/></td>
  @@ -403,13 +415,13 @@
   
   <xsl:template name="package.summary">
   	<xsl:param name="name"/>
  -	<HTML>
  -		<HEAD>
  +	<html>
  +		<head>
   			<xsl:call-template name="create.stylesheet.link">
   				<xsl:with-param name="package.name" select="$name"/>
   			</xsl:call-template>
  -		</HEAD>
  -		<BODY>
  +		</head>
  +		<body>
   			<xsl:attribute name="onload">open('package-frame.html','classListFrame')</xsl:attribute>
   			<xsl:call-template name="pageHeader"/>
   			<h3>Package <xsl:value-of select="$name"/></h3>
  @@ -421,7 +433,7 @@
   			
   			<xsl:variable name="insamepackage" select="/testsuites/testsuite[./@package = $name]"/>
   			<xsl:if test="count($insamepackage) &gt; 0">
  -				<H2>Classes</H2>
  +				<h2>Classes</h2>
   				<p>
   				<table border="0" cellpadding="5" cellspacing="2" width="95%">
   					<xsl:call-template name="testsuite.test.header"/>
  @@ -431,8 +443,8 @@
   				</table>
   				</p>
   			</xsl:if>
  -		</BODY>
  -	</HTML>
  +		</body>
  +	</html>
   </xsl:template>
   
   
  @@ -457,7 +469,7 @@
   <!-- create the link to the stylesheet based on the package name -->
   <xsl:template name="create.stylesheet.link">
   	<xsl:param name="package.name"/>
  -	<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>
  +	<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>
   </xsl:template>
   
   
  @@ -476,32 +488,32 @@
   <!-- class header -->
   <xsl:template name="testsuite.test.header">
   	<tr bgcolor="#A6CAF0" valign="top">
  -		<td width="80%"><b>Name</b></td>
  -		<td><b>Tests</b></td>
  -		<td><b>Errors</b></td>
  -		<td><b>Failures</b></td>
  -		<td nowrap="nowrap"><b>Time(s)</b></td>
  +		<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>
   </xsl:template>
   
   <!-- method header -->
   <xsl:template name="testcase.test.header">
   	<tr bgcolor="#A6CAF0" valign="top">
  -		<td><b>Name</b></td>
  -		<td><b>Status</b></td>
  -		<td width="80%"><b>Type</b></td>
  -		<td nowrap="nowrap"><b>Time(s)</b></td>
  +		<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>
   </xsl:template>
   
   
   <!-- class information -->
   <xsl:template match="testsuite" mode="print.test">
  -	<tr bgcolor="#EEEEE" valign="top">
  +	<tr bgcolor="#EEEEE" valign="top">		
   		<xsl:attribute name="class">
   			<xsl:choose>
  -			    <xsl:when test="@failures[.&gt; 0]">Failure</xsl:when>
   				<xsl:when test="@errors[.&gt; 0]">Error</xsl:when>
  +				<xsl:when test="@failures[.&gt; 0]">Failure</xsl:when>
   				<xsl:otherwise>Pass</xsl:otherwise>
   			</xsl:choose>
   		</xsl:attribute>
  @@ -520,7 +532,8 @@
   	<tr bgcolor="#EEEEE" valign="top">
   	    <xsl:attribute name="class">
   			<xsl:choose>
  -				<xsl:when test="failure | error">Error</xsl:when>
  +				<xsl:when test="error">Error</xsl:when>
  +				<xsl:when test="failure">Failure</xsl:when>
   				<xsl:otherwise>TableRowColor</xsl:otherwise>
   			</xsl:choose>
   		</xsl:attribute>
  @@ -558,7 +571,7 @@
   	<xsl:call-template name="display-failures"/>
   </xsl:template>
   
  -<!-- Style for the error and failure in the tescase template -->
  +<!-- Style for the error and failure in the testcase template -->
   <xsl:template name="display-failures">
   	<xsl:choose>
   		<xsl:when test="not(@message)">N/A</xsl:when>
  @@ -573,7 +586,7 @@
   			<xsl:with-param name="word" select="."/>
   		</xsl:call-template>
   	</code>
  -	<!-- the later is better but might be problematic for non-21" monitors... -->
  +	<!-- the latter is better but might be problematic for non-21" monitors... -->
   	<!--pre><xsl:value-of select="."/></pre-->
   </xsl:template>
   
  @@ -606,6 +619,5 @@
   	<xsl:param name="value"/>
   	<xsl:value-of select="format-number($value,'0.00%')"/>
   </xsl:template>
  -
   </xsl:stylesheet>
   	
  
  
  

Mime
View raw message