langtools/test/com/sun/javadoc/testNavigation/TestNavigation.java
author alanb
Thu, 17 Mar 2016 19:04:28 +0000
changeset 36526 3b41f1c69604
parent 31297 86fe1414f12c
permissions -rw-r--r--
8142968: Module System implementation Summary: Initial integration of JEP 200, JEP 260, JEP 261, and JEP 282 Reviewed-by: jjg, jlahoda, vromero, mcimadamore, bpatel, ksrini, darcy, anazarov, dfuchs Contributed-by: alan.bateman@oracle.com, alex.buckley@oracle.com, jonathan.gibbons@oracle.com, karen.kinnear@oracle.com, mandy.chung@oracle.com, mark.reinhold@oracle.com, jan.lahoda@oracle.com, vicente.romero@oracle.com, andreas.lundblad@oracle.com, andrey.x.nazarov@oracle.com, chris.hegarty@oracle.com, erik.joelsson@oracle.com, kumar.x.srinivasan@oracle.com, sundararajan.athijegannathan@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
     2
 * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
06bc494ca11e Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2985
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2985
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2985
diff changeset
    21
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
/*
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
 * @test
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    26
 * @bug      4131628 4664607 7025314 8023700 7198273 8025633 8026567 8081854 8150188
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
 * @summary  Make sure the Next/Prev Class links iterate through all types.
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
 *           Make sure the navagation is 2 columns, not 3.
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
 * @author   jamieh
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    30
 * @library  ../lib
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 29957
diff changeset
    31
 * @modules jdk.javadoc
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    32
 * @build    JavadocTester
19659
51324d86f628 8023701: Fix badly named test
jjg
parents: 9067
diff changeset
    33
 * @run main TestNavigation
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
19659
51324d86f628 8023701: Fix badly named test
jjg
parents: 9067
diff changeset
    36
public class TestNavigation extends JavadocTester {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    38
    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
    39
        TestNavigation tester = new TestNavigation();
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    40
        tester.runTests();
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    41
    }
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    42
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    43
    @Test
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    44
    void test() {
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    45
        javadoc("-d", "out",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    46
                "-sourcepath", testSrc,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    47
                "pkg");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    48
        checkExit(Exit.OK);
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    49
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    50
        checkOutput("pkg/A.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    51
                "<li>Prev&nbsp;Class</li>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    52
                "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>");
10
06bc494ca11e Initial load
duke
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/C.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    55
                "<a href=\"../pkg/A.html\" title=\"annotation in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    56
                "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    57
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    58
        checkOutput("pkg/E.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    59
                "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    60
                "<a href=\"../pkg/I.html\" title=\"interface in pkg\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a>");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    62
        checkOutput("pkg/I.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    63
                "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    64
                "<li>Next&nbsp;Class</li>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    65
                // Test for 4664607
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    66
                "<div class=\"skipNav\"><a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a></div>\n"
31297
86fe1414f12c 8081854: Javadoc should generate named anchors for HTML4 output
bpatel
parents: 30730
diff changeset
    67
                + "<a name=\"navbar.top.firstrow\">\n"
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    68
                + "<!--   -->\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    69
                + "</a>");
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    70
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    71
        // Remaining tests check for additional padding to offset the fixed navigation bar.
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    72
        checkOutput("pkg/A.html", true,
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    73
                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    74
                + "</div>\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    75
                + "<div class=\"navPadding\">&nbsp;</div>\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    76
                + "<!-- ======== START OF CLASS DATA ======== -->");
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    77
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    78
        checkOutput("pkg/package-summary.html", true,
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    79
                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    80
                + "</div>\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    81
                + "<div class=\"navPadding\">&nbsp;</div>\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    82
                + "<div class=\"header\">");
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    83
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    84
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    85
    // Test for checking additional padding to offset the fixed navigation bar in HTML5.
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    86
    @Test
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    87
    void test1() {
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    88
        javadoc("-d", "out-1", "-html5",
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    89
                "-sourcepath", testSrc,
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    90
                "pkg");
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    91
        checkExit(Exit.OK);
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    92
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    93
        checkOutput("pkg/A.html", true,
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    94
                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    95
                + "</div>\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    96
                + "<div class=\"navPadding\">&nbsp;</div>\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    97
                + "</nav>\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    98
                + "</header>\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
    99
                + "<!-- ======== START OF CLASS DATA ======== -->");
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   100
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   101
        checkOutput("pkg/package-summary.html", true,
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   102
                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   103
                + "</div>\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   104
                + "<div class=\"navPadding\">&nbsp;</div>\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   105
                + "</nav>");
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   106
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   107
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   108
    // Test to make sure that no extra padding for nav bar gets generated if -nonavbar is specified for HTML4.
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   109
    @Test
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   110
    void test2() {
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   111
        javadoc("-d", "out-2", "-nonavbar",
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   112
                "-sourcepath", testSrc,
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   113
                "pkg");
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   114
        checkExit(Exit.OK);
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   115
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   116
        checkOutput("pkg/A.html", false,
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   117
                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   118
                + "</div>\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   119
                + "<div class=\"navPadding\">&nbsp;</div>\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   120
                + "<!-- ======== START OF CLASS DATA ======== -->");
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   121
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   122
        checkOutput("pkg/package-summary.html", false,
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   123
                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   124
                + "</div>\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   125
                + "<div class=\"navPadding\">&nbsp;</div>\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   126
                + "<div class=\"header\">");
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   127
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   128
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   129
    // Test to make sure that no extra padding for nav bar gets generated if -nonavbar is specified for HTML5.
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   130
    @Test
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   131
    void test3() {
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   132
        javadoc("-d", "out-3", "-html5", "-nonavbar",
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   133
                "-sourcepath", testSrc,
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   134
                "pkg");
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   135
        checkExit(Exit.OK);
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   136
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   137
        checkOutput("pkg/A.html", false,
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   138
                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   139
                + "</div>\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   140
                + "<div class=\"navPadding\">&nbsp;</div>\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   141
                + "</nav>\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   142
                + "</header>\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   143
                + "<!-- ======== START OF CLASS DATA ======== -->");
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   144
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   145
        checkOutput("pkg/package-summary.html", false,
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   146
                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   147
                + "</div>\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   148
                + "<div class=\"navPadding\">&nbsp;</div>\n"
3b41f1c69604 8142968: Module System implementation
alanb
parents: 31297
diff changeset
   149
                + "</nav>");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
}