Wed, 28 Nov 2012 14:07:26 -0800
Merge
1 /*
2 * Copyright (c) 2005, 2011, 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
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";
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:Arial, Helvetica, sans-serif;" + NL +
58 " font-size:76%;" + NL + " margin:0;" + NL + "}"},
59 {BUG_ID + FS + "stylesheet.css",
60 "ul {" + NL + " list-style-type:disc;" + NL + "}"},
61 // Test whether a link to the stylesheet file is inserted properly
62 // in the class documentation.
63 {BUG_ID + FS + "pkg" + FS + "A.html",
64 "<link rel=\"stylesheet\" type=\"text/css\" " +
65 "href=\"../stylesheet.css\" title=\"Style\">"}
66 };
67 private static final String[][] NEGATED_TEST = {
68 {BUG_ID + FS + "stylesheet.css",
69 "* {" + NL + " margin:0;" + NL + " padding:0;" + NL + "}"}
70 };
72 /**
73 * The entry point of the test.
74 * @param args the array of command line arguments.
75 */
76 public static void main(String[] args) {
77 TestStylesheet tester = new TestStylesheet();
78 run(tester, ARGS, TEST, NEGATED_TEST);
79 tester.printSummary();
80 }
82 /**
83 * {@inheritDoc}
84 */
85 public String getBugId() {
86 return BUG_ID;
87 }
89 /**
90 * {@inheritDoc}
91 */
92 public String getBugName() {
93 return getClass().getName();
94 }
95 }