author | bpatel |
Wed, 07 Aug 2013 15:00:24 -0700 | |
changeset 19253 | b97b3e18547f |
parent 7681 | 1f0819a3341f |
child 21008 | af0b915df7cc |
permissions | -rw-r--r-- |
10 | 1 |
/* |
19253
b97b3e18547f
7198274: RFE : Javadoc Accessibility : Use CSS styles rather than <strong> or <i> tags
bpatel
parents:
7681
diff
changeset
|
2 |
* Copyright (c) 2003, 2013, 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 |
|
26 |
* @bug 4682448 4947464 5029946 |
|
27 |
* @summary Verify that the public modifier does not show up in the |
|
28 |
* documentation for public methods, as recommended by the JLS. |
|
29 |
* If A implements I and B extends A, B should be in the list of |
|
30 |
* implementing classes in the documentation for I. |
|
31 |
* @author jamieh |
|
32 |
* @library ../lib/ |
|
33 |
* @build JavadocTester |
|
34 |
* @build TestInterface |
|
35 |
* @run main TestInterface |
|
36 |
*/ |
|
37 |
||
38 |
public class TestInterface extends JavadocTester { |
|
39 |
||
40 |
//Test information. |
|
41 |
private static final String BUG_ID = "4682448-4947464-5029946"; |
|
42 |
||
43 |
//Javadoc arguments. |
|
44 |
private static final String[] ARGS = new String[] { |
|
2985
f43e1241e7fb
6843761: Update langtools tests to remove unncessary -source and -target options
darcy
parents:
2216
diff
changeset
|
45 |
"-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" |
10 | 46 |
}; |
47 |
||
48 |
//Input for string search tests. |
|
49 |
private static final String[][] TEST = { |
|
50 |
{BUG_ID + FS + "pkg" + FS + "Interface.html", |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
51 |
"<pre>int method()</pre>"}, |
10 | 52 |
{BUG_ID + FS + "pkg" + FS + "Interface.html", |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
53 |
"<pre>static final int field</pre>"}, |
10 | 54 |
|
55 |
||
56 |
// Make sure known implementing class list is correct and omits type parameters. |
|
57 |
{BUG_ID + FS + "pkg" + FS + "Interface.html", |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
58 |
"<dl>" + NL + "<dt>All Known Implementing Classes:</dt>" + NL + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
59 |
"<dd><a href=\"../pkg/Child.html\" title=\"class in pkg\">Child" + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
60 |
"</a>, <a href=\"../pkg/Parent.html\" title=\"class in pkg\">Parent" + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
61 |
"</a></dd>" + NL + "</dl>"}, |
10 | 62 |
|
63 |
// Make sure "All Implemented Interfaces": has substituted type parameters |
|
64 |
{BUG_ID + FS + "pkg" + FS + "Child.html", |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
65 |
"<dl>" + NL + "<dt>All Implemented Interfaces:</dt>" + NL + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
66 |
"<dd><a href=\"../pkg/Interface.html\" title=\"interface in pkg\">" + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
67 |
"Interface</a><T></dd>" + NL + "</dl>" |
10 | 68 |
}, |
69 |
//Make sure Class Tree has substituted type parameters. |
|
70 |
{BUG_ID + FS + "pkg" + FS + "Child.html", |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
71 |
"<ul class=\"inheritance\">" + NL + "<li>java.lang.Object</li>" + NL + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
72 |
"<li>" + NL + "<ul class=\"inheritance\">" + NL + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
73 |
"<li><a href=\"../pkg/Parent.html\" title=\"class in pkg\">" + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
74 |
"pkg.Parent</a><T></li>" + NL + "<li>" + NL + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
75 |
"<ul class=\"inheritance\">" + NL + "<li>pkg.Child<T></li>" + NL + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
76 |
"</ul>" + NL + "</li>" + NL + "</ul>" + NL + "</li>" + NL + "</ul>" |
10 | 77 |
}, |
78 |
//Make sure "Direct Know Subclasses" omits type parameters |
|
79 |
{BUG_ID + FS + "pkg" + FS + "Parent.html", |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
80 |
"<dl>" + NL + "<dt>Direct Known Subclasses:</dt>" + NL + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
81 |
"<dd><a href=\"../pkg/Child.html\" title=\"class in pkg\">Child" + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
82 |
"</a></dd>" + NL + "</dl>" |
10 | 83 |
}, |
84 |
//Make sure "Specified By" has substituted type parameters. |
|
85 |
{BUG_ID + FS + "pkg" + FS + "Child.html", |
|
19253
b97b3e18547f
7198274: RFE : Javadoc Accessibility : Use CSS styles rather than <strong> or <i> tags
bpatel
parents:
7681
diff
changeset
|
86 |
"<dt><span class=\"strong\">Specified by:</span></dt>" + NL + |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
87 |
"<dd><code><a href=\"../pkg/Interface.html#method()\">method</a>" + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
88 |
"</code> in interface <code>" + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
89 |
"<a href=\"../pkg/Interface.html\" title=\"interface in pkg\">" + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
90 |
"Interface</a><<a href=\"../pkg/Child.html\" title=\"type parameter in Child\">" + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
91 |
"T</a>></code></dd>" |
10 | 92 |
}, |
93 |
//Make sure "Overrides" has substituted type parameters. |
|
94 |
{BUG_ID + FS + "pkg" + FS + "Child.html", |
|
19253
b97b3e18547f
7198274: RFE : Javadoc Accessibility : Use CSS styles rather than <strong> or <i> tags
bpatel
parents:
7681
diff
changeset
|
95 |
"<dt><span class=\"strong\">Overrides:</span></dt>" + NL + |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
96 |
"<dd><code><a href=\"../pkg/Parent.html#method()\">method</a>" + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
97 |
"</code> in class <code><a href=\"../pkg/Parent.html\" " + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
98 |
"title=\"class in pkg\">Parent</a><<a href=\"../pkg/Child.html\" " + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
99 |
"title=\"type parameter in Child\">T</a>></code></dd>" |
10 | 100 |
}, |
101 |
}; |
|
102 |
private static final String[][] NEGATED_TEST = { |
|
103 |
{BUG_ID + FS + "pkg" + FS + "Interface.html", |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
104 |
"public int method()"}, |
10 | 105 |
{BUG_ID + FS + "pkg" + FS + "Interface.html", |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
106 |
"public static final int field"}, |
10 | 107 |
}; |
108 |
||
109 |
/** |
|
110 |
* The entry point of the test. |
|
111 |
* @param args the array of command line arguments. |
|
112 |
*/ |
|
113 |
public static void main(String[] args) { |
|
114 |
TestInterface tester = new TestInterface(); |
|
115 |
run(tester, ARGS, TEST, NEGATED_TEST); |
|
116 |
tester.printSummary(); |
|
117 |
} |
|
118 |
||
119 |
/** |
|
120 |
* {@inheritDoc} |
|
121 |
*/ |
|
122 |
public String getBugId() { |
|
123 |
return BUG_ID; |
|
124 |
} |
|
125 |
||
126 |
/** |
|
127 |
* {@inheritDoc} |
|
128 |
*/ |
|
129 |
public String getBugName() { |
|
130 |
return getClass().getName(); |
|
131 |
} |
|
132 |
} |