author | lana |
Fri, 05 Aug 2011 15:35:04 -0700 | |
changeset 10107 | 2132929d2ec3 |
parent 7681 | 1f0819a3341f |
child 19253 | b97b3e18547f |
permissions | -rw-r--r-- |
10 | 1 |
/* |
7681 | 2 |
* Copyright (c) 2002, 2010, 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 4638588 4635809 6256068 6270645 |
|
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 |
|
42 |
{BUG_ID + FS + "pkg" + FS + "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 |
|
46 |
{BUG_ID + FS + "pkg" + FS + "SubClass.html", |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
47 |
"<a href=\"../pkg/BaseClass.html#pubMethod()\">"}, |
10 | 48 |
|
49 |
//Public inner class should be inherited. |
|
50 |
{BUG_ID + FS + "pkg" + FS + "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 |
|
54 |
{BUG_ID + FS + "pkg" + FS + "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 |
|
58 |
{BUG_ID + FS + "pkg" + FS + "SubClass.html", |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
59 |
"<a href=\"../pkg/BaseClass.html#proMethod()\">"}, |
10 | 60 |
|
61 |
//Protected inner class should be inherited. |
|
62 |
{BUG_ID + FS + "pkg" + FS + "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 |
|
66 |
{BUG_ID + FS + "pkg" + FS + "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>"}, |
10 | 69 |
{BUG_ID + FS + "pkg" + FS + "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. |
|
74 |
{BUG_ID + FS + "pkg" + FS + "BaseClass.html", |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
75 |
"<dl>" + NL + "<dt><strong>Specified by:</strong></dt>" + NL + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
76 |
"<dd><code><a href=\"../pkg/BaseInterface.html#getAnnotation(java.lang.Class)\">" + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
77 |
"getAnnotation</a></code> in interface <code>" + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
78 |
"<a href=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">" + |
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
79 |
"BaseInterface</a></code></dd>" + NL + "</dl>"}, |
10 | 80 |
|
81 |
// Test diamond inheritence member summary (6256068) |
|
82 |
{BUG_ID + FS + "diamond" + FS + "Z.html", |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
83 |
"<code><a href=\"../diamond/A.html#aMethod()\">aMethod</a></code>"}, |
10 | 84 |
|
85 |
// Test that doc is inherited from closed parent (6270645) |
|
86 |
{BUG_ID + FS + "inheritDist" + FS + "C.html", |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
87 |
"<div class=\"block\">m1-B</div>"}, |
10 | 88 |
|
89 |
}; |
|
90 |
||
91 |
private static final String[][] NEGATED_TEST = { |
|
92 |
{BUG_ID + FS + "pkg" + FS + "SubClass.html", |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
93 |
"<a href=\"../pkg/BaseClass.html#staticMethod()\">staticMethod</a></code>"}, |
10 | 94 |
}; |
95 |
private static final String[] ARGS = |
|
96 |
new String[] { |
|
97 |
"-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", "diamond", "inheritDist"}; |
|
98 |
||
99 |
/** |
|
100 |
* The entry point of the test. |
|
101 |
* @param args the array of command line arguments. |
|
102 |
*/ |
|
103 |
public static void main(String[] args) { |
|
104 |
TestMemberInheritence tester = new TestMemberInheritence(); |
|
105 |
run(tester, ARGS, TEST, NEGATED_TEST); |
|
106 |
tester.printSummary(); |
|
107 |
} |
|
108 |
||
109 |
/** |
|
110 |
* {@inheritDoc} |
|
111 |
*/ |
|
112 |
public String getBugId() { |
|
113 |
return BUG_ID; |
|
114 |
} |
|
115 |
||
116 |
/** |
|
117 |
* {@inheritDoc} |
|
118 |
*/ |
|
119 |
public String getBugName() { |
|
120 |
return getClass().getName(); |
|
121 |
} |
|
122 |
} |