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

changeset 0
959103a6100f
child 2525
2eb010b6cb22
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/com/sun/javadoc/testStylesheet/TestStylesheet.java	Wed Apr 27 01:34:52 2016 +0800
     1.3 @@ -0,0 +1,160 @@
     1.4 +/*
     1.5 + * Copyright (c) 2005, 2013, 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      4494033 7028815 7052425 8007338 8023608 8008164 8016549
    1.30 + * @summary  Run tests on doclet stylesheet.
    1.31 + * @author   jamieh
    1.32 + * @library  ../lib/
    1.33 + * @build    JavadocTester TestStylesheet
    1.34 + * @run main TestStylesheet
    1.35 + */
    1.36 +
    1.37 +public class TestStylesheet extends JavadocTester {
    1.38 +
    1.39 +    //Test information.
    1.40 +    private static final String BUG_ID = "4494033-7028815-7052425-8007338";
    1.41 +
    1.42 +    //Javadoc arguments.
    1.43 +    private static final String[] ARGS = new String[] {
    1.44 +        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
    1.45 +    };
    1.46 +
    1.47 +    //Input for string search tests.
    1.48 +    private static final String[][] TEST = {
    1.49 +        {BUG_ID + FS + "stylesheet.css",
    1.50 +            "/* Javadoc style sheet */"},
    1.51 +        {BUG_ID + FS + "stylesheet.css",
    1.52 +            "/*" + NL + "Overall document style" + NL + "*/"},
    1.53 +        {BUG_ID + FS + "stylesheet.css",
    1.54 +            "/*" + NL + "Heading styles" + NL + "*/"},
    1.55 +        {BUG_ID + FS + "stylesheet.css",
    1.56 +            "/*" + NL + "Navigation bar styles" + NL + "*/"},
    1.57 +        {BUG_ID + FS + "stylesheet.css",
    1.58 +            "body {" + NL + "    background-color:#ffffff;" + NL +
    1.59 +            "    color:#353833;" + NL +
    1.60 +            "    font-family:'DejaVu Sans', Arial, Helvetica, sans-serif;" + NL +
    1.61 +            "    font-size:14px;" + NL + "    margin:0;" + NL + "}"},
    1.62 +        {BUG_ID + FS + "stylesheet.css",
    1.63 +            "ul {" + NL + "    list-style-type:disc;" + NL + "}"},
    1.64 +        {BUG_ID + FS + "stylesheet.css",
    1.65 +            ".overviewSummary caption, .memberSummary caption, .typeSummary caption," + NL +
    1.66 +            ".useSummary caption, .constantsSummary caption, .deprecatedSummary caption {" + NL +
    1.67 +            "    position:relative;" + NL +
    1.68 +            "    text-align:left;" + NL +
    1.69 +            "    background-repeat:no-repeat;" + NL +
    1.70 +            "    color:#253441;" + NL +
    1.71 +            "    font-weight:bold;" + NL +
    1.72 +            "    clear:none;" + NL +
    1.73 +            "    overflow:hidden;" + NL +
    1.74 +            "    padding:0px;" + NL +
    1.75 +            "    padding-top:10px;" + NL +
    1.76 +            "    padding-left:1px;" + NL +
    1.77 +            "    margin:0px;" + NL +
    1.78 +            "    white-space:pre;" + NL +
    1.79 +            "}"},
    1.80 +        {BUG_ID + FS + "stylesheet.css",
    1.81 +            ".overviewSummary caption span, .memberSummary caption span, .typeSummary caption span," + NL +
    1.82 +            ".useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span {" + NL +
    1.83 +            "    white-space:nowrap;" + NL +
    1.84 +            "    padding-top:5px;" + NL +
    1.85 +            "    padding-left:12px;" + NL +
    1.86 +            "    padding-right:12px;" + NL +
    1.87 +            "    padding-bottom:7px;" + NL +
    1.88 +            "    display:inline-block;" + NL +
    1.89 +            "    float:left;" + NL +
    1.90 +            "    background-color:#F8981D;" + NL +
    1.91 +            "    border: none;" + NL +
    1.92 +            "    height:16px;" + NL +
    1.93 +            "}"},
    1.94 +        {BUG_ID + FS + "stylesheet.css",
    1.95 +            ".memberSummary caption span.activeTableTab span {" + NL +
    1.96 +            "    white-space:nowrap;" + NL +
    1.97 +            "    padding-top:5px;" + NL +
    1.98 +            "    padding-left:12px;" + NL +
    1.99 +            "    padding-right:12px;" + NL +
   1.100 +            "    margin-right:3px;" + NL +
   1.101 +            "    display:inline-block;" + NL +
   1.102 +            "    float:left;" + NL +
   1.103 +            "    background-color:#F8981D;" + NL +
   1.104 +            "    height:16px;" + NL +
   1.105 +            "}"},
   1.106 +        {BUG_ID + FS + "stylesheet.css",
   1.107 +            ".memberSummary caption span.tableTab span {" + NL +
   1.108 +            "    white-space:nowrap;" + NL +
   1.109 +            "    padding-top:5px;" + NL +
   1.110 +            "    padding-left:12px;" + NL +
   1.111 +            "    padding-right:12px;" + NL +
   1.112 +            "    margin-right:3px;" + NL +
   1.113 +            "    display:inline-block;" + NL +
   1.114 +            "    float:left;" + NL +
   1.115 +            "    background-color:#4D7A97;" + NL +
   1.116 +            "    height:16px;" + NL +
   1.117 +            "}"},
   1.118 +        {BUG_ID + FS + "stylesheet.css",
   1.119 +            ".memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab {" + NL +
   1.120 +            "    padding-top:0px;" + NL +
   1.121 +            "    padding-left:0px;" + NL +
   1.122 +            "    padding-right:0px;" + NL +
   1.123 +            "    background-image:none;" + NL +
   1.124 +            "    float:none;" + NL +
   1.125 +            "    display:inline;" + NL +
   1.126 +            "}"},
   1.127 +        {BUG_ID + FS + "stylesheet.css",
   1.128 +            "@import url('resources/fonts/dejavu.css');"},
   1.129 +        // Test whether a link to the stylesheet file is inserted properly
   1.130 +        // in the class documentation.
   1.131 +        {BUG_ID + FS + "pkg" + FS + "A.html",
   1.132 +            "<link rel=\"stylesheet\" type=\"text/css\" " +
   1.133 +            "href=\"../stylesheet.css\" title=\"Style\">"}
   1.134 +    };
   1.135 +    private static final String[][] NEGATED_TEST = {
   1.136 +        {BUG_ID + FS + "stylesheet.css",
   1.137 +            "* {" + NL + "    margin:0;" + NL + "    padding:0;" + NL + "}"}
   1.138 +    };
   1.139 +
   1.140 +    /**
   1.141 +     * The entry point of the test.
   1.142 +     * @param args the array of command line arguments.
   1.143 +     */
   1.144 +    public static void main(String[] args) {
   1.145 +        TestStylesheet tester = new TestStylesheet();
   1.146 +        run(tester, ARGS, TEST, NEGATED_TEST);
   1.147 +        tester.printSummary();
   1.148 +    }
   1.149 +
   1.150 +    /**
   1.151 +     * {@inheritDoc}
   1.152 +     */
   1.153 +    public String getBugId() {
   1.154 +        return BUG_ID;
   1.155 +    }
   1.156 +
   1.157 +    /**
   1.158 +     * {@inheritDoc}
   1.159 +     */
   1.160 +    public String getBugName() {
   1.161 +        return getClass().getName();
   1.162 +    }
   1.163 +}

mercurial