TestTitleInHref.java revision 3294:9adfb22ff08f
124143Sjoerg/*
224143Sjoerg * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
324143Sjoerg * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
447901Sn_hibma *
524143Sjoerg * This code is free software; you can redistribute it and/or modify it
624143Sjoerg * under the terms of the GNU General Public License version 2 only, as
724143Sjoerg * published by the Free Software Foundation.
824143Sjoerg *
938278Swosch * This code is distributed in the hope that it will be useful, but WITHOUT
1038278Swosch * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1124143Sjoerg * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1224143Sjoerg * version 2 for more details (a copy is included in the LICENSE file that
1324143Sjoerg * accompanied this code).
1447901Sn_hibma *
1524143Sjoerg * You should have received a copy of the GNU General Public License version
1624143Sjoerg * 2 along with this work; if not, write to the Free Software Foundation,
1724143Sjoerg * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1824143Sjoerg *
1924143Sjoerg * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2024143Sjoerg * or visit www.oracle.com if you need additional information or have any
2172951Srwatson * questions.
2224143Sjoerg */
2350477Speter
2424143Sjoerg/*
2524143Sjoerg * @test
2624143Sjoerg * @bug 4714257
2724143Sjoerg * @summary Test to make sure that the title attribute shows up in links.
28131621Sdes * @author jamieh
29131621Sdes * @library ../lib
30131621Sdes * @modules jdk.javadoc/jdk.javadoc.internal.tool
31131621Sdes * @build JavadocTester
32131621Sdes * @run main TestTitleInHref
3324143Sjoerg */
3424143Sjoerg
3524143Sjoergpublic class TestTitleInHref extends JavadocTester {
3624143Sjoerg
3724143Sjoerg    public static void main(String... args) throws Exception {
38131621Sdes        TestTitleInHref tester = new TestTitleInHref();
39131621Sdes        tester.runTests();
40131621Sdes    }
41131626Sdes
42131621Sdes    @Test
43131621Sdes    void test() {
4424143Sjoerg        String uri = "http://java.sun.com/j2se/1.4/docs/api";
45144636Sstefanf        javadoc("-d", "out",
46144636Sstefanf                "-sourcepath", testSrc,
4772951Srwatson                "-linkoffline", uri, testSrc,
48168710Sstas                "pkg");
4924143Sjoerg        checkExit(Exit.OK);
5024143Sjoerg
5124143Sjoerg        checkOutput("pkg/Links.html", true,
5269375Sjhb                //Test to make sure that the title shows up in a class link.
5372951Srwatson                "<a href=\"../pkg/Class.html\" title=\"class in pkg\">",
54175420Speter                //Test to make sure that the title shows up in an interface link.
5524143Sjoerg                "<a href=\"../pkg/Interface.html\" title=\"interface in pkg\">",
5672951Srwatson                //Test to make sure that the title shows up in cross link shows up
57146291Sobrien                "<a href=\"" + uri + "/java/io/File.html?is-external=true\" "
58146291Sobrien                + "title=\"class or interface in java.io\">"
5972951Srwatson                + "<code>This is a cross link to class File</code></a>");
60145073Skeramida    }
6192922Simp}
6227340Speter