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

Sat, 01 Dec 2007 00:00:00 +0000

author
duke
date
Sat, 01 Dec 2007 00:00:00 +0000
changeset 1
9a66ca7c79fa
child 182
47a62d8d98b4
permissions
-rw-r--r--

Initial load

     1 /*
     2  * Copyright 2003-2006 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any 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                 "<B>Coin</B><DT>extends java.lang.Enum&lt;" +
    58                 "<A HREF=\"../pkg/Coin.html\" title=\"enum in pkg\">Coin</A>&gt;"
    59             },
    60             //Check for enum constant section
    61             {BUG_ID + FS + "pkg" + FS + "Coin.html", "<B>Enum Constant Summary</B>"},
    62             //Detail for enum constant
    63             {BUG_ID + FS + "pkg" + FS + "Coin.html",
    64                 "<B><A HREF=\"../pkg/Coin.html#Dime\">Dime</A></B>"},
    65             //Automatically insert documentation for values() and valueOf().
    66             {BUG_ID + FS + "pkg" + FS + "Coin.html",
    67                 "Returns an array containing the constants of this enum type,"},
    68             {BUG_ID + FS + "pkg" + FS + "Coin.html",
    69                 "Returns the enum constant of this type with the specified name"},
    70             {BUG_ID + FS + "pkg" + FS + "Coin.html", "for (Coin c : Coin.values())"},
    71             {BUG_ID + FS + "pkg" + FS + "Coin.html", "Overloaded valueOf() method has correct documentation."},
    72             {BUG_ID + FS + "pkg" + FS + "Coin.html", "Overloaded values method  has correct documentation."},
    74             //=================================
    75             // TYPE PARAMETER TESTING
    76             //=================================
    77             //Make sure the header is correct.
    78             {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
    79                 "Class TypeParameters&lt;E&gt;</H2>"},
    80             //Check class type parameters section.
    81             {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
    82                 "<DT><B>Type Parameters:</B><DD><CODE>E</CODE> - " +
    83                 "the type parameter for this class."},
    84             //Type parameters in @see/@link
    85             {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
    86                 "<DT><B>See Also:</B><DD><A HREF=\"../pkg/TypeParameters.html\" " +
    87                     "title=\"class in pkg\"><CODE>TypeParameters</CODE></A></DL>"},
    88             //Method that uses class type parameter.
    89             {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
    90                 "(<A HREF=\"../pkg/TypeParameters.html\" title=\"type " +
    91                     "parameter in TypeParameters\">E</A>&nbsp;param)"},
    92             //Method type parameter section.
    93             {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
    94                 "<B>Type Parameters:</B><DD><CODE>T</CODE> - This is the first " +
    95                     "type parameter.<DD><CODE>V</CODE> - This is the second type " +
    96                     "parameter."},
    97             //Signature of method with type parameters
    98             {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
    99                 "public &lt;T extends java.util.List,V&gt; " +
   100                     "java.lang.String[] <B>methodThatHasTypeParameters</B>"},
   101             //Wildcard testing.
   102             {BUG_ID + FS + "pkg" + FS + "Wildcards.html",
   103                 "<A HREF=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
   104                 "TypeParameters</A>&lt;? super java.lang.String&gt;&nbsp;a"},
   105             {BUG_ID + FS + "pkg" + FS + "Wildcards.html",
   106                 "<A HREF=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
   107                 "TypeParameters</A>&lt;? extends java.lang.StringBuffer&gt;&nbsp;b"},
   108             {BUG_ID + FS + "pkg" + FS + "Wildcards.html",
   109                 "<A HREF=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
   110                     "TypeParameters</A>&nbsp;c"},
   111             //Bad type parameter warnings.
   112             {WARNING_OUTPUT, "warning - @param argument " +
   113                 "\"<BadClassTypeParam>\" is not a type parameter name."},
   114             {WARNING_OUTPUT, "warning - @param argument " +
   115                 "\"<BadMethodTypeParam>\" is not a type parameter name."},
   117             //Signature of subclass that has type parameters.
   118             {BUG_ID + FS + "pkg" + FS + "TypeParameterSubClass.html",
   119                 "public class <B>TypeParameterSubClass&lt;T extends java.lang.String&gt;" +
   120                 "</B><DT>extends <A HREF=\"../pkg/TypeParameterSuperClass.html\" " +
   121                 "title=\"class in pkg\">TypeParameterSuperClass</A>&lt;T&gt;"},
   123             //Interface generic parameter substitution
   124             //Signature of subclass that has type parameters.
   125             {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
   126                 "<B>All Implemented Interfaces:</B> <DD><A HREF=\"../pkg/SubInterface.html\" title=\"interface in pkg\">SubInterface</A>&lt;E&gt;, <A HREF=\"../pkg/SuperInterface.html\" title=\"interface in pkg\">SuperInterface</A>&lt;E&gt;</DD>"},
   127             {BUG_ID + FS + "pkg" + FS + "SuperInterface.html",
   128                 "<B>All Known Subinterfaces:</B> <DD><A HREF=\"../pkg/SubInterface.html\" title=\"interface in pkg\">SubInterface</A>&lt;V&gt;</DD>"},
   129             {BUG_ID + FS + "pkg" + FS + "SubInterface.html",
   130                 "<B>All Superinterfaces:</B> <DD><A HREF=\"../pkg/SuperInterface.html\" title=\"interface in pkg\">SuperInterface</A>&lt;V&gt;</DD>"},
   132             //=================================
   133             // VAR ARG TESTING
   134             //=================================
   135             {BUG_ID + FS + "pkg" + FS + "VarArgs.html", "(int...&nbsp;i)"},
   136             {BUG_ID + FS + "pkg" + FS + "VarArgs.html", "(int[][]...&nbsp;i)"},
   137             {BUG_ID + FS + "pkg" + FS + "VarArgs.html", "(int[]...)"},
   138             {BUG_ID + FS + "pkg" + FS + "VarArgs.html",
   139                 "<A HREF=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
   140                 "TypeParameters</A>...&nbsp;t"},
   142             //=================================
   143             // ANNOTATION TYPE TESTING
   144             //=================================
   145             //Make sure the summary links are correct.
   146             {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
   147                 "SUMMARY:&nbsp;<A HREF=\"#annotation_type_required_element_summary\">" +
   148                 "REQUIRED</A>&nbsp;|&nbsp;<A HREF=\"#annotation_type_optional_element_summary\">" +
   149                 "OPTIONAL</A>"},
   150             //Make sure the detail links are correct.
   151             {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
   152                 "DETAIL:&nbsp;<A HREF=\"#annotation_type_element_detail\">ELEMENT</A>"},
   153             //Make sure the heading is correct.
   154             {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
   155                 "Annotation Type AnnotationType</H2>"},
   156             //Make sure the signature is correct.
   157             {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
   158                 "public @interface <B>AnnotationType</B>"},
   159             //Make sure member summary headings are correct.
   160             {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
   161                 "<B>Required Element Summary</B>"},
   162             {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
   163                 "<B>Optional Element Summary</B>"},
   164             //Make sure element detail heading is correct
   165             {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
   166                 "Element Detail"},
   167             //Make sure default annotation type value is printed when necessary.
   168             {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
   169                 "<B>Default:</B><DD>\"unknown\"</DD>"},
   171             //=================================
   172             // ANNOTATION TYPE USAGE TESTING
   173             //=================================
   175             //PACKAGE
   176             {BUG_ID + FS + "pkg" + FS + "package-summary.html",
   177                 "<A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Package Annotation\"," + NL +
   178                 "                <A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)"},
   180             //CLASS
   181             {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
   182                 "<FONT SIZE=\"-1\">" +
   183                 "<A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Class Annotation\","+NL +
   184                 "                <A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)"+NL +
   185                 "</FONT>public class <B>AnnotationTypeUsage</B><DT>extends java.lang.Object</DL>"},
   187             //FIELD
   188             {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
   189                 "<FONT SIZE=\"-1\">" +
   190                 "<A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Field Annotation\","+NL +
   191                 "                <A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)"+NL +
   192                 "</FONT>public int <B>field</B>"},
   194             //CONSTRUCTOR
   195             {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
   196                 "<FONT SIZE=\"-1\">" +
   197                 "<A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Constructor Annotation\","+NL +
   198                 "                <A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)"+NL +
   199                 "</FONT>public <B>AnnotationTypeUsage</B>()"},
   201             //METHOD
   202             {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
   203                 "<FONT SIZE=\"-1\">" +
   204                 "<A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Method Annotation\","+NL +
   205                 "                <A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)"+NL +
   206                 "</FONT>public void <B>method</B>()"},
   208             //METHOD PARAMS
   209             {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
   210                 "<PRE>" + NL +
   211                 "public void <B>methodWithParams</B>(<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 +
   212                 "                             int&nbsp;documented," + NL +
   213                 "                             int&nbsp;undocmented)</PRE>"},
   215             //CONSTRUCTOR PARAMS
   216             {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
   217                 "<PRE>" + NL +
   218                                 "public <B>AnnotationTypeUsage</B>(<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 +
   219                                 "                           int&nbsp;documented," + NL +
   220                 "                           int&nbsp;undocmented)</PRE>"},
   222             //=================================
   223             // ANNOTATION TYPE USAGE TESTING (All Different Types).
   224             //=================================
   226             //Integer
   227             {BUG_ID + FS + "pkg1" + FS + "B.html",
   228                 "<A HREF=\"../pkg1/A.html#d()\">d</A>=3.14,"},
   230             //Double
   231             {BUG_ID + FS + "pkg1" + FS + "B.html",
   232                 "<A HREF=\"../pkg1/A.html#d()\">d</A>=3.14,"},
   234             //Boolean
   235             {BUG_ID + FS + "pkg1" + FS + "B.html",
   236                 "<A HREF=\"../pkg1/A.html#b()\">b</A>=true,"},
   238             //String
   239             {BUG_ID + FS + "pkg1" + FS + "B.html",
   240                 "<A HREF=\"../pkg1/A.html#s()\">s</A>=\"sigh\","},
   242             //Class
   243             {BUG_ID + FS + "pkg1" + FS + "B.html",
   244                 "<A HREF=\"../pkg1/A.html#c()\">c</A>=<A HREF=\"../pkg2/Foo.html\" title=\"class in pkg2\">Foo.class</A>,"},
   246             //Bounded Class
   247             {BUG_ID + FS + "pkg1" + FS + "B.html",
   248                 "<A HREF=\"../pkg1/A.html#w()\">w</A>=<A HREF=\"../pkg/TypeParameterSubClass.html\" title=\"class in pkg\">TypeParameterSubClass.class</A>,"},
   250             //Enum
   251             {BUG_ID + FS + "pkg1" + FS + "B.html",
   252                 "<A HREF=\"../pkg1/A.html#e()\">e</A>=<A HREF=\"../pkg/Coin.html#Penny\">Penny</A>,"},
   254             //Annotation Type
   255             {BUG_ID + FS + "pkg1" + FS + "B.html",
   256                 "<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),"},
   258             //String Array
   259             {BUG_ID + FS + "pkg1" + FS + "B.html",
   260                 "<A HREF=\"../pkg1/A.html#sa()\">sa</A>={\"up\",\"down\"},"},
   262             //Primitive
   263             {BUG_ID + FS + "pkg1" + FS + "B.html",
   264                 "<A HREF=\"../pkg1/A.html#primitiveClassTest()\">primitiveClassTest</A>=boolean.class,"},
   266             //XXX:  Add array test case after this if fixed:
   267             //5020899: Incorrect internal representation of class-valued annotation elements
   269             //Make sure that annotations are surrounded by <pre> and </pre>
   270             {BUG_ID + FS + "pkg1" + FS + "B.html",
   271                 "<PRE><FONT SIZE=\"-1\"><A HREF=\"../pkg1/A.html\" title=\"annotation in pkg1\">@A</A>"},
   272             {BUG_ID + FS + "pkg1" + FS + "B.html",
   273                 "</FONT>public interface <B>B</B></DL>" + NL +
   274                     "</PRE>"},
   277             //==============================================================
   278             // Handle multiple bounds.
   279             //==============================================================
   280             {BUG_ID + FS + "pkg" + FS + "MultiTypeParameters.html",
   281                 "public &lt;T extends java.lang.Number & java.lang.Runnable&gt; T <B>foo</B>(T&nbsp;t)"},
   283             //==============================================================
   284             // Test Class-Use Documenation for Type Parameters.
   285             //==============================================================
   287             //ClassUseTest1: <T extends Foo & Foo2>
   288             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
   289                  "<TH ALIGN=\"left\" COLSPAN=\"2\">Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo</A></FONT></TH>"
   290             },
   291             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
   292                 "<TD><CODE><B><A HREF=\"../../pkg2/ClassUseTest1.html\" title=\"class in pkg2\">ClassUseTest1&lt;T extends Foo & Foo2&gt;</A></B></CODE>"
   293             },
   294             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
   295                 "<TH ALIGN=\"left\" COLSPAN=\"2\">Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo</A></FONT></TH>"
   296             },
   297             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
   298                 "<TD><CODE><B>ClassUseTest1.</B><B><A HREF=\"../../pkg2/ClassUseTest1.html#method(T)\">method</A></B>(T&nbsp;t)</CODE>"
   299             },
   300             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
   301                 "<TH ALIGN=\"left\" COLSPAN=\"2\">Fields in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo</A></FONT></TH>"
   302             },
   303             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
   304                 "<A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A>&lt;<A HREF=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo</A>&gt;</CODE></FONT></TD>"
   305             },
   307             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
   308                 "<TH ALIGN=\"left\" COLSPAN=\"2\">Fields in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> declared as <A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A></FONT></TH>"
   309             },
   310             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
   311                 "<A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A>&lt;<A HREF=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo</A>&gt;</CODE></FONT></TD>"
   312             },
   314            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
   315             "<TH ALIGN=\"left\" COLSPAN=\"2\">Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">Foo2</A></FONT></TH>"
   316            },
   317            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
   318             "<TD><CODE><B><A HREF=\"../../pkg2/ClassUseTest1.html\" title=\"class in pkg2\">ClassUseTest1&lt;T extends Foo & Foo2&gt;</A></B></CODE>"
   319            },
   320            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
   321                "<TH ALIGN=\"left\" COLSPAN=\"2\">Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">Foo2</A></FONT></TH>"
   322             },
   323             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
   324                "<TD><CODE><B>ClassUseTest1.</B><B><A HREF=\"../../pkg2/ClassUseTest1.html#method(T)\">method</A></B>(T&nbsp;t)</CODE>"
   325             },
   327             //ClassUseTest2: <T extends ParamTest<Foo3>>
   328             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
   329               "<TH ALIGN=\"left\" COLSPAN=\"2\">Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A></FONT></TH>"
   330             },
   331             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
   332               "<TD><CODE><B><A HREF=\"../../pkg2/ClassUseTest2.html\" title=\"class in pkg2\">ClassUseTest2&lt;T extends ParamTest&lt;<A HREF=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3</A>&gt;&gt;</A></B></CODE>"
   333             },
   334             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
   335               "<TH ALIGN=\"left\" COLSPAN=\"2\">Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A></FONT></TH>"
   336             },
   337             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
   338               "<TD><CODE><B>ClassUseTest2.</B><B><A HREF=\"../../pkg2/ClassUseTest2.html#method(T)\">method</A></B>(T&nbsp;t)</CODE>"
   339             },
   340             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
   341               "<TH ALIGN=\"left\" COLSPAN=\"2\">Fields in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> declared as <A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A></FONT></TH>"
   342             },
   343             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
   344               "<A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A>&lt;<A HREF=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo</A>&gt;</CODE></FONT></TD>"
   345             },
   346             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
   347               "<TH ALIGN=\"left\" COLSPAN=\"2\">Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A></FONT></TH>"
   348             },
   349             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
   350               "&lt;T extends <A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A>&lt;<A HREF=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3</A>&gt;&gt;"
   351             },
   353             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
   354                 "<TH ALIGN=\"left\" COLSPAN=\"2\">Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3</A></FONT></TH>"
   355             },
   356             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
   357                 "<TD><CODE><B><A HREF=\"../../pkg2/ClassUseTest2.html\" title=\"class in pkg2\">ClassUseTest2&lt;T extends ParamTest&lt;<A HREF=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3</A>&gt;&gt;</A></B></CODE>"
   358             },
   359             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
   360                 "<TH ALIGN=\"left\" COLSPAN=\"2\">Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3</A></FONT></TH>"
   361             },
   362             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
   363                 "<TD><CODE><B>ClassUseTest2.</B><B><A HREF=\"../../pkg2/ClassUseTest2.html#method(T)\">method</A></B>(T&nbsp;t)</CODE>"
   364             },
   365             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
   366                 "<TH ALIGN=\"left\" COLSPAN=\"2\">Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> that return types with arguments of type <A HREF=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3</A></FONT></TH>"
   367             },
   368             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
   369                 "&lt;T extends <A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A>&lt;<A HREF=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3</A>&gt;&gt;"
   370             },
   372             //ClassUseTest3: <T extends ParamTest2<List<? extends Foo4>>>
   373             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
   374                 "<TH ALIGN=\"left\" COLSPAN=\"2\">Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">ParamTest2</A></FONT></TH>"
   375             },
   376             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
   377                 "<TD><CODE><B><A HREF=\"../../pkg2/ClassUseTest3.html\" title=\"class in pkg2\">ClassUseTest3&lt;T extends ParamTest2&lt;java.util.List&lt;? extends Foo4&gt;&gt;&gt;</A></B></CODE>"
   378             },
   379             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
   380                 "<TH ALIGN=\"left\" COLSPAN=\"2\">Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">ParamTest2</A></FONT></TH>"
   381             },
   382             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
   383                 "<TD><CODE><B>ClassUseTest3.</B><B><A HREF=\"../../pkg2/ClassUseTest3.html#method(T)\">method</A></B>(T&nbsp;t)</CODE>"
   384             },
   385             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
   386                 "<TH ALIGN=\"left\" COLSPAN=\"2\">Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">ParamTest2</A></FONT></TH>"
   387             },
   388             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
   389                 "&lt;T extends <A HREF=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">ParamTest2</A>&lt;java.util.List&lt;? extends <A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</A>&gt;&gt;&gt;"
   390             },
   392             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
   393                 "<TH ALIGN=\"left\" COLSPAN=\"2\">Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</A></FONT></TH>"
   394             },
   395             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
   396                 "<TD><CODE><B><A HREF=\"../../pkg2/ClassUseTest3.html\" title=\"class in pkg2\">ClassUseTest3&lt;T extends ParamTest2&lt;java.util.List&lt;? extends Foo4&gt;&gt;&gt;</A></B></CODE>"
   397             },
   398             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
   399                 "<TH ALIGN=\"left\" COLSPAN=\"2\">Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</A></FONT></TH>"
   400             },
   401             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
   402                 "<TD><CODE><B>ClassUseTest3.</B><B><A HREF=\"../../pkg2/ClassUseTest3.html#method(T)\">method</A></B>(T&nbsp;t)</CODE>"
   403             },
   404             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
   405                 "<TH ALIGN=\"left\" COLSPAN=\"2\">Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> that return types with arguments of type <A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</A></FONT></TH>"
   406             },
   407             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
   408                 "&lt;T extends <A HREF=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">ParamTest2</A>&lt;java.util.List&lt;? extends <A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</A>&gt;&gt;&gt;"
   409             },
   411             //Type parameters in constructor and method args
   412             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
   413                 "<TH ALIGN=\"left\" COLSPAN=\"2\">Method parameters in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type arguments of type <A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</A></FONT></TH>" + NL +
   414                 "</TR>" + NL +
   415                 "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
   416                 "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
   417                 "<CODE>&nbsp;void</CODE></FONT></TD>" + NL +
   418                 "<TD><CODE><B>ClassUseTest3.</B><B><A HREF=\"../../pkg2/ClassUseTest3.html#method(java.util.Set)\">method</A></B>(java.util.Set&lt;<A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</A>&gt;&nbsp;p)</CODE>"
   419             },
   420             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
   421                 "<TH ALIGN=\"left\" COLSPAN=\"2\">Constructor parameters in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type arguments of type <A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</A></FONT></TH>" + NL +
   422                 "</TR>" + NL +
   423                 "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
   424                 "<TD><CODE><B><A HREF=\"../../pkg2/ClassUseTest3.html#ClassUseTest3(java.util.Set)\">ClassUseTest3</A></B>(java.util.Set&lt;<A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</A>&gt;&nbsp;p)</CODE>"
   425             },
   427             //=================================
   428             // Annotatation Type Usage
   429             //=================================
   430             {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
   431                 "<FONT SIZE=\"+2\">" + NL +
   432                 "Packages with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" title=\"annotation in pkg\">AnnotationType</A></FONT></TH>" + NL +
   433                 "</TR>" + NL +
   434                 "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
   435                 "<TD><A HREF=\"../../pkg/package-summary.html\"><B>pkg</B></A></TD>"
   436             },
   438             {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
   439                 "Classes in <A HREF=\"../../pkg/package-summary.html\">pkg</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" title=\"annotation in pkg\">AnnotationType</A></FONT></TH>" + NL +
   440                 "</TR>" + NL +
   441                 "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
   442                 "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
   443                 "<CODE>&nbsp;class</CODE></FONT></TD>" + NL +
   444                 "<TD><CODE><B><A HREF=\"../../pkg/AnnotationTypeUsage.html\" title=\"class in pkg\">AnnotationTypeUsage</A></B></CODE>"
   445             },
   447             {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
   448                 "Fields in <A HREF=\"../../pkg/package-summary.html\">pkg</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" title=\"annotation in pkg\">AnnotationType</A></FONT></TH>" + NL +
   449                 "</TR>" + NL +
   450                 "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
   451                 "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
   452                 "<CODE>&nbsp;int</CODE></FONT></TD>" + NL +
   453                 "<TD><CODE><B>AnnotationTypeUsage.</B><B><A HREF=\"../../pkg/AnnotationTypeUsage.html#field\">field</A></B></CODE>"
   454             },
   456             {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
   457                 "Methods in <A HREF=\"../../pkg/package-summary.html\">pkg</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" title=\"annotation in pkg\">AnnotationType</A></FONT></TH>" + NL +
   458                 "</TR>" + NL +
   459                 "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
   460                 "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
   461                 "<CODE>&nbsp;void</CODE></FONT></TD>" + NL +
   462                 "<TD><CODE><B>AnnotationTypeUsage.</B><B><A HREF=\"../../pkg/AnnotationTypeUsage.html#method()\">method</A></B>()</CODE>"
   463             },
   465             {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
   466                 "Method parameters in <A HREF=\"../../pkg/package-summary.html\">pkg</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" title=\"annotation in pkg\">AnnotationType</A></FONT></TH>" + NL +
   467                 "</TR>" + NL +
   468                 "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
   469                 "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
   470                 "<CODE>&nbsp;void</CODE></FONT></TD>" + NL +
   471                 "<TD><CODE><B>AnnotationTypeUsage.</B><B><A HREF=\"../../pkg/AnnotationTypeUsage.html#methodWithParams(int, int)\">methodWithParams</A></B>(int&nbsp;documented," + NL +
   472                 "                 int&nbsp;undocmented)</CODE>"
   473             },
   475             {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
   476                 "Constructors in <A HREF=\"../../pkg/package-summary.html\">pkg</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" title=\"annotation in pkg\">AnnotationType</A></FONT></TH>" + NL +
   477                 "</TR>" + NL +
   478                 "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
   479                 "<TD><CODE><B><A HREF=\"../../pkg/AnnotationTypeUsage.html#AnnotationTypeUsage()\">AnnotationTypeUsage</A></B>()</CODE>"
   480             },
   482             {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
   483                 "Constructor parameters in <A HREF=\"../../pkg/package-summary.html\">pkg</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" title=\"annotation in pkg\">AnnotationType</A></FONT></TH>" + NL +
   484                 "</TR>" + NL +
   485                 "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
   486                 "<TD><CODE><B><A HREF=\"../../pkg/AnnotationTypeUsage.html#AnnotationTypeUsage(int, int)\">AnnotationTypeUsage</A></B>(int&nbsp;documented," + NL +
   487                 "                    int&nbsp;undocmented)</CODE>"
   488             },
   490             //=================================
   491             // TYPE PARAMETER IN INDEX
   492             //=================================
   493             {BUG_ID + FS + "index-all.html",
   494                 "<A HREF=\"./pkg2/Foo.html#method(java.util.Vector)\"><B>method(Vector&lt;Object&gt;)</B></A>"
   495             },
   496             //=================================
   497             // TYPE PARAMETER IN INDEX
   498             //=================================
   499             {BUG_ID + FS + "index-all.html",
   500                 "<A HREF=\"./pkg2/Foo.html#method(java.util.Vector)\"><B>method(Vector&lt;Object&gt;)</B></A>"
   501             },
   502         };
   503     private static final String[][] NEGATED_TEST = {
   504         //=================================
   505         // ENUM TESTING
   506         //=================================
   507         //NO constructor section
   508         {BUG_ID + FS + "pkg" + FS + "Coin.html", "<B>Constructor Summary</B>"},
   509         //=================================
   510         // TYPE PARAMETER TESTING
   511         //=================================
   512         //No type parameters in class frame.
   513         {BUG_ID + FS + "allclasses-frame.html",
   514             "<A HREF=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
   515                     "TypeParameters</A>&lt;<A HREF=\"../pkg/TypeParameters.html\" " +
   516                     "title=\"type parameter in TypeParameters\">E</A>&gt;"
   517         },
   519         //==============================================================
   520         // ANNOTATION TYPE USAGE TESTING (When @Documented is omitted)
   521         //===============================================================
   523         //CLASS
   524         {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
   525             "<FONT SIZE=\"-1\">" + NL +
   526             "<A HREF=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</A>(<A HREF=\"../pkg/AnnotationType.html#optional\">optional</A>=\"Class Annotation\"," + NL +
   527             "                <A HREF=\"../pkg/AnnotationType.html#required\">required</A>=1994)" + NL +
   528             "</FONT>public class <B>AnnotationTypeUsage</B><DT>extends java.lang.Object</DL>"},
   530         //FIELD
   531         {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
   532             "<FONT SIZE=\"-1\">" + NL +
   533             "<A HREF=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</A>(<A HREF=\"../pkg/AnnotationType.html#optional\">optional</A>=\"Field Annotation\"," + NL +
   534             "                <A HREF=\"../pkg/AnnotationType.html#required\">required</A>=1994)" + NL +
   535             "</FONT>public int <B>field</B>"},
   537         //CONSTRUCTOR
   538         {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
   539             "<FONT SIZE=\"-1\">" + NL +
   540             "<A HREF=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</A>(<A HREF=\"../pkg/AnnotationType.html#optional\">optional</A>=\"Constructor Annotation\"," + NL +
   541             "                <A HREF=\"../pkg/AnnotationType.html#required\">required</A>=1994)" + NL +
   542             "</FONT>public <B>AnnotationTypeUsage</B>()"},
   544         //METHOD
   545         {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
   546             "<FONT SIZE=\"-1\">" + NL +
   547             "<A HREF=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</A>(<A HREF=\"../pkg/AnnotationType.html#optional\">optional</A>=\"Method Annotation\"," + NL +
   548             "                <A HREF=\"../pkg/AnnotationType.html#required\">required</A>=1994)" + NL +
   549             "</FONT>public void <B>method</B>()"},
   551         //=================================
   552         // Make sure annotation types do not
   553         // trigger this warning.
   554         //=================================
   555         {WARNING_OUTPUT,
   556             "Internal error: package sets don't match: [] with: null"
   557         },
   558     };
   560     /**
   561      * The entry point of the test.
   562      * @param args the array of command line arguments.
   563      */
   564     public static void main(String[] args) {
   565         TestNewLanguageFeatures tester = new TestNewLanguageFeatures();
   566         run(tester, ARGS, TEST, NEGATED_TEST);
   567         tester.printSummary();
   568     }
   570     /**
   571      * {@inheritDoc}
   572      */
   573     public String getBugId() {
   574         return BUG_ID;
   575     }
   577     /**
   578      * {@inheritDoc}
   579      */
   580     public String getBugName() {
   581         return getClass().getName();
   582     }
   583 }

mercurial