test/com/sun/javadoc/testHeadings/TestHeadings.java

Wed, 28 Nov 2012 14:07:26 -0800

author
katleman
date
Wed, 28 Nov 2012 14:07:26 -0800
changeset 1425
20230f8b0eef
parent 798
4868a36f6fd8
child 2525
2eb010b6cb22
permissions
-rw-r--r--

Merge

     1 /*
     2  * Copyright (c) 2003, 2010, 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      4905786 6259611
    27  * @summary  Make sure that headings use the TH tag instead of the TD tag.
    28  * @author   jamieh
    29  * @library  ../lib/
    30  * @build    JavadocTester
    31  * @build    TestHeadings
    32  * @run main TestHeadings
    33  */
    35 public class TestHeadings extends JavadocTester {
    37     //Test information.
    38     private static final String BUG_ID = "4905786-6259611";
    40     //Javadoc arguments.
    41     private static final String[] ARGS = new String[] {
    42         "-d", BUG_ID, "-sourcepath", SRC_DIR, "-use", "-header", "Test Files",
    43         "pkg1", "pkg2"
    44     };
    46     //Input for string search tests.
    47     private static final String[][] TEST = {
    48         //Package summary
    49         {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
    50             "<th class=\"colFirst\" scope=\"col\">" +
    51             "Class</th>" + NL + "<th class=\"colLast\" scope=\"col\"" +
    52             ">Description</th>"
    53         },
    55         // Class documentation
    56         {BUG_ID + FS + "pkg1" + FS + "C1.html",
    57             "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
    58             "<th class=\"colLast\" scope=\"col\">Field and Description</th>"
    59         },
    60         {BUG_ID + FS + "pkg1" + FS + "C1.html",
    61             "<h3>Methods inherited from class&nbsp;java.lang.Object</h3>"
    62         },
    64         // Class use documentation
    65         {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html",
    66             "<th class=\"colFirst\" scope=\"col\">Package</th>" + NL +
    67             "<th class=\"colLast\" scope=\"col\">Description</th>"
    68         },
    69         {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html",
    70             "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
    71             "<th class=\"colLast\" scope=\"col\">Field and Description</th>"
    72         },
    74         // Deprecated
    75         {BUG_ID + FS + "deprecated-list.html",
    76             "<th class=\"colOne\" scope=\"col\">Method and Description</th>"
    77         },
    79         // Constant values
    80         {BUG_ID + FS + "constant-values.html",
    81             "<th class=\"colFirst\" scope=\"col\">" +
    82             "Modifier and Type</th>" + NL + "<th scope=\"col\">Constant Field</th>" + NL +
    83             "<th class=\"colLast\" scope=\"col\">Value</th>"
    84         },
    86         // Serialized Form
    87         {BUG_ID + FS + "serialized-form.html",
    88             "<h2 title=\"Package\">Package&nbsp;pkg1</h2>"
    89         },
    90         {BUG_ID + FS + "serialized-form.html",
    91             "<h3>Class <a href=\"pkg1/C1.html\" title=\"class in pkg1\">" +
    92             "pkg1.C1</a> extends java.lang.Object implements Serializable</h3>"
    93         },
    94         {BUG_ID + FS + "serialized-form.html",
    95             "<h3>Serialized Fields</h3>"
    96         },
    98         // Overview Frame
    99         {BUG_ID + FS + "overview-frame.html",
   100             "<h1 title=\"Test Files\" class=\"bar\">Test Files</h1>"
   101         },
   102         {BUG_ID + FS + "overview-frame.html",
   103             "<title>Overview List</title>"
   104         },
   106         // Overview Summary
   107         {BUG_ID + FS + "overview-summary.html",
   108             "<title>Overview</title>"
   109         },
   111     };
   112     private static final String[][] NEGATED_TEST = NO_TEST;
   114     /**
   115      * The entry point of the test.
   116      * @param args the array of command line arguments.
   117      */
   118     public static void main(String[] args) {
   119         TestHeadings tester = new TestHeadings();
   120         run(tester, ARGS, TEST, NEGATED_TEST);
   121         tester.printSummary();
   122     }
   124     /**
   125      * {@inheritDoc}
   126      */
   127     public String getBugId() {
   128         return BUG_ID;
   129     }
   131     /**
   132      * {@inheritDoc}
   133      */
   134     public String getBugName() {
   135         return getClass().getName();
   136     }
   137 }

mercurial