author | ohair |
Tue, 25 May 2010 15:54:51 -0700 | |
changeset 5520 | 86e4b9a9da40 |
parent 2985 | f43e1241e7fb |
child 7614 | cfadc977ca75 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
5520 | 2 |
* Copyright (c) 2003, 2004, 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", |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
51 |
"int <STRONG>method</STRONG>()"}, |
10 | 52 |
{BUG_ID + FS + "pkg" + FS + "Interface.html", |
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
53 |
"static final int <STRONG>field</STRONG>"}, |
10 | 54 |
|
55 |
||
56 |
// Make sure known implementing class list is correct and omits type parameters. |
|
57 |
{BUG_ID + FS + "pkg" + FS + "Interface.html", |
|
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1787
diff
changeset
|
58 |
"<DT><STRONG>All Known Implementing Classes:</STRONG></DT> " + |
10 | 59 |
"<DD><A HREF=\"../pkg/Child.html\" " + |
60 |
"title=\"class in pkg\">Child</A>, " + |
|
61 |
"<A HREF=\"../pkg/Parent.html\" title=\"class in pkg\">" + |
|
62 |
"Parent</A></DD>"}, |
|
63 |
||
64 |
// Make sure "All Implemented Interfaces": has substituted type parameters |
|
65 |
{BUG_ID + FS + "pkg" + FS + "Child.html", |
|
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1787
diff
changeset
|
66 |
"<STRONG>All Implemented Interfaces:</STRONG></DT> <DD>" + |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1787
diff
changeset
|
67 |
"<A HREF=\"../pkg/Interface.html\" title=\"interface in pkg\">" + |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1787
diff
changeset
|
68 |
"Interface</A><T>" |
10 | 69 |
}, |
70 |
//Make sure Class Tree has substituted type parameters. |
|
71 |
{BUG_ID + FS + "pkg" + FS + "Child.html", |
|
72 |
"<PRE>" + NL + |
|
73 |
"java.lang.Object" + NL + |
|
74 |
" <IMG SRC=\"../resources/inherit.gif\" ALT=\"extended by \"><A HREF=\"../pkg/Parent.html\" title=\"class in pkg\">pkg.Parent</A><T>" + NL + |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
75 |
" <IMG SRC=\"../resources/inherit.gif\" ALT=\"extended by \"><STRONG>pkg.Child<T></STRONG>" + NL + |
10 | 76 |
"</PRE>" |
77 |
}, |
|
78 |
//Make sure "Direct Know Subclasses" omits type parameters |
|
79 |
{BUG_ID + FS + "pkg" + FS + "Parent.html", |
|
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1787
diff
changeset
|
80 |
"<STRONG>Direct Known Subclasses:</STRONG></DT> <DD><A HREF=\"../pkg/Child.html\" title=\"class in pkg\">Child</A>" |
10 | 81 |
}, |
82 |
//Make sure "Specified By" has substituted type parameters. |
|
83 |
{BUG_ID + FS + "pkg" + FS + "Child.html", |
|
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1787
diff
changeset
|
84 |
"<STRONG>Specified by:</STRONG></DT><DD><CODE><A HREF=\"../pkg/Interface.html#method()\">method</A></CODE> in interface <CODE><A HREF=\"../pkg/Interface.html\" title=\"interface in pkg\">Interface</A><<A HREF=\"../pkg/Child.html\" title=\"type parameter in Child\">T</A>></CODE>" |
10 | 85 |
}, |
86 |
//Make sure "Overrides" has substituted type parameters. |
|
87 |
{BUG_ID + FS + "pkg" + FS + "Child.html", |
|
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1787
diff
changeset
|
88 |
"<STRONG>Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg/Parent.html#method()\">method</A></CODE> in class <CODE><A HREF=\"../pkg/Parent.html\" title=\"class in pkg\">Parent</A><<A HREF=\"../pkg/Child.html\" title=\"type parameter in Child\">T</A>></CODE>" |
10 | 89 |
}, |
90 |
}; |
|
91 |
private static final String[][] NEGATED_TEST = { |
|
92 |
{BUG_ID + FS + "pkg" + FS + "Interface.html", |
|
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
93 |
"public int <STRONG>method</STRONG>()"}, |
10 | 94 |
{BUG_ID + FS + "pkg" + FS + "Interface.html", |
1787
1aa079321cd2
6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents:
10
diff
changeset
|
95 |
"public static final int <STRONG>field</STRONG>"}, |
10 | 96 |
}; |
97 |
||
98 |
/** |
|
99 |
* The entry point of the test. |
|
100 |
* @param args the array of command line arguments. |
|
101 |
*/ |
|
102 |
public static void main(String[] args) { |
|
103 |
TestInterface tester = new TestInterface(); |
|
104 |
run(tester, ARGS, TEST, NEGATED_TEST); |
|
105 |
tester.printSummary(); |
|
106 |
} |
|
107 |
||
108 |
/** |
|
109 |
* {@inheritDoc} |
|
110 |
*/ |
|
111 |
public String getBugId() { |
|
112 |
return BUG_ID; |
|
113 |
} |
|
114 |
||
115 |
/** |
|
116 |
* {@inheritDoc} |
|
117 |
*/ |
|
118 |
public String getBugName() { |
|
119 |
return getClass().getName(); |
|
120 |
} |
|
121 |
} |