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

Wed, 18 Sep 2013 22:47:06 -0700

author
bpatel
date
Wed, 18 Sep 2013 22:47:06 -0700
changeset 2036
8df12c315ea3
parent 997
dbc4ced9d171
child 2212
4cb9de4dd420
permissions
-rw-r--r--

8024096: some javadoc tests may contain false positive results
Reviewed-by: jjg

bpatel@997 1 /*
bpatel@997 2 * Copyright (c) 2011, 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
bpatel@997 26 * @bug 6553182
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@997 38 "<a href=\"../../technotes/guides/index.html\">"
bpatel@997 39 },
bpatel@997 40 {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
bpatel@997 41 "<a href=\"../../technotes/guides/index.html\">"
bpatel@997 42 }
bpatel@997 43 };
bpatel@997 44 private static final String[][] NEGATED_TEST1 = {
bpatel@997 45 {BUG_ID + FS + "pkg1" + FS + "C1.html",
bpatel@997 46 "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
bpatel@997 47 },
bpatel@997 48 {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
bpatel@997 49 "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
bpatel@997 50 }
bpatel@997 51 };
bpatel@997 52 private static final String[][] TEST2 = {
bpatel@997 53 {BUG_ID + FS + "pkg2" + FS + "C2.html",
bpatel@997 54 "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
bpatel@997 55 },
bpatel@997 56 {BUG_ID + FS + "pkg2" + FS + "package-summary.html",
bpatel@997 57 "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
bpatel@997 58 }
bpatel@997 59 };
bpatel@997 60 private static final String[][] NEGATED_TEST2 = {
bpatel@997 61 {BUG_ID + FS + "pkg2" + FS + "C2.html",
bpatel@997 62 "<a href=\"../../technotes/guides/index.html\">"
bpatel@997 63 },
bpatel@997 64 {BUG_ID + FS + "pkg2" + FS + "package-summary.html",
bpatel@997 65 "<a href=\"../../technotes/guides/index.html\">"
bpatel@997 66 }
bpatel@997 67 };
bpatel@997 68 private static final String[] ARGS1 =
bpatel@997 69 new String[]{
bpatel@997 70 "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"
bpatel@997 71 };
bpatel@997 72 private static final String[] ARGS2 =
bpatel@997 73 new String[]{
bpatel@997 74 "-d", BUG_ID, "-Xdocrootparent", "http://download.oracle.com/javase/7/docs", "-sourcepath", SRC_DIR, "pkg2"
bpatel@997 75 };
bpatel@997 76
bpatel@997 77 /**
bpatel@997 78 * The entry point of the test.
bpatel@997 79 * @param args the array of command line arguments.
bpatel@997 80 */
bpatel@997 81 public static void main(String[] args) {
bpatel@997 82 TestDocRootLink tester = new TestDocRootLink();
bpatel@997 83 run(tester, ARGS1, TEST1, NEGATED_TEST1);
bpatel@997 84 run(tester, ARGS2, TEST2, NEGATED_TEST2);
bpatel@997 85 tester.printSummary();
bpatel@997 86 }
bpatel@997 87
bpatel@997 88 /**
bpatel@997 89 * {@inheritDoc}
bpatel@997 90 */
bpatel@997 91 public String getBugId() {
bpatel@997 92 return BUG_ID;
bpatel@997 93 }
bpatel@997 94
bpatel@997 95 /**
bpatel@997 96 * {@inheritDoc}
bpatel@997 97 */
bpatel@997 98 public String getBugName() {
bpatel@997 99 return getClass().getName();
bpatel@997 100 }
bpatel@997 101 }

mercurial