commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: svn commit: r750313 - /commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/AbstractTestCase.java
Date Fri, 06 Mar 2009 05:00:53 GMT
On 2009-03-06, sebb <sebbaz@gmail.com> wrote:

> On 05/03/2009, bodewig@apache.org <bodewig@apache.org> wrote:

>>  URL: http://svn.apache.org/viewvc?rev=750313&view=rev
>>  Log:
>>  make tests pass on Linux

> However, they now fail on Windows (and compilation fails on Java
> 1.4/1.5, but I fixed that).

Sorry about the Java6ism.

> Adding back the .getClassLoader() stage improves matters,

That really isn't supposed to make any difference, strange.

> but then the ChangeSetTestCase tests fail with

>      java.io.IOException: Illegal character in path

> which is caused by the space character.

The File -> URI and URI -> File conversions have always been
problematic.  I had hoped new File(URI) would work - didn't test on
Windows, obviously).

The IOException probably is wrapping an URISyntaxException, which
means URL.toString() has returned an illegal URI on your JDK, great.

> I'm not sure that getResource() is the correct method to use here.

Well, it works great for files that don't contain spaces in their name
8-)

A hack could be to check whether the file name contains spaces and
locate the parent directory instead of the file itself - or use
getResourceAsStream in all tests that want to use files with spaces in
their names - neither approach looks nice, but I'm not sure how to
locate the files from the resources without hardcoding paths.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message