test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java

Wed, 13 Aug 2014 14:50:00 -0700

author
katleman
date
Wed, 13 Aug 2014 14:50:00 -0700
changeset 2549
0b6cc4ea670f
parent 2218
2d0a0ae7fa9c
child 2525
2eb010b6cb22
child 2628
a5eb8f677bd4
permissions
-rw-r--r--

Added tag jdk8u40-b01 for changeset bf89a471779d

bpatel@997 1 /*
bpatel@2212 2 * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
bpatel@997 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
bpatel@997 4 *
bpatel@997 5 * This code is free software; you can redistribute it and/or modify it
bpatel@997 6 * under the terms of the GNU General Public License version 2 only, as
bpatel@997 7 * published by the Free Software Foundation.
bpatel@997 8 *
bpatel@997 9 * This code is distributed in the hope that it will be useful, but WITHOUT
bpatel@997 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
bpatel@997 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
bpatel@997 12 * version 2 for more details (a copy is included in the LICENSE file that
bpatel@997 13 * accompanied this code).
bpatel@997 14 *
bpatel@997 15 * You should have received a copy of the GNU General Public License version
bpatel@997 16 * 2 along with this work; if not, write to the Free Software Foundation,
bpatel@997 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
bpatel@997 18 *
bpatel@997 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
bpatel@997 20 * or visit www.oracle.com if you need additional information or have any
bpatel@997 21 * questions.
bpatel@997 22 */
bpatel@997 23
bpatel@997 24 /*
bpatel@997 25 * @test
ksrini@2218 26 * @bug 6553182 8025416 8029504
bpatel@997 27 * @summary This test verifies the -Xdocrootparent option.
bpatel@997 28 * @author Bhavesh Patel
bpatel@997 29 * @library ../lib/
bpatel@997 30 * @build JavadocTester TestDocRootLink
bpatel@997 31 * @run main TestDocRootLink
bpatel@997 32 */
bpatel@997 33 public class TestDocRootLink extends JavadocTester {
bpatel@997 34
bpatel@997 35 private static final String BUG_ID = "6553182";
bpatel@997 36 private static final String[][] TEST1 = {
bpatel@997 37 {BUG_ID + FS + "pkg1" + FS + "C1.html",
bpatel@2212 38 "Refer <a href=\"../../technotes/guides/index.html\">Here</a>"
bpatel@2212 39 },
bpatel@2212 40 {BUG_ID + FS + "pkg1" + FS + "C1.html",
bpatel@2212 41 "This <a href=\"../pkg2/C2.html\">Here</a> should not be replaced" + NL +
bpatel@2212 42 " with an absolute link."
bpatel@2212 43 },
bpatel@2212 44 {BUG_ID + FS + "pkg1" + FS + "C1.html",
bpatel@2212 45 "Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and" + NL +
bpatel@2212 46 " <a href=\"../pkg2/C2.html\">Link 2</a>."
bpatel@997 47 },
bpatel@997 48 {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
bpatel@2212 49 "<a href=\"../../technotes/guides/index.html\">" + NL +
bpatel@2212 50 " Test document 1</a>"
bpatel@2212 51 },
bpatel@2212 52 {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
bpatel@2212 53 "<a href=\"../pkg2/C2.html\">" + NL +
bpatel@2212 54 " Another Test document 1</a>"
bpatel@2212 55 },
bpatel@2212 56 {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
bpatel@2212 57 "<a href=\"../technotes/guides/index.html\">" + NL +
bpatel@2212 58 " Another Test document 2.</a>"
bpatel@997 59 }
bpatel@997 60 };
bpatel@997 61 private static final String[][] NEGATED_TEST1 = {
bpatel@997 62 {BUG_ID + FS + "pkg1" + FS + "C1.html",
bpatel@997 63 "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
bpatel@997 64 },
bpatel@2212 65 {BUG_ID + FS + "pkg1" + FS + "C1.html",
bpatel@2212 66 "<a href=\"http://download.oracle.com/javase/7/docs/pkg2/C2.html\">"
bpatel@2212 67 },
bpatel@997 68 {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
bpatel@997 69 "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
bpatel@2212 70 },
bpatel@2212 71 {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
bpatel@2212 72 "<a href=\"http://download.oracle.com/javase/7/docs/pkg2/C2.html\">"
bpatel@997 73 }
bpatel@997 74 };
bpatel@997 75 private static final String[][] TEST2 = {
bpatel@2212 76 {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html",
bpatel@2212 77 "Refer <a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">Here</a>"
bpatel@997 78 },
bpatel@2212 79 {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html",
bpatel@2212 80 "This <a href=\"../pkg1/C1.html\">Here</a> should not be replaced" + NL +
bpatel@2212 81 " with an absolute link."
bpatel@2212 82 },
bpatel@2212 83 {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html",
bpatel@2212 84 "Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and" + NL +
bpatel@2212 85 " <a href=\"../pkg1/C1.html\">Link 2</a>."
bpatel@2212 86 },
bpatel@2212 87 {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html",
bpatel@2212 88 "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">" + NL +
bpatel@2212 89 " Test document 1</a>"
bpatel@2212 90 },
bpatel@2212 91 {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html",
bpatel@2212 92 "<a href=\"../pkg1/C1.html\">" + NL + " Another Test document 1</a>"
bpatel@2212 93 },
bpatel@2212 94 {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html",
bpatel@2212 95 "<a href=\"../technotes/guides/index.html\">" + NL + " Another Test document 2.</a>"
bpatel@997 96 }
bpatel@997 97 };
bpatel@997 98 private static final String[][] NEGATED_TEST2 = {
bpatel@2212 99 {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html",
bpatel@997 100 "<a href=\"../../technotes/guides/index.html\">"
bpatel@997 101 },
bpatel@2212 102 {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html",
bpatel@2212 103 "<a href=\"http://download.oracle.com/javase/7/docs/pkg1/C1.html\">"
bpatel@2212 104 },
bpatel@2212 105 {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html",
bpatel@997 106 "<a href=\"../../technotes/guides/index.html\">"
bpatel@2212 107 },
bpatel@2212 108 {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html",
bpatel@2212 109 "<a href=\"http://download.oracle.com/javase/7/docs/pkg1/C1.html\">"
bpatel@997 110 }
bpatel@997 111 };
bpatel@997 112 private static final String[] ARGS1 =
bpatel@997 113 new String[]{
bpatel@2212 114 "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2"
bpatel@997 115 };
bpatel@997 116 private static final String[] ARGS2 =
bpatel@997 117 new String[]{
bpatel@2212 118 "-d", BUG_ID + "-1", "-Xdocrootparent", "http://download.oracle.com/javase/7/docs", "-sourcepath", SRC_DIR, "pkg1", "pkg2"
bpatel@997 119 };
bpatel@997 120
bpatel@997 121 /**
bpatel@997 122 * The entry point of the test.
bpatel@997 123 * @param args the array of command line arguments.
bpatel@997 124 */
bpatel@997 125 public static void main(String[] args) {
bpatel@997 126 TestDocRootLink tester = new TestDocRootLink();
bpatel@997 127 run(tester, ARGS1, TEST1, NEGATED_TEST1);
bpatel@997 128 run(tester, ARGS2, TEST2, NEGATED_TEST2);
bpatel@997 129 tester.printSummary();
bpatel@997 130 }
bpatel@997 131
bpatel@997 132 /**
bpatel@997 133 * {@inheritDoc}
bpatel@997 134 */
bpatel@997 135 public String getBugId() {
bpatel@997 136 return BUG_ID;
bpatel@997 137 }
bpatel@997 138
bpatel@997 139 /**
bpatel@997 140 * {@inheritDoc}
bpatel@997 141 */
bpatel@997 142 public String getBugName() {
bpatel@997 143 return getClass().getName();
bpatel@997 144 }
bpatel@997 145 }

mercurial