langtools/test/com/sun/javadoc/testTitleInHref/TestTitleInHref.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 4714257
    26  * @bug 4714257
    27  * @summary Test to make sure that the title attribute shows up in links.
    27  * @summary Test to make sure that the title attribute shows up in links.
    28  * @author jamieh
    28  * @author jamieh
    29  * @library ../lib/
    29  * @library ../lib
    30  * @build JavadocTester
    30  * @build JavadocTester
    31  * @build TestTitleInHref
       
    32  * @run main TestTitleInHref
    31  * @run main TestTitleInHref
    33  */
    32  */
    34 
    33 
    35 public class TestTitleInHref extends JavadocTester {
    34 public class TestTitleInHref extends JavadocTester {
    36 
    35 
    37     private static final String[][] TEST = {
    36     public static void main(String... args) throws Exception {
    38         //Test to make sure that the title shows up in a class link.
    37         TestTitleInHref tester = new TestTitleInHref();
    39         { "pkg/Links.html",
    38         tester.runTests();
    40             "<a href=\"../pkg/Class.html\" title=\"class in pkg\">"},
    39     }
    41 
    40 
    42         //Test to make sure that the title shows up in an interface link.
    41     @Test
    43         { "pkg/Links.html",
    42     void test() {
    44             "<a href=\"../pkg/Interface.html\" title=\"interface in pkg\">"},
    43         String uri = "http://java.sun.com/j2se/1.4/docs/api";
       
    44         javadoc("-d", "out",
       
    45                 "-sourcepath", testSrc,
       
    46                 "-linkoffline", uri, testSrc,
       
    47                 "pkg");
       
    48         checkExit(Exit.OK);
    45 
    49 
    46         //Test to make sure that the title shows up in cross link shows up
    50         checkOutput("pkg/Links.html", true,
    47         { "pkg/Links.html",
    51                 //Test to make sure that the title shows up in a class link.
    48             "<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/io/File.html?is-external=true\" title=\"class or interface in java.io\"><code>This is a cross link to class File</code></a>"},
    52                 "<a href=\"../pkg/Class.html\" title=\"class in pkg\">",
    49 
    53                 //Test to make sure that the title shows up in an interface link.
    50     };
    54                 "<a href=\"../pkg/Interface.html\" title=\"interface in pkg\">",
    51 
    55                 //Test to make sure that the title shows up in cross link shows up
    52     private static final String[] ARGS = new String[] {
    56                 "<a href=\"" + uri + "/java/io/File.html?is-external=true\" "
    53         "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR,
    57                 + "title=\"class or interface in java.io\">"
    54         "-linkoffline", "http://java.sun.com/j2se/1.4/docs/api",
    58                 + "<code>This is a cross link to class File</code></a>");
    55         SRC_DIR, "pkg"
       
    56     };
       
    57 
       
    58     /**
       
    59      * The entry point of the test.
       
    60      * @param args the array of command line arguments.
       
    61      */
       
    62     public static void main(String[] args) {
       
    63         TestTitleInHref tester = new TestTitleInHref();
       
    64         tester.run(ARGS, TEST, NO_TEST);
       
    65         tester.printSummary();
       
    66     }
    59     }
    67 }
    60 }