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