author | jjg |
Tue, 22 Apr 2014 17:57:40 -0700 | |
changeset 24072 | e7549dcbc4af |
parent 24065 | fc4022e50129 |
child 24399 | af1a0220d0fa |
permissions | -rw-r--r-- |
15034
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
1 |
/* |
23971 | 2 |
* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. |
15034
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
4 |
* |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
8 |
* |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
13 |
* accompanied this code). |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
14 |
* |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
18 |
* |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
21 |
* questions. |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
22 |
*/ |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
23 |
|
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
24 |
/* |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
25 |
* @test |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
26 |
* @bug 8004891 |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
27 |
* @summary Make sure that the abstract method is identified correctly |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
28 |
* if the abstract modifier is present explicitly or implicitly. |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
29 |
* @author bpatel |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
30 |
* @library ../lib/ |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
31 |
* @build JavadocTester TestAbstractMethod |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
32 |
* @run main TestAbstractMethod |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
33 |
*/ |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
34 |
|
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
35 |
public class TestAbstractMethod extends JavadocTester { |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
36 |
|
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
37 |
//Test information. |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
38 |
|
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
39 |
//Javadoc arguments. |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
40 |
private static final String[] ARGS = new String[] { |
24072 | 41 |
"-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg" |
15034
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
42 |
}; |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
43 |
|
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
44 |
//Input for string search tests. |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
45 |
private static final String[][] TEST = { |
24072 | 46 |
{ "pkg/A.html", |
15034
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
47 |
"<td class=\"colFirst\"><code>default void</code></td>"}, |
24072 | 48 |
{ "pkg/A.html", |
15034
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
49 |
"<caption><span id=\"t0\" class=\"activeTableTab\"><span>" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
50 |
"All Methods</span><span class=\"tabEnd\"> </span></span>" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
51 |
"<span id=\"t2\" class=\"tableTab\"><span>" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
52 |
"<a href=\"javascript:show(2);\">Instance Methods</a></span>" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
53 |
"<span class=\"tabEnd\"> </span></span><span id=\"t3\" " + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
54 |
"class=\"tableTab\"><span><a href=\"javascript:show(4);\">" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
55 |
"Abstract Methods</a></span><span class=\"tabEnd\"> </span>" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
56 |
"</span><span id=\"t5\" class=\"tableTab\"><span>" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
57 |
"<a href=\"javascript:show(16);\">Default Methods</a></span>" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
58 |
"<span class=\"tabEnd\"> </span></span></caption>"}, |
24072 | 59 |
{ "pkg/B.html", |
15034
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
60 |
"<caption><span id=\"t0\" class=\"activeTableTab\"><span>" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
61 |
"All Methods</span><span class=\"tabEnd\"> </span></span>" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
62 |
"<span id=\"t2\" class=\"tableTab\"><span>" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
63 |
"<a href=\"javascript:show(2);\">Instance Methods</a></span>" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
64 |
"<span class=\"tabEnd\"> </span></span><span id=\"t3\" " + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
65 |
"class=\"tableTab\"><span><a href=\"javascript:show(4);\">Abstract " + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
66 |
"Methods</a></span><span class=\"tabEnd\"> </span></span>" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
67 |
"<span id=\"t4\" class=\"tableTab\"><span>" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
68 |
"<a href=\"javascript:show(8);\">Concrete Methods</a></span>" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
69 |
"<span class=\"tabEnd\"> </span></span></caption>"}, |
24072 | 70 |
{ "pkg/B.html", |
15034
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
71 |
"<td class=\"colFirst\"><code>abstract void</code></td>"}, |
24072 | 72 |
{ "pkg/C.html", |
15034
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
73 |
"<caption><span id=\"t0\" class=\"activeTableTab\"><span>" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
74 |
"All Methods</span><span class=\"tabEnd\"> </span></span>" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
75 |
"<span id=\"t2\" class=\"tableTab\"><span>" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
76 |
"<a href=\"javascript:show(2);\">Instance Methods</a></span>" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
77 |
"<span class=\"tabEnd\"> </span></span>" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
78 |
"<span id=\"t5\" class=\"tableTab\"><span>" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
79 |
"<a href=\"javascript:show(16);\">Default Methods</a></span>" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
80 |
"<span class=\"tabEnd\"> </span></span></caption>"}, |
24072 | 81 |
{ "pkg/C.html", |
15034
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
82 |
"<td class=\"colFirst\"><code>default void</code></td>"} |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
83 |
}; |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
84 |
private static final String[][] NEGATED_TEST = { |
24072 | 85 |
{ "pkg/A.html", |
15034
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
86 |
"<td class=\"colFirst\"><code>abstract void</code></td>"}, |
24072 | 87 |
{ "pkg/B.html", |
15034
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
88 |
"<span><a href=\"javascript:show(16);\">Default Methods</a></span>" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
89 |
"<span class=\"tabEnd\"> </span>"}, |
24072 | 90 |
{ "pkg/B.html", |
15034
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
91 |
"<td class=\"colFirst\"><code>default void</code></td>"}, |
24072 | 92 |
{ "pkg/C.html", |
15034
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
93 |
"<span><a href=\"javascript:show(4);\">Abstract Methods</a></span>" + |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
94 |
"<span class=\"tabEnd\"> </span>"} |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
95 |
}; |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
96 |
|
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
97 |
/** |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
98 |
* The entry point of the test. |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
99 |
* @param args the array of command line arguments. |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
100 |
*/ |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
101 |
public static void main(String[] args) { |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
102 |
TestAbstractMethod tester = new TestAbstractMethod(); |
24065
fc4022e50129
8041150: Avoid silly use of static methods in JavadocTester
jjg
parents:
23971
diff
changeset
|
103 |
tester.run(ARGS, TEST, NEGATED_TEST); |
15034
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
104 |
tester.printSummary(); |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
105 |
} |
b7c791bc4526
8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff
changeset
|
106 |
} |