Tue, 25 May 2010 15:54:51 -0700
6943119: Rebrand source copyright notices
Reviewed-by: darcy
1 /*
2 * Copyright (c) 2003, 2006, 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", "public enum "+
57 "<STRONG>Coin</STRONG>" + NL + "extends java.lang.Enum<" +
58 "<A HREF=\"../pkg/Coin.html\" title=\"enum in pkg\">Coin</A>>"
59 },
60 //Check for enum constant section
61 {BUG_ID + FS + "pkg" + FS + "Coin.html", "<CAPTION CLASS=\"TableCaption\">" + NL +
62 "Enum Constant Summary</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><STRONG>Type Parameters:</STRONG></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 "<DT><STRONG>See Also:</STRONG></DT><DD><A HREF=\"../pkg/TypeParameters.html\" " +
88 "title=\"class in pkg\"><CODE>TypeParameters</CODE></A></DD></DL>"},
89 //Method that uses class type parameter.
90 {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
91 "(<A HREF=\"../pkg/TypeParameters.html\" title=\"type " +
92 "parameter in TypeParameters\">E</A> param)"},
93 //Method type parameter section.
94 {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
95 "<STRONG>Type Parameters:</STRONG></DT><DD><CODE>T</CODE> - This is the first " +
96 "type parameter.</DD><DD><CODE>V</CODE> - This is the second type " +
97 "parameter."},
98 //Signature of method with type parameters
99 {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
100 "public <T extends java.util.List,V> " +
101 "java.lang.String[] <STRONG>methodThatHasTypeParameters</STRONG>"},
102 //Wildcard testing.
103 {BUG_ID + FS + "pkg" + FS + "Wildcards.html",
104 "<A HREF=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
105 "TypeParameters</A><? super java.lang.String> a"},
106 {BUG_ID + FS + "pkg" + FS + "Wildcards.html",
107 "<A HREF=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
108 "TypeParameters</A><? extends java.lang.StringBuffer> b"},
109 {BUG_ID + FS + "pkg" + FS + "Wildcards.html",
110 "<A HREF=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
111 "TypeParameters</A> c"},
112 //Bad type parameter warnings.
113 {WARNING_OUTPUT, "warning - @param argument " +
114 "\"<BadClassTypeParam>\" is not a type parameter name."},
115 {WARNING_OUTPUT, "warning - @param argument " +
116 "\"<BadMethodTypeParam>\" is not a type parameter name."},
118 //Signature of subclass that has type parameters.
119 {BUG_ID + FS + "pkg" + FS + "TypeParameterSubClass.html",
120 "public class <STRONG>TypeParameterSubClass<T extends java.lang.String>" +
121 "</STRONG>" + NL + "extends <A HREF=\"../pkg/TypeParameterSuperClass.html\" " +
122 "title=\"class in pkg\">TypeParameterSuperClass</A><T>"},
124 //Interface generic parameter substitution
125 //Signature of subclass that has type parameters.
126 {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
127 "<STRONG>All Implemented Interfaces:</STRONG></DT> <DD><A HREF=\"../pkg/SubInterface.html\" title=\"interface in pkg\">SubInterface</A><E>, <A HREF=\"../pkg/SuperInterface.html\" title=\"interface in pkg\">SuperInterface</A><E></DD>"},
128 {BUG_ID + FS + "pkg" + FS + "SuperInterface.html",
129 "<STRONG>All Known Subinterfaces:</STRONG></DT> <DD><A HREF=\"../pkg/SubInterface.html\" title=\"interface in pkg\">SubInterface</A><V></DD>"},
130 {BUG_ID + FS + "pkg" + FS + "SubInterface.html",
131 "<STRONG>All Superinterfaces:</STRONG></DT> <DD><A HREF=\"../pkg/SuperInterface.html\" title=\"interface in pkg\">SuperInterface</A><V></DD>"},
133 //=================================
134 // VAR ARG TESTING
135 //=================================
136 {BUG_ID + FS + "pkg" + FS + "VarArgs.html", "(int... i)"},
137 {BUG_ID + FS + "pkg" + FS + "VarArgs.html", "(int[][]... i)"},
138 {BUG_ID + FS + "pkg" + FS + "VarArgs.html", "(int[]...)"},
139 {BUG_ID + FS + "pkg" + FS + "VarArgs.html",
140 "<A HREF=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
141 "TypeParameters</A>... t"},
143 //=================================
144 // ANNOTATION TYPE TESTING
145 //=================================
146 //Make sure the summary links are correct.
147 {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
148 "SUMMARY: <A HREF=\"#annotation_type_required_element_summary\">" +
149 "REQUIRED</A> | <A HREF=\"#annotation_type_optional_element_summary\">" +
150 "OPTIONAL</A>"},
151 //Make sure the detail links are correct.
152 {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
153 "DETAIL: <A HREF=\"#annotation_type_element_detail\">ELEMENT</A>"},
154 //Make sure the heading is correct.
155 {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
156 "Annotation Type AnnotationType</H2>"},
157 //Make sure the signature is correct.
158 {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
159 "public @interface <STRONG>AnnotationType</STRONG>"},
160 //Make sure member summary headings are correct.
161 {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
162 "<CAPTION CLASS=\"TableCaption\">" + NL +
163 "Required Element Summary</CAPTION>"},
164 {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
165 "<CAPTION CLASS=\"TableCaption\">" + NL +
166 "Optional Element Summary</CAPTION>"},
167 //Make sure element detail heading is correct
168 {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
169 "Element Detail"},
170 //Make sure default annotation type value is printed when necessary.
171 {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
172 "<STRONG>Default:</STRONG></DT><DD>\"unknown\"</DD>"},
174 //=================================
175 // ANNOTATION TYPE USAGE TESTING
176 //=================================
178 //PACKAGE
179 {BUG_ID + FS + "pkg" + FS + "package-summary.html",
180 "<A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Package Annotation\"," + NL +
181 " <A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)"},
183 //CLASS
184 {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
185 "<FONT SIZE=\"-1\">" +
186 "<A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Class Annotation\","+NL +
187 " <A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)"+NL +
188 "</FONT>public class <STRONG>AnnotationTypeUsage</STRONG>" + NL +
189 "extends java.lang.Object"},
191 //FIELD
192 {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
193 "<FONT SIZE=\"-1\">" +
194 "<A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Field Annotation\","+NL +
195 " <A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)"+NL +
196 "</FONT>public int <STRONG>field</STRONG>"},
198 //CONSTRUCTOR
199 {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
200 "<FONT SIZE=\"-1\">" +
201 "<A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Constructor Annotation\","+NL +
202 " <A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)"+NL +
203 "</FONT>public <STRONG>AnnotationTypeUsage</STRONG>()"},
205 //METHOD
206 {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
207 "<FONT SIZE=\"-1\">" +
208 "<A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Method Annotation\","+NL +
209 " <A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)"+NL +
210 "</FONT>public void <STRONG>method</STRONG>()"},
212 //METHOD PARAMS
213 {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
214 "<PRE>" + NL +
215 "public void <STRONG>methodWithParams</STRONG>(<FONT SIZE=\"-1\"><A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Parameter Annotation\",<A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)</FONT>" + NL +
216 " int documented," + NL +
217 " int undocmented)</PRE>"},
219 //CONSTRUCTOR PARAMS
220 {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
221 "<PRE>" + NL +
222 "public <STRONG>AnnotationTypeUsage</STRONG>(<FONT SIZE=\"-1\"><A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Constructor Param Annotation\",<A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)</FONT>" + NL +
223 " int documented," + NL +
224 " int undocmented)</PRE>"},
226 //=================================
227 // ANNOTATION TYPE USAGE TESTING (All Different Types).
228 //=================================
230 //Integer
231 {BUG_ID + FS + "pkg1" + FS + "B.html",
232 "<A HREF=\"../pkg1/A.html#d()\">d</A>=3.14,"},
234 //Double
235 {BUG_ID + FS + "pkg1" + FS + "B.html",
236 "<A HREF=\"../pkg1/A.html#d()\">d</A>=3.14,"},
238 //Boolean
239 {BUG_ID + FS + "pkg1" + FS + "B.html",
240 "<A HREF=\"../pkg1/A.html#b()\">b</A>=true,"},
242 //String
243 {BUG_ID + FS + "pkg1" + FS + "B.html",
244 "<A HREF=\"../pkg1/A.html#s()\">s</A>=\"sigh\","},
246 //Class
247 {BUG_ID + FS + "pkg1" + FS + "B.html",
248 "<A HREF=\"../pkg1/A.html#c()\">c</A>=<A HREF=\"../pkg2/Foo.html\" title=\"class in pkg2\">Foo.class</A>,"},
250 //Bounded Class
251 {BUG_ID + FS + "pkg1" + FS + "B.html",
252 "<A HREF=\"../pkg1/A.html#w()\">w</A>=<A HREF=\"../pkg/TypeParameterSubClass.html\" title=\"class in pkg\">TypeParameterSubClass.class</A>,"},
254 //Enum
255 {BUG_ID + FS + "pkg1" + FS + "B.html",
256 "<A HREF=\"../pkg1/A.html#e()\">e</A>=<A HREF=\"../pkg/Coin.html#Penny\">Penny</A>,"},
258 //Annotation Type
259 {BUG_ID + FS + "pkg1" + FS + "B.html",
260 "<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),"},
262 //String Array
263 {BUG_ID + FS + "pkg1" + FS + "B.html",
264 "<A HREF=\"../pkg1/A.html#sa()\">sa</A>={\"up\",\"down\"},"},
266 //Primitive
267 {BUG_ID + FS + "pkg1" + FS + "B.html",
268 "<A HREF=\"../pkg1/A.html#primitiveClassTest()\">primitiveClassTest</A>=boolean.class,"},
270 //XXX: Add array test case after this if fixed:
271 //5020899: Incorrect internal representation of class-valued annotation elements
273 //Make sure that annotations are surrounded by <pre> and </pre>
274 {BUG_ID + FS + "pkg1" + FS + "B.html",
275 "<PRE><FONT SIZE=\"-1\"><A HREF=\"../pkg1/A.html\" title=\"annotation in pkg1\">@A</A>"},
276 {BUG_ID + FS + "pkg1" + FS + "B.html",
277 "</FONT>public interface <STRONG>B</STRONG></PRE>"},
280 //==============================================================
281 // Handle multiple bounds.
282 //==============================================================
283 {BUG_ID + FS + "pkg" + FS + "MultiTypeParameters.html",
284 "public <T extends java.lang.Number & java.lang.Runnable> T <STRONG>foo</STRONG>(T t)"},
286 //==============================================================
287 // Test Class-Use Documenation for Type Parameters.
288 //==============================================================
290 //ClassUseTest1: <T extends Foo & Foo2>
291 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
292 "<CAPTION CLASS=\"TableSubCaption\">" + NL +
293 "Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
294 "</A> with type parameters of type <A HREF=\"../../pkg2/Foo.html\" " +
295 "title=\"class in pkg2\">Foo</A></CAPTION>"
296 },
297 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
298 "<TD><CODE><STRONG><A HREF=\"../../pkg2/ClassUseTest1.html\" title=\"class in pkg2\">ClassUseTest1<T extends Foo & Foo2></A></STRONG></CODE>"
299 },
300 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
301 "<CAPTION CLASS=\"TableSubCaption\">" + NL +
302 "Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
303 "</A> with type parameters of type <A HREF=\"../../pkg2/Foo.html\" " +
304 "title=\"class in pkg2\">Foo</A></CAPTION>"
305 },
306 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
307 "<TD><CODE><STRONG>ClassUseTest1.</STRONG><STRONG><A HREF=\"../../pkg2/ClassUseTest1.html#method(T)\">method</A></STRONG>(T t)</CODE>"
308 },
309 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
310 "<CAPTION CLASS=\"TableSubCaption\">" + NL +
311 "Fields in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
312 "</A> with type parameters of type <A HREF=\"../../pkg2/Foo.html\" " +
313 "title=\"class in pkg2\">Foo</A></CAPTION>"
314 },
315 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
316 "<A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A><<A HREF=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo</A>></CODE></FONT></TD>"
317 },
319 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
320 "<CAPTION CLASS=\"TableSubCaption\">" + NL +
321 "Fields in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
322 "</A> declared as <A HREF=\"../../pkg2/ParamTest.html\" " +
323 "title=\"class in pkg2\">ParamTest</A></CAPTION>"
324 },
325 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
326 "<A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A><<A HREF=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo</A>></CODE></FONT></TD>"
327 },
329 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
330 "<CAPTION CLASS=\"TableSubCaption\">" + NL +
331 "Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
332 "</A> with type parameters of type <A HREF=\"../../pkg2/Foo2.html\" " +
333 "title=\"interface in pkg2\">Foo2</A></CAPTION>"
334 },
335 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
336 "<TD><CODE><STRONG><A HREF=\"../../pkg2/ClassUseTest1.html\" title=\"class in pkg2\">ClassUseTest1<T extends Foo & Foo2></A></STRONG></CODE>"
337 },
338 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
339 "<CAPTION CLASS=\"TableSubCaption\">" + NL +
340 "Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
341 "</A> with type parameters of type <A HREF=\"../../pkg2/Foo2.html\" " +
342 "title=\"interface in pkg2\">Foo2</A></CAPTION>"
343 },
344 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
345 "<TD><CODE><STRONG>ClassUseTest1.</STRONG><STRONG><A HREF=\"../../pkg2/ClassUseTest1.html#method(T)\">method</A></STRONG>(T t)</CODE>"
346 },
348 //ClassUseTest2: <T extends ParamTest<Foo3>>
349 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
350 "<CAPTION CLASS=\"TableSubCaption\">" + NL +
351 "Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
352 "</A> with type parameters of type <A HREF=\"../../pkg2/ParamTest.html\" " +
353 "title=\"class in pkg2\">ParamTest</A></CAPTION>"
354 },
355 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
356 "<TD><CODE><STRONG><A HREF=\"../../pkg2/ClassUseTest2.html\" title=\"class in pkg2\">ClassUseTest2<T extends ParamTest<<A HREF=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3</A>>></A></STRONG></CODE>"
357 },
358 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
359 "<CAPTION CLASS=\"TableSubCaption\">" + NL +
360 "Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
361 "</A> with type parameters of type <A HREF=\"../../pkg2/ParamTest.html\" " +
362 "title=\"class in pkg2\">ParamTest</A></CAPTION>"
363 },
364 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
365 "<TD><CODE><STRONG>ClassUseTest2.</STRONG><STRONG><A HREF=\"../../pkg2/ClassUseTest2.html#method(T)\">method</A></STRONG>(T t)</CODE>"
366 },
367 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
368 "<CAPTION CLASS=\"TableSubCaption\">" + NL +
369 "Fields in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
370 "</A> declared as <A HREF=\"../../pkg2/ParamTest.html\" " +
371 "title=\"class in pkg2\">ParamTest</A></CAPTION>"
372 },
373 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
374 "<A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A><<A HREF=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo</A>></CODE></FONT></TD>"
375 },
376 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
377 "<CAPTION CLASS=\"TableSubCaption\">" + NL +
378 "Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
379 "</A> with type parameters of type <A HREF=\"../../pkg2/ParamTest.html\" " +
380 "title=\"class in pkg2\">ParamTest</A></CAPTION>"
381 },
382 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
383 "<T extends <A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A><<A HREF=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3</A>>>"
384 },
386 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
387 "<CAPTION CLASS=\"TableSubCaption\">" + NL +
388 "Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
389 "</A> with type parameters of type <A HREF=\"../../pkg2/Foo3.html\" " +
390 "title=\"class in pkg2\">Foo3</A></CAPTION>"
391 },
392 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
393 "<TD><CODE><STRONG><A HREF=\"../../pkg2/ClassUseTest2.html\" title=\"class in pkg2\">ClassUseTest2<T extends ParamTest<<A HREF=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3</A>>></A></STRONG></CODE>"
394 },
395 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
396 "<CAPTION CLASS=\"TableSubCaption\">" + NL +
397 "Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
398 "</A> with type parameters of type <A HREF=\"../../pkg2/Foo3.html\" " +
399 "title=\"class in pkg2\">Foo3</A></CAPTION>"
400 },
401 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
402 "<TD><CODE><STRONG>ClassUseTest2.</STRONG><STRONG><A HREF=\"../../pkg2/ClassUseTest2.html#method(T)\">method</A></STRONG>(T t)</CODE>"
403 },
404 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
405 "<CAPTION CLASS=\"TableSubCaption\">" + NL +
406 "Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
407 "</A> that return types with arguments of type " +
408 "<A HREF=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" +
409 "Foo3</A></CAPTION>"
410 },
411 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
412 "<T extends <A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A><<A HREF=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3</A>>>"
413 },
415 //ClassUseTest3: <T extends ParamTest2<List<? extends Foo4>>>
416 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
417 "<CAPTION CLASS=\"TableSubCaption\">" + NL +
418 "Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
419 "</A> with type parameters of type " +
420 "<A HREF=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
421 "ParamTest2</A></CAPTION>"
422 },
423 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
424 "<TD><CODE><STRONG><A HREF=\"../../pkg2/ClassUseTest3.html\" title=\"class in pkg2\">ClassUseTest3<T extends ParamTest2<java.util.List<? extends Foo4>>></A></STRONG></CODE>"
425 },
426 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
427 "<CAPTION CLASS=\"TableSubCaption\">" + NL +
428 "Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
429 "</A> with type parameters of type " +
430 "<A HREF=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
431 "ParamTest2</A></CAPTION>"
432 },
433 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
434 "<TD><CODE><STRONG>ClassUseTest3.</STRONG><STRONG><A HREF=\"../../pkg2/ClassUseTest3.html#method(T)\">method</A></STRONG>(T t)</CODE>"
435 },
436 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
437 "<CAPTION CLASS=\"TableSubCaption\">" + NL +
438 "Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
439 "</A> with type parameters of type " +
440 "<A HREF=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
441 "ParamTest2</A></CAPTION>"
442 },
443 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
444 "<T extends <A HREF=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">ParamTest2</A><java.util.List<? extends <A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</A>>>>"
445 },
447 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
448 "<CAPTION CLASS=\"TableSubCaption\">" + NL +
449 "Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
450 "</A> with type parameters of type " +
451 "<A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">" +
452 "Foo4</A></CAPTION>"
453 },
454 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
455 "<TD><CODE><STRONG><A HREF=\"../../pkg2/ClassUseTest3.html\" title=\"class in pkg2\">ClassUseTest3<T extends ParamTest2<java.util.List<? extends Foo4>>></A></STRONG></CODE>"
456 },
457 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
458 "<CAPTION CLASS=\"TableSubCaption\">" + NL +
459 "Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
460 "</A> with type parameters of type <A HREF=\"../../pkg2/Foo4.html\" " +
461 "title=\"class in pkg2\">Foo4</A></CAPTION>"
462 },
463 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
464 "<TD><CODE><STRONG>ClassUseTest3.</STRONG><STRONG><A HREF=\"../../pkg2/ClassUseTest3.html#method(T)\">method</A></STRONG>(T t)</CODE>"
465 },
466 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
467 "<CAPTION CLASS=\"TableSubCaption\">" + NL +
468 "Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
469 "</A> that return types with arguments of type " +
470 "<A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">" +
471 "Foo4</A></CAPTION>"
472 },
473 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
474 "<T extends <A HREF=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">ParamTest2</A><java.util.List<? extends <A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</A>>>>"
475 },
477 //Type parameters in constructor and method args
478 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
479 "<CAPTION CLASS=\"TableSubCaption\">" + NL +
480 "Method parameters in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
481 "</A> with type arguments of type <A HREF=\"../../pkg2/Foo4.html\" " +
482 "title=\"class in pkg2\">Foo4</A></CAPTION>" + NL +
483 "<TR>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
484 " NOWRAP>Modifier and Type" +
485 "</TH>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
486 " NOWRAP>Method and Description</TH>" + NL +
487 "</TR>" + NL +
488 "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
489 "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
490 "<CODE> void</CODE></FONT></TD>" + NL +
491 "<TD><CODE><STRONG>ClassUseTest3.</STRONG><STRONG>" +
492 "<A HREF=\"../../pkg2/ClassUseTest3.html#method(java.util.Set)\">" +
493 "method</A></STRONG>(java.util.Set<<A HREF=\"../../pkg2/Foo4.html\" " +
494 "title=\"class in pkg2\">Foo4</A>> p)</CODE>"
495 },
496 {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
497 "<CAPTION CLASS=\"TableSubCaption\">" + NL +
498 "Constructor parameters in <A HREF=\"../../pkg2/package-summary.html\">" +
499 "pkg2</A> with type arguments of type <A HREF=\"../../pkg2/Foo4.html\" " +
500 "title=\"class in pkg2\">Foo4</A></CAPTION>" + NL +
501 "<TR>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
502 " NOWRAP>Constructor and Description" +
503 "</TH>" + NL + "</TR>" + NL +
504 "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
505 "<TD><CODE><STRONG><A HREF=\"../../pkg2/ClassUseTest3.html#ClassUseTest3" +
506 "(java.util.Set)\">ClassUseTest3</A></STRONG>(java.util.Set<" +
507 "<A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">" +
508 "Foo4</A>> p)</CODE>"
509 },
511 //=================================
512 // Annotatation Type Usage
513 //=================================
514 {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
515 "Packages with annotations of type " +
516 "<A HREF=\"../../pkg/AnnotationType.html\" " +
517 "title=\"annotation in pkg\">AnnotationType</A></CAPTION>" + NL +
518 "<TR>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
519 " NOWRAP>Package" +
520 "</TH>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
521 " NOWRAP>Description</TH>" + NL + "</TR>" + NL +
522 "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
523 "<TD><A HREF=\"../../pkg/package-summary.html\"><STRONG>pkg" +
524 "</STRONG></A></TD>"
525 },
527 {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
528 "Classes in <A HREF=\"../../pkg/package-summary.html\">pkg" +
529 "</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" " +
530 "title=\"annotation in pkg\">AnnotationType</A></CAPTION>" + NL +
531 "<TR>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
532 " NOWRAP>Modifier and Type" +
533 "</TH>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
534 " NOWRAP>Class and Description</TH>" + NL +
535 "</TR>" + NL +
536 "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
537 "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
538 "<CODE> class</CODE></FONT></TD>" + NL +
539 "<TD><CODE><STRONG><A HREF=\"../../pkg/AnnotationTypeUsage.html\" " +
540 "title=\"class in pkg\">AnnotationTypeUsage</A></STRONG></CODE>"
541 },
543 {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
544 "Fields in <A HREF=\"../../pkg/package-summary.html\">pkg" +
545 "</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" " +
546 "title=\"annotation in pkg\">AnnotationType</A></CAPTION>" + NL +
547 "<TR>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
548 " NOWRAP>Modifier and Type" +
549 "</TH>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
550 " NOWRAP>Field and Description</TH>" + NL +
551 "</TR>" + NL +
552 "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
553 "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
554 "<CODE> int</CODE></FONT></TD>" + NL +
555 "<TD><CODE><STRONG>AnnotationTypeUsage.</STRONG><STRONG>" +
556 "<A HREF=\"../../pkg/AnnotationTypeUsage.html#field\">field" +
557 "</A></STRONG></CODE>"
558 },
560 {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
561 "Methods in <A HREF=\"../../pkg/package-summary.html\">pkg" +
562 "</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" " +
563 "title=\"annotation in pkg\">AnnotationType</A></CAPTION>" + NL +
564 "<TR>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
565 " NOWRAP>Modifier and Type" +
566 "</TH>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
567 " NOWRAP>Method and Description</TH>" + NL +
568 "</TR>" + NL +
569 "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
570 "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
571 "<CODE> void</CODE></FONT></TD>" + NL +
572 "<TD><CODE><STRONG>AnnotationTypeUsage.</STRONG><STRONG>" +
573 "<A HREF=\"../../pkg/AnnotationTypeUsage.html#method()\">" +
574 "method</A></STRONG>()</CODE>"
575 },
577 {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
578 "Method parameters in <A HREF=\"../../pkg/package-summary.html\">pkg" +
579 "</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" " +
580 "title=\"annotation in pkg\">AnnotationType</A></CAPTION>" + NL +
581 "<TR>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
582 " NOWRAP>Modifier and Type" +
583 "</TH>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
584 " NOWRAP>Method and Description</TH>" + NL +
585 "</TR>" + NL +
586 "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
587 "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
588 "<CODE> void</CODE></FONT></TD>" + NL +
589 "<TD><CODE><STRONG>AnnotationTypeUsage.</STRONG><STRONG>" +
590 "<A HREF=\"../../pkg/AnnotationTypeUsage.html#methodWithParams" +
591 "(int, int)\">methodWithParams</A></STRONG>(int documented," + NL +
592 " int undocmented)</CODE>"
593 },
595 {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
596 "Constructors in <A HREF=\"../../pkg/package-summary.html\">pkg" +
597 "</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" " +
598 "title=\"annotation in pkg\">AnnotationType</A></CAPTION>" + NL +
599 "<TR>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
600 " NOWRAP>Constructor and Description" +
601 "</TH>" + NL + "</TR>" + NL +
602 "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
603 "<TD><CODE><STRONG><A HREF=\"../../pkg/" +
604 "AnnotationTypeUsage.html#AnnotationTypeUsage()\">" +
605 "AnnotationTypeUsage</A></STRONG>()</CODE>"
606 },
608 {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
609 "Constructor parameters in <A HREF=\"../../pkg/package-summary.html\">pkg" +
610 "</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" " +
611 "title=\"annotation in pkg\">AnnotationType</A></CAPTION>" + NL +
612 "<TR>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
613 " NOWRAP>Constructor and Description" +
614 "</TH>" + NL + "</TR>" + NL +
615 "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
616 "<TD><CODE><STRONG><A HREF=\"../../pkg/" +
617 "AnnotationTypeUsage.html#AnnotationTypeUsage(int, int)\">" +
618 "AnnotationTypeUsage</A></STRONG>(int documented," + NL +
619 " int undocmented)</CODE>"
620 },
622 //=================================
623 // TYPE PARAMETER IN INDEX
624 //=================================
625 {BUG_ID + FS + "index-all.html",
626 "<A HREF=\"./pkg2/Foo.html#method(java.util.Vector)\"><STRONG>method(Vector<Object>)</STRONG></A>"
627 },
628 //=================================
629 // TYPE PARAMETER IN INDEX
630 //=================================
631 {BUG_ID + FS + "index-all.html",
632 "<A HREF=\"./pkg2/Foo.html#method(java.util.Vector)\"><STRONG>method(Vector<Object>)</STRONG></A>"
633 },
634 };
635 private static final String[][] NEGATED_TEST = {
636 //=================================
637 // ENUM TESTING
638 //=================================
639 //NO constructor section
640 {BUG_ID + FS + "pkg" + FS + "Coin.html", "<STRONG>Constructor Summary</STRONG>"},
641 //=================================
642 // TYPE PARAMETER TESTING
643 //=================================
644 //No type parameters in class frame.
645 {BUG_ID + FS + "allclasses-frame.html",
646 "<A HREF=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
647 "TypeParameters</A><<A HREF=\"../pkg/TypeParameters.html\" " +
648 "title=\"type parameter in TypeParameters\">E</A>>"
649 },
651 //==============================================================
652 // ANNOTATION TYPE USAGE TESTING (When @Documented is omitted)
653 //===============================================================
655 //CLASS
656 {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
657 "<FONT SIZE=\"-1\">" + NL +
658 "<A HREF=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</A>(<A HREF=\"../pkg/AnnotationType.html#optional\">optional</A>=\"Class Annotation\"," + NL +
659 " <A HREF=\"../pkg/AnnotationType.html#required\">required</A>=1994)" + NL +
660 "</FONT>public class <STRONG>AnnotationTypeUsage</STRONG></DT><DT>extends java.lang.Object</DT></DL>"},
662 //FIELD
663 {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
664 "<FONT SIZE=\"-1\">" + NL +
665 "<A HREF=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</A>(<A HREF=\"../pkg/AnnotationType.html#optional\">optional</A>=\"Field Annotation\"," + NL +
666 " <A HREF=\"../pkg/AnnotationType.html#required\">required</A>=1994)" + NL +
667 "</FONT>public int <STRONG>field</STRONG>"},
669 //CONSTRUCTOR
670 {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
671 "<FONT SIZE=\"-1\">" + NL +
672 "<A HREF=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</A>(<A HREF=\"../pkg/AnnotationType.html#optional\">optional</A>=\"Constructor Annotation\"," + NL +
673 " <A HREF=\"../pkg/AnnotationType.html#required\">required</A>=1994)" + NL +
674 "</FONT>public <STRONG>AnnotationTypeUsage</STRONG>()"},
676 //METHOD
677 {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
678 "<FONT SIZE=\"-1\">" + NL +
679 "<A HREF=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</A>(<A HREF=\"../pkg/AnnotationType.html#optional\">optional</A>=\"Method Annotation\"," + NL +
680 " <A HREF=\"../pkg/AnnotationType.html#required\">required</A>=1994)" + NL +
681 "</FONT>public void <STRONG>method</STRONG>()"},
683 //=================================
684 // Make sure annotation types do not
685 // trigger this warning.
686 //=================================
687 {WARNING_OUTPUT,
688 "Internal error: package sets don't match: [] with: null"
689 },
690 };
692 /**
693 * The entry point of the test.
694 * @param args the array of command line arguments.
695 */
696 public static void main(String[] args) {
697 TestNewLanguageFeatures tester = new TestNewLanguageFeatures();
698 run(tester, ARGS, TEST, NEGATED_TEST);
699 tester.printSummary();
700 }
702 /**
703 * {@inheritDoc}
704 */
705 public String getBugId() {
706 return BUG_ID;
707 }
709 /**
710 * {@inheritDoc}
711 */
712 public String getBugName() {
713 return getClass().getName();
714 }
715 }