TestNewLanguageFeatures.java 38.1 KB
Newer Older
D
duke 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
/*
 * Copyright 2003-2006 Sun Microsystems, Inc.  All Rights Reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 * CA 95054 USA or visit www.sun.com if you need additional information or
 * have any questions.
 */

/*
 * @test
 * @bug      4789689 4905985 4927164 4827184 4993906 5004549
 * @summary  Run Javadoc on a set of source files that demonstrate new
 *           language features.  Check the output to ensure that the new
 *           language features are properly documented.
 * @author   jamieh
 * @library  ../lib/
 * @build    JavadocTester
 * @build    TestNewLanguageFeatures
 * @run main TestNewLanguageFeatures
 */

public class TestNewLanguageFeatures extends JavadocTester {

    //Test information.
    private static final String BUG_ID = "4789689-4905985-4927164-4827184-4993906";

    //Javadoc arguments.
    private static final String[] ARGS = new String[] {
        "-d", BUG_ID, "-use", "-source", "1.5", "-sourcepath", SRC_DIR, "pkg", "pkg1", "pkg2"
    };

    //Input for string search tests.
    private static final String[][] TEST =
        {
            //=================================
            // ENUM TESTING
            //=================================
            //Make sure enum header is correct.
            {BUG_ID + FS + "pkg" + FS + "Coin.html", "Enum Coin</H2>"},
            //Make sure enum signature is correct.
            {BUG_ID + FS + "pkg" + FS + "Coin.html", "public enum "+
57
                "<STRONG>Coin</STRONG>" + NL + "extends java.lang.Enum&lt;" +
D
duke 已提交
58 59 60
                "<A HREF=\"../pkg/Coin.html\" title=\"enum in pkg\">Coin</A>&gt;"
            },
            //Check for enum constant section
61
            {BUG_ID + FS + "pkg" + FS + "Coin.html", "<STRONG>Enum Constant Summary</STRONG>"},
D
duke 已提交
62 63
            //Detail for enum constant
            {BUG_ID + FS + "pkg" + FS + "Coin.html",
64
                "<STRONG><A HREF=\"../pkg/Coin.html#Dime\">Dime</A></STRONG>"},
D
duke 已提交
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
            //Automatically insert documentation for values() and valueOf().
            {BUG_ID + FS + "pkg" + FS + "Coin.html",
                "Returns an array containing the constants of this enum type,"},
            {BUG_ID + FS + "pkg" + FS + "Coin.html",
                "Returns the enum constant of this type with the specified name"},
            {BUG_ID + FS + "pkg" + FS + "Coin.html", "for (Coin c : Coin.values())"},
            {BUG_ID + FS + "pkg" + FS + "Coin.html", "Overloaded valueOf() method has correct documentation."},
            {BUG_ID + FS + "pkg" + FS + "Coin.html", "Overloaded values method  has correct documentation."},

            //=================================
            // TYPE PARAMETER TESTING
            //=================================
            //Make sure the header is correct.
            {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
                "Class TypeParameters&lt;E&gt;</H2>"},
            //Check class type parameters section.
            {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
82
                "<DT><STRONG>Type Parameters:</STRONG></DT><DD><CODE>E</CODE> - " +
D
duke 已提交
83 84 85
                "the type parameter for this class."},
            //Type parameters in @see/@link
            {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
86 87
                "<DT><STRONG>See Also:</STRONG></DT><DD><A HREF=\"../pkg/TypeParameters.html\" " +
                    "title=\"class in pkg\"><CODE>TypeParameters</CODE></A></DD></DL>"},
D
duke 已提交
88 89 90 91 92 93
            //Method that uses class type parameter.
            {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
                "(<A HREF=\"../pkg/TypeParameters.html\" title=\"type " +
                    "parameter in TypeParameters\">E</A>&nbsp;param)"},
            //Method type parameter section.
            {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
94 95
                "<STRONG>Type Parameters:</STRONG></DT><DD><CODE>T</CODE> - This is the first " +
                    "type parameter.</DD><DD><CODE>V</CODE> - This is the second type " +
D
duke 已提交
96 97 98 99
                    "parameter."},
            //Signature of method with type parameters
            {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
                "public &lt;T extends java.util.List,V&gt; " +
100
                    "java.lang.String[] <STRONG>methodThatHasTypeParameters</STRONG>"},
D
duke 已提交
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
            //Wildcard testing.
            {BUG_ID + FS + "pkg" + FS + "Wildcards.html",
                "<A HREF=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
                "TypeParameters</A>&lt;? super java.lang.String&gt;&nbsp;a"},
            {BUG_ID + FS + "pkg" + FS + "Wildcards.html",
                "<A HREF=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
                "TypeParameters</A>&lt;? extends java.lang.StringBuffer&gt;&nbsp;b"},
            {BUG_ID + FS + "pkg" + FS + "Wildcards.html",
                "<A HREF=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
                    "TypeParameters</A>&nbsp;c"},
            //Bad type parameter warnings.
            {WARNING_OUTPUT, "warning - @param argument " +
                "\"<BadClassTypeParam>\" is not a type parameter name."},
            {WARNING_OUTPUT, "warning - @param argument " +
                "\"<BadMethodTypeParam>\" is not a type parameter name."},

            //Signature of subclass that has type parameters.
            {BUG_ID + FS + "pkg" + FS + "TypeParameterSubClass.html",
119
                "public class <STRONG>TypeParameterSubClass&lt;T extends java.lang.String&gt;" +
120
                "</STRONG>" + NL + "extends <A HREF=\"../pkg/TypeParameterSuperClass.html\" " +
D
duke 已提交
121 122 123 124 125
                "title=\"class in pkg\">TypeParameterSuperClass</A>&lt;T&gt;"},

            //Interface generic parameter substitution
            //Signature of subclass that has type parameters.
            {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
126
                "<STRONG>All Implemented Interfaces:</STRONG></DT> <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>"},
D
duke 已提交
127
            {BUG_ID + FS + "pkg" + FS + "SuperInterface.html",
128
                "<STRONG>All Known Subinterfaces:</STRONG></DT> <DD><A HREF=\"../pkg/SubInterface.html\" title=\"interface in pkg\">SubInterface</A>&lt;V&gt;</DD>"},
D
duke 已提交
129
            {BUG_ID + FS + "pkg" + FS + "SubInterface.html",
130
                "<STRONG>All Superinterfaces:</STRONG></DT> <DD><A HREF=\"../pkg/SuperInterface.html\" title=\"interface in pkg\">SuperInterface</A>&lt;V&gt;</DD>"},
D
duke 已提交
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157

            //=================================
            // VAR ARG TESTING
            //=================================
            {BUG_ID + FS + "pkg" + FS + "VarArgs.html", "(int...&nbsp;i)"},
            {BUG_ID + FS + "pkg" + FS + "VarArgs.html", "(int[][]...&nbsp;i)"},
            {BUG_ID + FS + "pkg" + FS + "VarArgs.html", "(int[]...)"},
            {BUG_ID + FS + "pkg" + FS + "VarArgs.html",
                "<A HREF=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
                "TypeParameters</A>...&nbsp;t"},

            //=================================
            // ANNOTATION TYPE TESTING
            //=================================
            //Make sure the summary links are correct.
            {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
                "SUMMARY:&nbsp;<A HREF=\"#annotation_type_required_element_summary\">" +
                "REQUIRED</A>&nbsp;|&nbsp;<A HREF=\"#annotation_type_optional_element_summary\">" +
                "OPTIONAL</A>"},
            //Make sure the detail links are correct.
            {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
                "DETAIL:&nbsp;<A HREF=\"#annotation_type_element_detail\">ELEMENT</A>"},
            //Make sure the heading is correct.
            {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
                "Annotation Type AnnotationType</H2>"},
            //Make sure the signature is correct.
            {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
158
                "public @interface <STRONG>AnnotationType</STRONG>"},
D
duke 已提交
159 160
            //Make sure member summary headings are correct.
            {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
161
                "<STRONG>Required Element Summary</STRONG>"},
D
duke 已提交
162
            {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
163
                "<STRONG>Optional Element Summary</STRONG>"},
D
duke 已提交
164 165 166 167 168
            //Make sure element detail heading is correct
            {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
                "Element Detail"},
            //Make sure default annotation type value is printed when necessary.
            {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
169
                "<STRONG>Default:</STRONG></DT><DD>\"unknown\"</DD>"},
D
duke 已提交
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184

            //=================================
            // ANNOTATION TYPE USAGE TESTING
            //=================================

            //PACKAGE
            {BUG_ID + FS + "pkg" + FS + "package-summary.html",
                "<A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Package Annotation\"," + NL +
                "                <A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)"},

            //CLASS
            {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
                "<FONT SIZE=\"-1\">" +
                "<A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Class Annotation\","+NL +
                "                <A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)"+NL +
185 186
                "</FONT>public class <STRONG>AnnotationTypeUsage</STRONG>" + NL +
                "extends java.lang.Object"},
D
duke 已提交
187 188 189 190 191 192

            //FIELD
            {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
                "<FONT SIZE=\"-1\">" +
                "<A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Field Annotation\","+NL +
                "                <A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)"+NL +
193
                "</FONT>public int <STRONG>field</STRONG>"},
D
duke 已提交
194 195 196 197 198 199

            //CONSTRUCTOR
            {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
                "<FONT SIZE=\"-1\">" +
                "<A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Constructor Annotation\","+NL +
                "                <A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)"+NL +
200
                "</FONT>public <STRONG>AnnotationTypeUsage</STRONG>()"},
D
duke 已提交
201 202 203 204 205 206

            //METHOD
            {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
                "<FONT SIZE=\"-1\">" +
                "<A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Method Annotation\","+NL +
                "                <A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)"+NL +
207
                "</FONT>public void <STRONG>method</STRONG>()"},
D
duke 已提交
208 209 210 211

            //METHOD PARAMS
            {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
                "<PRE>" + NL +
212
                "public void <STRONG>methodWithParams</STRONG>(<FONT SIZE=\"-1\"><A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Parameter Annotation\",<A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)</FONT>" + NL +
D
duke 已提交
213 214 215 216 217 218
                "                             int&nbsp;documented," + NL +
                "                             int&nbsp;undocmented)</PRE>"},

            //CONSTRUCTOR PARAMS
            {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
                "<PRE>" + NL +
219
                                "public <STRONG>AnnotationTypeUsage</STRONG>(<FONT SIZE=\"-1\"><A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Constructor Param Annotation\",<A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)</FONT>" + NL +
D
duke 已提交
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273
                                "                           int&nbsp;documented," + NL +
                "                           int&nbsp;undocmented)</PRE>"},

            //=================================
            // ANNOTATION TYPE USAGE TESTING (All Different Types).
            //=================================

            //Integer
            {BUG_ID + FS + "pkg1" + FS + "B.html",
                "<A HREF=\"../pkg1/A.html#d()\">d</A>=3.14,"},

            //Double
            {BUG_ID + FS + "pkg1" + FS + "B.html",
                "<A HREF=\"../pkg1/A.html#d()\">d</A>=3.14,"},

            //Boolean
            {BUG_ID + FS + "pkg1" + FS + "B.html",
                "<A HREF=\"../pkg1/A.html#b()\">b</A>=true,"},

            //String
            {BUG_ID + FS + "pkg1" + FS + "B.html",
                "<A HREF=\"../pkg1/A.html#s()\">s</A>=\"sigh\","},

            //Class
            {BUG_ID + FS + "pkg1" + FS + "B.html",
                "<A HREF=\"../pkg1/A.html#c()\">c</A>=<A HREF=\"../pkg2/Foo.html\" title=\"class in pkg2\">Foo.class</A>,"},

            //Bounded Class
            {BUG_ID + FS + "pkg1" + FS + "B.html",
                "<A HREF=\"../pkg1/A.html#w()\">w</A>=<A HREF=\"../pkg/TypeParameterSubClass.html\" title=\"class in pkg\">TypeParameterSubClass.class</A>,"},

            //Enum
            {BUG_ID + FS + "pkg1" + FS + "B.html",
                "<A HREF=\"../pkg1/A.html#e()\">e</A>=<A HREF=\"../pkg/Coin.html#Penny\">Penny</A>,"},

            //Annotation Type
            {BUG_ID + FS + "pkg1" + FS + "B.html",
                "<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),"},

            //String Array
            {BUG_ID + FS + "pkg1" + FS + "B.html",
                "<A HREF=\"../pkg1/A.html#sa()\">sa</A>={\"up\",\"down\"},"},

            //Primitive
            {BUG_ID + FS + "pkg1" + FS + "B.html",
                "<A HREF=\"../pkg1/A.html#primitiveClassTest()\">primitiveClassTest</A>=boolean.class,"},

            //XXX:  Add array test case after this if fixed:
            //5020899: Incorrect internal representation of class-valued annotation elements

            //Make sure that annotations are surrounded by <pre> and </pre>
            {BUG_ID + FS + "pkg1" + FS + "B.html",
                "<PRE><FONT SIZE=\"-1\"><A HREF=\"../pkg1/A.html\" title=\"annotation in pkg1\">@A</A>"},
            {BUG_ID + FS + "pkg1" + FS + "B.html",
274
                "</FONT>public interface <STRONG>B</STRONG></PRE>"},
D
duke 已提交
275 276 277 278 279 280


            //==============================================================
            // Handle multiple bounds.
            //==============================================================
            {BUG_ID + FS + "pkg" + FS + "MultiTypeParameters.html",
281
                "public &lt;T extends java.lang.Number & java.lang.Runnable&gt; T <STRONG>foo</STRONG>(T&nbsp;t)"},
D
duke 已提交
282 283 284 285 286 287 288 289 290 291

            //==============================================================
            // Test Class-Use Documenation for Type Parameters.
            //==============================================================

            //ClassUseTest1: <T extends Foo & Foo2>
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
                 "<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>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
292
                "<TD><CODE><STRONG><A HREF=\"../../pkg2/ClassUseTest1.html\" title=\"class in pkg2\">ClassUseTest1&lt;T extends Foo & Foo2&gt;</A></STRONG></CODE>"
D
duke 已提交
293 294 295 296 297
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
                "<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>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
298
                "<TD><CODE><STRONG>ClassUseTest1.</STRONG><STRONG><A HREF=\"../../pkg2/ClassUseTest1.html#method(T)\">method</A></STRONG>(T&nbsp;t)</CODE>"
D
duke 已提交
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
                "<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>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
                "<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>"
            },

            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
                "<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>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
                "<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>"
            },

           {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
            "<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>"
           },
           {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
318
            "<TD><CODE><STRONG><A HREF=\"../../pkg2/ClassUseTest1.html\" title=\"class in pkg2\">ClassUseTest1&lt;T extends Foo & Foo2&gt;</A></STRONG></CODE>"
D
duke 已提交
319 320 321 322 323
           },
           {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
               "<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>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
324
               "<TD><CODE><STRONG>ClassUseTest1.</STRONG><STRONG><A HREF=\"../../pkg2/ClassUseTest1.html#method(T)\">method</A></STRONG>(T&nbsp;t)</CODE>"
D
duke 已提交
325 326 327 328 329 330 331
            },

            //ClassUseTest2: <T extends ParamTest<Foo3>>
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
              "<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>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
332
              "<TD><CODE><STRONG><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></STRONG></CODE>"
D
duke 已提交
333 334 335 336 337
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
              "<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>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
338
              "<TD><CODE><STRONG>ClassUseTest2.</STRONG><STRONG><A HREF=\"../../pkg2/ClassUseTest2.html#method(T)\">method</A></STRONG>(T&nbsp;t)</CODE>"
D
duke 已提交
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
              "<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>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
              "<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>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
              "<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>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
              "&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;"
            },

            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
                "<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>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
357
                "<TD><CODE><STRONG><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></STRONG></CODE>"
D
duke 已提交
358 359 360 361 362
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
                "<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>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
363
                "<TD><CODE><STRONG>ClassUseTest2.</STRONG><STRONG><A HREF=\"../../pkg2/ClassUseTest2.html#method(T)\">method</A></STRONG>(T&nbsp;t)</CODE>"
D
duke 已提交
364 365 366 367 368 369 370 371 372 373 374 375 376
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
                "<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>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
                "&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;"
            },

            //ClassUseTest3: <T extends ParamTest2<List<? extends Foo4>>>
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
                "<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>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
377
                "<TD><CODE><STRONG><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></STRONG></CODE>"
D
duke 已提交
378 379 380 381 382
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
                "<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>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
383
                "<TD><CODE><STRONG>ClassUseTest3.</STRONG><STRONG><A HREF=\"../../pkg2/ClassUseTest3.html#method(T)\">method</A></STRONG>(T&nbsp;t)</CODE>"
D
duke 已提交
384 385 386 387 388 389 390 391 392 393 394 395
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
                "<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>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
                "&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;"
            },

            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
                "<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>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
396
                "<TD><CODE><STRONG><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></STRONG></CODE>"
D
duke 已提交
397 398 399 400 401
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
                "<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>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
402
                "<TD><CODE><STRONG>ClassUseTest3.</STRONG><STRONG><A HREF=\"../../pkg2/ClassUseTest3.html#method(T)\">method</A></STRONG>(T&nbsp;t)</CODE>"
D
duke 已提交
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
                "<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>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
                "&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;"
            },

            //Type parameters in constructor and method args
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
                "<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 +
                "</TR>" + NL +
                "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
                "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
                "<CODE>&nbsp;void</CODE></FONT></TD>" + NL +
418
                "<TD><CODE><STRONG>ClassUseTest3.</STRONG><STRONG><A HREF=\"../../pkg2/ClassUseTest3.html#method(java.util.Set)\">method</A></STRONG>(java.util.Set&lt;<A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</A>&gt;&nbsp;p)</CODE>"
D
duke 已提交
419 420 421 422 423
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
                "<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 +
                "</TR>" + NL +
                "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
424
                "<TD><CODE><STRONG><A HREF=\"../../pkg2/ClassUseTest3.html#ClassUseTest3(java.util.Set)\">ClassUseTest3</A></STRONG>(java.util.Set&lt;<A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</A>&gt;&nbsp;p)</CODE>"
D
duke 已提交
425 426 427 428 429 430 431 432 433 434
            },

            //=================================
            // Annotatation Type Usage
            //=================================
            {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
                "<FONT SIZE=\"+2\">" + NL +
                "Packages with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" title=\"annotation in pkg\">AnnotationType</A></FONT></TH>" + NL +
                "</TR>" + NL +
                "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
435
                "<TD><A HREF=\"../../pkg/package-summary.html\"><STRONG>pkg</STRONG></A></TD>"
D
duke 已提交
436 437 438 439 440 441 442 443
            },

            {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
                "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 +
                "</TR>" + NL +
                "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
                "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
                "<CODE>&nbsp;class</CODE></FONT></TD>" + NL +
444
                "<TD><CODE><STRONG><A HREF=\"../../pkg/AnnotationTypeUsage.html\" title=\"class in pkg\">AnnotationTypeUsage</A></STRONG></CODE>"
D
duke 已提交
445 446 447 448 449 450 451 452
            },

            {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
                "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 +
                "</TR>" + NL +
                "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
                "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
                "<CODE>&nbsp;int</CODE></FONT></TD>" + NL +
453
                "<TD><CODE><STRONG>AnnotationTypeUsage.</STRONG><STRONG><A HREF=\"../../pkg/AnnotationTypeUsage.html#field\">field</A></STRONG></CODE>"
D
duke 已提交
454 455 456 457 458 459 460 461
            },

            {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
                "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 +
                "</TR>" + NL +
                "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
                "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
                "<CODE>&nbsp;void</CODE></FONT></TD>" + NL +
462
                "<TD><CODE><STRONG>AnnotationTypeUsage.</STRONG><STRONG><A HREF=\"../../pkg/AnnotationTypeUsage.html#method()\">method</A></STRONG>()</CODE>"
D
duke 已提交
463 464 465 466 467 468 469 470
            },

            {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
                "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 +
                "</TR>" + NL +
                "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
                "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
                "<CODE>&nbsp;void</CODE></FONT></TD>" + NL +
471
                "<TD><CODE><STRONG>AnnotationTypeUsage.</STRONG><STRONG><A HREF=\"../../pkg/AnnotationTypeUsage.html#methodWithParams(int, int)\">methodWithParams</A></STRONG>(int&nbsp;documented," + NL +
D
duke 已提交
472 473 474 475 476 477 478
                "                 int&nbsp;undocmented)</CODE>"
            },

            {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
                "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 +
                "</TR>" + NL +
                "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
479
                "<TD><CODE><STRONG><A HREF=\"../../pkg/AnnotationTypeUsage.html#AnnotationTypeUsage()\">AnnotationTypeUsage</A></STRONG>()</CODE>"
D
duke 已提交
480 481 482 483 484 485
            },

            {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
                "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 +
                "</TR>" + NL +
                "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
486
                "<TD><CODE><STRONG><A HREF=\"../../pkg/AnnotationTypeUsage.html#AnnotationTypeUsage(int, int)\">AnnotationTypeUsage</A></STRONG>(int&nbsp;documented," + NL +
D
duke 已提交
487 488 489 490 491 492 493
                "                    int&nbsp;undocmented)</CODE>"
            },

            //=================================
            // TYPE PARAMETER IN INDEX
            //=================================
            {BUG_ID + FS + "index-all.html",
494
                "<A HREF=\"./pkg2/Foo.html#method(java.util.Vector)\"><STRONG>method(Vector&lt;Object&gt;)</STRONG></A>"
D
duke 已提交
495 496 497 498 499
            },
            //=================================
            // TYPE PARAMETER IN INDEX
            //=================================
            {BUG_ID + FS + "index-all.html",
500
                "<A HREF=\"./pkg2/Foo.html#method(java.util.Vector)\"><STRONG>method(Vector&lt;Object&gt;)</STRONG></A>"
D
duke 已提交
501 502 503 504 505 506 507
            },
        };
    private static final String[][] NEGATED_TEST = {
        //=================================
        // ENUM TESTING
        //=================================
        //NO constructor section
508
        {BUG_ID + FS + "pkg" + FS + "Coin.html", "<STRONG>Constructor Summary</STRONG>"},
D
duke 已提交
509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527
        //=================================
        // TYPE PARAMETER TESTING
        //=================================
        //No type parameters in class frame.
        {BUG_ID + FS + "allclasses-frame.html",
            "<A HREF=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
                    "TypeParameters</A>&lt;<A HREF=\"../pkg/TypeParameters.html\" " +
                    "title=\"type parameter in TypeParameters\">E</A>&gt;"
        },

        //==============================================================
        // ANNOTATION TYPE USAGE TESTING (When @Documented is omitted)
        //===============================================================

        //CLASS
        {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
            "<FONT SIZE=\"-1\">" + NL +
            "<A HREF=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</A>(<A HREF=\"../pkg/AnnotationType.html#optional\">optional</A>=\"Class Annotation\"," + NL +
            "                <A HREF=\"../pkg/AnnotationType.html#required\">required</A>=1994)" + NL +
528
            "</FONT>public class <STRONG>AnnotationTypeUsage</STRONG></DT><DT>extends java.lang.Object</DT></DL>"},
D
duke 已提交
529 530 531 532 533 534

        //FIELD
        {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
            "<FONT SIZE=\"-1\">" + NL +
            "<A HREF=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</A>(<A HREF=\"../pkg/AnnotationType.html#optional\">optional</A>=\"Field Annotation\"," + NL +
            "                <A HREF=\"../pkg/AnnotationType.html#required\">required</A>=1994)" + NL +
535
            "</FONT>public int <STRONG>field</STRONG>"},
D
duke 已提交
536 537 538 539 540 541

        //CONSTRUCTOR
        {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
            "<FONT SIZE=\"-1\">" + NL +
            "<A HREF=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</A>(<A HREF=\"../pkg/AnnotationType.html#optional\">optional</A>=\"Constructor Annotation\"," + NL +
            "                <A HREF=\"../pkg/AnnotationType.html#required\">required</A>=1994)" + NL +
542
            "</FONT>public <STRONG>AnnotationTypeUsage</STRONG>()"},
D
duke 已提交
543 544 545 546 547 548

        //METHOD
        {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
            "<FONT SIZE=\"-1\">" + NL +
            "<A HREF=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</A>(<A HREF=\"../pkg/AnnotationType.html#optional\">optional</A>=\"Method Annotation\"," + NL +
            "                <A HREF=\"../pkg/AnnotationType.html#required\">required</A>=1994)" + NL +
549
            "</FONT>public void <STRONG>method</STRONG>()"},
D
duke 已提交
550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583

        //=================================
        // Make sure annotation types do not
        // trigger this warning.
        //=================================
        {WARNING_OUTPUT,
            "Internal error: package sets don't match: [] with: null"
        },
    };

    /**
     * The entry point of the test.
     * @param args the array of command line arguments.
     */
    public static void main(String[] args) {
        TestNewLanguageFeatures tester = new TestNewLanguageFeatures();
        run(tester, ARGS, TEST, NEGATED_TEST);
        tester.printSummary();
    }

    /**
     * {@inheritDoc}
     */
    public String getBugId() {
        return BUG_ID;
    }

    /**
     * {@inheritDoc}
     */
    public String getBugName() {
        return getClass().getName();
    }
}