You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "René Kraneis (Jira)" <ji...@apache.org> on 2020/12/29 18:58:00 UTC

[jira] [Created] (SUREFIRE-1869) Classloader.getResource() doesn't encode blanks with forkCount=0

René Kraneis created SUREFIRE-1869:
--------------------------------------

             Summary: Classloader.getResource() doesn't encode blanks with forkCount=0
                 Key: SUREFIRE-1869
                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1869
             Project: Maven Surefire
          Issue Type: Bug
    Affects Versions: 3.0.0-M5, 2.22.2, 2.20
            Reporter: René Kraneis


We found this bug when running cucumber tests, having project paths with spaces and forkCount set to 0 (see [https://github.com/cucumber/cucumber-jvm/issues/2196] for the but report there). A minimal reproducing example would be
{code:java}
$ pwd
/home/rene/Projects/path with space/classpath test{code}
{code:java}
$ tree
.
├── pom.xml
└── src
    └── test
        └── java
            └── ClassPathTest.java{code}
{code:java}
$ cat src/test/java/ClassPathTest.java
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
public class ClassPathTest {
  public void testClassPath() throws IOException, URISyntaxException {
    URI uri = ClassPathTest.class.getClassLoader()
      .getResources(".")
      .nextElement()
      .toURI();
      System.out.println(uri);
  }
}{code}
Last working version of surefire is 2.19.1. The build does not contain any additional dependencies and relies on pojo test execution. The same problem also happens when running tests with junit, junit vintage or junit platform.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)