langtools/test/tools/javac/modules/GraphsTest.java
changeset 39103 91a64ec5b970
parent 37758 3ecf9b414e05
child 40308 274367a99f98
--- a/langtools/test/tools/javac/modules/GraphsTest.java	Fri Jun 17 17:09:21 2016 -0600
+++ b/langtools/test/tools/javac/modules/GraphsTest.java	Fri Jun 17 17:40:01 2016 -0700
@@ -73,6 +73,7 @@
     @Test
     public void diamond(Path base) throws Exception {
 
+        Path modSrc = Files.createDirectories(base.resolve("modSrc"));
         Path modules = Files.createDirectories(base.resolve("modules"));
 
         new ModuleBuilder(tb, "J")
@@ -94,19 +95,19 @@
                 .requiresPublic("J", jarModules)
                 .classes("package openO; public class O { openJ.J j; }")
                 .classes("package closedO; public class O { }")
-                .build(modules);
+                .build(modSrc, modules);
         new ModuleBuilder(tb, "N")
                 .requiresPublic("O", modules, jarModules)
                 .exports("openN")
                 .classes("package openN; public class N { }")
                 .classes("package closedN; public class N { }")
-                .build(modules);
+                .build(modSrc, modules);
         new ModuleBuilder(tb, "L")
                 .requiresPublic("O", modules, jarModules)
                 .exports("openL")
                 .classes("package openL; public class L { }")
                 .classes("package closedL; public class L { }")
-                .build(modules);
+                .build(modSrc, modules);
         ModuleBuilder m = new ModuleBuilder(tb, "M");
         //positive case
         Path positiveSrc = m
@@ -140,14 +141,14 @@
             throw new Exception("Expected output not found");
         }
         //multi module mode
-        m.write(modules);
+        m.write(modSrc);
         List<String> out = new JavacTask(tb)
                 .options("-XDrawDiagnostics",
-                        "-modulesourcepath", modules + "/*/src",
+                        "-modulesourcepath", modSrc.toString(),
                         "-mp", jarModules.toString()
                 )
                 .outdir(Files.createDirectories(base.resolve("negative")))
-                .files(findJavaFiles(modules))
+                .files(findJavaFiles(modSrc))
                 .run(Task.Expect.FAIL)
                 .writeAll()
                 .getOutputLines(Task.OutputKind.DIRECT);
@@ -179,23 +180,23 @@
     */
     @Test
     public void reexportOfQualifiedExport(Path base) throws Exception {
-        Path modules = base.resolve("modules");
+        Path modSrc = base.resolve("modSrc");
         new ModuleBuilder(tb, "M")
                 .requiresPublic("N")
-                .write(modules);
+                .write(modSrc);
         new ModuleBuilder(tb, "N")
                 .exportsTo("pack", "M")
                 .classes("package pack; public class Clazz { }")
-                .write(modules);
+                .write(modSrc);
         new ModuleBuilder(tb, "L")
                 .requires("M")
                 .classes("package p; public class A { A(pack.Clazz cl){} } ")
-                .write(modules);
+                .write(modSrc);
         String log = new JavacTask(tb)
                 .options("-XDrawDiagnostics",
-                        "-modulesourcepath", modules + "/*/src")
+                        "-modulesourcepath", modSrc.toString())
                 .outdir(Files.createDirectories(base.resolve("negative")))
-                .files(findJavaFiles(modules))
+                .files(findJavaFiles(modSrc))
                 .run(Task.Expect.FAIL)
                 .writeAll()
                 .getOutput(Task.OutputKind.DIRECT);