Browse Source

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
master
Stefan Bodewig 23 years ago
parent
commit
2ff97ac3d1
4 changed files with 10 additions and 7 deletions
  1. +1
    -1
      docs/manual/CoreTasks/ant.html
  2. +1
    -1
      src/etc/testcases/taskdefs/gzip.xml
  3. +7
    -2
      src/main/org/apache/tools/ant/taskdefs/Pack.java
  4. +1
    -3
      src/testcases/org/apache/tools/ant/taskdefs/GzipTest.java

+ 1
- 1
docs/manual/CoreTasks/ant.html View File

@@ -219,7 +219,7 @@ a <code>&lt;path&gt;</code> with the id <code>path1</code>, but
new project using the id <code>path2</code>.</p> new project using the id <code>path2</code>.</p>


<hr> <hr>
<p align="center">Copyright &copy; 2001 Apache Software Foundation. All rights
<p align="center">Copyright &copy; 2001-2002 Apache Software Foundation. All rights
Reserved.</p> Reserved.</p>


</body> </body>


+ 1
- 1
src/etc/testcases/taskdefs/gzip.xml View File

@@ -15,7 +15,7 @@
</target> </target>


<target name="test4"> <target name="test4">
<gzip src="gzip.xml" zipfile=""/>
<gzip src="gzip.xml" zipfile="." />
</target> </target>


<target name="realTest"> <target name="realTest">


+ 7
- 2
src/main/org/apache/tools/ant/taskdefs/Pack.java View File

@@ -83,11 +83,16 @@ public abstract class Pack extends Task {
} }


private void validate() { private void validate() {
if (zipFile == null || zipFile.getName().equals("")) {
if (zipFile == null) {
throw new BuildException("zipfile attribute is required", location); 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); throw new BuildException("src attribute is required", location);
} }




+ 1
- 3
src/testcases/org/apache/tools/ant/taskdefs/GzipTest.java View File

@@ -82,11 +82,9 @@ public class GzipTest extends BuildFileTest {
expectBuildException("test3", "required argument missing"); expectBuildException("test3", "required argument missing");
} }


/** Disable - how could that ever work?
public void test4() { public void test4() {
expectBuildException("test4", "attribute zipfile invalid");
expectBuildException("test4", "zipfile must not point to a directory");
} }
*/


public void testGZip(){ public void testGZip(){
executeTarget("realTest"); executeTarget("realTest");


Loading…
Cancel
Save