[maven-surefire] branch maven2surefire-jvm-communication updated: fix testLoadInNewClassLoader

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[maven-surefire] branch maven2surefire-jvm-communication updated: fix testLoadInNewClassLoader

Tibor Digana
This is an automated email from the ASF dual-hosted git repository.

tibordigana pushed a commit to branch maven2surefire-jvm-communication
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git


The following commit(s) were added to refs/heads/maven2surefire-jvm-communication by this push:
     new 3d97d1c  fix testLoadInNewClassLoader
3d97d1c is described below

commit 3d97d1c36c22a9cd2100ca8b2bde29ea9d106e2d
Author: tibordigana <[hidden email]>
AuthorDate: Fri Feb 14 02:16:50 2020 +0100

    fix testLoadInNewClassLoader
---
 .../src/test/java/org/apache/maven/surefire/booter/ClasspathTest.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ClasspathTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ClasspathTest.java
index f4ad836..38387d5 100644
--- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ClasspathTest.java
+++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/ClasspathTest.java
@@ -200,7 +200,8 @@ public class ClasspathTest
         String thisPath = "/" + target.getName().replace( '.', '/' ) + ".class";
         URL url = target.getResource( thisPath );
         assertTrue( url.toString().endsWith( thisPath ) );
-        String oneClasspath = new URL( url.toString().replace( thisPath, "" ).replace( "!", "" ) ).getFile();
+        String s = url.toString().replace( thisPath, "" ).replace( "!", "" ).replace( "jar:file:", "file:" );
+        String oneClasspath = new URL( s ).getFile();
         assertTrue( new File( oneClasspath ).exists() );
         Classpath classpath = Classpath.emptyClasspath();
         ClassLoader classLoader = classpath.addClassPathElementUrl( new File( oneClasspath ).getCanonicalPath() )