bodewig 01/02/19 07:30:04
Modified: . Tag: ANT_13_BRANCH build.xml
src/main/org/apache/tools/ant/types Tag: ANT_13_BRANCH
Mapper.java
src/testcases/org/apache/tools/ant/types Tag: ANT_13_BRANCH
MapperTest.java
Added: src/etc/testcases/types Tag: ANT_13_BRANCH mapper.xml
Log:
Fixed problem that surfaced when a mapper and more than one fileset
would be used in <copy>. This one is yet another "reuse an object with
internal state that needs to be reset" problem.
Added a testcase for this as well.
Reported by: Sibon Barman <[EMAIL PROTECTED]>
Revision Changes Path
No revision
No revision
1.130.2.6 +1 -0 jakarta-ant/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-ant/build.xml,v
retrieving revision 1.130.2.5
retrieving revision 1.130.2.6
diff -u -r1.130.2.5 -r1.130.2.6
--- build.xml 2001/02/15 12:59:31 1.130.2.5
+++ build.xml 2001/02/19 15:30:00 1.130.2.6
@@ -582,6 +582,7 @@
<delete dir="${tests.etc.dir}/taskdefs/taskdefs.tmp" />
<delete dir="${tests.etc.dir}/taskdefs.tmp" />
<delete file="${tests.etc.dir}/taskdefs/tmp.jar" />
+ <delete dir="${tests.etc.dir}/types/copytest" />
</target>
<target name="run-single-test" if="testcase" depends="compile-tests">
No revision
No revision
1.1.2.1 +19 -0 jakarta-ant/src/etc/testcases/types/Attic/mapper.xml
No revision
No revision
1.3.2.1 +4 -0
jakarta-ant/src/main/org/apache/tools/ant/types/Mapper.java
Index: Mapper.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/Mapper.java,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- Mapper.java 2000/11/30 14:20:19 1.3
+++ Mapper.java 2001/02/19 15:30:02 1.3.2.1
@@ -213,6 +213,10 @@
throw be;
} catch (Throwable t) {
throw new BuildException(t);
+ } finally {
+ if (type != null) {
+ classname = null;
+ }
}
}
No revision
No revision
1.2.2.1 +21 -0
jakarta-ant/src/testcases/org/apache/tools/ant/types/MapperTest.java
Index: MapperTest.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/types/MapperTest.java,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -r1.2 -r1.2.2.1
--- MapperTest.java 2001/01/03 14:18:51 1.2
+++ MapperTest.java 2001/02/19 15:30:03 1.2.2.1
@@ -57,6 +57,7 @@
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.util.*;
+import org.apache.tools.ant.taskdefs.TaskdefsTest;
import junit.framework.TestCase;
import junit.framework.AssertionFailedError;
@@ -173,5 +174,25 @@
String[] result = fmm.mapFileName("a.java");
assertEquals("a.java should match", 1, result.length);
assertEquals("a.class", result[0]);
+ }
+
+ public void testCopyTaskWithTwoFilesets() {
+ TaskdefForCopyTest t = new TaskdefForCopyTest("test1");
+ t.setUp();
+ t.test1();
+ }
+
+ private class TaskdefForCopyTest extends TaskdefsTest {
+ TaskdefForCopyTest(String name) {
+ super(name);
+ }
+
+ public void setUp() {
+ configureProject("src/etc/testcases/types/mapper.xml");
+ }
+
+ public void test1() {
+ executeTarget("test1");
+ }
}
}