WebtestEmbeddingUtil.copyWebTestResources() fails on Windows XP if the JAR is 
in directory path with spaces
-----------------------------------------------------------------------------------------------------------

         Key: WT-530
         URL: http://webtest-community.canoo.com/jira/browse/WT-530
     Project: WebTest
        Type: Bug

    Versions: 3.0    
 Environment: Windows XP
    Reporter: Alex McManus


Using the WebtestCase class from Groovy, the tests fail with the following 
error:

java.io.FileNotFoundException: 
C:\Documents%20and%20Settings\amcmanus\.m2\repository\com\canoo\webtest\webtest\3.0\webtest-3.0.jar
 (The system cannot find the path specified)
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:114)
        at java.util.jar.JarFile.<init>(JarFile.java:133)
        at java.util.jar.JarFile.<init>(JarFile.java:70)
        at 
com.canoo.webtest.util.WebtestEmbeddingUtil.copyWebTestResources(WebtestEmbeddingUtil.java:38)

Looking at the code for WebtestEmbeddingUtil, it appears to get a URL to a 
resource in the webtest JAR as a way of deriving the filename of the JAR, which 
it then opens as a ZIP file. However, the URL is correctly escaped, with spaces 
encoded as %20. If using Maven on Window XP, the JAR will be in a sub-directory 
of "c:\Documents and Settings". When the encoded path is used to reference the 
JAR, it fails because Windows doesn't recognize %20 as a valid character in a 
directory path. 

A naive fix should be quite simple: just replace all occurrences of '%20' with 
' ' in the path before using it to find the JAR. However, I guess there could 
be other similar problems with specially encoded characters that are meaningful 
for URLs. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://webtest-community.canoo.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to