test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java

Tue, 14 May 2013 10:14:54 -0700

author
jjg
date
Tue, 14 May 2013 10:14:54 -0700
changeset 1744
76a691e3e961
parent 1743
6a5288a298fd
child 1935
8c55df2442c1
permissions
-rw-r--r--

8012176: reduce use of TagletOutputImpl.toString
Reviewed-by: darcy

     1 /*
     2  * Copyright (c) 2003, 2013, 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 7025314 7010344
    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  */
    36 public class TestNewLanguageFeatures extends JavadocTester {
    38     //Test information.
    39     private static final String BUG_ID = "4789689-4905985-4927164-4827184-4993906";
    41     //Javadoc arguments.
    42     private static final String[] ARGS = new String[] {
    43         "-Xdoclint:none", "-d", BUG_ID, "-use", "-source", "1.5", "-sourcepath", SRC_DIR, "pkg", "pkg1", "pkg2"
    44     };
    46     //Input for string search tests.
    47     private static final String[][] TEST =
    48         {
    49             //=================================
    50             // ENUM TESTING
    51             //=================================
    52             //Make sure enum header is correct.
    53             {BUG_ID + FS + "pkg" + FS + "Coin.html", "Enum Coin</h2>"},
    54             //Make sure enum signature is correct.
    55             {BUG_ID + FS + "pkg" + FS + "Coin.html", "<pre>public enum " +
    56                      "<span class=\"strong\">Coin</span>" + NL +
    57                      "extends java.lang.Enum&lt;<a href=\"../pkg/Coin.html\" " +
    58                      "title=\"enum in pkg\">Coin</a>&gt;</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\">&nbsp;</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&lt;E&gt;</h2>"},
    81             //Check class type parameters section.
    82             {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
    83                 "<dt><span class=\"strong\">Type Parameters:</span></dt>" + NL + "<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>" + NL + "<dt><span class=\"strong\">See Also:</span></dt>" + NL + "<dd>" +
    88                 "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
    89                 "<code>TypeParameters</code></a></dd>" + NL + "</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>&nbsp;param)"},
    94             //Method type parameter section.
    95             {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
    96                 "<span class=\"strong\">Type Parameters:</span></dt>" + NL + "<dd><code>T</code> - This is the first " +
    97                     "type parameter.</dd>" + NL + "<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&nbsp;&lt;T extends java.util.List,V&gt;&nbsp;" +
   102                 "java.lang.String[]&nbsp;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>&lt;? super java.lang.String&gt;&nbsp;a"},
   107             {BUG_ID + FS + "pkg" + FS + "Wildcards.html",
   108                 "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
   109                 "TypeParameters</a>&lt;? extends java.lang.StringBuffer&gt;&nbsp;b"},
   110             {BUG_ID + FS + "pkg" + FS + "Wildcards.html",
   111                 "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
   112                     "TypeParameters</a>&nbsp;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 <span class=\"strong\">TypeParameterSubClass&lt;T extends " +
   122                 "java.lang.String&gt;</span>" + NL + "extends " +
   123                 "<a href=\"../pkg/TypeParameterSuperClass.html\" title=\"class in pkg\">" +
   124                 "TypeParameterSuperClass</a>&lt;T&gt;</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>&lt;E&gt;, <a href=\"../pkg/SuperInterface.html\" " +
   132                 "title=\"interface in pkg\">SuperInterface</a>&lt;E&gt;</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>&lt;V&gt;</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>&lt;V&gt;</dd>" + NL + "</dl>"},
   143             //=================================
   144             // VAR ARG TESTING
   145             //=================================
   146             {BUG_ID + FS + "pkg" + FS + "VarArgs.html", "(int...&nbsp;i)"},
   147             {BUG_ID + FS + "pkg" + FS + "VarArgs.html", "(int[][]...&nbsp;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>...&nbsp;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:&nbsp;</li>" + NL +
   159                 "<li><a href=\"#annotation_type_required_element_summary\">" +
   160                 "Required</a>&nbsp;|&nbsp;</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:&nbsp;</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 <span class=\"strong\">AnnotationType</span>"},
   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 <span class=\"strong\">" +
   202                 "AnnotationTypeUsage</span>" + 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&nbsp;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&nbsp;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&nbsp;void&nbsp;method()</pre>"},
   231             //METHOD PARAMS
   232             {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
   233                 "<pre>public&nbsp;void&nbsp;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&nbsp;documented," + NL +
   239                 "                             int&nbsp;undocmented)</pre>"},
   241             //CONSTRUCTOR PARAMS
   242             {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
   243                 "<pre>public&nbsp;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&nbsp;documented," + NL +
   249                 "                           int&nbsp;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 <span class=\"strong\">B</span></pre>"},
   305             //==============================================================
   306             // Handle multiple bounds.
   307             //==============================================================
   308             {BUG_ID + FS + "pkg" + FS + "MultiTypeParameters.html",
   309                 "public&nbsp;&lt;T extends java.lang.Number &amp; java.lang.Runnable&gt;&nbsp;T&nbsp;foo(T&nbsp;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\">&nbsp;</span></caption>"
   321             },
   322             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
   323                      "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest1.html\" " +
   324                      "title=\"class in pkg2\">ClassUseTest1</a>&lt;T extends " +
   325                      "<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo" +
   326                      "</a> &amp; <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">" +
   327                      "Foo2</a>&gt;</strong></code>&nbsp;</td>"
   328             },
   329             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
   330                      "<caption><span>Methods in <a href=\"../../pkg2/" +
   331                      "package-summary.html\">pkg2</a> with type parameters of " +
   332                      "type <a href=\"../../pkg2/Foo.html\" title=\"class in " +
   333                      "pkg2\">Foo</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
   334             },
   335             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
   336                      "<td class=\"colLast\"><span class=\"strong\">ClassUseTest1." +
   337                      "</span><code><strong><a href=\"../../pkg2/" +
   338                      "ClassUseTest1.html#method(T)\">method</a></strong>" +
   339                      "(T&nbsp;t)</code>&nbsp;</td>"
   340             },
   341             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
   342                      "<caption><span>Fields in <a href=\"../../pkg2/" +
   343                      "package-summary.html\">pkg2</a> with type parameters of " +
   344                      "type <a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">" +
   345                      "Foo</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
   346             },
   347             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
   348                      "td class=\"colFirst\"><code><a href=\"../../pkg2/" +
   349                      "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>" +
   350                      "&lt;<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\"" +
   351                      ">Foo</a>&gt;</code></td>"
   352             },
   354             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
   355                      "<caption><span>Fields in <a href=\"../../pkg2/" +
   356                      "package-summary.html\">pkg2</a> declared as <a href=\"../" +
   357                      "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest" +
   358                      "</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
   359             },
   360             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
   361                      "<td class=\"colFirst\"><code><a href=\"../../pkg2/" +
   362                      "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>&lt;<a " +
   363                      "href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo</a" +
   364                      ">&gt;</code></td>"
   365             },
   367            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
   368                     "<caption><span>Classes in <a href=\"../../pkg2/" +
   369                     "package-summary.html\">pkg2</a> with type parameters of " +
   370                     "type <a href=\"../../pkg2/Foo2.html\" title=\"interface " +
   371                     "in pkg2\">Foo2</a></span><span class=\"tabEnd\">&nbsp;" +
   372                     "</span></caption>"
   373            },
   374            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
   375                     "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest1.html\" " +
   376                      "title=\"class in pkg2\">ClassUseTest1</a>&lt;T extends " +
   377                      "<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo" +
   378                      "</a> &amp; <a href=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">" +
   379                      "Foo2</a>&gt;</strong></code>&nbsp;</td>"
   380            },
   381            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
   382                     "<caption><span>Methods in <a href=\"../../pkg2/" +
   383                     "package-summary.html\">pkg2</a> with type parameters of " +
   384                     "type <a href=\"../../pkg2/Foo2.html\" title=\"interface " +
   385                     "in pkg2\">Foo2</a></span><span class=\"tabEnd\">&nbsp;" +
   386                     "</span></caption>"
   387             },
   388             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
   389                      "<td class=\"colLast\"><span class=\"strong\">" +
   390                      "ClassUseTest1.</span><code><strong><a href=\"../../" +
   391                      "pkg2/ClassUseTest1.html#method(T)\">method</a></strong>" +
   392                      "(T&nbsp;t)</code>&nbsp;</td>"
   393             },
   395             //ClassUseTest2: <T extends ParamTest<Foo3>>
   396             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
   397                      "<caption><span>Classes in <a href=\"../../pkg2/" +
   398                      "package-summary.html\">pkg2</a> with type parameters of " +
   399                      "type <a href=\"../../pkg2/ParamTest.html\" title=\"class " +
   400                      "in pkg2\">ParamTest</a></span><span class=\"tabEnd\">" +
   401                      "&nbsp;</span></caption>"
   402             },
   403             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
   404                      "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest2.html\" " +
   405                      "title=\"class in pkg2\">ClassUseTest2</a>&lt;T extends " +
   406                      "<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">" +
   407                      "ParamTest</a>&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" +
   408                      "Foo3</a>&gt;&gt;</strong></code>&nbsp;</td>"
   409             },
   410             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
   411                      "<caption><span>Methods in <a href=\"../../pkg2/" +
   412                      "package-summary.html\">pkg2</a> with type parameters of " +
   413                      "type <a href=\"../../pkg2/ParamTest.html\" title=\"class " +
   414                      "in pkg2\">ParamTest</a></span><span class=\"tabEnd\">" +
   415                      "&nbsp;</span></caption>"
   416             },
   417             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
   418                      "<td class=\"colLast\"><span class=\"strong\">ClassUseTest2." +
   419                      "</span><code><strong><a href=\"../../pkg2/" +
   420                      "ClassUseTest2.html#method(T)\">method</a></strong>" +
   421                      "(T&nbsp;t)</code>&nbsp;</td>"
   422             },
   423             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
   424                      "<caption><span>Fields in <a href=\"../../pkg2/" +
   425                      "package-summary.html\">pkg2</a> declared as <a href=\"../" +
   426                      "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest" +
   427                      "</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
   428             },
   429             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
   430                      "<td class=\"colFirst\"><code><a href=\"../../pkg2/" +
   431                      "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>" +
   432                      "&lt;<a href=\"../../pkg2/Foo.html\" title=\"class in pkg2\">" +
   433                      "Foo</a>&gt;</code></td>"
   434             },
   435             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
   436                      "<caption><span>Methods in <a href=\"../../pkg2/" +
   437                      "package-summary.html\">pkg2</a> with type parameters of " +
   438                      "type <a href=\"../../pkg2/ParamTest.html\" title=\"class " +
   439                      "in pkg2\">ParamTest</a></span><span class=\"tabEnd\">" +
   440                      "&nbsp;</span></caption>"
   441             },
   442             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
   443                      "<td class=\"colFirst\"><code>&lt;T extends <a href=\"../" +
   444                      "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest" +
   445                      "</a>&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class in " +
   446                      "pkg2\">Foo3</a>&gt;&gt;<br><a href=\"../../pkg2/" +
   447                      "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>" +
   448                      "&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class in " +
   449                      "pkg2\">Foo3</a>&gt;</code></td>"
   450             },
   452             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
   453                      "<caption><span>Classes in <a href=\"../../pkg2/" +
   454                      "package-summary.html\">pkg2</a> with type parameters of " +
   455                      "type <a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" +
   456                      "Foo3</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
   457             },
   458             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
   459                      "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest2.html\" " +
   460                      "title=\"class in pkg2\">ClassUseTest2</a>&lt;T extends " +
   461                      "<a href=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">" +
   462                      "ParamTest</a>&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" +
   463                      "Foo3</a>&gt;&gt;</strong></code>&nbsp;</td>"
   464             },
   465             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
   466                      "<caption><span>Methods in <a href=\"../../pkg2/" +
   467                      "package-summary.html\">pkg2</a> with type parameters of " +
   468                      "type <a href=\"../../pkg2/Foo3.html\" title=\"class in " +
   469                      "pkg2\">Foo3</a></span><span class=\"tabEnd\">&nbsp;" +
   470                      "</span></caption>"
   471             },
   472             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
   473                      "<td class=\"colLast\"><span class=\"strong\">ClassUseTest2." +
   474                      "</span><code><strong><a href=\"../../pkg2/" +
   475                      "ClassUseTest2.html#method(T)\">method</a></strong>" +
   476                      "(T&nbsp;t)</code>&nbsp;</td>"
   477             },
   478             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
   479                      "<caption><span>Methods in <a href=\"../../pkg2/" +
   480                      "package-summary.html\">pkg2</a> that return types with " +
   481                      "arguments of type <a href=\"../../pkg2/Foo3.html\" title" +
   482                      "=\"class in pkg2\">Foo3</a></span><span class=\"tabEnd\">" +
   483                      "&nbsp;</span></caption>"
   484             },
   485             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
   486                      "<td class=\"colFirst\"><code>&lt;T extends <a href=\"../../" +
   487                      "pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</a>&lt;" +
   488                      "<a href=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3" +
   489                      "</a>&gt;&gt;<br><a href=\"../../pkg2/ParamTest.html\" " +
   490                      "title=\"class in pkg2\">ParamTest</a>&lt;<a href=\"../../pkg2/" +
   491                      "Foo3.html\" title=\"class in pkg2\">Foo3</a>&gt;</code></td>"
   492             },
   494             //ClassUseTest3: <T extends ParamTest2<List<? extends Foo4>>>
   495             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
   496                      "<caption><span>Classes in <a href=\"../../pkg2/" +
   497                      "package-summary.html\">pkg2</a> with type parameters of " +
   498                      "type <a href=\"../../pkg2/ParamTest2.html\" title=\"class " +
   499                      "in pkg2\">ParamTest2</a></span><span class=\"tabEnd\">" +
   500                      "&nbsp;</span></caption>"
   501             },
   502             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
   503                      "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest3.html\" " +
   504                      "title=\"class in pkg2\">ClassUseTest3</a>&lt;T extends " +
   505                      "<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
   506                      "ParamTest2</a>&lt;java.util.List&lt;? extends " +
   507                      "<a href=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">" +
   508                      "Foo4</a>&gt;&gt;&gt;</strong></code>&nbsp;</td>"
   509             },
   510             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
   511                      "<caption><span>Methods in <a href=\"../../pkg2/" +
   512                      "package-summary.html\">pkg2</a> with type parameters of " +
   513                      "type <a href=\"../../pkg2/ParamTest2.html\" title=\"class " +
   514                      "in pkg2\">ParamTest2</a></span><span class=\"tabEnd\">" +
   515                      "&nbsp;</span></caption>"
   516             },
   517             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
   518                      "<td class=\"colLast\"><span class=\"strong\">ClassUseTest3" +
   519                      ".</span><code><strong><a href=\"../../pkg2/ClassUseTest3." +
   520                      "html#method(T)\">method</a></strong>(T&nbsp;t)</code>&nbsp;</td>"
   521             },
   522             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
   523                      "<td class=\"colFirst\"><code>&lt;T extends <a href=\"../" +
   524                      "../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
   525                      "ParamTest2</a>&lt;java.util.List&lt;? extends <a href=\".." +
   526                      "/../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</a>&gt;" +
   527                      "&gt;&gt;<br><a href=\"../../pkg2/ParamTest2.html\" " +
   528                      "title=\"class in pkg2\">ParamTest2</a>&lt;java.util.List" +
   529                      "&lt;? extends <a href=\"../../pkg2/Foo4.html\" title=\"" +
   530                      "class in pkg2\">Foo4</a>&gt;&gt;</code></td>"
   531             },
   533             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
   534                      "<caption><span>Classes in <a href=\"../../pkg2/" +
   535                      "package-summary.html\">pkg2</a> with type parameters of " +
   536                      "type <a href=\"../../pkg2/Foo4.html\" title=\"class in " +
   537                      "pkg2\">Foo4</a></span><span class=\"tabEnd\">&nbsp;" +
   538                      "</span></caption>"
   539             },
   540             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
   541                      "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/ClassUseTest3.html\" " +
   542                      "title=\"class in pkg2\">ClassUseTest3</a>&lt;T extends " +
   543                      "<a href=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
   544                      "ParamTest2</a>&lt;java.util.List&lt;? extends " +
   545                      "<a href=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">" +
   546                      "Foo4</a>&gt;&gt;&gt;</strong></code>&nbsp;</td>"
   547             },
   548             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
   549                      "<caption><span>Methods in <a href=\"../../pkg2/" +
   550                      "package-summary.html\">pkg2</a> with type parameters of " +
   551                      "type <a href=\"../../pkg2/Foo4.html\" title=\"class in " +
   552                      "pkg2\">Foo4</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
   553             },
   554             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
   555                      "<td class=\"colLast\"><span class=\"strong\">ClassUseTest3." +
   556                      "</span><code><strong><a href=\"../../pkg2/ClassUseTest3." +
   557                      "html#method(T)\">method</a></strong>(T&nbsp;t)</code>" +
   558                      "&nbsp;</td>"
   559             },
   560             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
   561                      "<caption><span>Methods in <a href=\"../../pkg2/" +
   562                      "package-summary.html\">pkg2</a> that return types with " +
   563                      "arguments of type <a href=\"../../pkg2/Foo4.html\" " +
   564                      "title=\"class in pkg2\">Foo4</a></span><span class=\"" +
   565                      "tabEnd\">&nbsp;</span></caption>"
   566             },
   567             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
   568                      "<td class=\"colFirst\"><code>&lt;T extends <a href=\"../" +
   569                      "../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
   570                      "ParamTest2</a>&lt;java.util.List&lt;? extends <a href=\".." +
   571                      "/../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</a>&gt;" +
   572                      "&gt;&gt;<br><a href=\"../../pkg2/ParamTest2.html\" " +
   573                      "title=\"class in pkg2\">ParamTest2</a>&lt;java.util.List" +
   574                      "&lt;? extends <a href=\"../../pkg2/Foo4.html\" title=\"" +
   575                      "class in pkg2\">Foo4</a>&gt;&gt;</code></td>"
   576             },
   578             //Type parameters in constructor and method args
   579             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
   580                      "<caption><span>Method parameters in <a href=\"../../pkg2/" +
   581                      "package-summary.html\">pkg2</a> with type arguments of " +
   582                      "type <a href=\"../../pkg2/Foo4.html\" title=\"class in " +
   583                      "pkg2\">Foo4</a></span><span class=\"tabEnd\">&nbsp;" +
   584                      "</span></caption>" + NL + "<tr>" + NL +
   585                      "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
   586                      "<th class=\"colLast\" scope=\"col\">Method and Description</th>" + NL +
   587                      "</tr>" + NL + "<tbody>" + NL + "<tr class=\"altColor\">" + NL +
   588                      "<td class=\"colFirst\"><code>void</code></td>" + NL +
   589                      "<td class=\"colLast\"><span class=\"strong\">ClassUseTest3." +
   590                      "</span><code><strong><a href=\"../../pkg2/ClassUseTest3." +
   591                      "html#method(java.util.Set)\">method</a></strong>(java." +
   592                      "util.Set&lt;<a href=\"../../pkg2/Foo4.html\" title=\"" +
   593                      "class in pkg2\">Foo4</a>&gt;&nbsp;p)</code>&nbsp;</td>" + NL +
   594                      "</tr>" + NL + "</tbody>"
   595             },
   596             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
   597                      "<caption><span>Constructor parameters in <a href=\"../../" +
   598                      "pkg2/package-summary.html\">pkg2</a> with type arguments " +
   599                      "of type <a href=\"../../pkg2/Foo4.html\" title=\"class in " +
   600                      "pkg2\">Foo4</a></span><span class=\"tabEnd\">&nbsp;" +
   601                      "</span></caption>"
   602             },
   604             //=================================
   605             // Annotatation Type Usage
   606             //=================================
   607             {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
   608                      "<caption><span>Packages with annotations of type <a href=\"" +
   609                      "../../pkg/AnnotationType.html\" title=\"annotation in pkg\">" +
   610                      "AnnotationType</a></span><span class=\"tabEnd\">&nbsp;" +
   611                      "</span></caption>"
   612             },
   614             {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
   615                      "<caption><span>Classes in <a href=\"../../pkg/" +
   616                      "package-summary.html\">pkg</a> with annotations of type " +
   617                      "<a href=\"../../pkg/AnnotationType.html\" title=\"" +
   618                      "annotation in pkg\">AnnotationType</a></span><span class" +
   619                      "=\"tabEnd\">&nbsp;</span></caption>"
   620             },
   622             {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
   623                      "<caption><span>Fields 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                      "&nbsp;</span></caption>"
   628             },
   630             {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
   631                      "<caption><span>Methods 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                      "&nbsp;</span></caption>"
   636             },
   638             {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
   639                      "<caption><span>Method parameters 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                      "&nbsp;</span></caption>"
   644             },
   646             {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
   647                      "<caption><span>Constructors in <a href=\"../../pkg/" +
   648                      "package-summary.html\">pkg</a> with annotations of type " +
   649                      "<a href=\"../../pkg/AnnotationType.html\" title=\"annotation " +
   650                      "in pkg\">AnnotationType</a></span><span class=\"tabEnd\">" +
   651                      "&nbsp;</span></caption>"
   652             },
   654             {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
   655                      "<caption><span>Constructor parameters in <a href=\"../../" +
   656                      "pkg/package-summary.html\">pkg</a> with annotations of " +
   657                      "type <a href=\"../../pkg/AnnotationType.html\" title=\"" +
   658                      "annotation in pkg\">AnnotationType</a></span><span class=\"" +
   659                      "tabEnd\">&nbsp;</span></caption>"
   660             },
   662             //=================================
   663             // TYPE PARAMETER IN INDEX
   664             //=================================
   665             {BUG_ID + FS + "index-all.html",
   666                 "<span class=\"strong\"><a href=\"pkg2/Foo.html#method(java.util.Vector)\">" +
   667                 "method(Vector&lt;Object&gt;)</a></span>"
   668             },
   669             //=================================
   670             // TYPE PARAMETER IN INDEX
   671             //=================================
   672             {BUG_ID + FS + "index-all.html",
   673                 "<span class=\"strong\"><a href=\"pkg2/Foo.html#method(java.util.Vector)\">" +
   674                 "method(Vector&lt;Object&gt;)</a></span>"
   675             },
   676         };
   677     private static final String[][] NEGATED_TEST = {
   678         //=================================
   679         // ENUM TESTING
   680         //=================================
   681         //NO constructor section
   682         {BUG_ID + FS + "pkg" + FS + "Coin.html", "<span class=\"strong\">Constructor Summary</span>"},
   683         //=================================
   684         // TYPE PARAMETER TESTING
   685         //=================================
   686         //No type parameters in class frame.
   687         {BUG_ID + FS + "allclasses-frame.html",
   688             "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
   689                     "TypeParameters</a>&lt;<a href=\"../pkg/TypeParameters.html\" " +
   690                     "title=\"type parameter in TypeParameters\">E</a>&gt;"
   691         },
   693         //==============================================================
   694         // ANNOTATION TYPE USAGE TESTING (When @Documented is omitted)
   695         //===============================================================
   697         //CLASS
   698         {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
   699             "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Class Annotation\"," + NL +
   700             "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
   701             "public class <strong>AnnotationTypeUsage</strong></dt><dt>extends java.lang.Object</dt>"},
   703         //FIELD
   704         {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
   705             "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Field Annotation\"," + NL +
   706             "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
   707             "public int <strong>field</strong>"},
   709         //CONSTRUCTOR
   710         {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
   711             "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Constructor Annotation\"," + NL +
   712             "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
   713             "public <strong>AnnotationTypeUsage</strong>()"},
   715         //METHOD
   716         {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
   717             "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Method Annotation\"," + NL +
   718             "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
   719             "public void <strong>method</strong>()"},
   721         //=================================
   722         // Make sure annotation types do not
   723         // trigger this warning.
   724         //=================================
   725         {WARNING_OUTPUT,
   726             "Internal error: package sets don't match: [] with: null"
   727         },
   728     };
   730     /**
   731      * The entry point of the test.
   732      * @param args the array of command line arguments.
   733      */
   734     public static void main(String[] args) {
   735         TestNewLanguageFeatures tester = new TestNewLanguageFeatures();
   736         run(tester, ARGS, TEST, NEGATED_TEST);
   737         tester.printSummary();
   738     }
   740     /**
   741      * {@inheritDoc}
   742      */
   743     public String getBugId() {
   744         return BUG_ID;
   745     }
   747     /**
   748      * {@inheritDoc}
   749      */
   750     public String getBugName() {
   751         return getClass().getName();
   752     }
   753 }

mercurial