author | chegar |
Thu, 17 Oct 2019 20:54:25 +0100 | |
branch | datagramsocketimpl-branch |
changeset 58679 | 9c3209ff7550 |
parent 58678 | 9cf78a70fa4f |
parent 55339 | 0530705ca300 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
53562 | 2 |
* Copyright (c) 2004, 2019, 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 |
|
55339
0530705ca300
8223364: Bad placement of anchor relative to header
hannesw
parents:
55232
diff
changeset
|
26 |
* @bug 4973609 8015249 8025633 8026567 6469561 8071982 8162363 8182765 8223364 |
10 | 27 |
* @summary Make sure that annotation types with 0 members does not have |
28 |
* extra HR tags. |
|
29 |
* @author jamieh |
|
53097 | 30 |
* @library ../../lib |
36526 | 31 |
* @modules jdk.javadoc/jdk.javadoc.internal.tool |
53097 | 32 |
* @build javadoc.tester.* |
10 | 33 |
* @run main TestAnnotationTypes |
34 |
*/ |
|
35 |
||
53097 | 36 |
import javadoc.tester.JavadocTester; |
37 |
||
10 | 38 |
public class TestAnnotationTypes extends JavadocTester { |
39 |
||
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
40 |
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
|
41 |
TestAnnotationTypes tester = new TestAnnotationTypes(); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
42 |
tester.runTests(); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
43 |
} |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
44 |
|
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
45 |
@Test |
53097 | 46 |
public void test() { |
36705 | 47 |
javadoc("-d", "out-1", |
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
48 |
"-sourcepath", testSrc, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
49 |
"pkg"); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
50 |
checkExit(Exit.OK); |
10 | 51 |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
52 |
checkOutput("pkg/AnnotationTypeField.html", true, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
53 |
"<li>Summary: </li>\n" |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
54 |
+ "<li><a href=\"#annotation.type." |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
55 |
+ "field.summary\">Field</a> | </li>", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
56 |
"<li>Detail: </li>\n" |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
57 |
+ "<li><a href=\"#annotation.type." |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
58 |
+ "field.detail\">Field</a> | </li>", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
59 |
"<!-- =========== ANNOTATION TYPE FIELD SUMMARY =========== -->", |
53991 | 60 |
"<h2>Field Summary</h2>", |
48654
36f58bd6269f
8195796: Reduce the size of relative URLs in generated docs
jjg
parents:
47216
diff
changeset
|
61 |
"<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#DEFAULT_NAME\">DEFAULT_NAME</a></span>" |
41157
b235a429089a
8162363: Tables in javadoc documentation missing row headers
bpatel
parents:
36709
diff
changeset
|
62 |
+ "</code></th>", |
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
63 |
"<!-- ============ ANNOTATION TYPE FIELD DETAIL =========== -->", |
55339
0530705ca300
8223364: Bad placement of anchor relative to header
hannesw
parents:
55232
diff
changeset
|
64 |
"<h3><a id=\"DEFAULT_NAME\">DEFAULT_NAME</a></h3>\n" |
55197
0ca8e495bbba
8214126: Method signatures not formatted correctly in browser
hannesw
parents:
54958
diff
changeset
|
65 |
+ "<div class=\"memberSignature\"><span class=\"modifiers\">static final</span> " |
0ca8e495bbba
8214126: Method signatures not formatted correctly in browser
hannesw
parents:
54958
diff
changeset
|
66 |
+ "<span class=\"returnType\">java.lang.String</span> " |
0ca8e495bbba
8214126: Method signatures not formatted correctly in browser
hannesw
parents:
54958
diff
changeset
|
67 |
+ "<span class=\"memberName\">DEFAULT_NAME</span></div>\n"); |
10 | 68 |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
69 |
checkOutput("pkg/AnnotationType.html", true, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
70 |
"<li>Summary: </li>\n" |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
71 |
+ "<li>Field | </li>", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
72 |
"<li>Detail: </li>\n" |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
73 |
+ "<li>Field | </li>"); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
74 |
|
36038
39c5445924b9
6469561: javadoc for annotation types should not display "public abstract" modifiers on methods
darcy
parents:
35426
diff
changeset
|
75 |
checkOutput("pkg/AnnotationType.html", true, |
39c5445924b9
6469561: javadoc for annotation types should not display "public abstract" modifiers on methods
darcy
parents:
35426
diff
changeset
|
76 |
"<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->", |
39c5445924b9
6469561: javadoc for annotation types should not display "public abstract" modifiers on methods
darcy
parents:
35426
diff
changeset
|
77 |
"<ul class=\"blockList\">", |
54596
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
53991
diff
changeset
|
78 |
"<li class=\"blockList\">", |
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
53991
diff
changeset
|
79 |
"<section class=\"memberDetails\">", |
54958
55bfc2eee3ab
8223733: "Detail" in headings should be "Details"
pmuthuswamy
parents:
54596
diff
changeset
|
80 |
"<h2>Element Details</h2>", |
54596
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
53991
diff
changeset
|
81 |
"<a id=\"annotation.type.element.detail\">", |
36038
39c5445924b9
6469561: javadoc for annotation types should not display "public abstract" modifiers on methods
darcy
parents:
35426
diff
changeset
|
82 |
"<!-- -->", |
39c5445924b9
6469561: javadoc for annotation types should not display "public abstract" modifiers on methods
darcy
parents:
35426
diff
changeset
|
83 |
"</a>", |
54596
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
53991
diff
changeset
|
84 |
"<ul class=\"blockList\">", |
55232 | 85 |
"<li class=\"blockList\">", |
54596
86c1da00dd6a
8219998: Eliminate inherently singleton lists
pmuthuswamy
parents:
53991
diff
changeset
|
86 |
"<section class=\"detail\">", |
55339
0530705ca300
8223364: Bad placement of anchor relative to header
hannesw
parents:
55232
diff
changeset
|
87 |
"<h3><a id=\"value()\">value</a></h3>", |
55197
0ca8e495bbba
8214126: Method signatures not formatted correctly in browser
hannesw
parents:
54958
diff
changeset
|
88 |
"<div class=\"memberSignature\"><span class=\"returnType\">int</span>" |
0ca8e495bbba
8214126: Method signatures not formatted correctly in browser
hannesw
parents:
54958
diff
changeset
|
89 |
+ " <span class=\"memberName\">value</span></div>"); |
36038
39c5445924b9
6469561: javadoc for annotation types should not display "public abstract" modifiers on methods
darcy
parents:
35426
diff
changeset
|
90 |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
91 |
checkOutput("pkg/AnnotationType.html", false, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
92 |
"<HR>\n\n" |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
93 |
+ "<P>\n\n" |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
94 |
+ "<P>" |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
95 |
+ "<!-- ========= END OF CLASS DATA ========= -->" + "<HR>"); |
49139
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
96 |
} |
36705 | 97 |
|
49139
771616d26ca1
8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents:
48654
diff
changeset
|
98 |
@Test |
53097 | 99 |
public void testLinkSource() { |
36705 | 100 |
javadoc("-d", "out-2", |
101 |
"-linksource", |
|
102 |
"-sourcepath", testSrc, |
|
103 |
"pkg"); |
|
104 |
checkExit(Exit.OK); |
|
105 |
||
106 |
checkOutput("src-html/pkg/AnnotationType.html", true, |
|
107 |
"<title>Source code</title>", |
|
108 |
"@Documented public @interface AnnotationType {"); |
|
109 |
||
110 |
checkOutput("src-html/pkg/AnnotationTypeField.html", true, |
|
111 |
"<title>Source code</title>", |
|
112 |
"@Documented public @interface AnnotationTypeField {"); |
|
113 |
||
114 |
checkOutput("pkg/AnnotationType.html", true, |
|
115 |
"public @interface <a href=\"../src-html/pkg/AnnotationType.html#line.34" |
|
116 |
+ "\">AnnotationType</a></pre>"); |
|
117 |
||
118 |
checkOutput("pkg/AnnotationTypeField.html", true, |
|
119 |
"public @interface <a href=\"../src-html/pkg/AnnotationTypeField.html#line.31" |
|
120 |
+ "\">AnnotationTypeField</a></pre>"); |
|
10 | 121 |
} |
122 |
} |