langtools/test/jdk/javadoc/doclet/testNavigation/TestNavigation.java
changeset 36526 3b41f1c69604
parent 35426 374342e56a56
child 36709 f9f252088afa
equal deleted inserted replaced
36525:4caf88912b7f 36526:3b41f1c69604
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug      4131628 4664607 7025314 8023700 7198273 8025633 8026567 8081854
    26  * @bug      4131628 4664607 7025314 8023700 7198273 8025633 8026567 8081854 8150188
    27  * @summary  Make sure the Next/Prev Class links iterate through all types.
    27  * @summary  Make sure the Next/Prev Class links iterate through all types.
    28  *           Make sure the navagation is 2 columns, not 3.
    28  *           Make sure the navagation is 2 columns, not 3.
    29  * @author   jamieh
    29  * @author   jamieh
    30  * @library  ../lib
    30  * @library  ../lib
    31  * @modules jdk.javadoc
    31  * @modules jdk.javadoc/jdk.javadoc.internal.tool
    32  * @build    JavadocTester
    32  * @build    JavadocTester
    33  * @run main TestNavigation
    33  * @run main TestNavigation
    34  */
    34  */
    35 
    35 
    36 public class TestNavigation extends JavadocTester {
    36 public class TestNavigation extends JavadocTester {
    65                 // Test for 4664607
    65                 // Test for 4664607
    66                 "<div class=\"skipNav\"><a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a></div>\n"
    66                 "<div class=\"skipNav\"><a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a></div>\n"
    67                 + "<a name=\"navbar.top.firstrow\">\n"
    67                 + "<a name=\"navbar.top.firstrow\">\n"
    68                 + "<!--   -->\n"
    68                 + "<!--   -->\n"
    69                 + "</a>");
    69                 + "</a>");
       
    70 
       
    71         // Remaining tests check for additional padding to offset the fixed navigation bar.
       
    72         checkOutput("pkg/A.html", true,
       
    73                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
       
    74                 + "</div>\n"
       
    75                 + "<div class=\"navPadding\">&nbsp;</div>\n"
       
    76                 + "<!-- ======== START OF CLASS DATA ======== -->");
       
    77 
       
    78         checkOutput("pkg/package-summary.html", true,
       
    79                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
       
    80                 + "</div>\n"
       
    81                 + "<div class=\"navPadding\">&nbsp;</div>\n"
       
    82                 + "<div class=\"header\">");
       
    83     }
       
    84 
       
    85     // Test for checking additional padding to offset the fixed navigation bar in HTML5.
       
    86     @Test
       
    87     void test1() {
       
    88         javadoc("-d", "out-1", "-html5",
       
    89                 "-sourcepath", testSrc,
       
    90                 "pkg");
       
    91         checkExit(Exit.OK);
       
    92 
       
    93         checkOutput("pkg/A.html", true,
       
    94                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
       
    95                 + "</div>\n"
       
    96                 + "<div class=\"navPadding\">&nbsp;</div>\n"
       
    97                 + "</nav>\n"
       
    98                 + "</header>\n"
       
    99                 + "<!-- ======== START OF CLASS DATA ======== -->");
       
   100 
       
   101         checkOutput("pkg/package-summary.html", true,
       
   102                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
       
   103                 + "</div>\n"
       
   104                 + "<div class=\"navPadding\">&nbsp;</div>\n"
       
   105                 + "</nav>");
       
   106     }
       
   107 
       
   108     // Test to make sure that no extra padding for nav bar gets generated if -nonavbar is specified for HTML4.
       
   109     @Test
       
   110     void test2() {
       
   111         javadoc("-d", "out-2", "-nonavbar",
       
   112                 "-sourcepath", testSrc,
       
   113                 "pkg");
       
   114         checkExit(Exit.OK);
       
   115 
       
   116         checkOutput("pkg/A.html", false,
       
   117                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
       
   118                 + "</div>\n"
       
   119                 + "<div class=\"navPadding\">&nbsp;</div>\n"
       
   120                 + "<!-- ======== START OF CLASS DATA ======== -->");
       
   121 
       
   122         checkOutput("pkg/package-summary.html", false,
       
   123                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
       
   124                 + "</div>\n"
       
   125                 + "<div class=\"navPadding\">&nbsp;</div>\n"
       
   126                 + "<div class=\"header\">");
       
   127     }
       
   128 
       
   129     // Test to make sure that no extra padding for nav bar gets generated if -nonavbar is specified for HTML5.
       
   130     @Test
       
   131     void test3() {
       
   132         javadoc("-d", "out-3", "-html5", "-nonavbar",
       
   133                 "-sourcepath", testSrc,
       
   134                 "pkg");
       
   135         checkExit(Exit.OK);
       
   136 
       
   137         checkOutput("pkg/A.html", false,
       
   138                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
       
   139                 + "</div>\n"
       
   140                 + "<div class=\"navPadding\">&nbsp;</div>\n"
       
   141                 + "</nav>\n"
       
   142                 + "</header>\n"
       
   143                 + "<!-- ======== START OF CLASS DATA ======== -->");
       
   144 
       
   145         checkOutput("pkg/package-summary.html", false,
       
   146                 "<!-- ========= END OF TOP NAVBAR ========= -->\n"
       
   147                 + "</div>\n"
       
   148                 + "<div class=\"navPadding\">&nbsp;</div>\n"
       
   149                 + "</nav>");
    70     }
   150     }
    71 }
   151 }