121 .testOpts("--module-path", modules.toString()) |
121 .testOpts("--module-path", modules.toString()) |
122 .otherOpts("--module-source-path", src.toString()) |
122 .otherOpts("--module-source-path", src.toString()) |
123 .files(findJavaFiles(src)) |
123 .files(findJavaFiles(src)) |
124 .run(); |
124 .run(); |
125 |
125 |
|
126 Path emptyClassPath = base.resolve("emptyClassPath"); |
|
127 |
|
128 Files.createDirectories(emptyClassPath); |
|
129 |
126 // This is the test, to verify that the module being compiled will not be able to read |
130 // This is the test, to verify that the module being compiled will not be able to read |
127 // modules on the module path when a --limit-modules is used |
131 // modules on the module path when a --limit-modules is used |
128 new TestCase(base) |
132 new TestCase(base) |
129 .testOpts("--module-path", modules.toString(), "--limit-modules", "jdk.compiler") |
133 .testOpts("--module-path", modules.toString(), "--limit-modules", "jdk.compiler") |
130 .otherOpts("-XDrawDiagnostics", |
134 .otherOpts("-XDrawDiagnostics", |
131 "--module-source-path", src.toString(), |
135 "--module-source-path", src.toString(), |
132 "-classpath", "") |
136 "-classpath", emptyClassPath.toString()) |
133 .files(findJavaFiles(src)) |
137 .files(findJavaFiles(src)) |
134 .expect(Task.Expect.FAIL, "compiler.err.module.not.found") |
138 .expect(Task.Expect.FAIL, "compiler.err.module.not.found") |
135 .run(); |
139 .run(); |
136 } |
140 } |
137 |
141 |