TestSeeTag.java revision 3233:b5d08bc0d224
1/*
2 * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24/*
25 * @test
26 * @bug      8017191
27 * @summary  Javadoc is confused by at-link to imported classes outside of the set of generated packages
28 * @author   jjg
29 * @library  ../lib
30 * @modules jdk.javadoc
31 * @build    JavadocTester
32 * @run main TestSeeTag
33 */
34
35public class TestSeeTag extends JavadocTester {
36
37    public static void main(String... args) throws Exception {
38        TestSeeTag tester = new TestSeeTag();
39        tester.runTests();
40    }
41
42    @Test
43    void test() {
44        javadoc("-d", "out",
45                "-sourcepath", testSrc,
46                "pkg");
47        checkExit(Exit.OK);
48
49        checkOutput("pkg/Test.html", true,
50            "<code>List</code>",
51            "<dl>\n"
52            + "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
53            + "<dd><a href=\"../pkg/Test.InnerOne.html#foo--\"><code>Test.InnerOne.foo()</code></a>, \n"
54            + "<a href=\"../pkg/Test.InnerOne.html#bar-java.lang.Object-\"><code>Test.InnerOne.bar(Object)</code></a>, \n"
55            + "<a href=\"http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#see\">Javadoc</a>, \n"
56            + "<a href=\"../pkg/Test.InnerOne.html#baz-float-\"><code>something</code></a></dd>\n"
57            + "</dl>");
58
59        checkOutput("pkg/Test.html", false,
60          "&lt;code&gt;List&lt;/code&gt;");
61
62        checkOutput("pkg/Test2.html", true,
63           "<code>Serializable</code>");
64
65        checkOutput("pkg/Test2.html", false,
66           ">Serialized Form<");
67    }
68}
69