author | bpatel |
Wed, 27 Sep 2017 16:47:07 -0700 | |
changeset 47284 | 355349babaf4 |
parent 47216 | 71c04702a3d5 |
child 48028 | 9e022f580a9d |
permissions | -rw-r--r-- |
46184
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
1 |
/* |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
2 |
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
4 |
* |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. Oracle designates this |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
8 |
* particular file as subject to the "Classpath" exception as provided |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
10 |
* |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
15 |
* accompanied this code). |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
16 |
* |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
20 |
* |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
22 |
* or visit www.oracle.com if you need additional information or have any |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
23 |
* questions. |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
24 |
*/ |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
25 |
|
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
26 |
/* |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
27 |
* @test |
47284
355349babaf4
8186332: Fix method signature in method summary table
bpatel
parents:
47216
diff
changeset
|
28 |
* @bug 8173425 8186332 |
46184
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
29 |
* @summary tests for the summary tag behavior |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
30 |
* @library ../lib |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
31 |
* @modules jdk.javadoc/jdk.javadoc.internal.tool |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
32 |
* @build JavadocTester |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
33 |
* @run main TestSummaryTag |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
34 |
*/ |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
35 |
|
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
36 |
public class TestSummaryTag extends JavadocTester { |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
37 |
|
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
38 |
public static void main(String... args) throws Exception { |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
39 |
TestSummaryTag tester = new TestSummaryTag(); |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
40 |
tester.runTests(); |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
41 |
} |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
42 |
|
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
43 |
@Test |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
44 |
void test1() { |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
45 |
javadoc("-d", "out1", |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
46 |
"-sourcepath", testSrc, |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
47 |
"p1"); |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
48 |
checkExit(Exit.OK); |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
49 |
|
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
50 |
checkOutput("index-all.html", true, |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
51 |
"<dl>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
52 |
+ "<dt><span class=\"memberNameLink\"><a href=\"p1/A.html#m--\">m()" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
53 |
+ "</a></span> - Method in class p1.<a href=\"p1/A.html\" title=\"class in p1\">A</a></dt>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
54 |
+ "<dd>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
55 |
+ "<div class=\"block\">First sentence</div>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
56 |
+ "</dd>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
57 |
+ "<dt><span class=\"memberNameLink\"><a href=\"p1/B.html#m--\">m()" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
58 |
+ "</a></span> - Method in class p1.<a href=\"p1/B.html\" title=\"class in p1\">B</a></dt>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
59 |
+ "<dd>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
60 |
+ "<div class=\"block\">First sentence</div>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
61 |
+ "</dd>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
62 |
+ "<dt><span class=\"memberNameLink\"><a href=\"p1/A.html#m1--\">m1()" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
63 |
+ "</a></span> - Method in class p1.<a href=\"p1/A.html\" title=\"class in p1\">A</a></dt>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
64 |
+ "<dd>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
65 |
+ "<div class=\"block\"> First sentence </div>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
66 |
+ "</dd>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
67 |
+ "<dt><span class=\"memberNameLink\"><a href=\"p1/A.html#m2--\">m2()" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
68 |
+ "</a></span> - Method in class p1.<a href=\"p1/A.html\" title=\"class in p1\">A</a></dt>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
69 |
+ "<dd>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
70 |
+ "<div class=\"block\">Some html <foo> codes</div>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
71 |
+ "</dd>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
72 |
+ "<dt><span class=\"memberNameLink\"><a href=\"p1/A.html#m3--\">m3()" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
73 |
+ "</a></span> - Method in class p1.<a href=\"p1/A.html\" title=\"class in p1\">A</a></dt>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
74 |
+ "<dd>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
75 |
+ "<div class=\"block\">First sentence </div>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
76 |
+ "</dd>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
77 |
+ "<dt><span class=\"memberNameLink\"><a href=\"p1/A.html#m4--\">m4()" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
78 |
+ "</a></span> - Method in class p1.<a href=\"p1/A.html\" title=\"class in p1\">A</a></dt>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
79 |
+ "<dd>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
80 |
+ "<div class=\"block\">First sentence i.e. the first sentence</div>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
81 |
+ "</dd>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
82 |
+ "</dl>\n", |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
83 |
"<div class=\"block\">The first... line</div>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
84 |
); |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
85 |
|
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
86 |
// make sure the second @summary's content is displayed correctly |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
87 |
checkOutput("p1/A.html", true, |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
88 |
"<li class=\"blockList\">\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
89 |
+ "<h4>m3</h4>\n" |
47284
355349babaf4
8186332: Fix method signature in method summary table
bpatel
parents:
47216
diff
changeset
|
90 |
+ "<pre>public void m3()</pre>\n" |
46184
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
91 |
+ "<div class=\"block\">First sentence some text maybe second sentence.</div>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
92 |
+ "</li>\n" |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
93 |
); |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
94 |
|
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
95 |
checkOutput("p1/package-summary.html", true, |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
96 |
"<div class=\"block\">The first... line second from ...</div>"); |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
97 |
} |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
98 |
@Test |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
99 |
void test2() { |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
100 |
javadoc("-d", "out2", |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
101 |
"-sourcepath", testSrc, |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
102 |
"p2"); |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
103 |
checkExit(Exit.OK); |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
104 |
|
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
105 |
checkOutput(Output.OUT, true, "package.html:5: warning: invalid use of @summary"); |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
106 |
|
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
107 |
checkOutput("index-all.html", true, "<div class=\"block\">foo bar</div>\n"); |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
108 |
|
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
109 |
checkOutput("p2/package-summary.html", true, "<div class=\"block\">foo bar baz.</div>\n"); |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
110 |
} |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
111 |
|
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
112 |
@Test |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
113 |
void test3() { |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
114 |
javadoc("-d", "out3", |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
115 |
"-sourcepath", testSrc, |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
116 |
"-overview", testSrc("p3/overview.html"), |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
117 |
"p3"); |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
118 |
checkExit(Exit.OK); |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
119 |
|
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
120 |
checkOutput("overview-summary.html", true, |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
121 |
"<div class=\"block\">The first... line second from ...</div>"); |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
122 |
} |
f1325703ea85
8173425: Javadoc needs a new tag to specify the summary.
ksrini
parents:
diff
changeset
|
123 |
} |