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