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 2005/03/14 10:13:46 UTC
cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/junit XMLConstants.java XMLResultAggregator.java
bodewig 2005/03/14 01:13:45
Modified: . CONTRIBUTORS WHATSNEW
src/etc junit-frames.xsl
src/main/org/apache/tools/ant/taskdefs/optional/junit
XMLConstants.java XMLResultAggregator.java
Log:
Make the framed JUnit report deal with multiple reports for the same testcase.
PR: 32645
Submitted by: Yves Martin <yves dot martin at elca dot ch>
Revision Changes Path
1.44 +1 -0 ant/CONTRIBUTORS
Index: CONTRIBUTORS
===================================================================
RCS file: /home/cvs/ant/CONTRIBUTORS,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- CONTRIBUTORS 7 Mar 2005 09:37:43 -0000 1.43
+++ CONTRIBUTORS 14 Mar 2005 09:13:41 -0000 1.44
@@ -219,4 +219,5 @@
Wolf Siberski
Yohann Roussel
Yuji Yamano
+Yves Martin
Zdenek Wagner
1.773 +3 -0 ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/ant/WHATSNEW,v
retrieving revision 1.772
retrieving revision 1.773
diff -u -r1.772 -r1.773
--- WHATSNEW 14 Mar 2005 08:56:48 -0000 1.772
+++ WHATSNEW 14 Mar 2005 09:13:41 -0000 1.773
@@ -378,6 +378,9 @@
* Get with usetimestamp did not work when local timestamp roughly >= now.
+* The framed JUnit report now handles multiple reports for the same
+ testcase properly. Bugzilla Report 32745.
+
Changes from Ant 1.6.1 to Ant 1.6.2
===================================
1.24 +9 -9 ant/src/etc/junit-frames.xsl
Index: junit-frames.xsl
===================================================================
RCS file: /home/cvs/ant/src/etc/junit-frames.xsl,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- junit-frames.xsl 13 Nov 2004 01:51:29 -0000 1.23
+++ junit-frames.xsl 14 Mar 2005 09:13:42 -0000 1.24
@@ -6,7 +6,7 @@
<xsl:output method="html" indent="yes" encoding="US-ASCII"/>
<xsl:decimal-format decimal-separator="." grouping-separator=","/>
<!--
- Copyright 2001-2004 The Apache Software Foundation
+ Copyright 2001-2005 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.
@@ -91,16 +91,16 @@
<!-- for each class, creates a @name.html -->
<!-- @bug there will be a problem with inner classes having the same name, it will be overwritten -->
<xsl:for-each select="/testsuites/testsuite[@package = $name]">
- <redirect:write file="{$output.dir}/{$package.dir}/{@name}.html">
+ <redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}.html">
<xsl:apply-templates select="." mode="class.details"/>
</redirect:write>
<xsl:if test="string-length(./system-out)!=0">
- <redirect:write file="{$output.dir}/{$package.dir}/{@name}-out.txt">
+ <redirect:write file="{$output.dir}/{$package.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}/{@name}-err.txt">
+ <redirect:write file="{$output.dir}/{$package.dir}/{@id}_{@name}-err.txt">
<xsl:value-of disable-output-escaping="yes" select="./system-err" />
</redirect:write>
</xsl:if>
@@ -262,7 +262,7 @@
<xsl:if test="string-length(./system-out)!=0">
<div class="Properties">
<a>
- <xsl:attribute name="href">./<xsl:value-of select="@name"/>-out.txt</xsl:attribute>
+ <xsl:attribute name="href">./<xsl:value-of select="@id"/>_<xsl:value-of select="@name"/>-out.txt</xsl:attribute>
System.out »
</a>
</div>
@@ -270,7 +270,7 @@
<xsl:if test="string-length(./system-err)!=0">
<div class="Properties">
<a>
- <xsl:attribute name="href">./<xsl:value-of select="@name"/>-err.txt</xsl:attribute>
+ <xsl:attribute name="href">./<xsl:value-of select="@id"/>_<xsl:value-of select="@name"/>-err.txt</xsl:attribute>
System.err »
</a>
</div>
@@ -325,7 +325,7 @@
<xsl:sort select="@name"/>
<tr>
<td nowrap="nowrap">
- <a href="{@name}.html" target="classFrame"><xsl:value-of select="@name"/></a>
+ <a href="{@id}_{@name}.html" target="classFrame"><xsl:value-of select="@name"/></a>
</td>
</tr>
</xsl:for-each>
@@ -366,7 +366,7 @@
<xsl:attribute name="href">
<xsl:if test="not($package.name='')">
<xsl:value-of select="translate($package.name,'.','/')"/><xsl:text>/</xsl:text>
- </xsl:if><xsl:value-of select="@name"/><xsl:text>.html</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"/>
</a>
@@ -612,7 +612,7 @@
<xsl:otherwise>Pass</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
- <td><a href="{@name}.html"><xsl:value-of select="@name"/></a></td>
+ <td><a href="{@id}_{@name}.html"><xsl:value-of select="@name"/></a></td>
<td><xsl:apply-templates select="@tests"/></td>
<td><xsl:apply-templates select="@errors"/></td>
<td><xsl:apply-templates select="@failures"/></td>
1.14 +4 -1 ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLConstants.java
Index: XMLConstants.java
===================================================================
RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLConstants.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- XMLConstants.java 22 Nov 2004 09:23:34 -0000 1.13
+++ XMLConstants.java 14 Mar 2005 09:13:42 -0000 1.14
@@ -1,5 +1,5 @@
/*
- * Copyright 2001,2004 The Apache Software Foundation
+ * Copyright 2001,2004-2005 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.
@@ -86,6 +86,9 @@
/** classname attribute for testcase elements */
String ATTR_CLASSNAME = "classname";
+ /** id attribute */
+ String ATTR_ID = "id";
+
/**
* timestamp of test cases
*/
1.32 +7 -0 ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java
Index: XMLResultAggregator.java
===================================================================
RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- XMLResultAggregator.java 1 Dec 2004 17:37:57 -0000 1.31
+++ XMLResultAggregator.java 14 Mar 2005 09:13:42 -0000 1.32
@@ -73,6 +73,9 @@
/** the default file name: <tt>TESTS-TestSuites.xml</tt> */
public static final String DEFAULT_FILENAME = "TESTS-TestSuites.xml";
+ /** the current generated id */
+ protected int generatedId = 0;
+
/**
* Generate a report based on the document created by the merge.
* @return the report
@@ -220,6 +223,8 @@
Element rootElement = doc.createElement(TESTSUITES);
doc.appendChild(rootElement);
+ generatedId = 0;
+
// get all files and add them to the document
File[] files = getFiles();
for (int i = 0; i < files.length; i++) {
@@ -234,6 +239,7 @@
// make sure that this is REALLY a testsuite.
if (TESTSUITE.equals(elem.getNodeName())) {
addTestSuite(rootElement, elem);
+ generatedId++;
} else {
// issue a warning.
log("the file " + files[i]
@@ -278,6 +284,7 @@
// modify the name attribute and set the package
copy.setAttribute(ATTR_NAME, classname);
copy.setAttribute(ATTR_PACKAGE, pkgName);
+ copy.setAttribute(ATTR_ID, Integer.toString(generatedId));
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org