bodewig     2002/09/26 04:14:43

  Modified:    src/etc  junit-frames.xsl junit-noframes.xsl
  Log:
  Make HTML generated by <junitreport> look more like valid HTML.
  
  PR: 12604
  Submitted by: Ville Skytt� <ville.skytta at iki.fi>
  
  Revision  Changes    Path
  1.12      +23 -25    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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- junit-frames.xsl  6 Sep 2002 00:01:34 -0000       1.11
  +++ junit-frames.xsl  26 Sep 2002 11:14:43 -0000      1.12
  @@ -158,13 +158,13 @@
               <frame src="allclasses-frame.html" name="classListFrame"/>
           </frameset>
           <frame src="overview-summary.html" name="classFrame"/>
  +        <noframes>
  +            <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>
  +        </noframes>
       </frameset>
  -    <noframes>
  -        <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>
  -    </noframes>
   </html>
   </xsl:template>
   
  @@ -227,22 +227,24 @@
        ====================================================================== 
-->
   <xsl:template match="testsuite" mode="class.details">
       <xsl:variable name="package.name" select="@package"/>
  +    <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>
       <html>
           <head>
  +          <title>Unit Test Results: <xsl:value-of 
select="$class.name"/></title>
               <xsl:call-template name="create.stylesheet.link">
                   <xsl:with-param name="package.name" select="$package.name"/>
               </xsl:call-template>
  -      <script language="JavaScript">
  +       <script type="text/javascript" language="JavaScript">
           var TestCases = new Array();
           var cur;
           <xsl:apply-templates select="properties"/>
          </script>
  -       <script language="JavaScript"><![CDATA[
  +       <script type="text/javascript" language="JavaScript"><![CDATA[
           function displayProperties (name) {
             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("<style type=\"text/css\">");
             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; }");
  @@ -268,7 +270,7 @@
           </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:value-of select="$class.name"/></h3>
   
               
               <table class="details" border="0" cellpadding="5" 
cellspacing="2" width="95%">
  @@ -277,7 +279,6 @@
               </table>
       
               <h2>Tests</h2>
  -            <p>
               <table class="details" border="0" cellpadding="5" 
cellspacing="2" width="95%">
           <xsl:call-template name="testcase.test.header"/>
                 <!--
  @@ -291,7 +292,6 @@
                   </xsl:if>
                   <xsl:apply-templates select="./testcase" mode="print.test"/>
               </table>
  -            </p>
               <div class="Properties">
                   <a>
                       <xsl:attribute 
name="href">javascript:displayProperties('<xsl:value-of 
select="@package"/>.<xsl:value-of select="@name"/>');</xsl:attribute>
  @@ -341,6 +341,7 @@
       <xsl:param name="name"/>
       <html>
           <head>
  +            <title>Unit Test Classes: <xsl:value-of select="$name"/></title>
               <xsl:call-template name="create.stylesheet.link">
                   <xsl:with-param name="package.name" select="$name"/>
               </xsl:call-template>
  @@ -355,7 +356,6 @@
               </table>
       
               <h2>Classes</h2>
  -            <p>
               <table width="100%">
                   <xsl:for-each select="/testsuites/testsuite[./@package = 
$name]">
                       <xsl:sort select="@name"/>
  @@ -366,7 +366,6 @@
                       </tr>
                   </xsl:for-each>
               </table>
  -            </p>
           </body>
       </html>
   </xsl:template>
  @@ -379,19 +378,18 @@
   <xsl:template match="testsuites" mode="all.classes">
       <html>
           <head>
  +            <title>All Unit Test Classes</title>
               <xsl:call-template name="create.stylesheet.link">
                   <xsl:with-param name="package.name"/>
               </xsl:call-template>
           </head>
           <body>
               <h2>Classes</h2>
  -            <p>
               <table width="100%">
                   <xsl:apply-templates select="testsuite" mode="all.classes">
                       <xsl:sort select="@name"/>
                   </xsl:apply-templates>
               </table>
  -            </p>
           </body>
       </html>
   </xsl:template>
  @@ -421,6 +419,7 @@
   <xsl:template match="testsuites" mode="all.packages">
       <html>
           <head>
  +            <title>All Unit Test Packages</title>
               <xsl:call-template name="create.stylesheet.link">
                   <xsl:with-param name="package.name"/>
               </xsl:call-template>
  @@ -428,13 +427,11 @@
           <body>
               <h2><a href="overview-summary.html" 
target="classFrame">Home</a></h2>
               <h2>Packages</h2>
  -            <p>
  -                <table width="100%">
  -                    <xsl:apply-templates select="testsuite[not(./@package = 
preceding-sibling::testsuite/@package)]" mode="all.packages">
  -                        <xsl:sort select="@package"/>
  -                    </xsl:apply-templates>
  -                </table>
  -            </p>
  +            <table width="100%">
  +                <xsl:apply-templates select="testsuite[not(./@package = 
preceding-sibling::testsuite/@package)]" mode="all.packages">
  +                    <xsl:sort select="@package"/>
  +                </xsl:apply-templates>
  +            </table>
           </body>
       </html>
   </xsl:template>
  @@ -453,6 +450,7 @@
   <xsl:template match="testsuites" mode="overview.packages">
       <html>
           <head>
  +            <title>Unit Test Results: Summary</title>
               <xsl:call-template name="create.stylesheet.link">
                   <xsl:with-param name="package.name"/>
               </xsl:call-template>
  @@ -605,7 +603,7 @@
       <table width="100%">
       <tr>
           <td align="left"></td>
  -        <td align="right">Designed for use with <a 
href='http://www.junit.org'>JUnit</a> and <a 
href='http://jakarta.apache.org'>Ant</a>.</td>
  +        <td align="right">Designed for use with <a 
href="http://www.junit.org/";>JUnit</a> and <a 
href="http://jakarta.apache.org/";>Ant</a>.</td>
       </tr>
       </table>
       <hr size="1"/>
  @@ -706,8 +704,8 @@
           </xsl:otherwise>
       </xsl:choose>
       <!-- display the stacktrace -->
  +    <br/><br/>
       <code>
  -        <p/>
           <xsl:call-template name="br-replace">
               <xsl:with-param name="word" select="."/>
           </xsl:call-template>
  
  
  
  1.9       +10 -8     jakarta-ant/src/etc/junit-noframes.xsl
  
  Index: junit-noframes.xsl
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/etc/junit-noframes.xsl,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- junit-noframes.xsl        6 Sep 2002 00:06:01 -0000       1.8
  +++ junit-noframes.xsl        26 Sep 2002 11:14:43 -0000      1.9
  @@ -1,5 +1,6 @@
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  -<xsl:output method="html" indent="yes" encoding="US-ASCII"/>
  +<xsl:output method="html" indent="yes" encoding="US-ASCII"
  +  doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" />
   <xsl:decimal-format decimal-separator="." grouping-separator="," />
   <!--
    The Apache Software License, Version 1.1
  @@ -67,8 +68,9 @@
    
   -->
   <xsl:template match="testsuites">
  -    <HTML>
  -        <HEAD>
  +    <html>
  +        <head>
  +            <title>Unit Test Results</title>
       <style type="text/css">
         body {
           font:normal 68% verdana,arial,helvetica;
  @@ -118,7 +120,7 @@
           text-align:right;
         }
         </style>
  -      <script language="JavaScript">
  +      <script type="text/javascript" language="JavaScript">
           var TestCases = new Array();
           var cur;
           <xsl:for-each select="./testsuite">      
  @@ -126,7 +128,7 @@
           </xsl:for-each>
   
          </script>
  -       <script language="JavaScript"><![CDATA[
  +       <script type="text/javascript" language="JavaScript"><![CDATA[
           function displayProperties (name) {
             var win = 
window.open('','JUnitSystemProperties','scrollbars=1,resizable=1');
             var doc = win.document.open();
  @@ -154,7 +156,7 @@
           }
         ]]>  
         </script>
  -        </HEAD>
  +        </head>
           <body>
               <a name="top"></a>
               <xsl:call-template name="pageHeader"/>  
  @@ -175,7 +177,7 @@
               <xsl:call-template name="classes"/>
               
           </body>
  -    </HTML>
  +    </html>
   </xsl:template>
       
       
  @@ -454,7 +456,7 @@
       </xsl:choose>
       <!-- display the stacktrace -->
       <code>
  -        <p/>
  +        <br/><br/>
           <xsl:call-template name="br-replace">
               <xsl:with-param name="word" select="."/>
           </xsl:call-template>
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to