TestAbsLinkPath.java revision 3294:9adfb22ff08f
1193323Sed/*
2193323Sed * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
3193323Sed * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4193323Sed *
5193323Sed * This code is free software; you can redistribute it and/or modify it
6193323Sed * under the terms of the GNU General Public License version 2 only, as
7193323Sed * published by the Free Software Foundation.
8193323Sed *
9193323Sed * This code is distributed in the hope that it will be useful, but WITHOUT
10193323Sed * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11193323Sed * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12193323Sed * version 2 for more details (a copy is included in the LICENSE file that
13193323Sed * accompanied this code).
14193323Sed *
15193323Sed * You should have received a copy of the GNU General Public License version
16249423Sdim * 2 along with this work; if not, write to the Free Software Foundation,
17193323Sed * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18193323Sed *
19263508Sdim * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20193323Sed * or visit www.oracle.com if you need additional information or have any
21249423Sdim * questions.
22198090Srdivacky */
23193323Sed
24193323Sed/*
25193323Sed * @test
26193323Sed * @bug 4640745
27198090Srdivacky * @summary This test verifys that the -link option handles absolute paths.
28198090Srdivacky * @author jamieh
29198090Srdivacky * @library ../lib
30198090Srdivacky * @modules jdk.javadoc/jdk.javadoc.internal.tool
31198090Srdivacky * @build JavadocTester
32193323Sed * @run main TestAbsLinkPath
33193323Sed */
34193323Sed
35193323Sedpublic class TestAbsLinkPath extends JavadocTester {
36193323Sed
37193323Sed    public static void main(String... args) throws Exception {
38193323Sed        TestAbsLinkPath tester = new TestAbsLinkPath();
39193323Sed        tester.runTests();
40193323Sed    }
41193323Sed
42198090Srdivacky    @Test
43198090Srdivacky    void test1() {
44198090Srdivacky        String out1 = "out1";
45198090Srdivacky        javadoc("-d", out1, "-sourcepath", testSrc, "pkg2");
46193323Sed        checkExit(Exit.OK);
47193323Sed
48193323Sed        javadoc("-d", "out2",
49193323Sed                "-sourcepath", testSrc,
50193323Sed                "-link", "../" + out1,
51193323Sed                "pkg1");
52193323Sed        checkExit(Exit.OK);
53193323Sed
54198090Srdivacky        checkOutput("pkg1/C1.html", true,
55198090Srdivacky                "C2.html");
56207618Srdivacky    }
57263508Sdim}
58193323Sed