test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.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-2004 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      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, "<B>Deprecated.</B>" + NL +
    80                 "<P>" + NL +
    81             "<DL>" + NL +
    82             "<DT><PRE><FONT SIZE=\"-1\">@Deprecated" + NL +
    83             "</FONT>public class <B>DeprecatedClassByAnnotation</B>"},
    85         {TARGET_FILE2, "public int <B>field</B></PRE>" + NL +
    86             "<DL>" + NL +
    87             "<DD><B>Deprecated.</B>&nbsp;<DL>"},
    89         {TARGET_FILE2, "<FONT SIZE=\"-1\">@Deprecated" + NL +
    90             "</FONT>public <B>DeprecatedClassByAnnotation</B>()</PRE>" + NL +
    91             "<DL>" + NL +
    92             "<DD><B>Deprecated.</B>"},
    94         {TARGET_FILE2, "<FONT SIZE=\"-1\">@Deprecated" + NL +
    95             "</FONT>public void <B>method</B>()</PRE>" + NL +
    96             "<DL>" + NL +
    97             "<DD><B>Deprecated.</B>"},
    98     };
   100     private static final String[][] NEGATED_TEST = NO_TEST;
   102     /**
   103      * The entry point of the test.
   104      * @param args the array of command line arguments.
   105      */
   106     public static void main(String[] args) {
   107         TestDeprecatedDocs tester = new TestDeprecatedDocs();
   108         run(tester, ARGS, TEST, NEGATED_TEST);
   109         tester.printSummary();
   110     }
   112     /**
   113      * {@inheritDoc}
   114      */
   115     public String getBugId() {
   116         return BUG_ID;
   117     }
   119     /**
   120      * {@inheritDoc}
   121      */
   122     public String getBugName() {
   123         return getClass().getName();
   124     }
   125 }

mercurial