langtools/test/com/sun/javadoc/testSubTitle/TestSubTitle.java
changeset 24399 af1a0220d0fa
parent 24072 e7549dcbc4af
child 30730 d3ce7619db2c
equal deleted inserted replaced
24398:601a611d0aee 24399:af1a0220d0fa
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug 7010342
    26  * @bug 7010342
    27  * @summary Test for correct sub title generation.
    27  * @summary Test for correct sub title generation.
    28  * @author Bhavesh Patel
    28  * @author Bhavesh Patel
    29  * @library ../lib/
    29  * @library ../lib
    30  * @build JavadocTester
    30  * @build JavadocTester
    31  * @build TestSubTitle
       
    32  * @run main TestSubTitle
    31  * @run main TestSubTitle
    33  */
    32  */
    34 
    33 
    35 public class TestSubTitle extends JavadocTester {
    34 public class TestSubTitle extends JavadocTester {
    36 
    35 
    37     private static final String[][] TEST = {
    36     public static void main(String... args) throws Exception {
    38         { "pkg/package-summary.html",
    37         TestSubTitle tester = new TestSubTitle();
    39             "<div class=\"block\">This is the description of package pkg.</div>"
    38         tester.runTests();
    40         },
    39     }
    41         { "pkg/C.html",
    40 
    42             "<div class=\"subTitle\">pkg</div>"
    41     @Test
    43         }
    42     void test() {
    44     };
    43         javadoc("-d", "out",
    45     private static final String[][] NEG_TEST = {
    44                 "-sourcepath", testSrc,
    46         { "pkg/package-summary.html",
    45                 "pkg");
       
    46         checkExit(Exit.OK);
       
    47 
       
    48         checkOutput("pkg/package-summary.html", true,
       
    49             "<div class=\"block\">This is the description of package pkg.</div>");
       
    50 
       
    51         checkOutput("pkg/C.html", true,
       
    52             "<div class=\"subTitle\">pkg</div>");
       
    53 
       
    54         checkOutput("pkg/package-summary.html", false,
    47             "<p class=\"subTitle\">\n" +
    55             "<p class=\"subTitle\">\n" +
    48             "<div class=\"block\">This is the " +
    56             "<div class=\"block\">This is the " +
    49             "description of package pkg.</div>\n" +
    57             "description of package pkg.</div>\n" +
    50             "</p>"
    58             "</p>");
    51         },
       
    52         { "pkg/C.html",
       
    53             "<p class=\"subTitle\">pkg</p>"
       
    54         }
       
    55     };
       
    56     private static final String[] ARGS = new String[]{
       
    57         "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"
       
    58     };
       
    59 
    59 
    60     /**
    60         checkOutput("pkg/C.html", false,
    61      * The entry point of the test.
    61             "<p class=\"subTitle\">pkg</p>");
    62      * @param args the array of command line arguments.
       
    63      */
       
    64     public static void main(String[] args) {
       
    65         TestSubTitle tester = new TestSubTitle();
       
    66         tester.run(ARGS, TEST, NEG_TEST);
       
    67         tester.printSummary();
       
    68     }
    62     }
    69 }
    63 }