test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java
author jjg
Mon, 22 Jan 2018 11:15:51 -0800
changeset 48654 36f58bd6269f
parent 47748 dfc709c80775
child 49139 771616d26ca1
permissions -rw-r--r--
8195796: Reduce the size of relative URLs in generated docs Reviewed-by: ksrini
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19254
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
     1
/*
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47748
diff changeset
     2
 * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
19254
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
     4
 *
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
     7
 * published by the Free Software Foundation.
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
     8
 *
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    13
 * accompanied this code).
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    14
 *
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    18
 *
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    21
 * questions.
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    22
 */
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    23
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    24
/*
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    25
 * @test
47748
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
    26
 * @bug      4749567 8071982 8175200 8186332 8185371
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
    27
 * @summary  Test the output for -header, -footer, -nooverview, -nodeprecatedlist, -nonavbar, -notree,
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
    28
 *           -stylesheetfile, --main-stylesheet, --add-stylesheet options.
19254
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    29
 * @author   Bhavesh Patel
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    30
 * @library  ../lib
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    31
 * @modules jdk.javadoc/jdk.javadoc.internal.tool
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    32
 * @build    JavadocTester
19254
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    33
 * @run main TestOptions
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    34
 */
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    35
36705
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    36
import java.io.File;
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    37
19254
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    38
public class TestOptions extends JavadocTester {
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    39
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    40
    public static void main(String... args) throws Exception {
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    41
        TestOptions tester = new TestOptions();
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    42
        tester.runTests();
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    43
    }
19254
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    44
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    45
    @Test
36705
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    46
    void testHeaderFooter() {
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    47
        javadoc("-d", "out-1",
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    48
                "-header", "Test header",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    49
                "-footer", "Test footer",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    50
                "-sourcepath", testSrc,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    51
                "pkg");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    52
        checkExit(Exit.OK);
19254
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    53
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    54
        checkOutput("pkg/package-summary.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    55
                "<div class=\"aboutLanguage\">Test header</div>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    56
                "<div class=\"aboutLanguage\">Test footer</div>");
19254
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
    57
    }
36705
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    58
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    59
    @Test
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    60
    void testNoOverview() {
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    61
        javadoc("-d", "out-4",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    62
                "-nooverview",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    63
                "-sourcepath", testSrc,
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    64
                "pkg", "deprecated");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    65
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    66
        checkExit(Exit.OK);
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    67
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    68
        checkFiles(false, "overview-summary.html");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    69
    }
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    70
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    71
    @Test
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    72
    void testNoDeprecatedList() {
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    73
        javadoc("-d", "out-5",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    74
                "-nodeprecatedlist",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    75
                "-sourcepath", testSrc,
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    76
                "deprecated");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    77
        checkExit(Exit.OK);
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    78
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    79
        checkFiles(false, "deprecated-list.html");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    80
    }
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    81
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    82
    @Test
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    83
    void testNoNavbar() {
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    84
        javadoc("-d", "out-6",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    85
                "-nonavbar",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    86
                "-bottom", "Bottom text",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    87
                "-sourcepath", testSrc,
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    88
                "pkg");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    89
        checkExit(Exit.OK);
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    90
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    91
        checkOutput("pkg/Foo.html", false, "navbar");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    92
        checkOutput("pkg/Foo.html", true, "Bottom text");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    93
    }
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    94
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    95
    @Test
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    96
    void testNoTree() {
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    97
        javadoc("-d", "out-7",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    98
                "-notree",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
    99
                "-sourcepath", testSrc,
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   100
                "pkg");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   101
        checkExit(Exit.OK);
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   102
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   103
        checkFiles(false, "overview-tree.html");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   104
        checkFiles(false, "pkg/package-tree.html");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   105
        checkOutput("pkg/Foo.html", false, "<li><a href=\"package-tree.html\">Tree</a></li>");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   106
    }
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   107
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   108
    @Test
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   109
    void testStylesheetFile() {
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   110
        javadoc("-d", "out-8",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   111
                "-stylesheetfile", new File(testSrc, "custom-stylesheet.css").getAbsolutePath(),
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   112
                "-sourcepath", testSrc,
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   113
                "pkg");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   114
        checkExit(Exit.OK);
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   115
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   116
        checkOutput("custom-stylesheet.css", true, "Custom javadoc style sheet");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   117
        checkOutput("pkg/Foo.html", true, "<link rel=\"stylesheet\" type=\"text/css\" "
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   118
                + "href=\"../custom-stylesheet.css\" title=\"Style\">");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   119
    }
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   120
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   121
    @Test
47748
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   122
    void testStylesheetFileAltOption() {
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   123
        javadoc("-d", "out-stylesheet-file",
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   124
                "--main-stylesheet", new File(testSrc, "custom-stylesheet.css").getAbsolutePath(),
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   125
                "-sourcepath", testSrc,
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   126
                "pkg");
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   127
        checkExit(Exit.OK);
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   128
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   129
        checkOutput("custom-stylesheet.css", true, "Custom javadoc style sheet");
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   130
        checkOutput("pkg/Foo.html", true, "<link rel=\"stylesheet\" type=\"text/css\" "
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   131
                + "href=\"../custom-stylesheet.css\" title=\"Style\">");
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   132
    }
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   133
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   134
    @Test
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   135
    void testAdditionalStylesheetFile() {
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   136
        javadoc("-d", "out-additional-css",
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   137
                "--add-stylesheet", new File(testSrc, "additional-stylesheet-1.css").getAbsolutePath(),
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   138
                "--add-stylesheet", new File(testSrc, "additional-stylesheet-2.css").getAbsolutePath(),
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   139
                "--add-stylesheet", new File(testSrc, "additional-stylesheet-3.css").getAbsolutePath(),
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   140
                "-sourcepath", testSrc,
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   141
                "pkg");
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   142
        checkExit(Exit.OK);
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   143
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   144
        checkOutput("additional-stylesheet-1.css", true, "Additional javadoc style sheet 1");
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   145
        checkOutput("additional-stylesheet-2.css", true, "Additional javadoc style sheet 2");
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   146
        checkOutput("additional-stylesheet-3.css", true, "Additional javadoc style sheet 3");
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   147
        checkOutput("pkg/Foo.html", true,
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   148
                "<link rel=\"stylesheet\" type=\"text/css\" href=\"../additional-stylesheet-1.css\" title=\"Style\">\n"
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   149
                + "<link rel=\"stylesheet\" type=\"text/css\" href=\"../additional-stylesheet-2.css\" title=\"Style\">\n"
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   150
                + "<link rel=\"stylesheet\" type=\"text/css\" href=\"../additional-stylesheet-3.css\" title=\"Style\">");
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   151
    }
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   152
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   153
    @Test
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   154
    void testInvalidStylesheetFile() {
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   155
        javadoc("-d", "out-invalid-css",
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   156
                "--main-stylesheet", new File(testSrc, "custom-stylesheet-1.css").getAbsolutePath(),
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   157
                "-sourcepath", testSrc,
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   158
                "pkg");
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   159
        checkExit(Exit.ERROR);
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   160
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   161
        checkOutput(Output.OUT, true,
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   162
                "javadoc: error - File not found:",
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   163
                "custom-stylesheet-1.css");
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   164
    }
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   165
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   166
    @Test
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   167
    void testInvalidAdditionalStylesheetFiles() {
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   168
        javadoc("-d", "out-invalid-additional-css",
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   169
                "--add-stylesheet", new File(testSrc, "additional-stylesheet-4.css").getAbsolutePath(),
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   170
                "-sourcepath", testSrc,
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   171
                "pkg");
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   172
        checkExit(Exit.ERROR);
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   173
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   174
        checkOutput(Output.OUT, true,
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   175
                "javadoc: error - File not found:",
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   176
                "additional-stylesheet-4.css");
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   177
    }
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   178
dfc709c80775 8185371: Support for multiple stylesheets in javadoc
bpatel
parents: 47284
diff changeset
   179
    @Test
36705
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   180
    void testLinkSource() {
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   181
        javadoc("-d", "out-9",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   182
                "-linksource",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   183
                "-javafx",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   184
                "-sourcepath", testSrc,
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   185
                "-package",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   186
                "linksource");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   187
        checkExit(Exit.OK);
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   188
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   189
        checkOutput("linksource/AnnotationTypeField.html", true,
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   190
                "<pre>@Documented\npublic @interface <a href="
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   191
                + "\"../src-html/linksource/AnnotationTypeField.html#line.31\">"
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   192
                + "AnnotationTypeField</a></pre>",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   193
                "<h4>DEFAULT_NAME</h4>\n<pre>static final&nbsp;java.lang.String&nbsp;"
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   194
                + "<a href=\"../src-html/linksource/AnnotationTypeField.html#line.32\">"
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   195
                + "DEFAULT_NAME</a></pre>",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   196
                "<h4>name</h4>\n<pre>java.lang.String&nbsp;<a href="
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   197
                + "\"../src-html/linksource/AnnotationTypeField.html#line.34\">name</a></pre>");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   198
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   199
        checkOutput("src-html/linksource/AnnotationTypeField.html", true,
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   200
                "<title>Source code</title>",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   201
                "<span class=\"sourceLineNo\">031</span><a name=\"line.31\">"
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   202
                + "@Documented public @interface AnnotationTypeField {</a>");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   203
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   204
        checkOutput("linksource/Properties.html", true,
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   205
                "<pre>public class <a href=\"../src-html/linksource/Properties.html#line.29\">"
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   206
                + "Properties</a>",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   207
                "<pre>public&nbsp;java.lang.Object <a href="
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   208
                + "\"../src-html/linksource/Properties.html#line.31\">someProperty</a></pre>",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   209
                "<pre>public&nbsp;java.lang.Object&nbsp;<a href="
47284
355349babaf4 8186332: Fix method signature in method summary table
bpatel
parents: 47216
diff changeset
   210
                + "\"../src-html/linksource/Properties.html#line.31\">someProperty</a>()</pre>");
36705
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   211
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   212
        checkOutput("src-html/linksource/Properties.html", true,
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   213
                "<title>Source code</title>",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   214
                "<span class=\"sourceLineNo\">031</span><a name=\"line.31\">    "
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   215
                + "public Object someProperty() {</a>");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   216
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   217
        checkOutput("linksource/SomeClass.html", true,
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   218
                "<pre>public class <a href=\"../src-html/linksource/SomeClass.html#line.29\">"
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   219
                + "SomeClass</a>\nextends java.lang.Object</pre>",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   220
                "<pre>public&nbsp;int <a href=\"../src-html/linksource/SomeClass.html#line.31\">"
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   221
                + "field</a></pre>",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   222
                "<pre>public&nbsp;<a href=\"../src-html/linksource/SomeClass.html#line.33\">"
47284
355349babaf4 8186332: Fix method signature in method summary table
bpatel
parents: 47216
diff changeset
   223
                + "SomeClass</a>()</pre>",
36705
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   224
                "<pre>public&nbsp;int&nbsp;<a href=\"../src-html/linksource/SomeClass.html#line.36\">"
47284
355349babaf4 8186332: Fix method signature in method summary table
bpatel
parents: 47216
diff changeset
   225
                + "method</a>()</pre>");
36705
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   226
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   227
        checkOutput("src-html/linksource/SomeClass.html", true,
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   228
                "<title>Source code</title>",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   229
                "<span class=\"sourceLineNo\">029</span><a name=\"line.29\">"
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   230
                + "public class SomeClass {</a>",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   231
                "<span class=\"sourceLineNo\">031</span><a name=\"line.31\">    "
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   232
                + "public int field;</a>",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   233
                "<span class=\"sourceLineNo\">033</span><a name=\"line.33\">    "
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   234
                + "public SomeClass() {</a>",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   235
                "<span class=\"sourceLineNo\">036</span><a name=\"line.36\">    "
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   236
                + "public int method() {</a>");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   237
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   238
        checkOutput("linksource/SomeEnum.html", true,
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47748
diff changeset
   239
                "<pre>public static final&nbsp;<a href=\"SomeEnum.html\" "
36705
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   240
                + "title=\"enum in linksource\">SomeEnum</a> <a href="
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   241
                + "\"../src-html/linksource/SomeEnum.html#line.29\">VALUE1</a></pre>",
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47748
diff changeset
   242
                "<pre>public static final&nbsp;<a href=\"SomeEnum.html\" "
36705
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   243
                + "title=\"enum in linksource\">SomeEnum</a> <a href="
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   244
                + "\"../src-html/linksource/SomeEnum.html#line.30\">VALUE2</a></pre>");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   245
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   246
        checkOutput("src-html/linksource/SomeEnum.html", true,
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   247
                "<span class=\"sourceLineNo\">029</span><a name=\"line.29\">    VALUE1,</a>",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   248
                "<span class=\"sourceLineNo\">030</span><a name=\"line.30\">    VALUE2</a>");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   249
    }
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   250
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   251
    @Test
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   252
    void testNoQualifier() {
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   253
        javadoc("-d", "out-10",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   254
                "-noqualifier", "pkg",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   255
                "-sourcepath", testSrc,
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   256
                "pkg", "deprecated");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   257
        checkExit(Exit.OK);
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   258
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   259
        checkOutput("pkg/Foo.html", true,
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   260
                "<li>Foo</li>");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   261
        checkOutput("deprecated/Foo.html", true,
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   262
                "<li>deprecated.Foo</li>");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   263
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   264
        javadoc("-d", "out-10a",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   265
                "-noqualifier", "all",
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   266
                "-sourcepath", testSrc,
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   267
                "pkg", "deprecated");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   268
        checkExit(Exit.OK);
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   269
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   270
        checkOutput("pkg/Foo.html", true,
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   271
                "<li>Foo</li>");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   272
        checkOutput("deprecated/Foo.html", true,
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   273
                "<li>Foo</li>");
890c250d8da8 8071982: Update tests for revamped Doclet API
ksrini
parents: 35426
diff changeset
   274
    }
19254
0988183c8164 4749567: stddoclet: Add CSS style for setting header/footer to be italic
bpatel
parents:
diff changeset
   275
}