From 2ff97ac3d107d741c35a236960a0f963e7aad6a8 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Thu, 28 Feb 2002 12:39:58 +0000 Subject: [PATCH] Now that we know why the test worked all these month, make it work again, this time documenting the reason. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271603 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/CoreTasks/ant.html | 2 +- src/etc/testcases/taskdefs/gzip.xml | 2 +- src/main/org/apache/tools/ant/taskdefs/Pack.java | 9 +++++++-- .../org/apache/tools/ant/taskdefs/GzipTest.java | 4 +--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/manual/CoreTasks/ant.html b/docs/manual/CoreTasks/ant.html index 58310f5c5..c61721491 100644 --- a/docs/manual/CoreTasks/ant.html +++ b/docs/manual/CoreTasks/ant.html @@ -219,7 +219,7 @@ a <path> with the id path1, but new project using the id path2.


-

Copyright © 2001 Apache Software Foundation. All rights +

Copyright © 2001-2002 Apache Software Foundation. All rights Reserved.

diff --git a/src/etc/testcases/taskdefs/gzip.xml b/src/etc/testcases/taskdefs/gzip.xml index a59973505..f4b5e0e8d 100644 --- a/src/etc/testcases/taskdefs/gzip.xml +++ b/src/etc/testcases/taskdefs/gzip.xml @@ -15,7 +15,7 @@ - + diff --git a/src/main/org/apache/tools/ant/taskdefs/Pack.java b/src/main/org/apache/tools/ant/taskdefs/Pack.java index 289a21ef0..9e3dbc215 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Pack.java +++ b/src/main/org/apache/tools/ant/taskdefs/Pack.java @@ -83,11 +83,16 @@ public abstract class Pack extends Task { } private void validate() { - if (zipFile == null || zipFile.getName().equals("")) { + if (zipFile == null) { throw new BuildException("zipfile attribute is required", location); } - if (source == null || source.getName().equals("")) { + if (zipFile.isDirectory()) { + throw new BuildException("zipfile attribute must not " + + "represent a directory!", location); + } + + if (source == null) { throw new BuildException("src attribute is required", location); } diff --git a/src/testcases/org/apache/tools/ant/taskdefs/GzipTest.java b/src/testcases/org/apache/tools/ant/taskdefs/GzipTest.java index d0e4b76ce..372f854eb 100644 --- a/src/testcases/org/apache/tools/ant/taskdefs/GzipTest.java +++ b/src/testcases/org/apache/tools/ant/taskdefs/GzipTest.java @@ -82,11 +82,9 @@ public class GzipTest extends BuildFileTest { expectBuildException("test3", "required argument missing"); } - /** Disable - how could that ever work? public void test4() { - expectBuildException("test4", "attribute zipfile invalid"); + expectBuildException("test4", "zipfile must not point to a directory"); } - */ public void testGZip(){ executeTarget("realTest");