Normalize search path in PropertiesLauncher

* Windows: allow absolute file paths without file:/// prefix
* All: only add nested archives (not directories), so loader.path=lib/*
behaves the same as -classpath=lib/* (except for adding zip files)

Fixes gh-1352
This commit is contained in:
Dave Syer
2014-08-19 14:14:01 +01:00
parent ccfc47091c
commit 8e84151f8f
2 changed files with 23 additions and 8 deletions

View File

@@ -112,6 +112,17 @@ public class PropertiesLauncherTests {
waitFor("Hello World");
}
@Test
public void testUserSpecifiedJarPathWithDot() throws Exception {
System.setProperty("loader.path", "./jars/app.jar");
System.setProperty("loader.main", "demo.Application");
PropertiesLauncher launcher = new PropertiesLauncher();
assertEquals("[jars/app.jar]", ReflectionTestUtils.getField(launcher, "paths")
.toString());
launcher.launch(new String[0]);
waitFor("Hello World");
}
@Test
public void testUserSpecifiedClassLoader() throws Exception {
System.setProperty("loader.path", "jars/app.jar");