Sat, 22 Dec 2018 13:10:38 -0800
Added tag jdk8u202-b25 for changeset 15d8c732039b
1 /*
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
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 *
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.
22 */
24 /*
25 * @test
26 * @bug 7021614
27 * @summary extend com.sun.source API to support parsing javadoc comments
28 * @build DocCommentTester
29 * @run main DocCommentTester ElementTest.java
30 */
32 class ElementTest {
33 /**
34 * <p>para</p>
35 */
36 void simple() { }
37 /*
38 DocComment[DOC_COMMENT, pos:1
39 firstSentence: empty
40 body: 3
41 StartElement[START_ELEMENT, pos:1
42 name:p
43 attributes: empty
44 ]
45 Text[TEXT, pos:4, para]
46 EndElement[END_ELEMENT, pos:8, p]
47 block tags: empty
48 ]
49 */
51 /**
52 * abc <hr/>
53 */
54 void self_closing() { }
55 /*
56 DocComment[DOC_COMMENT, pos:1
57 firstSentence: 2
58 Text[TEXT, pos:1, abc_]
59 StartElement[START_ELEMENT, pos:5
60 name:hr
61 attributes: empty
62 ]
63 body: empty
64 block tags: empty
65 ]
66 */
68 /**
69 * abc < def
70 */
71 void bad_lt() { }
72 /*
73 DocComment[DOC_COMMENT, pos:1
74 firstSentence: 3
75 Text[TEXT, pos:1, abc_]
76 Erroneous[ERRONEOUS, pos:5
77 code: compiler.err.dc.malformed.html
78 body: <
79 ]
80 Text[TEXT, pos:6, _def]
81 body: empty
82 block tags: empty
83 ]
84 */
86 /**
87 * abc > def
88 */
89 void bad_gt() { }
90 /*
91 DocComment[DOC_COMMENT, pos:1
92 firstSentence: 3
93 Text[TEXT, pos:1, abc_]
94 Erroneous[ERRONEOUS, pos:5
95 code: compiler.err.dc.bad.gt
96 body: >
97 ]
98 Text[TEXT, pos:6, _def]
99 body: empty
100 block tags: empty
101 ]
102 */
104 /**
105 * abc <p 123> def
106 */
107 void bad_chars_start();
108 /*
109 DocComment[DOC_COMMENT, pos:1
110 firstSentence: 5
111 Text[TEXT, pos:1, abc_]
112 Erroneous[ERRONEOUS, pos:5
113 code: compiler.err.dc.malformed.html
114 body: <
115 ]
116 Text[TEXT, pos:6, p_123]
117 Erroneous[ERRONEOUS, pos:11
118 code: compiler.err.dc.bad.gt
119 body: >
120 ]
121 Text[TEXT, pos:12, _def]
122 body: empty
123 block tags: empty
124 ]
125 */
127 /**
128 * abc </p 123> def
129 */
130 void bad_chars_end();
131 /*
132 DocComment[DOC_COMMENT, pos:1
133 firstSentence: 5
134 Text[TEXT, pos:1, abc_]
135 Erroneous[ERRONEOUS, pos:5
136 code: compiler.err.dc.malformed.html
137 body: <
138 ]
139 Text[TEXT, pos:6, /p_123]
140 Erroneous[ERRONEOUS, pos:12
141 code: compiler.err.dc.bad.gt
142 body: >
143 ]
144 Text[TEXT, pos:13, _def]
145 body: empty
146 block tags: empty
147 ]
148 */
150 /**
151 * abc <hr
152 */
153 void unterminated_eoi() { }
154 /*
155 DocComment[DOC_COMMENT, pos:1
156 firstSentence: 3
157 Text[TEXT, pos:1, abc_]
158 Erroneous[ERRONEOUS, pos:5
159 code: compiler.err.dc.malformed.html
160 body: <
161 ]
162 Text[TEXT, pos:6, hr]
163 body: empty
164 block tags: empty
165 ]
166 */
168 /**
169 * abc <hr
170 * @author jjg
171 */
172 void unterminated_block() { }
173 /*
174 DocComment[DOC_COMMENT, pos:1
175 firstSentence: 3
176 Text[TEXT, pos:1, abc_]
177 Erroneous[ERRONEOUS, pos:5
178 code: compiler.err.dc.malformed.html
179 body: <
180 ]
181 Text[TEXT, pos:6, hr]
182 body: empty
183 block tags: 1
184 Author[AUTHOR, pos:10
185 name: 1
186 Text[TEXT, pos:18, jjg]
187 ]
188 ]
189 */
192 /**
193 * abc </p
194 */
195 void unterminated_end_eoi() { }
196 /*
197 DocComment[DOC_COMMENT, pos:1
198 firstSentence: 3
199 Text[TEXT, pos:1, abc_]
200 Erroneous[ERRONEOUS, pos:5
201 code: compiler.err.dc.malformed.html
202 body: <
203 ]
204 Text[TEXT, pos:6, /p]
205 body: empty
206 block tags: empty
207 ]
208 */
210 /**
211 * abc </p
212 * @author jjg
213 */
214 void unterminated_end_block() { }
215 /*
216 DocComment[DOC_COMMENT, pos:1
217 firstSentence: 3
218 Text[TEXT, pos:1, abc_]
219 Erroneous[ERRONEOUS, pos:5
220 code: compiler.err.dc.malformed.html
221 body: <
222 ]
223 Text[TEXT, pos:6, /p]
224 body: empty
225 block tags: 1
226 Author[AUTHOR, pos:10
227 name: 1
228 Text[TEXT, pos:18, jjg]
229 ]
230 ]
231 */
233 /**
234 * abc
235 * <!-- comment -->
236 * def
237 */
238 void comment() { }
239 /*
240 DocComment[DOC_COMMENT, pos:1
241 firstSentence: 3
242 Text[TEXT, pos:1, abc|_]
243 Comment[COMMENT, pos:6, <!--_comment_-->]
244 Text[TEXT, pos:22, |_def]
245 body: empty
246 block tags: empty
247 ]
248 */
250 }