author | jjg |
Wed, 16 Apr 2014 16:17:09 -0700 | |
changeset 23971 | f5ff1f5a8dee |
parent 21478 | fa4c7cda1b41 |
child 24065 | fc4022e50129 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
23971 | 2 |
* Copyright (c) 2002, 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 |
|
21478
fa4c7cda1b41
8026567: Use meaningful style names for strong and italic styles.
bpatel
parents:
21008
diff
changeset
|
26 |
* @bug 4638588 4635809 6256068 6270645 8025633 8026567 |
10 | 27 |
* @summary Test to make sure that members are inherited properly in the Javadoc. |
28 |
* Verify that inheritence labels are correct. |
|
29 |
* @author jamieh |
|
30 |
* @library ../lib/ |
|
31 |
* @build JavadocTester |
|
32 |
* @build TestMemberInheritence |
|
33 |
* @run main TestMemberInheritence |
|
34 |
*/ |
|
35 |
||
36 |
public class TestMemberInheritence extends JavadocTester { |
|
37 |
||
38 |
private static final String BUG_ID = "4638588-4635809-6256068-6270645"; |
|
39 |
||
40 |
private static final String[][] TEST = { |
|
41 |
//Public field should be inherited |
|
23971 | 42 |
{BUG_ID + "/pkg/SubClass.html", |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
43 |
"<a href=\"../pkg/BaseClass.html#pubField\">"}, |
10 | 44 |
|
45 |
//Public method should be inherited |
|
23971 | 46 |
{BUG_ID + "/pkg/SubClass.html", |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
19253
diff
changeset
|
47 |
"<a href=\"../pkg/BaseClass.html#pubMethod--\">"}, |
10 | 48 |
|
49 |
//Public inner class should be inherited. |
|
23971 | 50 |
{BUG_ID + "/pkg/SubClass.html", |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
51 |
"<a href=\"../pkg/BaseClass.pubInnerClass.html\" title=\"class in pkg\">"}, |
10 | 52 |
|
53 |
//Protected field should be inherited |
|
23971 | 54 |
{BUG_ID + "/pkg/SubClass.html", |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
55 |
"<a href=\"../pkg/BaseClass.html#proField\">"}, |
10 | 56 |
|
57 |
//Protected method should be inherited |
|
23971 | 58 |
{BUG_ID + "/pkg/SubClass.html", |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
19253
diff
changeset
|
59 |
"<a href=\"../pkg/BaseClass.html#proMethod--\">"}, |
10 | 60 |
|
61 |
//Protected inner class should be inherited. |
|
23971 | 62 |
{BUG_ID + "/pkg/SubClass.html", |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
63 |
"<a href=\"../pkg/BaseClass.proInnerClass.html\" title=\"class in pkg\">"}, |
10 | 64 |
|
65 |
// New labels as of 1.5.0 |
|
23971 | 66 |
{BUG_ID + "/pkg/SubClass.html", |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
67 |
"Nested classes/interfaces inherited from class pkg." + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
68 |
"<a href=\"../pkg/BaseClass.html\" title=\"class in pkg\">BaseClass</a>"}, |
23971 | 69 |
{BUG_ID + "/pkg/SubClass.html", |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
70 |
"Nested classes/interfaces inherited from interface pkg." + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
71 |
"<a href=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">BaseInterface</a>"}, |
10 | 72 |
|
73 |
// Test overriding/implementing methods with generic parameters. |
|
23971 | 74 |
{BUG_ID + "/pkg/BaseClass.html", |
75 |
"<dl>\n" + |
|
76 |
"<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n" + |
|
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
19253
diff
changeset
|
77 |
"<dd><code><a href=\"../pkg/BaseInterface.html#getAnnotation-java.lang.Class-\">" + |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
78 |
"getAnnotation</a></code> in interface <code>" + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
79 |
"<a href=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">" + |
23971 | 80 |
"BaseInterface</a></code></dd>\n" + |
81 |
"</dl>"}, |
|
10 | 82 |
|
83 |
// Test diamond inheritence member summary (6256068) |
|
23971 | 84 |
{BUG_ID + "/diamond/Z.html", |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
19253
diff
changeset
|
85 |
"<code><a href=\"../diamond/A.html#aMethod--\">aMethod</a></code>"}, |
10 | 86 |
|
87 |
// Test that doc is inherited from closed parent (6270645) |
|
23971 | 88 |
{BUG_ID + "/inheritDist/C.html", |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
89 |
"<div class=\"block\">m1-B</div>"}, |
10 | 90 |
|
91 |
}; |
|
92 |
||
93 |
private static final String[][] NEGATED_TEST = { |
|
23971 | 94 |
{BUG_ID + "/pkg/SubClass.html", |
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
19253
diff
changeset
|
95 |
"<a href=\"../pkg/BaseClass.html#staticMethod--\">staticMethod</a></code>"}, |
10 | 96 |
}; |
97 |
private static final String[] ARGS = |
|
98 |
new String[] { |
|
23971 | 99 |
"-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", "diamond", |
100 |
"inheritDist"}; |
|
10 | 101 |
|
102 |
/** |
|
103 |
* The entry point of the test. |
|
104 |
* @param args the array of command line arguments. |
|
105 |
*/ |
|
106 |
public static void main(String[] args) { |
|
107 |
TestMemberInheritence tester = new TestMemberInheritence(); |
|
108 |
run(tester, ARGS, TEST, NEGATED_TEST); |
|
109 |
tester.printSummary(); |
|
110 |
} |
|
111 |
||
112 |
/** |
|
113 |
* {@inheritDoc} |
|
114 |
*/ |
|
115 |
public String getBugId() { |
|
116 |
return BUG_ID; |
|
117 |
} |
|
118 |
||
119 |
/** |
|
120 |
* {@inheritDoc} |
|
121 |
*/ |
|
122 |
public String getBugName() { |
|
123 |
return getClass().getName(); |
|
124 |
} |
|
125 |
} |