You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2006/08/26 21:07:45 UTC
svn commit: r437212 - in /ant: antlibs/antunit/trunk/src/etc/
antlibs/antunit/trunk/src/etc/testcases/
antlibs/antunit/trunk/src/testcases/ antlibs/antunit/trunk/src/tests/
antlibs/antunit/trunk/src/tests/junit/ antlibs/common/trunk/
antlibs/dotnet/tru...
Author: bodewig
Date: Sat Aug 26 12:07:44 2006
New Revision: 437212
URL: http://svn.apache.org/viewvc?rev=437212&view=rev
Log:
Move JUnit tests into a separate directory structure, preparation to add AntUnit to the mix
Added:
ant/antlibs/antunit/trunk/src/etc/junit-frames.xsl
- copied, changed from r433145, ant/core/trunk/src/etc/junit-frames.xsl
ant/antlibs/antunit/trunk/src/etc/junit-noframes.xsl
- copied unchanged from r433145, ant/core/trunk/src/etc/junit-noframes.xsl
ant/antlibs/antunit/trunk/src/tests/
ant/antlibs/antunit/trunk/src/tests/junit/
- copied from r437198, ant/antlibs/antunit/trunk/src/testcases/
ant/antlibs/dotnet/trunk/src/tests/
ant/antlibs/dotnet/trunk/src/tests/junit/
- copied from r430109, ant/antlibs/dotnet/trunk/src/testcases/
ant/antlibs/dotnet/trunk/src/tests/junit/org/apache/ant/dotnet/build/
- copied from r434477, ant/antlibs/dotnet/trunk/src/testcases/org/apache/ant/dotnet/build/
ant/antlibs/dotnet/trunk/src/tests/junit/org/apache/ant/dotnet/compile/
- copied from r434477, ant/antlibs/dotnet/trunk/src/testcases/org/apache/ant/dotnet/compile/
ant/antlibs/svn/trunk/src/tests/
ant/antlibs/svn/trunk/src/tests/junit/
- copied from r430109, ant/antlibs/svn/trunk/src/testcases/
ant/sandbox/antlibs/vss/src/tests/
ant/sandbox/antlibs/vss/src/tests/junit/
- copied from r430109, ant/sandbox/antlibs/vss/src/testcases/
Removed:
ant/antlibs/antunit/trunk/src/testcases/
ant/antlibs/dotnet/trunk/src/testcases/
ant/antlibs/svn/trunk/src/testcases/
ant/sandbox/antlibs/vss/src/testcases/
Modified:
ant/antlibs/antunit/trunk/src/etc/testcases/antunit.xml
ant/antlibs/common/trunk/build.xml
ant/antlibs/dotnet/trunk/build.xml
Copied: ant/antlibs/antunit/trunk/src/etc/junit-frames.xsl (from r433145, ant/core/trunk/src/etc/junit-frames.xsl)
URL: http://svn.apache.org/viewvc/ant/antlibs/antunit/trunk/src/etc/junit-frames.xsl?p2=ant/antlibs/antunit/trunk/src/etc/junit-frames.xsl&p1=ant/core/trunk/src/etc/junit-frames.xsl&r1=433145&r2=437212&rev=437212&view=diff
==============================================================================
--- ant/core/trunk/src/etc/junit-frames.xsl (original)
+++ ant/antlibs/antunit/trunk/src/etc/junit-frames.xsl Sat Aug 26 12:07:44 2006
@@ -6,27 +6,30 @@
<xsl:output method="html" indent="yes" encoding="US-ASCII"/>
<xsl:decimal-format decimal-separator="." grouping-separator=","/>
<!--
- Copyright 2001-2006 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
<!--
Sample stylesheet to be used with Ant JUnitReport output.
It creates a set of HTML files a la javadoc where you can browse easily
- through all packages and classes.
+ through all directories and projects.
-->
<xsl:param name="output.dir" select="'.'"/>
@@ -43,19 +46,19 @@
<xsl:call-template name="stylesheet.css"/>
</redirect:write>
- <!-- create the overview-packages.html at the root -->
+ <!-- create the overview-directories.html at the root -->
<redirect:write file="{$output.dir}/overview-summary.html">
- <xsl:apply-templates select="." mode="overview.packages"/>
+ <xsl:apply-templates select="." mode="overview.directories"/>
</redirect:write>
- <!-- create the all-packages.html at the root -->
+ <!-- create the all-directories.html at the root -->
<redirect:write file="{$output.dir}/overview-frame.html">
- <xsl:apply-templates select="." mode="all.packages"/>
+ <xsl:apply-templates select="." mode="all.directories"/>
</redirect:write>
- <!-- create the all-classes.html at the root -->
- <redirect:write file="{$output.dir}/allclasses-frame.html">
- <xsl:apply-templates select="." mode="all.classes"/>
+ <!-- create the all-projects.html at the root -->
+ <redirect:write file="{$output.dir}/allprojects-frame.html">
+ <xsl:apply-templates select="." mode="all.projects"/>
</redirect:write>
<!-- create the all-tests.html at the root -->
@@ -77,62 +80,62 @@
</xsl:apply-templates>
</redirect:write>
- <!-- process all packages -->
+ <!-- process all directories -->
<xsl:for-each select="./testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
- <xsl:call-template name="package">
+ <xsl:call-template name="directory">
<xsl:with-param name="name" select="@package"/>
</xsl:call-template>
</xsl:for-each>
</xsl:template>
-<xsl:template name="package">
+<xsl:template name="directory">
<xsl:param name="name"/>
- <xsl:variable name="package.dir">
+ <xsl:variable name="directory.dir">
<xsl:if test="not($name = '')"><xsl:value-of select="translate($name,'.','/')"/></xsl:if>
<xsl:if test="$name = ''">.</xsl:if>
</xsl:variable>
- <!--Processing package <xsl:value-of select="@name"/> in <xsl:value-of select="$output.dir"/> -->
- <!-- create a classes-list.html in the package directory -->
- <redirect:write file="{$output.dir}/{$package.dir}/package-frame.html">
- <xsl:call-template name="classes.list">
+ <!--Processing directory <xsl:value-of select="@name"/> in <xsl:value-of select="$output.dir"/> -->
+ <!-- create a projects-list.html in the directory directory -->
+ <redirect:write file="{$output.dir}/{$directory.dir}/directory-frame.html">
+ <xsl:call-template name="projects.list">
<xsl:with-param name="name" select="$name"/>
</xsl:call-template>
</redirect:write>
- <!-- create a package-summary.html in the package directory -->
- <redirect:write file="{$output.dir}/{$package.dir}/package-summary.html">
- <xsl:call-template name="package.summary">
+ <!-- create a directory-summary.html in the directory directory -->
+ <redirect:write file="{$output.dir}/{$directory.dir}/directory-summary.html">
+ <xsl:call-template name="directory.summary">
<xsl:with-param name="name" select="$name"/>
</xsl:call-template>
</redirect:write>
- <!-- for each class, creates a @name.html -->
- <!-- @bug there will be a problem with inner classes having the same name, it will be overwritten -->
+ <!-- for each project, creates a @name.html -->
+ <!-- @bug there will be a problem with inner projects having the same name, it will be overwritten -->
<xsl:for-each select="/testsuites/testsuite[@package = $name]">
- <redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}.html">
- <xsl:apply-templates select="." mode="class.details"/>
+ <redirect:write file="{$output.dir}/{$directory.dir}/{@id}_{@name}.html">
+ <xsl:apply-templates select="." mode="project.details"/>
</redirect:write>
<xsl:if test="string-length(./system-out)!=0">
- <redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}-out.txt">
+ <redirect:write file="{$output.dir}/{$directory.dir}/{@id}_{@name}-out.txt">
<xsl:value-of disable-output-escaping="yes" select="./system-out"/>
</redirect:write>
</xsl:if>
<xsl:if test="string-length(./system-err)!=0">
- <redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}-err.txt">
+ <redirect:write file="{$output.dir}/{$directory.dir}/{@id}_{@name}-err.txt">
<xsl:value-of disable-output-escaping="yes" select="./system-err"/>
</redirect:write>
</xsl:if>
- <xsl:if test="@failures != 0">
- <redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}-fails.html">
- <xsl:apply-templates select="." mode="class.details">
+ <xsl:if test="failures/text() != 0">
+ <redirect:write file="{$output.dir}/{$directory.dir}/{@id}_{@name}-fails.html">
+ <xsl:apply-templates select="." mode="project.details">
<xsl:with-param name="type" select="'fails'"/>
</xsl:apply-templates>
</redirect:write>
</xsl:if>
- <xsl:if test="@errors != 0">
- <redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}-errors.html">
- <xsl:apply-templates select="." mode="class.details">
+ <xsl:if test="errors/text() != 0">
+ <redirect:write file="{$output.dir}/{$directory.dir}/{@id}_{@name}-errors.html">
+ <xsl:apply-templates select="." mode="project.details">
<xsl:with-param name="type" select="'errors'"/>
</xsl:apply-templates>
</redirect:write>
@@ -143,14 +146,14 @@
<xsl:template name="index.html">
<html>
<head>
- <title>Unit Test Results.</title>
+ <title>AntUnit 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"/>
+ <frame src="overview-frame.html" name="directoryListFrame"/>
+ <frame src="allprojects-frame.html" name="projectListFrame"/>
</frameset>
- <frame src="overview-summary.html" name="classFrame"/>
+ <frame src="overview-summary.html" name="projectFrame"/>
<noframes>
<h2>Frame Alert</h2>
<p>
@@ -230,22 +233,22 @@
</xsl:choose>
</xsl:variable>
<head>
- <title>Unit Test Results: <xsl:value-of select="$title"/></title>
+ <title>AntUnit Test Results: <xsl:value-of select="$title"/></title>
<xsl:call-template name="create.stylesheet.link">
- <xsl:with-param name="package.name"/>
+ <xsl:with-param name="directory.name"/>
</xsl:call-template>
</head>
<body>
- <xsl:attribute name="onload">open('allclasses-frame.html','classListFrame')</xsl:attribute>
+ <xsl:attribute name="onload">open('allprojects-frame.html','projectListFrame')</xsl:attribute>
<xsl:call-template name="pageHeader"/>
<h2><xsl:value-of select="$title"/></h2>
<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
<xsl:call-template name="testcase.test.header">
- <xsl:with-param name="show.class" select="'yes'"/>
+ <xsl:with-param name="show.project" select="'yes'"/>
</xsl:call-template>
<!--
- test can even not be started at all (failure to load the class)
+ test can even not be started at all (failure to load the project)
so report the error directly
-->
<xsl:if test="./error">
@@ -258,17 +261,17 @@
<xsl:choose>
<xsl:when test="$type = 'fails'">
<xsl:apply-templates select=".//testcase[failure]" mode="print.test">
- <xsl:with-param name="show.class" select="'yes'"/>
+ <xsl:with-param name="show.project" select="'yes'"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="$type = 'errors'">
<xsl:apply-templates select=".//testcase[error]" mode="print.test">
- <xsl:with-param name="show.class" select="'yes'"/>
+ <xsl:with-param name="show.project" select="'yes'"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select=".//testcase" mode="print.test">
- <xsl:with-param name="show.class" select="'yes'"/>
+ <xsl:with-param name="show.project" select="'yes'"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
@@ -279,19 +282,19 @@
<!-- ======================================================================
- This page is created for every testsuite class.
+ This page is created for every testsuite project.
It prints a summary of the testsuite and detailed information about
testcase methods.
====================================================================== -->
-<xsl:template match="testsuite" mode="class.details">
+<xsl:template match="testsuite" mode="project.details">
<xsl:param name="type" select="'all'"/>
- <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>
+ <xsl:variable name="directory.name" select="@package"/>
+ <xsl:variable name="project.name"><xsl:if test="not($directory.name = '')"><xsl:value-of select="$directory.name"/>.</xsl:if><xsl:value-of select="@name"/></xsl:variable>
<html>
<head>
- <title>Unit Test Results: <xsl:value-of select="$class.name"/></title>
+ <title>AntUnit Test Results: <xsl:value-of select="$project.name"/></title>
<xsl:call-template name="create.stylesheet.link">
- <xsl:with-param name="package.name" select="$package.name"/>
+ <xsl:with-param name="directory.name" select="$directory.name"/>
</xsl:call-template>
<script type="text/javascript" language="JavaScript">
var TestCases = new Array();
@@ -330,7 +333,7 @@
</head>
<body>
<xsl:call-template name="pageHeader"/>
- <h3>Class <xsl:value-of select="$class.name"/></h3>
+ <h3>Project <xsl:value-of select="$project.name"/></h3>
<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
@@ -352,7 +355,7 @@
<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
<xsl:call-template name="testcase.test.header"/>
<!--
- test can even not be started at all (failure to load the class)
+ test can even not be started at all (failure to load the project)
so report the error directly
-->
<xsl:if test="./error">
@@ -372,7 +375,7 @@
</xsl:otherwise>
</xsl:choose>
</table>
- <div class="Properties">
+ <!--div class="Properties">
<a>
<xsl:attribute name="href">javascript:displayProperties('<xsl:value-of select="@package"/>.<xsl:value-of select="@name"/>');</xsl:attribute>
Properties »
@@ -393,7 +396,7 @@
System.err »
</a>
</div>
- </xsl:if>
+ </xsl:if-->
</body>
</html>
</xsl:template>
@@ -412,25 +415,25 @@
<!-- ======================================================================
- This page is created for every package.
- It prints the name of all classes that belongs to this package.
- @param name the package name to print classes.
+ This page is created for every directory.
+ It prints the name of all projects that belongs to this directory.
+ @param name the directory name to print projects.
====================================================================== -->
-<!-- list of classes in a package -->
-<xsl:template name="classes.list">
+<!-- list of projects in a directory -->
+<xsl:template name="projects.list">
<xsl:param name="name"/>
<html>
<head>
- <title>Unit Test Classes: <xsl:value-of select="$name"/></title>
+ <title>AntUnit Test Projects: <xsl:value-of select="$name"/></title>
<xsl:call-template name="create.stylesheet.link">
- <xsl:with-param name="package.name" select="$name"/>
+ <xsl:with-param name="directory.name" select="$name"/>
</xsl:call-template>
</head>
<body>
<table width="100%">
<tr>
<td nowrap="nowrap">
- <h2><a href="package-summary.html" target="classFrame">
+ <h2><a href="directory-summary.html" target="projectFrame">
<xsl:value-of select="$name"/>
<xsl:if test="$name = ''"><none></xsl:if>
</a></h2>
@@ -438,13 +441,13 @@
</tr>
</table>
- <h2>Classes</h2>
+ <h2>Projects</h2>
<table width="100%">
<xsl:for-each select="/testsuites/testsuite[./@package = $name]">
<xsl:sort select="@name"/>
<tr>
<td nowrap="nowrap">
- <a href="{@id}_{@name}.html" target="classFrame"><xsl:value-of select="@name"/></a>
+ <a href="{@id}_{@name}.html" target="projectFrame"><xsl:value-of select="@name"/></a>
</td>
</tr>
</xsl:for-each>
@@ -455,21 +458,21 @@
<!--
- Creates an all-classes.html file that contains a link to all package-summary.html
- on each class.
+ Creates an all-projects.html file that contains a link to all directory-summary.html
+ on each project.
-->
-<xsl:template match="testsuites" mode="all.classes">
+<xsl:template match="testsuites" mode="all.projects">
<html>
<head>
- <title>All Unit Test Classes</title>
+ <title>All AntUnit Test Projects</title>
<xsl:call-template name="create.stylesheet.link">
- <xsl:with-param name="package.name"/>
+ <xsl:with-param name="directory.name"/>
</xsl:call-template>
</head>
<body>
- <h2>Classes</h2>
+ <h2>Projects</h2>
<table width="100%">
- <xsl:apply-templates select="testsuite" mode="all.classes">
+ <xsl:apply-templates select="testsuite" mode="all.projects">
<xsl:sort select="@name"/>
</xsl:apply-templates>
</table>
@@ -477,14 +480,14 @@
</html>
</xsl:template>
-<xsl:template match="testsuite" mode="all.classes">
- <xsl:variable name="package.name" select="@package"/>
+<xsl:template match="testsuite" mode="all.projects">
+ <xsl:variable name="directory.name" select="@package"/>
<tr>
<td nowrap="nowrap">
- <a target="classFrame">
+ <a target="projectFrame">
<xsl:attribute name="href">
- <xsl:if test="not($package.name='')">
- <xsl:value-of select="translate($package.name,'.','/')"/><xsl:text>/</xsl:text>
+ <xsl:if test="not($directory.name='')">
+ <xsl:value-of select="translate($directory.name,'.','/')"/><xsl:text>/</xsl:text>
</xsl:if><xsl:value-of select="@id"/>_<xsl:value-of select="@name"/><xsl:text>.html</xsl:text>
</xsl:attribute>
<xsl:value-of select="@name"/>
@@ -495,23 +498,23 @@
<!--
- Creates an html file that contains a link to all package-summary.html files on
- each package existing on testsuites.
- @bug there will be a problem here, I don't know yet how to handle unnamed package :(
+ Creates an html file that contains a link to all directory-summary.html files on
+ each directory existing on testsuites.
+ @bug there will be a problem here, I don't know yet how to handle unnamed directory :(
-->
-<xsl:template match="testsuites" mode="all.packages">
+<xsl:template match="testsuites" mode="all.directories">
<html>
<head>
- <title>All Unit Test Packages</title>
+ <title>All AntUnit Test Directories</title>
<xsl:call-template name="create.stylesheet.link">
- <xsl:with-param name="package.name"/>
+ <xsl:with-param name="directory.name"/>
</xsl:call-template>
</head>
<body>
- <h2><a href="overview-summary.html" target="classFrame">Home</a></h2>
- <h2>Packages</h2>
+ <h2><a href="overview-summary.html" target="projectFrame">Home</a></h2>
+ <h2>Directories</h2>
<table width="100%">
- <xsl:apply-templates select="testsuite[not(./@package = preceding-sibling::testsuite/@package)]" mode="all.packages">
+ <xsl:apply-templates select="testsuite[not(./@package = preceding-sibling::testsuite/@package)]" mode="all.directories">
<xsl:sort select="@package"/>
</xsl:apply-templates>
</table>
@@ -519,10 +522,10 @@
</html>
</xsl:template>
-<xsl:template match="testsuite" mode="all.packages">
+<xsl:template match="testsuite" mode="all.directories">
<tr>
<td nowrap="nowrap">
- <a href="./{translate(@package,'.','/')}/package-summary.html" target="classFrame">
+ <a href="./{translate(@package,'.','/')}/directory-summary.html" target="projectFrame">
<xsl:value-of select="@package"/>
<xsl:if test="@package = ''"><none></xsl:if>
</a>
@@ -531,22 +534,22 @@
</xsl:template>
-<xsl:template match="testsuites" mode="overview.packages">
+<xsl:template match="testsuites" mode="overview.directories">
<html>
<head>
- <title>Unit Test Results: Summary</title>
+ <title>AntUnit Test Results: Summary</title>
<xsl:call-template name="create.stylesheet.link">
- <xsl:with-param name="package.name"/>
+ <xsl:with-param name="directory.name"/>
</xsl:call-template>
</head>
<body>
- <xsl:attribute name="onload">open('allclasses-frame.html','classListFrame')</xsl:attribute>
+ <xsl:attribute name="onload">open('allprojects-frame.html','projectListFrame')</xsl:attribute>
<xsl:call-template name="pageHeader"/>
<h2>Summary</h2>
- <xsl:variable name="testCount" select="sum(testsuite/@tests)"/>
- <xsl:variable name="errorCount" select="sum(testsuite/@errors)"/>
- <xsl:variable name="failureCount" select="sum(testsuite/@failures)"/>
- <xsl:variable name="timeCount" select="sum(testsuite/@time)"/>
+ <xsl:variable name="testCount" select="sum(testsuite/tests/text())"/>
+ <xsl:variable name="errorCount" select="sum(testsuite/errors/text())"/>
+ <xsl:variable name="failureCount" select="sum(testsuite/failures/text())"/>
+ <xsl:variable name="timeCount" select="sum(testsuite/time/text())"/>
<xsl:variable name="successRate" select="($testCount - $failureCount - $errorCount) div $testCount"/>
<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
<tr valign="top">
@@ -587,36 +590,36 @@
</tr>
</table>
- <h2>Packages</h2>
+ <h2>Directories</h2>
<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
<xsl:call-template name="testsuite.test.header"/>
<xsl:for-each select="testsuite[not(./@package = preceding-sibling::testsuite/@package)]">
<xsl:sort select="@package" order="ascending"/>
- <!-- get the node set containing all testsuites that have the same package -->
- <xsl:variable name="insamepackage" select="/testsuites/testsuite[./@package = current()/@package]"/>
+ <!-- get the node set containing all testsuites that have the same directory -->
+ <xsl:variable name="insamedirectory" select="/testsuites/testsuite[./@package = current()/@package]"/>
<tr valign="top">
- <!-- display a failure if there is any failure/error in the package -->
+ <!-- display a failure if there is any failure/error in the directory -->
<xsl:attribute name="class">
<xsl:choose>
- <xsl:when test="sum($insamepackage/@errors) > 0">Error</xsl:when>
- <xsl:when test="sum($insamepackage/@failures) > 0">Failure</xsl:when>
+ <xsl:when test="sum($insamedirectory/errors/text()) > 0">Error</xsl:when>
+ <xsl:when test="sum($insamedirectory/failures/text()) > 0">Failure</xsl:when>
<xsl:otherwise>Pass</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
- <td><a href="./{translate(@package,'.','/')}/package-summary.html">
+ <td><a href="./{translate(@package,'.','/')}/directory-summary.html">
<xsl:value-of select="@package"/>
<xsl:if test="@package = ''"><none></xsl:if>
</a></td>
- <td><xsl:value-of select="sum($insamepackage/@tests)"/></td>
- <td><xsl:value-of select="sum($insamepackage/@errors)"/></td>
- <td><xsl:value-of select="sum($insamepackage/@failures)"/></td>
+ <td><xsl:value-of select="sum($insamedirectory/tests/text())"/></td>
+ <td><xsl:value-of select="sum($insamedirectory/errors/text())"/></td>
+ <td><xsl:value-of select="sum($insamedirectory/failures/text())"/></td>
<td>
<xsl:call-template name="display-time">
- <xsl:with-param name="value" select="sum($insamepackage/@time)"/>
+ <xsl:with-param name="value" select="sum($insamedirectory/time/text())"/>
</xsl:call-template>
</td>
- <td><xsl:value-of select="$insamepackage/@timestamp"/></td>
- <td><xsl:value-of select="$insamepackage/@hostname"/></td>
+ <td><xsl:value-of select="$insamedirectory/@timestamp"/></td>
+ <td><xsl:value-of select="$insamedirectory/@hostname"/></td>
</tr>
</xsl:for-each>
</table>
@@ -625,31 +628,31 @@
</xsl:template>
-<xsl:template name="package.summary">
+<xsl:template name="directory.summary">
<xsl:param name="name"/>
<html>
<head>
<xsl:call-template name="create.stylesheet.link">
- <xsl:with-param name="package.name" select="$name"/>
+ <xsl:with-param name="directory.name" select="$name"/>
</xsl:call-template>
</head>
<body>
- <xsl:attribute name="onload">open('package-frame.html','classListFrame')</xsl:attribute>
+ <xsl:attribute name="onload">open('directory-frame.html','projectListFrame')</xsl:attribute>
<xsl:call-template name="pageHeader"/>
- <h3>Package <xsl:value-of select="$name"/></h3>
+ <h3>Directory <xsl:value-of select="$name"/></h3>
<!--table border="0" cellpadding="5" cellspacing="2" width="95%">
- <xsl:call-template name="class.metrics.header"/>
+ <xsl:call-template name="project.metrics.header"/>
<xsl:apply-templates select="." mode="print.metrics"/>
</table-->
- <xsl:variable name="insamepackage" select="/testsuites/testsuite[./@package = $name]"/>
- <xsl:if test="count($insamepackage) > 0">
- <h2>Classes</h2>
+ <xsl:variable name="insamedirectory" select="/testsuites/testsuite[./@package = $name]"/>
+ <xsl:if test="count($insamedirectory) > 0">
+ <h2>Projects</h2>
<p>
<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
<xsl:call-template name="testsuite.test.header"/>
- <xsl:apply-templates select="$insamepackage" mode="print.test">
+ <xsl:apply-templates select="$insamedirectory" mode="print.test">
<xsl:sort select="@name"/>
</xsl:apply-templates>
</table>
@@ -678,26 +681,26 @@
</xsl:template>
-<!-- create the link to the stylesheet based on the package name -->
+<!-- create the link to the stylesheet based on the directory 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>
+ <xsl:param name="directory.name"/>
+ <link rel="stylesheet" type="text/css" title="Style"><xsl:attribute name="href"><xsl:if test="not($directory.name = 'unnamed directory')"><xsl:call-template name="path"><xsl:with-param name="path" select="$directory.name"/></xsl:call-template></xsl:if>stylesheet.css</xsl:attribute></link>
</xsl:template>
<!-- Page HEADER -->
<xsl:template name="pageHeader">
- <h1>Unit Test Results</h1>
+ <h1>AntUnit Test Results</h1>
<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://ant.apache.org/">Ant</a>.</td>
+ <td align="right">Designed for use with AntUnit and <a href="http://ant.apache.org/">Ant</a>.</td>
</tr>
</table>
<hr size="1"/>
</xsl:template>
-<!-- class header -->
+<!-- project header -->
<xsl:template name="testsuite.test.header">
<tr valign="top">
<th width="80%">Name</th>
@@ -712,10 +715,10 @@
<!-- method header -->
<xsl:template name="testcase.test.header">
- <xsl:param name="show.class" select="''"/>
+ <xsl:param name="show.project" select="''"/>
<tr valign="top">
- <xsl:if test="boolean($show.class)">
- <th>Class</th>
+ <xsl:if test="boolean($show.project)">
+ <th>Project</th>
</xsl:if>
<th>Name</th>
<th>Status</th>
@@ -725,13 +728,13 @@
</xsl:template>
-<!-- class information -->
+<!-- project information -->
<xsl:template match="testsuite" mode="print.test">
<tr valign="top">
<xsl:attribute name="class">
<xsl:choose>
- <xsl:when test="@errors[.> 0]">Error</xsl:when>
- <xsl:when test="@failures[.> 0]">Failure</xsl:when>
+ <xsl:when test="errors/text()[.> 0]">Error</xsl:when>
+ <xsl:when test="failures/text()[.> 0]">Failure</xsl:when>
<xsl:otherwise>Pass</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
@@ -739,26 +742,26 @@
<td><a title="Display all tests" href="{@id}_{@name}.html"><xsl:apply-templates select="@tests"/></a></td>
<td>
<xsl:choose>
- <xsl:when test="@errors != 0">
- <a title="Display only errors" href="{@id}_{@name}-errors.html"><xsl:apply-templates select="@errors"/></a>
+ <xsl:when test="errors/text() != 0">
+ <a title="Display only errors" href="{@id}_{@name}-errors.html"><xsl:apply-templates select="errors/text()"/></a>
</xsl:when>
<xsl:otherwise>
- <xsl:apply-templates select="@errors"/>
+ <xsl:apply-templates select="errors/text()"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td>
<xsl:choose>
- <xsl:when test="@failures != 0">
- <a title="Display only failures" href="{@id}_{@name}-fails.html"><xsl:apply-templates select="@failures"/></a>
+ <xsl:when test="failures/text() != 0">
+ <a title="Display only failures" href="{@id}_{@name}-fails.html"><xsl:apply-templates select="failures/text()"/></a>
</xsl:when>
<xsl:otherwise>
- <xsl:apply-templates select="@failures"/>
+ <xsl:apply-templates select="failures/text()"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td><xsl:call-template name="display-time">
- <xsl:with-param name="value" select="@time"/>
+ <xsl:with-param name="value" select="time/text()"/>
</xsl:call-template>
</td>
<td><xsl:apply-templates select="@timestamp"/></td>
@@ -767,7 +770,7 @@
</xsl:template>
<xsl:template match="testcase" mode="print.test">
- <xsl:param name="show.class" select="''"/>
+ <xsl:param name="show.project" select="''"/>
<tr valign="top">
<xsl:attribute name="class">
<xsl:choose>
@@ -776,17 +779,17 @@
<xsl:otherwise>TableRowColor</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
- <xsl:variable name="class.href">
+ <xsl:variable name="project.href">
<xsl:value-of select="concat(translate(../@package,'.','/'), '/', ../@id, '_', ../@name, '.html')"/>
</xsl:variable>
- <xsl:if test="boolean($show.class)">
- <td><a href="{$class.href}"><xsl:value-of select="../@name"/></a></td>
+ <xsl:if test="boolean($show.project)">
+ <td><a href="{$project.href}"><xsl:value-of select="../@name"/></a></td>
</xsl:if>
<td>
<a name="{@name}"/>
<xsl:choose>
- <xsl:when test="boolean($show.class)">
- <a href="{concat($class.href, '#', @name)}"><xsl:value-of select="@name"/></a>
+ <xsl:when test="boolean($show.project)">
+ <a href="{concat($project.href, '#', @name)}"><xsl:value-of select="@name"/></a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@name"/>
@@ -809,7 +812,7 @@
</xsl:choose>
<td>
<xsl:call-template name="display-time">
- <xsl:with-param name="value" select="@time"/>
+ <xsl:with-param name="value" select="time/text()"/>
</xsl:call-template>
</td>
</tr>
Modified: ant/antlibs/antunit/trunk/src/etc/testcases/antunit.xml
URL: http://svn.apache.org/viewvc/ant/antlibs/antunit/trunk/src/etc/testcases/antunit.xml?rev=437212&r1=437211&r2=437212&view=diff
==============================================================================
--- ant/antlibs/antunit/trunk/src/etc/testcases/antunit.xml (original)
+++ ant/antlibs/antunit/trunk/src/etc/testcases/antunit.xml Sat Aug 26 12:07:44 2006
@@ -22,7 +22,7 @@
default="all"
xmlns:au="antlib:org.apache.ant.antunit">
- <target name="all" depends="antunit-basetest,antunit-copy" />
+ <target name="all" depends="antunit-basetest,antunit-dir" />
<target name="antunit-basetest">
<au:antunit>
@@ -67,13 +67,22 @@
</au:antunit>
</target>
- <target name="antunit-copy">
- <property name="reportsdir" location="../../../build/reports"/>
+ <property name="reportsdir" location="../../../build/reports"/>
+ <target name="antunit-dir">
<mkdir dir="${reportsdir}"/>
- <au:antunit>
- <fileset dir="antunit" includes="copy.xml"/>
+ <au:antunit failonerror="false" errorproperty="antunit-failure">
+ <fileset dir="antunit" includes="*.xml"/>
<au:plainlistener sendLogTo="both" toDir="${reportsdir}"/>
<au:xmllistener toDir="${reportsdir}"/>
</au:antunit>
+ </target>
+
+ <target name="report" depends="antunit-dir">
+ <mkdir dir="${reportsdir}-frames"/>
+ <junitreport>
+ <fileset dir="${reportsdir}" includes="*.xml"/>
+ <report format="frames" styledir=".." todir="${reportsdir}-frames"/>
+ </junitreport>
+ <fail if="antunit-failure">At least one test has failed</fail>
</target>
</project>
Modified: ant/antlibs/common/trunk/build.xml
URL: http://svn.apache.org/viewvc/ant/antlibs/common/trunk/build.xml?rev=437212&r1=437211&r2=437212&view=diff
==============================================================================
--- ant/antlibs/common/trunk/build.xml (original)
+++ ant/antlibs/common/trunk/build.xml Sat Aug 26 12:07:44 2006
@@ -32,6 +32,7 @@
<property name="build.classes" value="${build}/classes"/>
<property name="build.testclasses" value="${build}/test-classes"/>
<property name="build.lib" value="${build}/lib"/>
+ <property name="src.junit" location="src/tests/junit"/>
<!--you really need a proper version in libraries.properties-->
<property name="artifact.version" value="0.1-SNAPSHOT"/>
@@ -90,7 +91,7 @@
</target>
- <target name="setup-for-tests" depends="setup">
+ <target name="setup-for-junit-tests" depends="setup" unless="skip-junit">
<available classname="org.apache.tools.ant.BuildFileTest"
property="testutil-present?"
classpath="${ant-testutil.jar}"/>
@@ -100,9 +101,10 @@
to the correct location.</fail>
</target>
- <target name="compile-tests" depends="setup-for-tests, antlib">
+ <target name="compile-tests" depends="setup-for-junit-tests, antlib"
+ unless="skip-junit">
<javac
- srcdir="src/testcases"
+ srcdir="${src.junit}"
destdir="${build.testclasses}"
debug="true"
>
@@ -112,15 +114,15 @@
</classpath>
</javac>
<copy todir="${build.testclasses}">
- <fileset dir="src/testcases" includes="**/*.xml,**/*.properties"/>
+ <fileset dir="${src.junit}" includes="**/*.xml,**/*.properties"/>
</copy>
</target>
- <target name="test" depends="ready-to-test">
+ <target name="junit-test" depends="ready-to-test" unless="skip-junit">
<junit
printsummary="false"
haltonfailure="false"
- failureproperty="tests.failed"
+ failureproperty="junit.tests.failed"
filtertrace="false"
fork="true"
forkmode="once"
@@ -133,13 +135,15 @@
</classpath>
<batchtest>
- <fileset dir="src/testcases"/>
+ <fileset dir="${src.junit}"/>
</batchtest>
<formatter type="plain" usefile="false"/>
</junit>
+ </target>
- <fail if="tests.failed">At least one test has failed.</fail>
+ <target name="test" depends="junit-test">
+ <fail if="junit.tests.failed">At least one test has failed.</fail>
</target>
<target name="clean" depends="setup-properties">
Modified: ant/antlibs/dotnet/trunk/build.xml
URL: http://svn.apache.org/viewvc/ant/antlibs/dotnet/trunk/build.xml?rev=437212&r1=437211&r2=437212&view=diff
==============================================================================
--- ant/antlibs/dotnet/trunk/build.xml (original)
+++ ant/antlibs/dotnet/trunk/build.xml Sat Aug 26 12:07:44 2006
@@ -21,11 +21,11 @@
<import file="common/build.xml"/>
- <target name="test" depends="compile-tests">
+ <target name="junit-test" depends="compile-tests">
<junit
printsummary="false"
haltonfailure="false"
- failureproperty="tests.failed"
+ failureproperty="junit.tests.failed"
filtertrace="false"
fork="true"
forkmode="once"
@@ -38,12 +38,10 @@
</classpath>
<batchtest>
- <fileset dir="src/testcases"/>
+ <fileset dir="${src.junit}"/>
</batchtest>
<formatter type="plain" usefile="false"/>
</junit>
-
- <fail if="tests.failed">At least one test has failed.</fail>
</target>
</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org