author | jjg |
Tue, 22 Apr 2014 17:57:40 -0700 | |
changeset 24072 | e7549dcbc4af |
parent 24071 | b0845717434e |
child 24217 | 25b12d4d4192 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
23971 | 2 |
* Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. |
10 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5520 | 19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
10 | 22 |
*/ |
23 |
||
24 |
/* |
|
25 |
* @test |
|
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
15354
diff
changeset
|
26 |
* @bug 4515705 4804296 4702454 4697036 8025633 |
10 | 27 |
* @summary Make sure that first sentence warning only appears once. |
28 |
* Make sure that only warnings/errors are printed when quiet is used. |
|
29 |
* Make sure that links to private/unincluded methods do not cause |
|
30 |
* a "link unresolved" warning. |
|
31 |
* Make sure error message starts with "error -". |
|
32 |
* @author jamieh |
|
33 |
* @library ../lib/ |
|
34 |
* @build JavadocTester |
|
35 |
* @build TestWarnings |
|
36 |
* @run main TestWarnings |
|
37 |
*/ |
|
38 |
||
39 |
public class TestWarnings extends JavadocTester { |
|
40 |
||
41 |
//Javadoc arguments. |
|
42 |
private static final String[] ARGS = new String[] { |
|
24072 | 43 |
"-Xdoclint:none", "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg" |
10 | 44 |
}; |
45 |
||
46 |
private static final String[] ARGS2 = new String[] { |
|
24072 | 47 |
"-Xdoclint:none", "-d", OUTPUT_DIR, "-private", "-sourcepath", SRC_DIR, |
23971 | 48 |
"pkg" |
10 | 49 |
}; |
50 |
||
51 |
//Input for string search tests. |
|
52 |
private static final String[][] TEST = { |
|
53 |
{WARNING_OUTPUT, |
|
54 |
"X.java:11: warning - Missing closing '}' character for inline tag"}, |
|
55 |
{ERROR_OUTPUT, |
|
56 |
"package.html: error - Body tag missing from HTML"}, |
|
57 |
||
58 |
}; |
|
59 |
private static final String[][] NEGATED_TEST = { |
|
24072 | 60 |
{ "pkg/X.html", "can't find m()"}, |
61 |
{ "pkg/X.html", "can't find X()"}, |
|
62 |
{ "pkg/X.html", "can't find f"}, |
|
10 | 63 |
}; |
64 |
||
65 |
private static final String[][] TEST2 = { |
|
24072 | 66 |
{ "pkg/X.html", |
23971 | 67 |
"<a href=\"../pkg/X.html#m--\"><code>m()</code></a><br/>"}, |
24072 | 68 |
{ "pkg/X.html", |
23971 | 69 |
"<a href=\"../pkg/X.html#X--\"><code>X()</code></a><br/>"}, |
24072 | 70 |
{ "pkg/X.html", |
23971 | 71 |
"<a href=\"../pkg/X.html#f\"><code>f</code></a><br/>"}, |
10 | 72 |
}; |
73 |
||
74 |
/** |
|
75 |
* The entry point of the test. |
|
76 |
* @param args the array of command line arguments. |
|
77 |
*/ |
|
78 |
public static void main(String[] args) { |
|
79 |
TestWarnings tester = new TestWarnings(); |
|
24065
fc4022e50129
8041150: Avoid silly use of static methods in JavadocTester
jjg
parents:
23971
diff
changeset
|
80 |
tester.run(ARGS, TEST, NEGATED_TEST); |
24071 | 81 |
tester.run(ARGS, TEST, NEGATED_TEST); |
82 |
tester.run(ARGS2, TEST2, NO_TEST); |
|
10 | 83 |
tester.printSummary(); |
84 |
} |
|
85 |
} |