test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java

Thu, 08 Jan 2009 16:26:59 -0800

author
bpatel
date
Thu, 08 Jan 2009 16:26:59 -0800
changeset 182
47a62d8d98b4
parent 1
9a66ca7c79fa
child 233
5240b1120530
permissions
-rw-r--r--

6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
Reviewed-by: jjg

     1 /*
     2  * Copyright 2002-2005 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 4638588 4635809 6256068 6270645
    27  * @summary Test to make sure that members are inherited properly in the Javadoc.
    28  *          Verify that inheritence labels are correct.
    29  * @author jamieh
    30  * @library ../lib/
    31  * @build JavadocTester
    32  * @build TestMemberInheritence
    33  * @run main TestMemberInheritence
    34  */
    36 public class TestMemberInheritence extends JavadocTester {
    38     private static final String BUG_ID = "4638588-4635809-6256068-6270645";
    40     private static final String[][] TEST = {
    41         //Public field should be inherited
    42         {BUG_ID + FS + "pkg" + FS + "SubClass.html",
    43          "<A HREF=\"../pkg/BaseClass.html#pubField\">"},
    45         //Public method should be inherited
    46         {BUG_ID + FS + "pkg" + FS + "SubClass.html",
    47          "<A HREF=\"../pkg/BaseClass.html#pubMethod()\">"},
    49         //Public inner class should be inherited.
    50         {BUG_ID + FS + "pkg" + FS + "SubClass.html",
    51          "<A HREF=\"../pkg/BaseClass.pubInnerClass.html\" title=\"class in pkg\">"},
    53         //Protected field should be inherited
    54         {BUG_ID + FS + "pkg" + FS + "SubClass.html",
    55          "<A HREF=\"../pkg/BaseClass.html#proField\">"},
    57         //Protected method should be inherited
    58         {BUG_ID + FS + "pkg" + FS + "SubClass.html",
    59          "<A HREF=\"../pkg/BaseClass.html#proMethod()\">"},
    61         //Protected inner class should be inherited.
    62         {BUG_ID + FS + "pkg" + FS + "SubClass.html",
    63          "<A HREF=\"../pkg/BaseClass.proInnerClass.html\" title=\"class in pkg\">"},
    65         // New labels as of 1.5.0
    66         {BUG_ID + FS + "pkg" + FS + "SubClass.html",
    67          "<STRONG>Nested classes/interfaces inherited from class pkg." +
    68          "<A HREF=\"../pkg/BaseClass.html\" title=\"class in pkg\">" +
    69          "BaseClass</A></STRONG>"},
    70         {BUG_ID + FS + "pkg" + FS + "SubClass.html",
    71          "<STRONG>Nested classes/interfaces inherited from interface pkg." +
    72          "<A HREF=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">" +
    73          "BaseInterface</A></STRONG>"},
    75          // Test overriding/implementing methods with generic parameters.
    76                  {BUG_ID + FS + "pkg" + FS + "BaseClass.html",
    77          "<DT><STRONG>Specified by:</STRONG><DD><CODE><A HREF=\"../pkg/BaseInterface.html#getAnnotation(java.lang.Class)\">getAnnotation</A></CODE> in interface <CODE><A HREF=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">BaseInterface</A></CODE></DL>"},
    79          // Test diamond inheritence member summary (6256068)
    80                  {BUG_ID + FS + "diamond" + FS + "Z.html",
    81                  "<TD><CODE><A HREF=\"../diamond/A.html#aMethod()\">aMethod</A></CODE></TD>"},
    83          // Test that doc is inherited from closed parent (6270645)
    84                  {BUG_ID + FS + "inheritDist" + FS + "C.html",
    85                  "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m1-B</TD>"},
    87     };
    89     private static final String[][] NEGATED_TEST = {
    90         {BUG_ID + FS + "pkg" + FS + "SubClass.html",
    91         "<A HREF=\"../pkg/BaseClass.html#staticMethod()\">staticMethod</A></CODE>"},
    92     };
    93     private static final String[] ARGS =
    94         new String[] {
    95             "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", "diamond", "inheritDist"};
    97     /**
    98      * The entry point of the test.
    99      * @param args the array of command line arguments.
   100      */
   101     public static void main(String[] args) {
   102         TestMemberInheritence tester = new TestMemberInheritence();
   103         run(tester, ARGS, TEST, NEGATED_TEST);
   104         tester.printSummary();
   105     }
   107     /**
   108      * {@inheritDoc}
   109      */
   110     public String getBugId() {
   111         return BUG_ID;
   112     }
   114     /**
   115      * {@inheritDoc}
   116      */
   117     public String getBugName() {
   118         return getClass().getName();
   119     }
   120 }

mercurial