maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jesse Kuhnert (JIRA)" <>
Subject [jira] Commented: (SUREFIRE-307) Tests fail if in path with spaces
Date Sat, 14 Apr 2007 01:44:46 GMT


Jesse Kuhnert commented on SUREFIRE-307:

Can you tell me if this still happens with surefire 2.4-SNAPSHOT and TestNG 5.5? 

> Tests fail if in path with spaces
> ---------------------------------
>                 Key: SUREFIRE-307
>                 URL:
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: classloading, TestNG support
>    Affects Versions: 2.3
>         Environment: Windows XP
> Maven 2.0.5
> Java 1.6.0
>            Reporter: Wim Deblauwe
> I use TestNG with Surefire. My build fails if my project is in a path with spaces, because
my tests fail. In my tests I have the following code:
> new File( getClass().getResource( "sample-java-utils-log.xml" ).toURI() )
> This results in the following error:
> Illegal character in path at index 18: file:/C:/Documents
and Settings/wdb/.hudson/jobs/Vigilog/workspace/trunk/target/test-classes/net/sourceforge/vigilog/parse/sample-
>     at$ Source)
>     at$Parser.checkChars(Unknown Source)
>     at$Parser.parseHierarchical(Unknown Source)
>     at$Parser.parse (Unknown Source)
>     at<init>(Unknown Source)
>     at Source)
>     at net.sourceforge.vigilog.parse.JavaLoggingXMLFileLogFileParserTest.testParse(
> If I put my project in a path without spaces, I don't have this problem (I noticed this
problem, because I tried Hudson build server and it checks the project out to my home directory)
> According to Jesse Glick from the Hudson mailing list, the problem is due to the following
fact (full thread:
> Wim Deblauwe wrote:
> > If it is any help, this is the source code of IsolatedClassLoader:
> >
> It sure does help, because this class is probably to blame for your problem:
> Note the call to File.toURL(), deprecated as of JDK 6 because
> $ jrunscript
> js> println(new"/tmp/foo and bar/baz").toURI().toURL())
> file:/tmp/foo%20and%20bar/baz
> js> println(new"/tmp/foo and bar/baz").toURL())
> file:/tmp/foo and bar/baz
> js> println(new"/tmp/foo and bar/baz").toURL().toURI())
> script error:
> Wrapped Illegal character in path at index
> 13: file:/tmp/foo and bar/baz (<STDIN>#1) in <STDIN> at line number 1
> js>
> If you want to reproduce this, check out my open source project to a directory with spaces
> and run 'mvn test'.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message