1
1
/*
2
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
23
23
24
24
/*
25
25
* @test
26
- * @bug 8175219
26
+ * @bug 8175219 8268582
27
27
* @summary test --ignore-errors works correctly
28
28
* @modules
29
29
* jdk.javadoc/jdk.javadoc.internal.api
@@ -73,6 +73,12 @@ public void runIgnoreErrorsOffByDefault() throws Exception {
73
73
if (!out .contains ("modifier static not allowed here" )) {
74
74
throw new Exception ("expected string not found \' modifier static not allowed here\' " );
75
75
}
76
+ if (!out .contains ("package invalid.example does not exist" )) {
77
+ throw new Exception ("expected string not found \' package invalid.example does not exist\' " );
78
+ }
79
+ if (!out .contains ("cannot find symbol" )) {
80
+ throw new Exception ("expected string not found \' cannot find symbol\' " );
81
+ }
76
82
}
77
83
78
84
@ Test
@@ -84,12 +90,19 @@ public void runIgnoreErrorsOn() throws Exception {
84
90
if (!out .contains ("modifier static not allowed here" )) {
85
91
throw new Exception ("expected string not found \' modifier static not allowed here\' " );
86
92
}
93
+ if (!out .contains ("package invalid.example does not exist" )) {
94
+ throw new Exception ("expected string not found \' package invalid.example does not exist\' " );
95
+ }
96
+ if (!out .contains ("cannot find symbol" )) {
97
+ throw new Exception ("expected string not found \' cannot find symbol\' " );
98
+ }
87
99
}
88
100
89
101
void emitSample (Path file ) throws IOException {
90
102
String [] contents = {
91
103
"/** A java file with errors */" ,
92
- "public static class Foo {}"
104
+ "import invalid.example.OtherClass;" ,
105
+ "public static class Foo<T> extends OtherClass<T> {}"
93
106
};
94
107
Files .write (file , Arrays .asList (contents ), StandardOpenOption .CREATE );
95
108
}
0 commit comments