1/* 2 * Copyright (c) 2003, 2015, 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 */ 23 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 * @modules jdk.javadoc 31 * @build JavadocTester 32 * @build TestHeadings 33 * @run main TestHeadings 34 */ 35 36public class TestHeadings extends JavadocTester { 37 38 private static final String[][] TEST = { 39 40 { 41 }, 42 { "serialized-form.html" 43 }, 44 { "serialized-form.html" 45 }, 46 47 { 48 }, 49 { "overview-frame.html" 50 }, 51 { 52 } 53 }; 54 55 public static void main(String... args) throws Exception { 56 TestHeadings tester = new TestHeadings(); 57 tester.runTests(); 58 } 59 60 @Test 61 void test() { 62 javadoc("-d", "out", 63 "-sourcepath", testSrc, 64 "-use", 65 "-header", "Test Files", 66 "pkg1", "pkg2"); 67 checkExit(Exit.OK); 68 69 //Package summary 70 checkOutput("pkg1/package-summary.html", true, 71 "<th class=\"colFirst\" scope=\"col\">" 72 + "Class</th>\n" 73 + "<th class=\"colLast\" scope=\"col\"" 74 + ">Description</th>"); 75 76 // Class documentation 77 checkOutput("pkg1/C1.html", true, 78 "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" 79 + "<th class=\"colLast\" scope=\"col\">Field and Description</th>", 80 "<h3>Methods inherited from class java.lang.Object</h3>"); 81 82 // Class use documentation 83 checkOutput("pkg1/class-use/C1.html", true, 84 "<th class=\"colFirst\" scope=\"col\">Package</th>\n" 85 + "<th class=\"colLast\" scope=\"col\">Description</th>", 86 "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>\n" 87 + "<th class=\"colLast\" scope=\"col\">Field and Description</th>"); 88 89 // Deprecated 90 checkOutput("deprecated-list.html", true, 91 "<th class=\"colOne\" scope=\"col\">Method and Description</th>"); 92 93 // Constant values 94 checkOutput("constant-values.html", true, 95 "<th class=\"colFirst\" scope=\"col\">" 96 + "Modifier and Type</th>\n" 97 + "<th scope=\"col\">Constant Field</th>\n" 98 + "<th class=\"colLast\" scope=\"col\">Value</th>"); 99 100 // Serialized Form 101 checkOutput("serialized-form.html", true, 102 "<h2 title=\"Package\">Package pkg1</h2>", 103 "<h3>Class <a href=\"pkg1/C1.html\" title=\"class in pkg1\">" 104 + "pkg1.C1</a> extends java.lang.Object implements Serializable</h3>", 105 "<h3>Serialized Fields</h3>"); 106 107 // Overview Frame 108 checkOutput("overview-frame.html", true, 109 "<h1 title=\"Test Files\" class=\"bar\">Test Files</h1>", 110 "<title>Overview List</title>"); 111 112 // Overview Summary 113 checkOutput("overview-summary.html", true, 114 "<title>Overview</title>"); 115 } 116} 117