antoine 2003/10/13 12:37:02 Modified: src/testcases/org/apache/tools/ant/taskdefs/optional/net Tag: ANT_16_BRANCH FTPTest.java src/etc/testcases/taskdefs/optional/net Tag: ANT_16_BRANCH ftp.xml Log: Added a testcase for the ftp task concerning the deletion of directories Revision Changes Path No revision No revision 1.8.2.1 +6 -1 ant/src/testcases/org/apache/tools/ant/taskdefs/optional/net/FTPTest.java Index: FTPTest.java =================================================================== RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/optional/net/FTPTest.java,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -r1.8 -r1.8.2.1 --- FTPTest.java 22 Aug 2003 10:48:08 -0000 1.8 +++ FTPTest.java 13 Oct 2003 19:37:01 -0000 1.8.2.1 @@ -570,7 +570,12 @@ new String[] {"alpha/beta", "alpha/beta/gamma", "delta"}); } - + /** + * this test is inspired by a user reporting that deletions of directories with the ftp task do not work + */ + public void testFTPDelete() { + getProject().executeTarget("ftp-delete"); + } private void compareFiles(DirectoryScanner ds, String[] expectedFiles, String[] expectedDirectories) { String includedFiles[] = ds.getIncludedFiles(); No revision No revision 1.5.2.1 +23 -0 ant/src/etc/testcases/taskdefs/optional/net/ftp.xml Index: ftp.xml =================================================================== RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/optional/net/ftp.xml,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -r1.5 -r1.5.2.1 --- ftp.xml 14 Aug 2003 17:23:22 -0000 1.5 +++ ftp.xml 13 Oct 2003 19:37:02 -0000 1.5.2.1 @@ -77,4 +77,27 @@ <symlink link="${tmp.dir}/alpha/beta/gamma/gamma.xml" resource="${tmp.dir}/alpha/beta/beta.xml"/> </target> + <target name="ftp-delete"> + <!-- this target can produce an error if the rmdir does not work --> + <!-- there can be problems with the rmdir action if the directories are not removed in a proper order --> + <!-- which means beginning by the leaves of the tree, going back to the trunk --> + <ftp action="del" + server="${ftp.host}" + userid="${ftp.user}" + password="${ftp.password}" + remotedir="${tmp.dir}"> + <fileset dir="${tmp.get.dir}"> + <include name="**"/> + </fileset> + </ftp> + <ftp action="rmdir" + server="${ftp.host}" + userid="${ftp.user}" + password="${ftp.password}" + remotedir="${tmp.dir}"> + <fileset dir="${tmp.get.dir}"> + <include name="**"/> + </fileset> + </ftp> + </target> </project>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]