author | jjg |
Tue, 22 Apr 2014 17:57:40 -0700 | |
changeset 24072 | e7549dcbc4af |
parent 24065 | fc4022e50129 |
child 24399 | af1a0220d0fa |
permissions | -rw-r--r-- |
9608 | 1 |
/* |
23971 | 2 |
* Copyright (c) 2011, 2014, 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[][] TEST1 = { |
|
24072 | 36 |
{ "pkg1/C1.html", |
22005
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
9608
diff
changeset
|
37 |
"Refer <a href=\"../../technotes/guides/index.html\">Here</a>" |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
9608
diff
changeset
|
38 |
}, |
24072 | 39 |
{ "pkg1/C1.html", |
23971 | 40 |
"This <a href=\"../pkg2/C2.html\">Here</a> should not be replaced\n" + |
22005
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
9608
diff
changeset
|
41 |
" with an absolute link." |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
9608
diff
changeset
|
42 |
}, |
24072 | 43 |
{ "pkg1/C1.html", |
23971 | 44 |
"Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and\n" + |
22005
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
9608
diff
changeset
|
45 |
" <a href=\"../pkg2/C2.html\">Link 2</a>." |
9608 | 46 |
}, |
24072 | 47 |
{ "pkg1/package-summary.html", |
23971 | 48 |
"<a href=\"../../technotes/guides/index.html\">\n" + |
22005
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
9608
diff
changeset
|
49 |
" Test document 1</a>" |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
9608
diff
changeset
|
50 |
}, |
24072 | 51 |
{ "pkg1/package-summary.html", |
23971 | 52 |
"<a href=\"../pkg2/C2.html\">\n" + |
22005
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
9608
diff
changeset
|
53 |
" Another Test document 1</a>" |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
9608
diff
changeset
|
54 |
}, |
24072 | 55 |
{ "pkg1/package-summary.html", |
23971 | 56 |
"<a href=\"../technotes/guides/index.html\">\n" + |
22005
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
9608
diff
changeset
|
57 |
" Another Test document 2.</a>" |
9608 | 58 |
} |
59 |
}; |
|
60 |
private static final String[][] NEGATED_TEST1 = { |
|
24072 | 61 |
{ "pkg1/C1.html", |
9608 | 62 |
"<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">" |
63 |
}, |
|
24072 | 64 |
{ "pkg1/C1.html", |
22005
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
9608
diff
changeset
|
65 |
"<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
|
66 |
}, |
24072 | 67 |
{ "pkg1/package-summary.html", |
9608 | 68 |
"<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
|
69 |
}, |
24072 | 70 |
{ "pkg1/package-summary.html", |
22005
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
9608
diff
changeset
|
71 |
"<a href=\"http://download.oracle.com/javase/7/docs/pkg2/C2.html\">" |
9608 | 72 |
} |
73 |
}; |
|
74 |
private static final String[][] TEST2 = { |
|
24072 | 75 |
{ "pkg2/C2.html", |
22005
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
9608
diff
changeset
|
76 |
"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
|
77 |
}, |
24072 | 78 |
{ "pkg2/C2.html", |
23971 | 79 |
"This <a href=\"../pkg1/C1.html\">Here</a> should not be replaced\n" + |
22005
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
9608
diff
changeset
|
80 |
" with an absolute link." |
9608 | 81 |
}, |
24072 | 82 |
{ "pkg2/C2.html", |
23971 | 83 |
"Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and\n" + |
22005
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
9608
diff
changeset
|
84 |
" <a href=\"../pkg1/C1.html\">Link 2</a>." |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
9608
diff
changeset
|
85 |
}, |
24072 | 86 |
{ "pkg2/package-summary.html", |
23971 | 87 |
"<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">\n" + |
22005
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
9608
diff
changeset
|
88 |
" Test document 1</a>" |
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
9608
diff
changeset
|
89 |
}, |
24072 | 90 |
{ "pkg2/package-summary.html", |
23971 | 91 |
"<a href=\"../pkg1/C1.html\">\n" + |
92 |
" Another Test document 1</a>" |
|
22005
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
9608
diff
changeset
|
93 |
}, |
24072 | 94 |
{ "pkg2/package-summary.html", |
23971 | 95 |
"<a href=\"../technotes/guides/index.html\">\n" + |
96 |
" Another Test document 2.</a>" |
|
9608 | 97 |
} |
98 |
}; |
|
99 |
private static final String[][] NEGATED_TEST2 = { |
|
24072 | 100 |
{ "pkg2/C2.html", |
9608 | 101 |
"<a href=\"../../technotes/guides/index.html\">" |
102 |
}, |
|
24072 | 103 |
{ "pkg2/C2.html", |
22005
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
9608
diff
changeset
|
104 |
"<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
|
105 |
}, |
24072 | 106 |
{ "pkg2/package-summary.html", |
9608 | 107 |
"<a href=\"../../technotes/guides/index.html\">" |
22005
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
9608
diff
changeset
|
108 |
}, |
24072 | 109 |
{ "pkg2/package-summary.html", |
22005
4270ada5dcd1
8025416: doclet not substituting {@docRoot} in some cases
bpatel
parents:
9608
diff
changeset
|
110 |
"<a href=\"http://download.oracle.com/javase/7/docs/pkg1/C1.html\">" |
9608 | 111 |
} |
112 |
}; |
|
113 |
private static final String[] ARGS1 = |
|
114 |
new String[]{ |
|
24072 | 115 |
"-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg1", "pkg2" |
9608 | 116 |
}; |
117 |
private static final String[] ARGS2 = |
|
118 |
new String[]{ |
|
24072 | 119 |
"-d", OUTPUT_DIR + "-1", "-Xdocrootparent", |
23971 | 120 |
"http://download.oracle.com/javase/7/docs", "-sourcepath", |
121 |
SRC_DIR, "pkg1", "pkg2" |
|
9608 | 122 |
}; |
123 |
||
124 |
/** |
|
125 |
* The entry point of the test. |
|
126 |
* @param args the array of command line arguments. |
|
127 |
*/ |
|
128 |
public static void main(String[] args) { |
|
129 |
TestDocRootLink tester = new TestDocRootLink(); |
|
24065
fc4022e50129
8041150: Avoid silly use of static methods in JavadocTester
jjg
parents:
23971
diff
changeset
|
130 |
tester.run(ARGS1, TEST1, NEGATED_TEST1); |
fc4022e50129
8041150: Avoid silly use of static methods in JavadocTester
jjg
parents:
23971
diff
changeset
|
131 |
tester.run(ARGS2, TEST2, NEGATED_TEST2); |
9608 | 132 |
tester.printSummary(); |
133 |
} |
|
134 |
} |