1.1 --- a/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java Tue Dec 03 18:13:18 2013 +0000 1.2 +++ b/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java Tue Dec 03 14:21:45 2013 -0800 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -23,7 +23,7 @@ 1.11 1.12 /* 1.13 * @test 1.14 - * @bug 6553182 1.15 + * @bug 6553182 8025416 1.16 * @summary This test verifies the -Xdocrootparent option. 1.17 * @author Bhavesh Patel 1.18 * @library ../lib/ 1.19 @@ -35,43 +35,87 @@ 1.20 private static final String BUG_ID = "6553182"; 1.21 private static final String[][] TEST1 = { 1.22 {BUG_ID + FS + "pkg1" + FS + "C1.html", 1.23 - "<a href=\"../../technotes/guides/index.html\">" 1.24 + "Refer <a href=\"../../technotes/guides/index.html\">Here</a>" 1.25 + }, 1.26 + {BUG_ID + FS + "pkg1" + FS + "C1.html", 1.27 + "This <a href=\"../pkg2/C2.html\">Here</a> should not be replaced" + NL + 1.28 + " with an absolute link." 1.29 + }, 1.30 + {BUG_ID + FS + "pkg1" + FS + "C1.html", 1.31 + "Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and" + NL + 1.32 + " <a href=\"../pkg2/C2.html\">Link 2</a>." 1.33 }, 1.34 {BUG_ID + FS + "pkg1" + FS + "package-summary.html", 1.35 - "<a href=\"../../technotes/guides/index.html\">" 1.36 + "<a href=\"../../technotes/guides/index.html\">" + NL + 1.37 + " Test document 1</a>" 1.38 + }, 1.39 + {BUG_ID + FS + "pkg1" + FS + "package-summary.html", 1.40 + "<a href=\"../pkg2/C2.html\">" + NL + 1.41 + " Another Test document 1</a>" 1.42 + }, 1.43 + {BUG_ID + FS + "pkg1" + FS + "package-summary.html", 1.44 + "<a href=\"../technotes/guides/index.html\">" + NL + 1.45 + " Another Test document 2.</a>" 1.46 } 1.47 }; 1.48 private static final String[][] NEGATED_TEST1 = { 1.49 {BUG_ID + FS + "pkg1" + FS + "C1.html", 1.50 "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">" 1.51 }, 1.52 + {BUG_ID + FS + "pkg1" + FS + "C1.html", 1.53 + "<a href=\"http://download.oracle.com/javase/7/docs/pkg2/C2.html\">" 1.54 + }, 1.55 {BUG_ID + FS + "pkg1" + FS + "package-summary.html", 1.56 "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">" 1.57 + }, 1.58 + {BUG_ID + FS + "pkg1" + FS + "package-summary.html", 1.59 + "<a href=\"http://download.oracle.com/javase/7/docs/pkg2/C2.html\">" 1.60 } 1.61 }; 1.62 private static final String[][] TEST2 = { 1.63 - {BUG_ID + FS + "pkg2" + FS + "C2.html", 1.64 - "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">" 1.65 + {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html", 1.66 + "Refer <a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">Here</a>" 1.67 }, 1.68 - {BUG_ID + FS + "pkg2" + FS + "package-summary.html", 1.69 - "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">" 1.70 + {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html", 1.71 + "This <a href=\"../pkg1/C1.html\">Here</a> should not be replaced" + NL + 1.72 + " with an absolute link." 1.73 + }, 1.74 + {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html", 1.75 + "Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and" + NL + 1.76 + " <a href=\"../pkg1/C1.html\">Link 2</a>." 1.77 + }, 1.78 + {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html", 1.79 + "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">" + NL + 1.80 + " Test document 1</a>" 1.81 + }, 1.82 + {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html", 1.83 + "<a href=\"../pkg1/C1.html\">" + NL + " Another Test document 1</a>" 1.84 + }, 1.85 + {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html", 1.86 + "<a href=\"../technotes/guides/index.html\">" + NL + " Another Test document 2.</a>" 1.87 } 1.88 }; 1.89 private static final String[][] NEGATED_TEST2 = { 1.90 - {BUG_ID + FS + "pkg2" + FS + "C2.html", 1.91 + {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html", 1.92 "<a href=\"../../technotes/guides/index.html\">" 1.93 }, 1.94 - {BUG_ID + FS + "pkg2" + FS + "package-summary.html", 1.95 + {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html", 1.96 + "<a href=\"http://download.oracle.com/javase/7/docs/pkg1/C1.html\">" 1.97 + }, 1.98 + {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html", 1.99 "<a href=\"../../technotes/guides/index.html\">" 1.100 + }, 1.101 + {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html", 1.102 + "<a href=\"http://download.oracle.com/javase/7/docs/pkg1/C1.html\">" 1.103 } 1.104 }; 1.105 private static final String[] ARGS1 = 1.106 new String[]{ 1.107 - "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1" 1.108 + "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2" 1.109 }; 1.110 private static final String[] ARGS2 = 1.111 new String[]{ 1.112 - "-d", BUG_ID, "-Xdocrootparent", "http://download.oracle.com/javase/7/docs", "-sourcepath", SRC_DIR, "pkg2" 1.113 + "-d", BUG_ID + "-1", "-Xdocrootparent", "http://download.oracle.com/javase/7/docs", "-sourcepath", SRC_DIR, "pkg1", "pkg2" 1.114 }; 1.115 1.116 /**