langtools/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java
author iignatyev
Sun, 03 Aug 2014 12:04:17 +0400
changeset 25924 4c3dd8541530
parent 24399 af1a0220d0fa
child 30730 d3ce7619db2c
permissions -rw-r--r--
8051896: jtreg tests don't use $TESTJAVAOPTS Reviewed-by: kvn, ctornqvi
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
/*
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 22160
diff changeset
     2
 * Copyright (c) 2011, 2014, 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
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    30
 * @build JavadocTester
9608
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    31
 * @run main TestDocRootLink
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    32
 */
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    33
public class TestDocRootLink extends JavadocTester {
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    34
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    35
    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
    36
        TestDocRootLink tester = new TestDocRootLink();
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    37
        tester.runTests();
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    38
    }
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
    @Test
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    41
    void test1() {
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    42
        javadoc("-d", "out-1",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    43
                "-sourcepath", testSrc,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    44
                "pkg1", "pkg2");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    45
        checkExit(Exit.OK);
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    46
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    47
        checkOutput("pkg1/C1.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    48
            "Refer <a href=\"../../technotes/guides/index.html\">Here</a>",
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 22160
diff changeset
    49
            "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
    50
            " with an absolute link.",
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 22160
diff changeset
    51
            "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
    52
            " <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
    53
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    54
        checkOutput("pkg1/package-summary.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    55
            "<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
    56
            "            Test document 1</a>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    57
            "<a href=\"../pkg2/C2.html\">\n" +
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    58
            "            Another Test document 1</a>",
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 22160
diff changeset
    59
            "<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
    60
            "            Another Test document 2.</a>");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    61
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    62
        // 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
    63
        checkOutput("pkg1/C1.html", false,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    64
            "<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
    65
            "<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
    66
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    67
        checkOutput("pkg1/package-summary.html", false,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    68
            "<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
    69
            "<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
    70
    }
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
    @Test
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    73
    void test2() {
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    74
        javadoc("-d", "out-2",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    75
                "-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
    76
                "-sourcepath", testSrc,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    77
                "pkg1", "pkg2");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    78
        checkExit(Exit.OK);
9608
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    79
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    80
        checkOutput("pkg2/C2.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    81
            "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
    82
            "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
    83
            " with an absolute link.",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    84
            "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
    85
            " <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
    86
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    87
        checkOutput("pkg2/package-summary.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    88
            "<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
    89
            "            Test document 1</a>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    90
            "<a href=\"../pkg1/C1.html\">\n" +
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    91
            "            Another Test document 1</a>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    92
            "<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
    93
            "            Another Test document 2.</a>");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    94
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    95
        checkOutput("pkg2/C2.html", false,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    96
            "<a href=\"../../technotes/guides/index.html\">",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    97
            "<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
    98
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    99
        checkOutput("pkg2/package-summary.html", false,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   100
            "<a href=\"../../technotes/guides/index.html\">",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   101
            "<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
   102
    }
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
   103
}