1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/test/com/sun/javadoc/testHeadings/TestHeadings.java Wed Apr 27 01:34:52 2016 +0800 1.3 @@ -0,0 +1,137 @@ 1.4 +/* 1.5 + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. 1.11 + * 1.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.15 + * version 2 for more details (a copy is included in the LICENSE file that 1.16 + * accompanied this code). 1.17 + * 1.18 + * You should have received a copy of the GNU General Public License version 1.19 + * 2 along with this work; if not, write to the Free Software Foundation, 1.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.21 + * 1.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.23 + * or visit www.oracle.com if you need additional information or have any 1.24 + * questions. 1.25 + */ 1.26 + 1.27 +/* 1.28 + * @test 1.29 + * @bug 4905786 6259611 1.30 + * @summary Make sure that headings use the TH tag instead of the TD tag. 1.31 + * @author jamieh 1.32 + * @library ../lib/ 1.33 + * @build JavadocTester 1.34 + * @build TestHeadings 1.35 + * @run main TestHeadings 1.36 + */ 1.37 + 1.38 +public class TestHeadings extends JavadocTester { 1.39 + 1.40 + //Test information. 1.41 + private static final String BUG_ID = "4905786-6259611"; 1.42 + 1.43 + //Javadoc arguments. 1.44 + private static final String[] ARGS = new String[] { 1.45 + "-d", BUG_ID, "-sourcepath", SRC_DIR, "-use", "-header", "Test Files", 1.46 + "pkg1", "pkg2" 1.47 + }; 1.48 + 1.49 + //Input for string search tests. 1.50 + private static final String[][] TEST = { 1.51 + //Package summary 1.52 + {BUG_ID + FS + "pkg1" + FS + "package-summary.html", 1.53 + "<th class=\"colFirst\" scope=\"col\">" + 1.54 + "Class</th>" + NL + "<th class=\"colLast\" scope=\"col\"" + 1.55 + ">Description</th>" 1.56 + }, 1.57 + 1.58 + // Class documentation 1.59 + {BUG_ID + FS + "pkg1" + FS + "C1.html", 1.60 + "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL + 1.61 + "<th class=\"colLast\" scope=\"col\">Field and Description</th>" 1.62 + }, 1.63 + {BUG_ID + FS + "pkg1" + FS + "C1.html", 1.64 + "<h3>Methods inherited from class java.lang.Object</h3>" 1.65 + }, 1.66 + 1.67 + // Class use documentation 1.68 + {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html", 1.69 + "<th class=\"colFirst\" scope=\"col\">Package</th>" + NL + 1.70 + "<th class=\"colLast\" scope=\"col\">Description</th>" 1.71 + }, 1.72 + {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html", 1.73 + "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL + 1.74 + "<th class=\"colLast\" scope=\"col\">Field and Description</th>" 1.75 + }, 1.76 + 1.77 + // Deprecated 1.78 + {BUG_ID + FS + "deprecated-list.html", 1.79 + "<th class=\"colOne\" scope=\"col\">Method and Description</th>" 1.80 + }, 1.81 + 1.82 + // Constant values 1.83 + {BUG_ID + FS + "constant-values.html", 1.84 + "<th class=\"colFirst\" scope=\"col\">" + 1.85 + "Modifier and Type</th>" + NL + "<th scope=\"col\">Constant Field</th>" + NL + 1.86 + "<th class=\"colLast\" scope=\"col\">Value</th>" 1.87 + }, 1.88 + 1.89 + // Serialized Form 1.90 + {BUG_ID + FS + "serialized-form.html", 1.91 + "<h2 title=\"Package\">Package pkg1</h2>" 1.92 + }, 1.93 + {BUG_ID + FS + "serialized-form.html", 1.94 + "<h3>Class <a href=\"pkg1/C1.html\" title=\"class in pkg1\">" + 1.95 + "pkg1.C1</a> extends java.lang.Object implements Serializable</h3>" 1.96 + }, 1.97 + {BUG_ID + FS + "serialized-form.html", 1.98 + "<h3>Serialized Fields</h3>" 1.99 + }, 1.100 + 1.101 + // Overview Frame 1.102 + {BUG_ID + FS + "overview-frame.html", 1.103 + "<h1 title=\"Test Files\" class=\"bar\">Test Files</h1>" 1.104 + }, 1.105 + {BUG_ID + FS + "overview-frame.html", 1.106 + "<title>Overview List</title>" 1.107 + }, 1.108 + 1.109 + // Overview Summary 1.110 + {BUG_ID + FS + "overview-summary.html", 1.111 + "<title>Overview</title>" 1.112 + }, 1.113 + 1.114 + }; 1.115 + private static final String[][] NEGATED_TEST = NO_TEST; 1.116 + 1.117 + /** 1.118 + * The entry point of the test. 1.119 + * @param args the array of command line arguments. 1.120 + */ 1.121 + public static void main(String[] args) { 1.122 + TestHeadings tester = new TestHeadings(); 1.123 + run(tester, ARGS, TEST, NEGATED_TEST); 1.124 + tester.printSummary(); 1.125 + } 1.126 + 1.127 + /** 1.128 + * {@inheritDoc} 1.129 + */ 1.130 + public String getBugId() { 1.131 + return BUG_ID; 1.132 + } 1.133 + 1.134 + /** 1.135 + * {@inheritDoc} 1.136 + */ 1.137 + public String getBugName() { 1.138 + return getClass().getName(); 1.139 + } 1.140 +}