test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java

Thu, 15 Jul 2010 16:31:02 +0100

author
mcimadamore
date
Thu, 15 Jul 2010 16:31:02 +0100
changeset 607
b49b0d72c071
parent 554
9d9f26857129
child 766
90af8d87741f
permissions
-rw-r--r--

6967002: JDK7 b99 javac compilation error (java.lang.AssertionError)
Summary: bug in JavacParser related to parsing of type annotations in varargs position
Reviewed-by: jjg
Contributed-by: mahmood@notnoop.com

     1 /*
     2  * Copyright (c) 2003, 2004, 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      4927552
    27  * @summary  <DESC>
    28  * @author   jamieh
    29  * @library  ../lib/
    30  * @build    JavadocTester
    31  * @build    TestDeprecatedDocs
    32  * @run main TestDeprecatedDocs
    33  */
    35 public class TestDeprecatedDocs extends JavadocTester {
    37     //Test information.
    38     private static final String BUG_ID = "4927552";
    40     //Javadoc arguments.
    41     private static final String[] ARGS = new String[] {
    42         "-d", BUG_ID, "-source", "1.5", "-sourcepath", SRC_DIR, "pkg"
    43     };
    45     private static final String TARGET_FILE  =
    46         BUG_ID + FS + "deprecated-list.html";
    48     private static final String TARGET_FILE2  =
    49         BUG_ID + FS + "pkg" + FS + "DeprecatedClassByAnnotation.html";
    51     //Input for string search tests.
    52     private static final String[][] TEST = {
    53         {TARGET_FILE, "annotation_test1 passes"},
    54         {TARGET_FILE, "annotation_test2 passes"},
    55         {TARGET_FILE, "annotation_test3 passes"},
    56         {TARGET_FILE, "class_test1 passes"},
    57         {TARGET_FILE, "class_test2 passes"},
    58         {TARGET_FILE, "class_test3 passes"},
    59         {TARGET_FILE, "class_test4 passes"},
    60         {TARGET_FILE, "enum_test1 passes"},
    61         {TARGET_FILE, "enum_test2 passes"},
    62         {TARGET_FILE, "error_test1 passes"},
    63         {TARGET_FILE, "error_test2 passes"},
    64         {TARGET_FILE, "error_test3 passes"},
    65         {TARGET_FILE, "error_test4 passes"},
    66         {TARGET_FILE, "exception_test1 passes"},
    67         {TARGET_FILE, "exception_test2 passes"},
    68         {TARGET_FILE, "exception_test3 passes"},
    69         {TARGET_FILE, "exception_test4 passes"},
    70         {TARGET_FILE, "interface_test1 passes"},
    71         {TARGET_FILE, "interface_test2 passes"},
    72         {TARGET_FILE, "interface_test3 passes"},
    73         {TARGET_FILE, "interface_test4 passes"},
    74         {TARGET_FILE, "pkg.DeprecatedClassByAnnotation"},
    75         {TARGET_FILE, "pkg.DeprecatedClassByAnnotation()"},
    76         {TARGET_FILE, "pkg.DeprecatedClassByAnnotation.method()"},
    77         {TARGET_FILE, "pkg.DeprecatedClassByAnnotation.field"},
    79         {TARGET_FILE2, "<STRONG>Deprecated.</STRONG>" + NL +
    80                 "<P>" + NL +
    81             "<PRE><FONT SIZE=\"-1\">@Deprecated" + NL +
    82             "</FONT>public class <STRONG>DeprecatedClassByAnnotation</STRONG>"},
    84         {TARGET_FILE2, "public int <STRONG>field</STRONG></PRE>" + NL +
    85             "<DL>" + NL +
    86             "<DD><STRONG>Deprecated.</STRONG>&nbsp;</DD></DL>"},
    88         {TARGET_FILE2, "<FONT SIZE=\"-1\">@Deprecated" + NL +
    89             "</FONT>public <STRONG>DeprecatedClassByAnnotation</STRONG>()</PRE>" + NL +
    90             "<DL>" + NL +
    91             "<DD><STRONG>Deprecated.</STRONG>"},
    93         {TARGET_FILE2, "<FONT SIZE=\"-1\">@Deprecated" + NL +
    94             "</FONT>public void <STRONG>method</STRONG>()</PRE>" + NL +
    95             "<DL>" + NL +
    96             "<DD><STRONG>Deprecated.</STRONG>"},
    97     };
    99     private static final String[][] NEGATED_TEST = NO_TEST;
   101     /**
   102      * The entry point of the test.
   103      * @param args the array of command line arguments.
   104      */
   105     public static void main(String[] args) {
   106         TestDeprecatedDocs tester = new TestDeprecatedDocs();
   107         run(tester, ARGS, TEST, NEGATED_TEST);
   108         tester.printSummary();
   109     }
   111     /**
   112      * {@inheritDoc}
   113      */
   114     public String getBugId() {
   115         return BUG_ID;
   116     }
   118     /**
   119      * {@inheritDoc}
   120      */
   121     public String getBugName() {
   122         return getClass().getName();
   123     }
   124 }

mercurial