test/langtools/jdk/javadoc/doclet/testDocRootLink/TestDocRootLink.java
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 36526 langtools/test/jdk/javadoc/doclet/testDocRootLink/TestDocRootLink.java@3b41f1c69604
child 53097 2e82ca64b25d
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9608
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
     1
/*
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
     2
 * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
9608
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
     4
 *
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
     7
 * published by the Free Software Foundation.
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
     8
 *
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    13
 * accompanied this code).
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    14
 *
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    18
 *
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    21
 * questions.
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    22
 */
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    23
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    24
/*
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    25
 * @test
22160
fe9f4b305bcf 8029504: Regression: TestDocRootLink test fails on Windows
ksrini
parents: 22005
diff changeset
    26
 * @bug 6553182 8025416 8029504
9608
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    27
 * @summary This test verifies the -Xdocrootparent option.
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    28
 * @author Bhavesh Patel
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    29
 * @library ../lib
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    30
 * @modules jdk.javadoc/jdk.javadoc.internal.tool
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    31
 * @build JavadocTester
9608
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    32
 * @run main TestDocRootLink
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    33
 */
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    34
public class TestDocRootLink extends JavadocTester {
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    35
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    36
    public static void main(String... args) throws Exception {
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    37
        TestDocRootLink tester = new TestDocRootLink();
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    38
        tester.runTests();
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    39
    }
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    40
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    41
    @Test
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    42
    void test1() {
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    43
        javadoc("-d", "out-1",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    44
                "-sourcepath", testSrc,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    45
                "pkg1", "pkg2");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    46
        checkExit(Exit.OK);
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    47
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    48
        checkOutput("pkg1/C1.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    49
            "Refer <a href=\"../../technotes/guides/index.html\">Here</a>",
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 22160
diff changeset
    50
            "This <a href=\"../pkg2/C2.html\">Here</a> should not be replaced\n" +
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    51
            " with an absolute link.",
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 22160
diff changeset
    52
            "Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and\n" +
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    53
            " <a href=\"../pkg2/C2.html\">Link 2</a>.");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    54
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    55
        checkOutput("pkg1/package-summary.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    56
            "<a href=\"../../technotes/guides/index.html\">\n" +
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    57
            "            Test document 1</a>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    58
            "<a href=\"../pkg2/C2.html\">\n" +
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    59
            "            Another Test document 1</a>",
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 22160
diff changeset
    60
            "<a href=\"../technotes/guides/index.html\">\n" +
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    61
            "            Another Test document 2.</a>");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    62
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    63
        // TODO: should this check *any* reference to http://download.oracle.com/
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    64
        checkOutput("pkg1/C1.html", false,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    65
            "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    66
            "<a href=\"http://download.oracle.com/javase/7/docs/pkg2/C2.html\">");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    67
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    68
        checkOutput("pkg1/package-summary.html", false,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    69
            "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    70
            "<a href=\"http://download.oracle.com/javase/7/docs/pkg2/C2.html\">");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    71
    }
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    72
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    73
    @Test
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    74
    void test2() {
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    75
        javadoc("-d", "out-2",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    76
                "-Xdocrootparent", "http://download.oracle.com/javase/7/docs",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    77
                "-sourcepath", testSrc,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    78
                "pkg1", "pkg2");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    79
        checkExit(Exit.OK);
9608
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    80
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    81
        checkOutput("pkg2/C2.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    82
            "Refer <a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">Here</a>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    83
            "This <a href=\"../pkg1/C1.html\">Here</a> should not be replaced\n" +
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    84
            " with an absolute link.",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    85
            "Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and\n" +
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    86
            " <a href=\"../pkg1/C1.html\">Link 2</a>.");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    87
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    88
        checkOutput("pkg2/package-summary.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    89
            "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">\n" +
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    90
            "            Test document 1</a>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    91
            "<a href=\"../pkg1/C1.html\">\n" +
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    92
            "            Another Test document 1</a>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    93
            "<a href=\"../technotes/guides/index.html\">\n" +
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    94
            "            Another Test document 2.</a>");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    95
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    96
        checkOutput("pkg2/C2.html", false,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    97
            "<a href=\"../../technotes/guides/index.html\">",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    98
            "<a href=\"http://download.oracle.com/javase/7/docs/pkg1/C1.html\">");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    99
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   100
        checkOutput("pkg2/package-summary.html", false,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   101
            "<a href=\"../../technotes/guides/index.html\">",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   102
            "<a href=\"http://download.oracle.com/javase/7/docs/pkg1/C1.html\">");
9608
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
   103
    }
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
   104
}