test/com/sun/javadoc/testStylesheet/TestStylesheet.java

Mon, 16 Oct 2017 16:07:48 +0800

author
aoqi
date
Mon, 16 Oct 2017 16:07:48 +0800
changeset 2893
ca5783d9a597
parent 2723
477c2ce534d0
parent 2525
2eb010b6cb22
permissions
-rw-r--r--

merge

aoqi@0 1 /*
igerasim@2723 2 * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 *
aoqi@0 5 * This code is free software; you can redistribute it and/or modify it
aoqi@0 6 * under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 * published by the Free Software Foundation.
aoqi@0 8 *
aoqi@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 12 * version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 13 * accompanied this code).
aoqi@0 14 *
aoqi@0 15 * You should have received a copy of the GNU General Public License version
aoqi@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 18 *
aoqi@0 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 20 * or visit www.oracle.com if you need additional information or have any
aoqi@0 21 * questions.
aoqi@0 22 */
aoqi@0 23
aoqi@0 24 /*
aoqi@0 25 * @test
igerasim@2723 26 * @bug 4494033 7028815 7052425 8007338 8023608 8008164 8016549 8072461
aoqi@0 27 * @summary Run tests on doclet stylesheet.
aoqi@0 28 * @author jamieh
aoqi@0 29 * @library ../lib/
aoqi@0 30 * @build JavadocTester TestStylesheet
aoqi@0 31 * @run main TestStylesheet
aoqi@0 32 */
aoqi@0 33
aoqi@0 34 public class TestStylesheet extends JavadocTester {
aoqi@0 35
aoqi@0 36 //Test information.
igerasim@2723 37 private static final String BUG_ID = "4494033-7028815-7052425-8007338-8072461";
aoqi@0 38
aoqi@0 39 //Javadoc arguments.
aoqi@0 40 private static final String[] ARGS = new String[] {
aoqi@0 41 "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
aoqi@0 42 };
aoqi@0 43
aoqi@0 44 //Input for string search tests.
aoqi@0 45 private static final String[][] TEST = {
aoqi@0 46 {BUG_ID + FS + "stylesheet.css",
aoqi@0 47 "/* Javadoc style sheet */"},
aoqi@0 48 {BUG_ID + FS + "stylesheet.css",
aoqi@0 49 "/*" + NL + "Overall document style" + NL + "*/"},
aoqi@0 50 {BUG_ID + FS + "stylesheet.css",
aoqi@0 51 "/*" + NL + "Heading styles" + NL + "*/"},
aoqi@0 52 {BUG_ID + FS + "stylesheet.css",
aoqi@0 53 "/*" + NL + "Navigation bar styles" + NL + "*/"},
aoqi@0 54 {BUG_ID + FS + "stylesheet.css",
aoqi@0 55 "body {" + NL + " background-color:#ffffff;" + NL +
aoqi@0 56 " color:#353833;" + NL +
aoqi@0 57 " font-family:'DejaVu Sans', Arial, Helvetica, sans-serif;" + NL +
aoqi@0 58 " font-size:14px;" + NL + " margin:0;" + NL + "}"},
aoqi@0 59 {BUG_ID + FS + "stylesheet.css",
aoqi@0 60 "ul {" + NL + " list-style-type:disc;" + NL + "}"},
aoqi@0 61 {BUG_ID + FS + "stylesheet.css",
aoqi@0 62 ".overviewSummary caption, .memberSummary caption, .typeSummary caption," + NL +
aoqi@0 63 ".useSummary caption, .constantsSummary caption, .deprecatedSummary caption {" + NL +
aoqi@0 64 " position:relative;" + NL +
aoqi@0 65 " text-align:left;" + NL +
aoqi@0 66 " background-repeat:no-repeat;" + NL +
aoqi@0 67 " color:#253441;" + NL +
aoqi@0 68 " font-weight:bold;" + NL +
aoqi@0 69 " clear:none;" + NL +
aoqi@0 70 " overflow:hidden;" + NL +
aoqi@0 71 " padding:0px;" + NL +
aoqi@0 72 " padding-top:10px;" + NL +
aoqi@0 73 " padding-left:1px;" + NL +
aoqi@0 74 " margin:0px;" + NL +
aoqi@0 75 " white-space:pre;" + NL +
aoqi@0 76 "}"},
aoqi@0 77 {BUG_ID + FS + "stylesheet.css",
aoqi@0 78 ".overviewSummary caption span, .memberSummary caption span, .typeSummary caption span," + NL +
aoqi@0 79 ".useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span {" + NL +
aoqi@0 80 " white-space:nowrap;" + NL +
aoqi@0 81 " padding-top:5px;" + NL +
aoqi@0 82 " padding-left:12px;" + NL +
aoqi@0 83 " padding-right:12px;" + NL +
aoqi@0 84 " padding-bottom:7px;" + NL +
aoqi@0 85 " display:inline-block;" + NL +
aoqi@0 86 " float:left;" + NL +
aoqi@0 87 " background-color:#F8981D;" + NL +
aoqi@0 88 " border: none;" + NL +
aoqi@0 89 " height:16px;" + NL +
aoqi@0 90 "}"},
aoqi@0 91 {BUG_ID + FS + "stylesheet.css",
aoqi@0 92 ".memberSummary caption span.activeTableTab span {" + NL +
aoqi@0 93 " white-space:nowrap;" + NL +
aoqi@0 94 " padding-top:5px;" + NL +
aoqi@0 95 " padding-left:12px;" + NL +
aoqi@0 96 " padding-right:12px;" + NL +
aoqi@0 97 " margin-right:3px;" + NL +
aoqi@0 98 " display:inline-block;" + NL +
aoqi@0 99 " float:left;" + NL +
aoqi@0 100 " background-color:#F8981D;" + NL +
aoqi@0 101 " height:16px;" + NL +
aoqi@0 102 "}"},
aoqi@0 103 {BUG_ID + FS + "stylesheet.css",
aoqi@0 104 ".memberSummary caption span.tableTab span {" + NL +
aoqi@0 105 " white-space:nowrap;" + NL +
aoqi@0 106 " padding-top:5px;" + NL +
aoqi@0 107 " padding-left:12px;" + NL +
aoqi@0 108 " padding-right:12px;" + NL +
aoqi@0 109 " margin-right:3px;" + NL +
aoqi@0 110 " display:inline-block;" + NL +
aoqi@0 111 " float:left;" + NL +
aoqi@0 112 " background-color:#4D7A97;" + NL +
aoqi@0 113 " height:16px;" + NL +
aoqi@0 114 "}"},
aoqi@0 115 {BUG_ID + FS + "stylesheet.css",
aoqi@0 116 ".memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab {" + NL +
aoqi@0 117 " padding-top:0px;" + NL +
aoqi@0 118 " padding-left:0px;" + NL +
aoqi@0 119 " padding-right:0px;" + NL +
aoqi@0 120 " background-image:none;" + NL +
aoqi@0 121 " float:none;" + NL +
aoqi@0 122 " display:inline;" + NL +
aoqi@0 123 "}"},
aoqi@0 124 {BUG_ID + FS + "stylesheet.css",
aoqi@0 125 "@import url('resources/fonts/dejavu.css');"},
igerasim@2723 126 // Test the formatting styles for proper content display in use and constant values pages.
igerasim@2723 127 {BUG_ID + FS + "stylesheet.css",
igerasim@2723 128 ".overviewSummary td.colFirst, .overviewSummary th.colFirst," + NL +
igerasim@2723 129 ".useSummary td.colFirst, .useSummary th.colFirst," + NL +
igerasim@2723 130 ".overviewSummary td.colOne, .overviewSummary th.colOne," + NL +
igerasim@2723 131 ".memberSummary td.colFirst, .memberSummary th.colFirst," + NL +
igerasim@2723 132 ".memberSummary td.colOne, .memberSummary th.colOne," + NL +
igerasim@2723 133 ".typeSummary td.colFirst{" + NL +
igerasim@2723 134 " width:25%;" + NL +
igerasim@2723 135 " vertical-align:top;" + NL +
igerasim@2723 136 "}"},
igerasim@2723 137 {BUG_ID + FS + "stylesheet.css",
igerasim@2723 138 ".overviewSummary td, .memberSummary td, .typeSummary td," + NL +
igerasim@2723 139 ".useSummary td, .constantsSummary td, .deprecatedSummary td {" + NL +
igerasim@2723 140 " text-align:left;" + NL +
igerasim@2723 141 " padding:0px 0px 12px 10px;" + NL +
igerasim@2723 142 "}"},
aoqi@0 143 // Test whether a link to the stylesheet file is inserted properly
aoqi@0 144 // in the class documentation.
aoqi@0 145 {BUG_ID + FS + "pkg" + FS + "A.html",
aoqi@0 146 "<link rel=\"stylesheet\" type=\"text/css\" " +
aoqi@0 147 "href=\"../stylesheet.css\" title=\"Style\">"}
aoqi@0 148 };
aoqi@0 149 private static final String[][] NEGATED_TEST = {
aoqi@0 150 {BUG_ID + FS + "stylesheet.css",
aoqi@0 151 "* {" + NL + " margin:0;" + NL + " padding:0;" + NL + "}"}
aoqi@0 152 };
aoqi@0 153
aoqi@0 154 /**
aoqi@0 155 * The entry point of the test.
aoqi@0 156 * @param args the array of command line arguments.
aoqi@0 157 */
aoqi@0 158 public static void main(String[] args) {
aoqi@0 159 TestStylesheet tester = new TestStylesheet();
aoqi@0 160 run(tester, ARGS, TEST, NEGATED_TEST);
aoqi@0 161 tester.printSummary();
aoqi@0 162 }
aoqi@0 163
aoqi@0 164 /**
aoqi@0 165 * {@inheritDoc}
aoqi@0 166 */
aoqi@0 167 public String getBugId() {
aoqi@0 168 return BUG_ID;
aoqi@0 169 }
aoqi@0 170
aoqi@0 171 /**
aoqi@0 172 * {@inheritDoc}
aoqi@0 173 */
aoqi@0 174 public String getBugName() {
aoqi@0 175 return getClass().getName();
aoqi@0 176 }
aoqi@0 177 }

mercurial