Wed, 27 Apr 2016 01:34:52 +0800
Initial load
http://hg.openjdk.java.net/jdk8u/jdk8u/langtools/
changeset: 2573:53ca196be1ae
tag: jdk8u25-b17
1 /*
2 * Copyright (c) 2005, 2013, 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 4494033 7028815 7052425 8007338 8023608 8008164 8016549
27 * @summary Run tests on doclet stylesheet.
28 * @author jamieh
29 * @library ../lib/
30 * @build JavadocTester TestStylesheet
31 * @run main TestStylesheet
32 */
34 public class TestStylesheet extends JavadocTester {
36 //Test information.
37 private static final String BUG_ID = "4494033-7028815-7052425-8007338";
39 //Javadoc arguments.
40 private static final String[] ARGS = new String[] {
41 "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
42 };
44 //Input for string search tests.
45 private static final String[][] TEST = {
46 {BUG_ID + FS + "stylesheet.css",
47 "/* Javadoc style sheet */"},
48 {BUG_ID + FS + "stylesheet.css",
49 "/*" + NL + "Overall document style" + NL + "*/"},
50 {BUG_ID + FS + "stylesheet.css",
51 "/*" + NL + "Heading styles" + NL + "*/"},
52 {BUG_ID + FS + "stylesheet.css",
53 "/*" + NL + "Navigation bar styles" + NL + "*/"},
54 {BUG_ID + FS + "stylesheet.css",
55 "body {" + NL + " background-color:#ffffff;" + NL +
56 " color:#353833;" + NL +
57 " font-family:'DejaVu Sans', Arial, Helvetica, sans-serif;" + NL +
58 " font-size:14px;" + NL + " margin:0;" + NL + "}"},
59 {BUG_ID + FS + "stylesheet.css",
60 "ul {" + NL + " list-style-type:disc;" + NL + "}"},
61 {BUG_ID + FS + "stylesheet.css",
62 ".overviewSummary caption, .memberSummary caption, .typeSummary caption," + NL +
63 ".useSummary caption, .constantsSummary caption, .deprecatedSummary caption {" + NL +
64 " position:relative;" + NL +
65 " text-align:left;" + NL +
66 " background-repeat:no-repeat;" + NL +
67 " color:#253441;" + NL +
68 " font-weight:bold;" + NL +
69 " clear:none;" + NL +
70 " overflow:hidden;" + NL +
71 " padding:0px;" + NL +
72 " padding-top:10px;" + NL +
73 " padding-left:1px;" + NL +
74 " margin:0px;" + NL +
75 " white-space:pre;" + NL +
76 "}"},
77 {BUG_ID + FS + "stylesheet.css",
78 ".overviewSummary caption span, .memberSummary caption span, .typeSummary caption span," + NL +
79 ".useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span {" + NL +
80 " white-space:nowrap;" + NL +
81 " padding-top:5px;" + NL +
82 " padding-left:12px;" + NL +
83 " padding-right:12px;" + NL +
84 " padding-bottom:7px;" + NL +
85 " display:inline-block;" + NL +
86 " float:left;" + NL +
87 " background-color:#F8981D;" + NL +
88 " border: none;" + NL +
89 " height:16px;" + NL +
90 "}"},
91 {BUG_ID + FS + "stylesheet.css",
92 ".memberSummary caption span.activeTableTab span {" + NL +
93 " white-space:nowrap;" + NL +
94 " padding-top:5px;" + NL +
95 " padding-left:12px;" + NL +
96 " padding-right:12px;" + NL +
97 " margin-right:3px;" + NL +
98 " display:inline-block;" + NL +
99 " float:left;" + NL +
100 " background-color:#F8981D;" + NL +
101 " height:16px;" + NL +
102 "}"},
103 {BUG_ID + FS + "stylesheet.css",
104 ".memberSummary caption span.tableTab span {" + NL +
105 " white-space:nowrap;" + NL +
106 " padding-top:5px;" + NL +
107 " padding-left:12px;" + NL +
108 " padding-right:12px;" + NL +
109 " margin-right:3px;" + NL +
110 " display:inline-block;" + NL +
111 " float:left;" + NL +
112 " background-color:#4D7A97;" + NL +
113 " height:16px;" + NL +
114 "}"},
115 {BUG_ID + FS + "stylesheet.css",
116 ".memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab {" + NL +
117 " padding-top:0px;" + NL +
118 " padding-left:0px;" + NL +
119 " padding-right:0px;" + NL +
120 " background-image:none;" + NL +
121 " float:none;" + NL +
122 " display:inline;" + NL +
123 "}"},
124 {BUG_ID + FS + "stylesheet.css",
125 "@import url('resources/fonts/dejavu.css');"},
126 // Test whether a link to the stylesheet file is inserted properly
127 // in the class documentation.
128 {BUG_ID + FS + "pkg" + FS + "A.html",
129 "<link rel=\"stylesheet\" type=\"text/css\" " +
130 "href=\"../stylesheet.css\" title=\"Style\">"}
131 };
132 private static final String[][] NEGATED_TEST = {
133 {BUG_ID + FS + "stylesheet.css",
134 "* {" + NL + " margin:0;" + NL + " padding:0;" + NL + "}"}
135 };
137 /**
138 * The entry point of the test.
139 * @param args the array of command line arguments.
140 */
141 public static void main(String[] args) {
142 TestStylesheet tester = new TestStylesheet();
143 run(tester, ARGS, TEST, NEGATED_TEST);
144 tester.printSummary();
145 }
147 /**
148 * {@inheritDoc}
149 */
150 public String getBugId() {
151 return BUG_ID;
152 }
154 /**
155 * {@inheritDoc}
156 */
157 public String getBugName() {
158 return getClass().getName();
159 }
160 }