8295176: some langtools test pollutes source tree
Reviewed-by: sadayapalam, darcy, vromero
This commit is contained in:
parent
bca7ab3c11
commit
71aa821091
test/langtools/tools/javac/options/release
@ -1,9 +1,10 @@
|
||||
/**
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8072480
|
||||
* @summary Verify that javac rejects Java 8 program with --release 7
|
||||
* @summary Verify that javac rejects Java 17 program with --release 11
|
||||
* @compile ReleaseOption.java
|
||||
* @compile/fail/ref=ReleaseOption.out -XDrawDiagnostics --release 11 ReleaseOption.java
|
||||
*/
|
||||
|
||||
interface ReleaseOption extends java.util.stream.Stream {
|
||||
interface ReleaseOption extends java.util.random.RandomGenerator {
|
||||
}
|
||||
|
@ -0,0 +1,2 @@
|
||||
ReleaseOption.java:9:49: compiler.err.doesnt.exist: java.util.random
|
||||
1 error
|
@ -50,10 +50,12 @@ public class ReleaseOptionThroughAPI {
|
||||
PrintWriter outWriter = new PrintWriter(out)) {
|
||||
Iterable<? extends JavaFileObject> input =
|
||||
fm.getJavaFileObjects(System.getProperty("test.src") + "/ReleaseOption.java");
|
||||
List<String> options = Arrays.asList("--release", "8", "-XDrawDiagnostics", "-Xlint:-options");
|
||||
List<String> options = Arrays.asList("--release", "11", "-XDrawDiagnostics", "-d", ".");
|
||||
|
||||
compiler.getTask(outWriter, fm, null, options, null, input).call();
|
||||
String expected ="";
|
||||
String expected =
|
||||
"ReleaseOption.java:9:49: compiler.err.doesnt.exist: java.util.random" + lineSep +
|
||||
"1 error" + lineSep;
|
||||
if (!expected.equals(out.toString())) {
|
||||
throw new AssertionError("Unexpected output: " + out.toString());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user