langtools/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java
author goetz
Thu, 20 Jun 2013 16:30:44 -0700
changeset 22807 1cf02ef734e2
parent 9608 385a828ba236
child 22005 4270ada5dcd1
permissions -rw-r--r--
8016586: PPC64 (part 3): basic changes for PPC64 Summary: added #includes needed for ppc64 port. Renamed _MODEL_ppc to _MODEL_ppc_32 and renamed corresponding old _ppc files to _ppc_32. Reviewed-by: dholmes, kvn
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
/*
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
     2
 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
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
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    26
 * @bug 6553182
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
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    29
 * @library ../lib/
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    30
 * @build JavadocTester TestDocRootLink
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
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    35
    private static final String BUG_ID = "6553182";
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    36
    private static final String[][] TEST1 = {
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    37
        {BUG_ID + FS + "pkg1" + FS + "C1.html",
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    38
            "<a href=\"../../technotes/guides/index.html\">"
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    39
        },
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    40
        {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    41
            "<a href=\"../../technotes/guides/index.html\">"
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    42
        }
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    43
    };
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    44
    private static final String[][] NEGATED_TEST1 = {
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    45
        {BUG_ID + FS + "pkg1" + FS + "C1.html",
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    46
            "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    47
        },
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    48
        {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    49
            "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    50
        }
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    51
    };
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    52
    private static final String[][] TEST2 = {
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    53
        {BUG_ID + FS + "pkg2" + FS + "C2.html",
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    54
            "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    55
        },
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    56
        {BUG_ID + FS + "pkg2" + FS + "package-summary.html",
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    57
            "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    58
        }
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    59
    };
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    60
    private static final String[][] NEGATED_TEST2 = {
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    61
        {BUG_ID + FS + "pkg2" + FS + "C2.html",
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    62
            "<a href=\"../../technotes/guides/index.html\">"
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    63
        },
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    64
        {BUG_ID + FS + "pkg2" + FS + "package-summary.html",
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    65
            "<a href=\"../../technotes/guides/index.html\">"
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    66
        }
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    67
    };
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    68
    private static final String[] ARGS1 =
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    69
            new String[]{
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    70
        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    71
    };
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    72
    private static final String[] ARGS2 =
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    73
            new String[]{
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    74
        "-d", BUG_ID, "-Xdocrootparent", "http://download.oracle.com/javase/7/docs", "-sourcepath", SRC_DIR, "pkg2"
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    75
    };
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    76
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    77
    /**
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    78
     * The entry point of the test.
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    79
     * @param args the array of command line arguments.
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    80
     */
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    81
    public static void main(String[] args) {
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    82
        TestDocRootLink tester = new TestDocRootLink();
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    83
        run(tester, ARGS1, TEST1, NEGATED_TEST1);
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    84
        run(tester, ARGS2, TEST2, NEGATED_TEST2);
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    85
        tester.printSummary();
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    86
    }
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    87
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    88
    /**
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    89
     * {@inheritDoc}
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    90
     */
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    91
    public String getBugId() {
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    92
        return BUG_ID;
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    93
    }
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    94
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    95
    /**
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    96
     * {@inheritDoc}
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    97
     */
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    98
    public String getBugName() {
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
    99
        return getClass().getName();
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
   100
    }
385a828ba236 6553182: Need to modify javadoc doclet for GPL
bpatel
parents:
diff changeset
   101
}