You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by eh...@apache.org on 2002/02/05 01:56:00 UTC
cvs commit: jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs CopyTest.java
ehatcher 02/02/04 16:56:00
Modified: src/main/org/apache/tools/ant/taskdefs Copy.java
src/etc/testcases/taskdefs copy.xml
src/testcases/org/apache/tools/ant/taskdefs CopyTest.java
Log:
Fix single-file fileset functionality. Did this ever work (,Peter)?
XP-style: added test case to detect bug, then fixed it. Also, trying to break out of the mould of the "testN" test case names - too brittle and non-descriptive.
Revision Changes Path
1.30 +1 -1 jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Copy.java
Index: Copy.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Copy.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- Copy.java 25 Jan 2002 16:15:44 -0000 1.29
+++ Copy.java 5 Feb 2002 00:56:00 -0000 1.30
@@ -326,7 +326,7 @@
if (srcFiles.length > 0) {
if (file == null) {
- file = new File(srcFiles[0]);
+ file = new File(ds.getBasedir(), srcFiles[0]);
filesets.removeElementAt(0);
} else {
throw new BuildException(
1.6 +7 -0 jakarta-ant/src/etc/testcases/taskdefs/copy.xml
Index: copy.xml
===================================================================
RCS file: /home/cvs/jakarta-ant/src/etc/testcases/taskdefs/copy.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- copy.xml 8 Dec 2001 07:34:36 -0000 1.5
+++ copy.xml 5 Feb 2002 00:56:00 -0000 1.6
@@ -38,12 +38,19 @@
-->
</target>
+ <target name="test_single_file_fileset">
+ <copy tofile="copytest_single_file_fileset.tmp">
+ <fileset dir="." includes="copy.xml"/>
+ </copy>
+ </target>
+
<target name="cleanup">
<delete file="copytest1.tmp"/>
<delete file="copytest3.tmp"/>
<delete file="copytest3a.tmp"/>
<delete file="copytest3b.tmp"/>
<delete file="copytest3c.tmp"/>
+ <delete file="copytest_single_file_fileset.tmp"/>
<delete dir="copytest1dir"/>
</target>
1.5 +7 -0 jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/CopyTest.java
Index: CopyTest.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/CopyTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- CopyTest.java 10 Jan 2002 10:13:12 -0000 1.4
+++ CopyTest.java 5 Feb 2002 00:56:00 -0000 1.5
@@ -122,4 +122,11 @@
}
}
+
+ public void testSingleFileFileset() {
+ executeTarget("test_single_file_fileset");
+ File file = new File(getProjectDir(),
+ "copytest_single_file_fileset.tmp");
+ assertTrue(file.exists());
+ }
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>