Tue, 28 Dec 2010 15:54:52 -0800
6962318: Update copyright year
Reviewed-by: xdono
1 /*
2 * Copyright (c) 2003, 2010, 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 4789689 4905985 4927164 4827184 4993906 5004549
27 * @summary Run Javadoc on a set of source files that demonstrate new
28 * language features. Check the output to ensure that the new
29 * language features are properly documented.
30 * @author jamieh
31 * @library ../lib/
32 * @build JavadocTester
33 * @build TestNewLanguageFeatures
34 * @run main TestNewLanguageFeatures
35 */
37 public class TestNewLanguageFeatures extends JavadocTester {
39 //Test information.
40 private static final String BUG_ID = "4789689-4905985-4927164-4827184-4993906";
42 //Javadoc arguments.
43 private static final String[] ARGS = new String[] {
44 "-d", BUG_ID, "-use", "-source", "1.5", "-sourcepath", SRC_DIR, "pkg", "pkg1", "pkg2"
45 };
47 //Input for string search tests.
48 private static final String[][] TEST =
49 {
50 //=================================
51 // ENUM TESTING
52 //=================================
53 //Make sure enum header is correct.
54 {BUG_ID + FS + "pkg" + FS + "Coin.html", "Enum Coin</h2>"},
55 //Make sure enum signature is correct.
56 {BUG_ID + FS + "pkg" + FS + "Coin.html", "<pre>public enum <strong>Coin</strong>" + NL +
57 "extends java.lang.Enum<<a href=\"../pkg/Coin.html\" " +
58 "title=\"enum in pkg\">Coin</a>></pre>"
59 },
60 //Check for enum constant section
61 {BUG_ID + FS + "pkg" + FS + "Coin.html", "<caption><span>Enum Constants" +
62 "</span><span class=\"tabEnd\"> </span></caption>"},
63 //Detail for enum constant
64 {BUG_ID + FS + "pkg" + FS + "Coin.html",
65 "<strong><a href=\"../pkg/Coin.html#Dime\">Dime</a></strong>"},
66 //Automatically insert documentation for values() and valueOf().
67 {BUG_ID + FS + "pkg" + FS + "Coin.html",
68 "Returns an array containing the constants of this enum type,"},
69 {BUG_ID + FS + "pkg" + FS + "Coin.html",
70 "Returns the enum constant of this type with the specified name"},
71 {BUG_ID + FS + "pkg" + FS + "Coin.html", "for (Coin c : Coin.values())"},
72 {BUG_ID + FS + "pkg" + FS + "Coin.html", "Overloaded valueOf() method has correct documentation."},
73 {BUG_ID + FS + "pkg" + FS + "Coin.html", "Overloaded values method has correct documentation."},
75 //=================================
76 // TYPE PARAMETER TESTING
77 //=================================
78 //Make sure the header is correct.
79 {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
80 "Class TypeParameters<E></h2>"},
81 //Check class type parameters section.
82 {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
83 "<dt><span class=\"strong\">Type Parameters:</span></dt><dd><code>E</code> - " +
84 "the type parameter for this class."},
85 //Type parameters in @see/@link
86 {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
87 "<dl><dt><span class=\"strong\">See Also:</span></dt><dd>" +
88 "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
89 "<code>TypeParameters</code></a></dd></dl>"},
90 //Method that uses class type parameter.
91 {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
92 "(<a href=\"../pkg/TypeParameters.html\" title=\"type " +
93 "parameter in TypeParameters\">E</a> param)"},
94 //Method type parameter section.
95 {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
96 "<span class=\"strong\">Type Parameters:</span></dt><dd><code>T</code> - This is the first " +
97 "type parameter.</dd><dd><code>V</code> - This is the second type " +
98 "parameter."},
99 //Signature of method with type parameters
100 {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
101 "public <T extends java.util.List,V> " +
102 "java.lang.String[] methodThatHasTypeParameters"},
103 //Wildcard testing.
104 {BUG_ID + FS + "pkg" + FS + "Wildcards.html",
105 "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
106 "TypeParameters</a><? super java.lang.String> a"},
107 {BUG_ID + FS + "pkg" + FS + "Wildcards.html",
108 "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
109 "TypeParameters</a><? extends java.lang.StringBuffer> b"},
110 {BUG_ID + FS + "pkg" + FS + "Wildcards.html",
111 "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
112 "TypeParameters</a> c"},
113 //Bad type parameter warnings.
114 {WARNING_OUTPUT, "warning - @param argument " +
115 "\"<BadClassTypeParam>\" is not a type parameter name."},
116 {WARNING_OUTPUT, "warning - @param argument " +
117 "\"<BadMethodTypeParam>\" is not a type parameter name."},
119 //Signature of subclass that has type parameters.
120 {BUG_ID + FS + "pkg" + FS + "TypeParameterSubClass.html",
121 "<pre>public class <strong>TypeParameterSubClass<T extends " +
122 "java.lang.String></strong>" + NL + "extends " +
123 "<a href=\"../pkg/TypeParameterSuperClass.html\" title=\"class in pkg\">" +
124 "TypeParameterSuperClass</a><T></pre>"},
126 //Interface generic parameter substitution
127 //Signature of subclass that has type parameters.
128 {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
129 "<dl>" + NL + "<dt>All Implemented Interfaces:</dt>" + NL +
130 "<dd><a href=\"../pkg/SubInterface.html\" title=\"interface in pkg\">" +
131 "SubInterface</a><E>, <a href=\"../pkg/SuperInterface.html\" " +
132 "title=\"interface in pkg\">SuperInterface</a><E></dd>" + NL +
133 "</dl>"},
134 {BUG_ID + FS + "pkg" + FS + "SuperInterface.html",
135 "<dl>" + NL + "<dt>All Known Subinterfaces:</dt>" + NL +
136 "<dd><a href=\"../pkg/SubInterface.html\" title=\"interface in pkg\">" +
137 "SubInterface</a><V></dd>" + NL + "</dl>"},
138 {BUG_ID + FS + "pkg" + FS + "SubInterface.html",
139 "<dl>" + NL + "<dt>All Superinterfaces:</dt>" + NL +
140 "<dd><a href=\"../pkg/SuperInterface.html\" title=\"interface in pkg\">" +
141 "SuperInterface</a><V></dd>" + NL + "</dl>"},
143 //=================================
144 // VAR ARG TESTING
145 //=================================
146 {BUG_ID + FS + "pkg" + FS + "VarArgs.html", "(int... i)"},
147 {BUG_ID + FS + "pkg" + FS + "VarArgs.html", "(int[][]... i)"},
148 {BUG_ID + FS + "pkg" + FS + "VarArgs.html", "(int[]...)"},
149 {BUG_ID + FS + "pkg" + FS + "VarArgs.html",
150 "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
151 "TypeParameters</a>... t"},
153 //=================================
154 // ANNOTATION TYPE TESTING
155 //=================================
156 //Make sure the summary links are correct.
157 {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
158 "<li>SUMMARY: </li>" + NL +
159 "<li><a href=\"#annotation_type_required_element_summary\">" +
160 "REQUIRED</a> | </li>" + NL + "<li>" +
161 "<a href=\"#annotation_type_optional_element_summary\">OPTIONAL</a></li>"},
162 //Make sure the detail links are correct.
163 {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
164 "<li>DETAIL: </li>" + NL +
165 "<li><a href=\"#annotation_type_element_detail\">ELEMENT</a></li>"},
166 //Make sure the heading is correct.
167 {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
168 "Annotation Type AnnotationType</h2>"},
169 //Make sure the signature is correct.
170 {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
171 "public @interface <strong>AnnotationType</strong>"},
172 //Make sure member summary headings are correct.
173 {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
174 "<h3>Required Element Summary</h3>"},
175 {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
176 "<h3>Optional Element Summary</h3>"},
177 //Make sure element detail heading is correct
178 {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
179 "Element Detail"},
180 //Make sure default annotation type value is printed when necessary.
181 {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
182 "<dl>" + NL + "<dt>Default:</dt>" + NL + "<dd>\"unknown\"</dd>" + NL +
183 "</dl>"},
185 //=================================
186 // ANNOTATION TYPE USAGE TESTING
187 //=================================
189 //PACKAGE
190 {BUG_ID + FS + "pkg" + FS + "package-summary.html",
191 "<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional()\">optional</a>=\"Package Annotation\"," + NL +
192 " <a href=\"../pkg/AnnotationType.html#required()\">required</a>=1994)"},
194 //CLASS
195 {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
196 "<pre><a href=\"../pkg/AnnotationType.html\" " +
197 "title=\"annotation in pkg\">@AnnotationType</a>(" +
198 "<a href=\"../pkg/AnnotationType.html#optional()\">optional</a>" +
199 "=\"Class Annotation\"," + NL +
200 " <a href=\"../pkg/AnnotationType.html#required()\">" +
201 "required</a>=1994)" + NL + "public class <strong>" +
202 "AnnotationTypeUsage</strong>" + NL + "extends java.lang.Object</pre>"},
204 //FIELD
205 {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
206 "<pre><a href=\"../pkg/AnnotationType.html\" " +
207 "title=\"annotation in pkg\">@AnnotationType</a>(" +
208 "<a href=\"../pkg/AnnotationType.html#optional()\">optional</a>" +
209 "=\"Field Annotation\"," + NL +
210 " <a href=\"../pkg/AnnotationType.html#required()\">" +
211 "required</a>=1994)" + NL + "public int field</pre>"},
213 //CONSTRUCTOR
214 {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
215 "<pre><a href=\"../pkg/AnnotationType.html\" " +
216 "title=\"annotation in pkg\">@AnnotationType</a>(" +
217 "<a href=\"../pkg/AnnotationType.html#optional()\">optional</a>" +
218 "=\"Constructor Annotation\"," + NL +
219 " <a href=\"../pkg/AnnotationType.html#required()\">" +
220 "required</a>=1994)" + NL + "public AnnotationTypeUsage()</pre>"},
222 //METHOD
223 {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
224 "<pre><a href=\"../pkg/AnnotationType.html\" " +
225 "title=\"annotation in pkg\">@AnnotationType</a>(" +
226 "<a href=\"../pkg/AnnotationType.html#optional()\">optional</a>" +
227 "=\"Method Annotation\"," + NL +
228 " <a href=\"../pkg/AnnotationType.html#required()\">" +
229 "required</a>=1994)" + NL + "public void method()</pre>"},
231 //METHOD PARAMS
232 {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
233 "<pre>public void methodWithParams(" +
234 "<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">" +
235 "@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional()\">" +
236 "optional</a>=\"Parameter Annotation\",<a " +
237 "href=\"../pkg/AnnotationType.html#required()\">required</a>=1994)" + NL +
238 " int documented," + NL +
239 " int undocmented)</pre>"},
241 //CONSTRUCTOR PARAMS
242 {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
243 "<pre>public AnnotationTypeUsage(<a " +
244 "href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">" +
245 "@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional()\">" +
246 "optional</a>=\"Constructor Param Annotation\",<a " +
247 "href=\"../pkg/AnnotationType.html#required()\">required</a>=1994)" + NL +
248 " int documented," + NL +
249 " int undocmented)</pre>"},
251 //=================================
252 // ANNOTATION TYPE USAGE TESTING (All Different Types).
253 //=================================
255 //Integer
256 {BUG_ID + FS + "pkg1" + FS + "B.html",
257 "<a href=\"../pkg1/A.html#d()\">d</a>=3.14,"},
259 //Double
260 {BUG_ID + FS + "pkg1" + FS + "B.html",
261 "<a href=\"../pkg1/A.html#d()\">d</a>=3.14,"},
263 //Boolean
264 {BUG_ID + FS + "pkg1" + FS + "B.html",
265 "<a href=\"../pkg1/A.html#b()\">b</a>=true,"},
267 //String
268 {BUG_ID + FS + "pkg1" + FS + "B.html",
269 "<a href=\"../pkg1/A.html#s()\">s</a>=\"sigh\","},
271 //Class
272 {BUG_ID + FS + "pkg1" + FS + "B.html",
273 "<a href=\"../pkg1/A.html#c()\">c</a>=<a href=\"../pkg2/Foo.html\" title=\"class in pkg2\">Foo.class</a>,"},
275 //Bounded Class
276 {BUG_ID + FS + "pkg1" + FS + "B.html",
277 "<a href=\"../pkg1/A.html#w()\">w</a>=<a href=\"../pkg/TypeParameterSubClass.html\" title=\"class in pkg\">TypeParameterSubClass.class</a>,"},
279 //Enum
280 {BUG_ID + FS + "pkg1" + FS + "B.html",
281 "<a href=\"../pkg1/A.html#e()\">e</a>=<a href=\"../pkg/Coin.html#Penny\">Penny</a>,"},
283 //Annotation Type
284 {BUG_ID + FS + "pkg1" + FS + "B.html",
285 "<a href=\"../pkg1/A.html#a()\">a</a>=<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional()\">optional</a>=\"foo\",<a href=\"../pkg/AnnotationType.html#required()\">required</a>=1994),"},
287 //String Array
288 {BUG_ID + FS + "pkg1" + FS + "B.html",
289 "<a href=\"../pkg1/A.html#sa()\">sa</a>={\"up\",\"down\"},"},
291 //Primitive
292 {BUG_ID + FS + "pkg1" + FS + "B.html",
293 "<a href=\"../pkg1/A.html#primitiveClassTest()\">primitiveClassTest</a>=boolean.class,"},
295 //XXX: Add array test case after this if fixed:
296 //5020899: Incorrect internal representation of class-valued annotation elements
298 //Make sure that annotations are surrounded by <pre> and </pre>
299 {BUG_ID + FS + "pkg1" + FS + "B.html",
300 "<pre><a href=\"../pkg1/A.html\" title=\"annotation in pkg1\">@A</a>"},
301 {BUG_ID + FS + "pkg1" + FS + "B.html",
302 "public interface <strong>B</strong></pre>"},
305 //==============================================================
306 // Handle multiple bounds.
307 //==============================================================
308 {BUG_ID + FS + "pkg" + FS + "MultiTypeParameters.html",
309 "public <T extends java.lang.Number & java.lang.Runnable> T foo(T t)"},
311 //==============================================================
312 // Test Class-Use Documenation for Type Parameters.
313 //==============================================================
315 //ClassUseTest1: <T extends Foo & Foo2>
316 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
317 "<caption><span>Classes in <a href=\"../../pkg2/" +
318 "package-summary.html\">pkg2</a> with type parameters of " +
319 "type <a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">" +
320 "Foo</a></span><span class=\"tabEnd\"> </span></caption>"
321 },
322 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
323 "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/" +
324 "ClassUseTest1.html\" title=\"class in pkg2\">ClassUseTest1" +
325 "<T extends Foo & Foo2></a></strong></code> </td>"
326 },
327 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
328 "<caption><span>Methods in <a href=\"../../pkg2/" +
329 "package-summary.html\">pkg2</a> with type parameters of " +
330 "type <a href=\"../../pkg2/Foo.html\" title=\"class in " +
331 "pkg2\">Foo</a></span><span class=\"tabEnd\"> </span></caption>"
332 },
333 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
334 "<td class=\"colLast\"><span class=\"strong\">ClassUseTest1." +
335 "</span><code><strong><a href=\"../../pkg2/" +
336 "ClassUseTest1.html#method(T)\">method</a></strong>" +
337 "(T t)</code> </td>"
338 },
339 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
340 "<caption><span>Fields in <a href=\"../../pkg2/" +
341 "package-summary.html\">pkg2</a> with type parameters of " +
342 "type <a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">" +
343 "Foo</a></span><span class=\"tabEnd\"> </span></caption>"
344 },
345 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
346 "td class=\"colFirst\"><code><a href=\"../../pkg2/" +
347 "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>" +
348 "<<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\"" +
349 ">Foo</a>></code></td>"
350 },
352 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
353 "<caption><span>Fields in <a href=\"../../pkg2/" +
354 "package-summary.html\">pkg2</a> declared as <a href=\"../" +
355 "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest" +
356 "</a></span><span class=\"tabEnd\"> </span></caption>"
357 },
358 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
359 "<td class=\"colFirst\"><code><a href=\"../../pkg2/" +
360 "ParamTest.html\" title=\"class in pkg2\">ParamTest</a><<a " +
361 "href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo</a" +
362 ">></code></td>"
363 },
365 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
366 "<caption><span>Classes in <a href=\"../../pkg2/" +
367 "package-summary.html\">pkg2</a> with type parameters of " +
368 "type <a href=\"../../pkg2/Foo2.html\" title=\"interface " +
369 "in pkg2\">Foo2</a></span><span class=\"tabEnd\"> " +
370 "</span></caption>"
371 },
372 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
373 "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/" +
374 "ClassUseTest1.html\" title=\"class in pkg2\">" +
375 "ClassUseTest1<T extends Foo & Foo2></a></strong>" +
376 "</code> </td>"
377 },
378 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
379 "<caption><span>Methods in <a href=\"../../pkg2/" +
380 "package-summary.html\">pkg2</a> with type parameters of " +
381 "type <a href=\"../../pkg2/Foo2.html\" title=\"interface " +
382 "in pkg2\">Foo2</a></span><span class=\"tabEnd\"> " +
383 "</span></caption>"
384 },
385 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
386 "<td class=\"colLast\"><span class=\"strong\">" +
387 "ClassUseTest1.</span><code><strong><a href=\"../../" +
388 "pkg2/ClassUseTest1.html#method(T)\">method</a></strong>" +
389 "(T t)</code> </td>"
390 },
392 //ClassUseTest2: <T extends ParamTest<Foo3>>
393 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
394 "<caption><span>Classes in <a href=\"../../pkg2/" +
395 "package-summary.html\">pkg2</a> with type parameters of " +
396 "type <a href=\"../../pkg2/ParamTest.html\" title=\"class " +
397 "in pkg2\">ParamTest</a></span><span class=\"tabEnd\">" +
398 " </span></caption>"
399 },
400 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
401 "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/" +
402 "ClassUseTest2.html\" title=\"class in pkg2\">ClassUseTest2<T " +
403 "extends ParamTest<<a href=\"../../pkg2/Foo3.html\" title=\"class " +
404 "in pkg2\">Foo3</a>>></a></strong></code> </td>"
405 },
406 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
407 "<caption><span>Methods in <a href=\"../../pkg2/" +
408 "package-summary.html\">pkg2</a> with type parameters of " +
409 "type <a href=\"../../pkg2/ParamTest.html\" title=\"class " +
410 "in pkg2\">ParamTest</a></span><span class=\"tabEnd\">" +
411 " </span></caption>"
412 },
413 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
414 "<td class=\"colLast\"><span class=\"strong\">ClassUseTest2." +
415 "</span><code><strong><a href=\"../../pkg2/" +
416 "ClassUseTest2.html#method(T)\">method</a></strong>" +
417 "(T t)</code> </td>"
418 },
419 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
420 "<caption><span>Fields in <a href=\"../../pkg2/" +
421 "package-summary.html\">pkg2</a> declared as <a href=\"../" +
422 "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest" +
423 "</a></span><span class=\"tabEnd\"> </span></caption>"
424 },
425 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
426 "<td class=\"colFirst\"><code><a href=\"../../pkg2/" +
427 "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>" +
428 "<<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">" +
429 "Foo</a>></code></td>"
430 },
431 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
432 "<caption><span>Methods in <a href=\"../../pkg2/" +
433 "package-summary.html\">pkg2</a> with type parameters of " +
434 "type <a href=\"../../pkg2/ParamTest.html\" title=\"class " +
435 "in pkg2\">ParamTest</a></span><span class=\"tabEnd\">" +
436 " </span></caption>"
437 },
438 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
439 "<td class=\"colFirst\"><code><T extends <a href=\"../" +
440 "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest" +
441 "</a><<a href=\"../../pkg2/Foo3.html\" title=\"class in " +
442 "pkg2\">Foo3</a>>> <br><a href=\"../../pkg2/" +
443 "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>" +
444 "<<a href=\"../../pkg2/Foo3.html\" title=\"class in " +
445 "pkg2\">Foo3</a>></code></td>"
446 },
448 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
449 "<caption><span>Classes in <a href=\"../../pkg2/" +
450 "package-summary.html\">pkg2</a> with type parameters of " +
451 "type <a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" +
452 "Foo3</a></span><span class=\"tabEnd\"> </span></caption>"
453 },
454 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
455 "<td class=\"colLast\"><code><strong><a href=\"../../" +
456 "pkg2/ClassUseTest2.html\" title=\"class in pkg2\">" +
457 "ClassUseTest2<T extends ParamTest<<a href=\"../../" +
458 "pkg2/Foo3.html\" title=\"class in pkg2\">Foo3</a>>>" +
459 "</a></strong></code> </td>"
460 },
461 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
462 "<caption><span>Methods in <a href=\"../../pkg2/" +
463 "package-summary.html\">pkg2</a> with type parameters of " +
464 "type <a href=\"../../pkg2/Foo3.html\" title=\"class in " +
465 "pkg2\">Foo3</a></span><span class=\"tabEnd\"> " +
466 "</span></caption>"
467 },
468 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
469 "<td class=\"colLast\"><span class=\"strong\">ClassUseTest2." +
470 "</span><code><strong><a href=\"../../pkg2/" +
471 "ClassUseTest2.html#method(T)\">method</a></strong>" +
472 "(T t)</code> </td>"
473 },
474 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
475 "<caption><span>Methods in <a href=\"../../pkg2/" +
476 "package-summary.html\">pkg2</a> that return types with " +
477 "arguments of type <a href=\"../../pkg2/Foo3.html\" title" +
478 "=\"class in pkg2\">Foo3</a></span><span class=\"tabEnd\">" +
479 " </span></caption>"
480 },
481 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
482 "<td class=\"colFirst\"><code><T extends <a href=\"../../" +
483 "pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</a><" +
484 "<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3" +
485 "</a>>> <br><a href=\"../../pkg2/ParamTest.html\" " +
486 "title=\"class in pkg2\">ParamTest</a><<a href=\"../../pkg2/" +
487 "Foo3.html\" title=\"class in pkg2\">Foo3</a>></code></td>"
488 },
490 //ClassUseTest3: <T extends ParamTest2<List<? extends Foo4>>>
491 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
492 "<caption><span>Classes in <a href=\"../../pkg2/" +
493 "package-summary.html\">pkg2</a> with type parameters of " +
494 "type <a href=\"../../pkg2/ParamTest2.html\" title=\"class " +
495 "in pkg2\">ParamTest2</a></span><span class=\"tabEnd\">" +
496 " </span></caption>"
497 },
498 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
499 "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/" +
500 "ClassUseTest3.html\" title=\"class in pkg2\">" +
501 "ClassUseTest3<T extends ParamTest2<java.util.List" +
502 "<? extends Foo4>>></a></strong></code> </td>"
503 },
504 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
505 "<caption><span>Methods in <a href=\"../../pkg2/" +
506 "package-summary.html\">pkg2</a> with type parameters of " +
507 "type <a href=\"../../pkg2/ParamTest2.html\" title=\"class " +
508 "in pkg2\">ParamTest2</a></span><span class=\"tabEnd\">" +
509 " </span></caption>"
510 },
511 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
512 "<td class=\"colLast\"><span class=\"strong\">ClassUseTest3" +
513 ".</span><code><strong><a href=\"../../pkg2/ClassUseTest3." +
514 "html#method(T)\">method</a></strong>(T t)</code> </td>"
515 },
516 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
517 "<td class=\"colFirst\"><code><T extends <a href=\"../" +
518 "../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
519 "ParamTest2</a><java.util.List<? extends <a href=\".." +
520 "/../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</a>>" +
521 ">> <br><a href=\"../../pkg2/ParamTest2.html\" " +
522 "title=\"class in pkg2\">ParamTest2</a><java.util.List" +
523 "<? extends <a href=\"../../pkg2/Foo4.html\" title=\"" +
524 "class in pkg2\">Foo4</a>>></code></td>"
525 },
527 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
528 "<caption><span>Classes in <a href=\"../../pkg2/" +
529 "package-summary.html\">pkg2</a> with type parameters of " +
530 "type <a href=\"../../pkg2/Foo4.html\" title=\"class in " +
531 "pkg2\">Foo4</a></span><span class=\"tabEnd\"> " +
532 "</span></caption>"
533 },
534 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
535 "<td class=\"colLast\"><code><strong><a href=\"../../" +
536 "pkg2/ClassUseTest3.html\" title=\"class in pkg2\">" +
537 "ClassUseTest3<T extends ParamTest2<java.util.List" +
538 "<? extends Foo4>>></a></strong></code> </td>"
539 },
540 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
541 "<caption><span>Methods in <a href=\"../../pkg2/" +
542 "package-summary.html\">pkg2</a> with type parameters of " +
543 "type <a href=\"../../pkg2/Foo4.html\" title=\"class in " +
544 "pkg2\">Foo4</a></span><span class=\"tabEnd\"> </span></caption>"
545 },
546 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
547 "<td class=\"colLast\"><span class=\"strong\">ClassUseTest3." +
548 "</span><code><strong><a href=\"../../pkg2/ClassUseTest3." +
549 "html#method(T)\">method</a></strong>(T t)</code>" +
550 " </td>"
551 },
552 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
553 "<caption><span>Methods in <a href=\"../../pkg2/" +
554 "package-summary.html\">pkg2</a> that return types with " +
555 "arguments of type <a href=\"../../pkg2/Foo4.html\" " +
556 "title=\"class in pkg2\">Foo4</a></span><span class=\"" +
557 "tabEnd\"> </span></caption>"
558 },
559 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
560 "<td class=\"colFirst\"><code><T extends <a href=\"../" +
561 "../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
562 "ParamTest2</a><java.util.List<? extends <a href=\".." +
563 "/../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</a>>" +
564 ">> <br><a href=\"../../pkg2/ParamTest2.html\" " +
565 "title=\"class in pkg2\">ParamTest2</a><java.util.List" +
566 "<? extends <a href=\"../../pkg2/Foo4.html\" title=\"" +
567 "class in pkg2\">Foo4</a>>></code></td>"
568 },
570 //Type parameters in constructor and method args
571 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
572 "<caption><span>Method parameters in <a href=\"../../pkg2/" +
573 "package-summary.html\">pkg2</a> with type arguments of " +
574 "type <a href=\"../../pkg2/Foo4.html\" title=\"class in " +
575 "pkg2\">Foo4</a></span><span class=\"tabEnd\"> " +
576 "</span></caption>" + NL + "<tr>" + NL +
577 "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
578 "<th class=\"colLast\" scope=\"col\">Method and Description</th>" + NL +
579 "</tr>" + NL + "<tbody>" + NL + "<tr class=\"altColor\">" + NL +
580 "<td class=\"colFirst\"><code>void</code></td>" + NL +
581 "<td class=\"colLast\"><span class=\"strong\">ClassUseTest3." +
582 "</span><code><strong><a href=\"../../pkg2/ClassUseTest3." +
583 "html#method(java.util.Set)\">method</a></strong>(java." +
584 "util.Set<<a href=\"../../pkg2/Foo4.html\" title=\"" +
585 "class in pkg2\">Foo4</a>> p)</code> </td>" + NL +
586 "</tr>" + NL + "</tbody>"
587 },
588 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
589 "<caption><span>Constructor parameters in <a href=\"../../" +
590 "pkg2/package-summary.html\">pkg2</a> with type arguments " +
591 "of type <a href=\"../../pkg2/Foo4.html\" title=\"class in " +
592 "pkg2\">Foo4</a></span><span class=\"tabEnd\"> " +
593 "</span></caption>"
594 },
596 //=================================
597 // Annotatation Type Usage
598 //=================================
599 {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
600 "<caption><span>Packages with annotations of type <a href=\"" +
601 "../../pkg/AnnotationType.html\" title=\"annotation in pkg\">" +
602 "AnnotationType</a></span><span class=\"tabEnd\"> " +
603 "</span></caption>"
604 },
606 {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
607 "<caption><span>Classes in <a href=\"../../pkg/" +
608 "package-summary.html\">pkg</a> with annotations of type " +
609 "<a href=\"../../pkg/AnnotationType.html\" title=\"" +
610 "annotation in pkg\">AnnotationType</a></span><span class" +
611 "=\"tabEnd\"> </span></caption>"
612 },
614 {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
615 "<caption><span>Fields in <a href=\"../../pkg/" +
616 "package-summary.html\">pkg</a> with annotations of type " +
617 "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation " +
618 "in pkg\">AnnotationType</a></span><span class=\"tabEnd\">" +
619 " </span></caption>"
620 },
622 {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
623 "<caption><span>Methods in <a href=\"../../pkg/" +
624 "package-summary.html\">pkg</a> with annotations of type " +
625 "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation " +
626 "in pkg\">AnnotationType</a></span><span class=\"tabEnd\">" +
627 " </span></caption>"
628 },
630 {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
631 "<caption><span>Method parameters in <a href=\"../../pkg/" +
632 "package-summary.html\">pkg</a> with annotations of type " +
633 "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation " +
634 "in pkg\">AnnotationType</a></span><span class=\"tabEnd\">" +
635 " </span></caption>"
636 },
638 {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
639 "<caption><span>Constructors in <a href=\"../../pkg/" +
640 "package-summary.html\">pkg</a> with annotations of type " +
641 "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation " +
642 "in pkg\">AnnotationType</a></span><span class=\"tabEnd\">" +
643 " </span></caption>"
644 },
646 {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
647 "<caption><span>Constructor parameters in <a href=\"../../" +
648 "pkg/package-summary.html\">pkg</a> with annotations of " +
649 "type <a href=\"../../pkg/AnnotationType.html\" title=\"" +
650 "annotation in pkg\">AnnotationType</a></span><span class=\"" +
651 "tabEnd\"> </span></caption>"
652 },
654 //=================================
655 // TYPE PARAMETER IN INDEX
656 //=================================
657 {BUG_ID + FS + "index-all.html",
658 "<span class=\"strong\"><a href=\"./pkg2/Foo.html#method(java.util.Vector)\">" +
659 "method(Vector<Object>)</a></span>"
660 },
661 //=================================
662 // TYPE PARAMETER IN INDEX
663 //=================================
664 {BUG_ID + FS + "index-all.html",
665 "<span class=\"strong\"><a href=\"./pkg2/Foo.html#method(java.util.Vector)\">" +
666 "method(Vector<Object>)</a></span>"
667 },
668 };
669 private static final String[][] NEGATED_TEST = {
670 //=================================
671 // ENUM TESTING
672 //=================================
673 //NO constructor section
674 {BUG_ID + FS + "pkg" + FS + "Coin.html", "<span class=\"strong\">Constructor Summary</span>"},
675 //=================================
676 // TYPE PARAMETER TESTING
677 //=================================
678 //No type parameters in class frame.
679 {BUG_ID + FS + "allclasses-frame.html",
680 "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
681 "TypeParameters</a><<a href=\"../pkg/TypeParameters.html\" " +
682 "title=\"type parameter in TypeParameters\">E</a>>"
683 },
685 //==============================================================
686 // ANNOTATION TYPE USAGE TESTING (When @Documented is omitted)
687 //===============================================================
689 //CLASS
690 {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
691 "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Class Annotation\"," + NL +
692 " <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
693 "public class <strong>AnnotationTypeUsage</strong></dt><dt>extends java.lang.Object</dt>"},
695 //FIELD
696 {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
697 "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Field Annotation\"," + NL +
698 " <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
699 "public int <strong>field</strong>"},
701 //CONSTRUCTOR
702 {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
703 "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Constructor Annotation\"," + NL +
704 " <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
705 "public <strong>AnnotationTypeUsage</strong>()"},
707 //METHOD
708 {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
709 "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Method Annotation\"," + NL +
710 " <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
711 "public void <strong>method</strong>()"},
713 //=================================
714 // Make sure annotation types do not
715 // trigger this warning.
716 //=================================
717 {WARNING_OUTPUT,
718 "Internal error: package sets don't match: [] with: null"
719 },
720 };
722 /**
723 * The entry point of the test.
724 * @param args the array of command line arguments.
725 */
726 public static void main(String[] args) {
727 TestNewLanguageFeatures tester = new TestNewLanguageFeatures();
728 run(tester, ARGS, TEST, NEGATED_TEST);
729 tester.printSummary();
730 }
732 /**
733 * {@inheritDoc}
734 */
735 public String getBugId() {
736 return BUG_ID;
737 }
739 /**
740 * {@inheritDoc}
741 */
742 public String getBugName() {
743 return getClass().getName();
744 }
745 }