author | bpatel |
Tue, 06 Mar 2018 10:45:47 -0800 | |
changeset 49139 | 771616d26ca1 |
parent 48654 | 36f58bd6269f |
child 51127 | c2e676c2cf7b |
permissions | -rw-r--r-- |
10 | 1 |
/* |
48654
36f58bd6269f
8195796: Reduce the size of relative URLs in generated docs
jjg
parents:
47284
diff
changeset
|
2 |
* Copyright (c) 2003, 2018, 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 |
|
49139
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
26 |
* @bug 4951228 6290760 8025633 8026567 8081854 8162363 8175200 8177417 8186332 8182765 |
10 | 27 |
* @summary Test the case where the overriden method returns a different |
28 |
* type than the method in the child class. Make sure the |
|
29 |
* documentation is inherited but the return type isn't. |
|
30 |
* @author jamieh |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
31 |
* @library ../lib |
36526 | 32 |
* @modules jdk.javadoc/jdk.javadoc.internal.tool |
10 | 33 |
* @build JavadocTester |
34 |
* @run main TestMemberSummary |
|
35 |
*/ |
|
36 |
||
37 |
public class TestMemberSummary extends JavadocTester { |
|
38 |
||
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
39 |
public static void main(String... args) throws Exception { |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
40 |
TestMemberSummary tester = new TestMemberSummary(); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
41 |
tester.runTests(); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
42 |
} |
10 | 43 |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
44 |
@Test |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
45 |
void test() { |
49139
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
46 |
javadoc("-d", "out", |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
47 |
"-private", |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
48 |
"-sourcepath", testSrc, |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
49 |
"pkg","pkg2"); |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
50 |
checkExit(Exit.OK); |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
51 |
|
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
52 |
checkOutput("pkg/PublicChild.html", true, |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
53 |
// Check return type in member summary. |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
54 |
"<code><a href=\"PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>\n" |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
55 |
+ "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#returnTypeTest()\">" |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
56 |
+ "returnTypeTest</a></span>()</code>", |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
57 |
// Check return type in member detail. |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
58 |
"<pre>public <a href=\"PublicChild.html\" title=\"class in pkg\">" |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
59 |
+ "PublicChild</a> returnTypeTest()</pre>", |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
60 |
"<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\">" |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
61 |
+ "<a href=\"#%3Cinit%3E()\">PublicChild</a></span>()</code></th>"); |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
62 |
|
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
63 |
checkOutput("pkg/PrivateParent.html", true, |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
64 |
"<td class=\"colFirst\"><code>private </code></td>\n" |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
65 |
+ "<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\">" |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
66 |
+ "<a href=\"#%3Cinit%3E(int)\">PrivateParent</a></span>​(int i)</code>" |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
67 |
+ "</th>"); |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
68 |
|
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
69 |
// Legacy anchor dimensions (6290760) |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
70 |
checkOutput("pkg2/A.html", true, |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
71 |
"<a id=\"f(java.lang.Object[])\">\n" |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
72 |
+ "<!-- -->\n" |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
73 |
+ "</a><a id=\"f(T[])\">\n" |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
74 |
+ "<!-- -->\n" |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
75 |
+ "</a>"); |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
76 |
} |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
77 |
|
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
78 |
@Test |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
79 |
void test_html4() { |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
80 |
javadoc("-d", "out-html4", |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
81 |
"-html4", |
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
82 |
"-private", |
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
83 |
"-sourcepath", testSrc, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
84 |
"pkg","pkg2"); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
85 |
checkExit(Exit.OK); |
10 | 86 |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
87 |
checkOutput("pkg/PublicChild.html", true, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
88 |
// Check return type in member summary. |
48654
36f58bd6269f
8195796: Reduce the size of relative URLs in generated docs
jjg
parents:
47284
diff
changeset
|
89 |
"<code><a href=\"PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>\n" |
36f58bd6269f
8195796: Reduce the size of relative URLs in generated docs
jjg
parents:
47284
diff
changeset
|
90 |
+ "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#returnTypeTest--\">" |
47284
355349babaf4
8186332: Fix method signature in method summary table
bpatel
parents:
47216
diff
changeset
|
91 |
+ "returnTypeTest</a></span>()</code>", |
44565
41071e253324
8177417: Constructor Summary readability problems in jdk9 javadoc
bpatel
parents:
44297
diff
changeset
|
92 |
"<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\">" |
48654
36f58bd6269f
8195796: Reduce the size of relative URLs in generated docs
jjg
parents:
47284
diff
changeset
|
93 |
+ "<a href=\"#PublicChild--\">PublicChild</a></span>()</code></th>"); |
44565
41071e253324
8177417: Constructor Summary readability problems in jdk9 javadoc
bpatel
parents:
44297
diff
changeset
|
94 |
|
41071e253324
8177417: Constructor Summary readability problems in jdk9 javadoc
bpatel
parents:
44297
diff
changeset
|
95 |
checkOutput("pkg/PrivateParent.html", true, |
41071e253324
8177417: Constructor Summary readability problems in jdk9 javadoc
bpatel
parents:
44297
diff
changeset
|
96 |
"<td class=\"colFirst\"><code>private </code></td>\n" |
41071e253324
8177417: Constructor Summary readability problems in jdk9 javadoc
bpatel
parents:
44297
diff
changeset
|
97 |
+ "<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\">" |
48654
36f58bd6269f
8195796: Reduce the size of relative URLs in generated docs
jjg
parents:
47284
diff
changeset
|
98 |
+ "<a href=\"#PrivateParent-int-\">PrivateParent</a></span>​(int i)</code>" |
44565
41071e253324
8177417: Constructor Summary readability problems in jdk9 javadoc
bpatel
parents:
44297
diff
changeset
|
99 |
+ "</th>"); |
10 | 100 |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
101 |
// Legacy anchor dimensions (6290760) |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
102 |
checkOutput("pkg2/A.html", true, |
31297
86fe1414f12c
8081854: Javadoc should generate named anchors for HTML4 output
bpatel
parents:
30730
diff
changeset
|
103 |
"<a name=\"f-java.lang.Object:A-\">\n" |
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
104 |
+ "<!-- -->\n" |
31297
86fe1414f12c
8081854: Javadoc should generate named anchors for HTML4 output
bpatel
parents:
30730
diff
changeset
|
105 |
+ "</a><a name=\"f-T:A-\">\n" |
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
106 |
+ "<!-- -->\n" |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
107 |
+ "</a>"); |
10 | 108 |
} |
109 |
} |