author | ohair |
Tue, 25 May 2010 15:54:51 -0700 | |
changeset 5520 | 86e4b9a9da40 |
parent 2216 | b124d5c924eb |
child 7614 | cfadc977ca75 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
5520 | 2 |
* Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. |
10 | 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 |
* |
|
5520 | 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. |
|
10 | 22 |
*/ |
23 |
||
24 |
/* |
|
25 |
* @test |
|
26 |
* @bug 4720957 5020118 |
|
27 |
* @summary Test to make sure that -link and -linkoffline link to |
|
28 |
* right files. |
|
29 |
* @author jamieh |
|
30 |
* @library ../lib/ |
|
31 |
* @build JavadocTester |
|
32 |
* @build TestLinkOption |
|
33 |
* @run main TestLinkOption |
|
34 |
*/ |
|
35 |
||
36 |
public class TestLinkOption extends JavadocTester { |
|
37 |
||
38 |
private static final String BUG_ID = "4720957-5020118"; |
|
39 |
||
40 |
//Generate the documentation using -linkoffline and a URL as the first parameter. |
|
41 |
private static final String[] ARGS1 = new String[] { |
|
42 |
"-d", BUG_ID + "-1", "-sourcepath", SRC_DIR, |
|
43 |
"-linkoffline", "http://java.sun.com/j2se/1.4/docs/api/", |
|
44 |
SRC_DIR, "-package", "pkg", "java.lang" |
|
45 |
}; |
|
46 |
||
47 |
private static final String[][] TEST1 = { |
|
48 |
{BUG_ID + "-1" + FS + "pkg" + FS + "C.html", |
|
49 |
"<A HREF=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html?is-external=true\" " + |
|
50 |
"title=\"class or interface in java.lang\"><CODE>Link to String Class</CODE></A>" |
|
51 |
}, |
|
52 |
//Make sure the parameters are indented properly when the -link option is used. |
|
53 |
{BUG_ID + "-1" + FS + "pkg" + FS + "C.html", |
|
54 |
"(int p1," + NL + |
|
55 |
" int p2," + NL + |
|
56 |
" int p3)" |
|
57 |
}, |
|
58 |
{BUG_ID + "-1" + FS + "pkg" + FS + "C.html", |
|
59 |
"(int p1," + NL + |
|
60 |
" int p2," + NL + |
|
61 |
" " + |
|
62 |
"<A HREF=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true\" " + |
|
63 |
"title=\"class or interface in java.lang\">Object</A> p3)" |
|
64 |
}, |
|
65 |
{BUG_ID + "-1" + FS + "java" + FS + "lang" + FS + "StringBuilderChild.html", |
|
2216
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1787
diff
changeset
|
66 |
"public abstract class <STRONG>StringBuilderChild</STRONG>" + NL + |
b124d5c924eb
6786690: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - DL tag and nesting issue
bpatel
parents:
1787
diff
changeset
|
67 |
"extends <A HREF=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true\" title=\"class or interface in java.lang\">Object</A>" |
10 | 68 |
}, |
69 |
||
70 |
}; |
|
71 |
private static final String[][] NEGATED_TEST1 = NO_TEST; |
|
72 |
||
73 |
//Generate the documentation using -linkoffline and a relative path as the first parameter. |
|
74 |
//We will try linking to the docs generated in test 1 with a relative path. |
|
75 |
private static final String[] ARGS2 = new String[] { |
|
76 |
"-d", BUG_ID + "-2", "-sourcepath", SRC_DIR, |
|
77 |
"-linkoffline", "../" + BUG_ID + "-1", BUG_ID + "-1", "-package", "pkg2" |
|
78 |
}; |
|
79 |
||
80 |
private static final String[][] TEST2 = { |
|
81 |
{BUG_ID + "-2" + FS + "pkg2" + FS + "C2.html", |
|
82 |
"This is a link to <A HREF=\"../../" + BUG_ID + "-1/pkg/C.html?is-external=true\" " + |
|
83 |
"title=\"class or interface in pkg\"><CODE>Class C</CODE></A>." |
|
84 |
} |
|
85 |
}; |
|
86 |
private static final String[][] NEGATED_TEST2 = NO_TEST; |
|
87 |
||
88 |
/** |
|
89 |
* The entry point of the test. |
|
90 |
* @param args the array of command line arguments. |
|
91 |
*/ |
|
92 |
public static void main(String[] args) { |
|
93 |
TestLinkOption tester = new TestLinkOption(); |
|
94 |
run(tester, ARGS1, TEST1, NEGATED_TEST1); |
|
95 |
run(tester, ARGS2, TEST2, NEGATED_TEST2); |
|
96 |
tester.printSummary(); |
|
97 |
} |
|
98 |
||
99 |
/** |
|
100 |
* {@inheritDoc} |
|
101 |
*/ |
|
102 |
public String getBugId() { |
|
103 |
return BUG_ID; |
|
104 |
} |
|
105 |
||
106 |
/** |
|
107 |
* {@inheritDoc} |
|
108 |
*/ |
|
109 |
public String getBugName() { |
|
110 |
return getClass().getName(); |
|
111 |
} |
|
112 |
} |