--- a/jdk/test/tools/jlink/basic/BasicTest.java Wed Nov 23 16:16:35 2016 +0000
+++ b/jdk/test/tools/jlink/basic/BasicTest.java Thu Dec 01 08:57:53 2016 +0000
@@ -59,10 +59,11 @@
new RuntimeException("jlink tool not found")
);
+ private final String TEST_MODULE = "test";
private final Path jdkHome = Paths.get(System.getProperty("test.jdk"));
private final Path jdkMods = jdkHome.resolve("jmods");
private final Path testSrc = Paths.get(System.getProperty("test.src"));
- private final Path src = testSrc.resolve("src");
+ private final Path src = testSrc.resolve("src").resolve(TEST_MODULE);
private final Path classes = Paths.get("classes");
private final Path jmods = Paths.get("jmods");
private final Path jars = Paths.get("jars");
@@ -80,23 +81,22 @@
throw new AssertionError("Compilation failure. See log.");
}
- String modName = "test";
Files.createDirectories(jmods);
Files.createDirectories(jars);
Path jarfile = jars.resolve("test.jar");
JarUtils.createJarFile(jarfile, classes);
Path image = Paths.get("mysmallimage");
- runJmod(jarfile.toString(), modName);
- runJlink(image, modName, "--compress", "2");
- execute(image, modName);
+ runJmod(jarfile.toString(), TEST_MODULE);
+ runJlink(image, TEST_MODULE, "--compress", "2");
+ execute(image, TEST_MODULE);
- Files.delete(jmods.resolve(modName + ".jmod"));
+ Files.delete(jmods.resolve(TEST_MODULE + ".jmod"));
image = Paths.get("myimage");
- runJmod(classes.toString(), modName);
- runJlink(image, modName);
- execute(image, modName);
+ runJmod(classes.toString(), TEST_MODULE);
+ runJlink(image, TEST_MODULE);
+ execute(image, TEST_MODULE);
}
private void execute(Path image, String moduleName) throws Throwable {