ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject GzipTest suddenly fails for me
Date Wed, 27 Feb 2002 16:20:52 GMT
and I don't understand why it has ever worked.

The test causing trouble is test4:

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

This has been the target for a veeery long time.  GzipTest expects it
to fail because zipfile is not valid (so it says) - no changes here as
well.

The code in Pack that is supposed to throw the BuildException has been

        if (zipFile == null) {
            throw new BuildException("zipfile attribute is required", location);
        }

until Jeff's patch turned it into

        if (zipFile == null || zipFile.getName().equals("")) {
            throw new BuildException("zipfile attribute is required", location);
        }

OK, now I pass an empty String as zipfile attribute, this will go
through Project.resolveFile and gets out of this as the project's
basedir.

At least on my box, getName() on the project's basedir returns the
name of the directory and not an empty String - i.e. taskdefs in the
case of our testcase.  This explains why the second condition cannot
be matched.

zipFile is non-null and I cannot see how this test can have ever
passed as it shouldn't have been null at any time.

Any idea?

Stefan

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message