Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classpath with spaces causes FitNesse test to hang #498

Closed
stanio opened this issue Jul 12, 2014 · 4 comments
Closed

Classpath with spaces causes FitNesse test to hang #498

stanio opened this issue Jul 12, 2014 · 4 comments

Comments

@stanio
Copy link
Contributor

stanio commented Jul 12, 2014

Using release 20140630 on Windows.

Having the following directory setup:

W:\Work Dir
  fitnesse.jar
  classes\net\example
    HelloFixture.java
  FitNesseRoot\SpaceTest
    content.txt
    properties.xml

SpaceTest\content.txt (a test page):

!define TEST_SYSTEM {slim}

!path W:\Work Dir\classes

|import     |
|net.example|

|script|hello fixture                |
|check |say hello|World|Hello, World!|

HelloFixture.java:

package net.example;

public class HelloFixture {

    public String sayHello(String name) {
        return "Hello, " + name + '!';
    }

}

Running the given test causes FitNesse to hang.

As commented to #497, I've identified the problem appears to be:

fitnesse.wiki.ClassPathBuilder.addPathToClassPathString(ClassPathBuilder.java:83)

where surroundPathWithQuotesIfItHasSpaces(path) is invoked. This constructs a classpath argument like:

fitnesse.jar;"W:\Work Dir\classes"

Changing it to:

fitnesse.jar;W:\Work Dir\classes

corrects the problem.

It may have been once necessary, before 32029b0, but now using the java.lang.ProcessBuilder(String[]) constructor this additional quoting actually breaks it.

@stanio
Copy link
Contributor Author

stanio commented Jul 12, 2014

The workaround of course is to avoid directory/file names containing spaces.

@amolenaar
Copy link
Collaborator

We're not executing through a shell, so the class path items should not be quoted. Same goes for the executable name, btw (#499).

@stanio
Copy link
Contributor Author

stanio commented Jul 31, 2014

a0e53cd appears to fix the issue for me.

@amolenaar
Copy link
Collaborator

Should have been fixed by #508.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants