< prev index next >

test/tools/javac/modules/GetLocationForModuleTest.java

Print this page

        

*** 46,59 **** } public void run(Path base) throws Exception { // Set up some trivial modules Path moduleSrc = base.resolve("module-src"); ! Path m1 = moduleSrc.resolve("m1"); ! tb.writeJavaFiles(m1, "module m1 { }"); ! Path m2 = moduleSrc.resolve("m2"); ! tb.writeJavaFiles(m2, "module m2 { }"); Path modulePath = base.resolve("module-path"); Files.createDirectories(modulePath); new JavacTask(tb) .options("--module-source-path", moduleSrc.toString()) --- 46,59 ---- } public void run(Path base) throws Exception { // Set up some trivial modules Path moduleSrc = base.resolve("module-src"); ! Path m1 = moduleSrc.resolve("m1x"); ! tb.writeJavaFiles(m1, "module m1x { }"); ! Path m2 = moduleSrc.resolve("m2x"); ! tb.writeJavaFiles(m2, "module m2x { }"); Path modulePath = base.resolve("module-path"); Files.createDirectories(modulePath); new JavacTask(tb) .options("--module-source-path", moduleSrc.toString())
*** 67,77 **** ToolProvider.getSystemJavaCompiler().getStandardFileManager(null, null, null); fm.setLocationFromPaths(StandardLocation.MODULE_PATH, Arrays.asList(modulePath)); // Test test(fm, StandardLocation.SYSTEM_MODULES, "java.base", "java.compiler"); ! test(fm, StandardLocation.MODULE_PATH, "m1", "m2"); } void test(JavaFileManager fm, JavaFileManager.Location locn, String... mods) throws IOException { for (String mod : mods) { JavaFileManager.Location modLocn = fm.getLocationForModule(locn, mod); --- 67,77 ---- ToolProvider.getSystemJavaCompiler().getStandardFileManager(null, null, null); fm.setLocationFromPaths(StandardLocation.MODULE_PATH, Arrays.asList(modulePath)); // Test test(fm, StandardLocation.SYSTEM_MODULES, "java.base", "java.compiler"); ! test(fm, StandardLocation.MODULE_PATH, "m1x", "m2x"); } void test(JavaFileManager fm, JavaFileManager.Location locn, String... mods) throws IOException { for (String mod : mods) { JavaFileManager.Location modLocn = fm.getLocationForModule(locn, mod);
< prev index next >