author | jjg |
Tue, 22 Apr 2014 17:41:11 -0700 | |
changeset 24071 | b0845717434e |
parent 24065 | fc4022e50129 |
child 24072 | e7549dcbc4af |
permissions | -rw-r--r-- |
10 | 1 |
/* |
23971 | 2 |
* Copyright (c) 2003, 2014, 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 |
|
21008
af0b915df7cc
8025633: Fix javadoc to generate valid anchor names
bpatel
parents:
17564
diff
changeset
|
26 |
* @bug 4927167 4974929 7010344 8025633 |
10 | 27 |
* @summary When the type parameters are more than 10 characters in length, |
28 |
* make sure there is a line break between type params and return type |
|
9083
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
29 |
* in member summary. Also, test for type parameter links in package-summary and |
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
30 |
* class-use pages. The class/annotation pages should check for type |
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
31 |
* parameter links in the class/annotation signature section when -linksource is set. |
10 | 32 |
* @author jamieh |
33 |
* @library ../lib/ |
|
9083
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
34 |
* @build JavadocTester TestTypeParameters |
10 | 35 |
* @run main TestTypeParameters |
36 |
*/ |
|
37 |
||
38 |
public class TestTypeParameters extends JavadocTester { |
|
39 |
||
40 |
//Test information. |
|
9083
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
41 |
private static final String BUG_ID = "4927167-4974929-7010344"; |
10 | 42 |
|
43 |
//Javadoc arguments. |
|
9083
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
44 |
private static final String[] ARGS1 = new String[]{ |
23139
612191246a7d
8031670: Remove unneeded -source options in javadoc tests
darcy
parents:
21008
diff
changeset
|
45 |
"-d", BUG_ID, "-use", "-sourcepath", SRC_DIR, |
9083
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
46 |
"pkg" |
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
47 |
}; |
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
48 |
private static final String[] ARGS2 = new String[]{ |
23139
612191246a7d
8031670: Remove unneeded -source options in javadoc tests
darcy
parents:
21008
diff
changeset
|
49 |
"-d", BUG_ID, "-linksource", "-sourcepath", SRC_DIR, |
9083
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
50 |
"pkg" |
10 | 51 |
}; |
52 |
||
53 |
//Input for string search tests. |
|
9083
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
54 |
private static final String[][] TEST1 = { |
23971 | 55 |
{BUG_ID + "/pkg/C.html", |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
56 |
"<td class=\"colFirst\"><code><W extends java.lang.String,V extends " + |
17564
c329fe11193d
8011288: Erratic/inconsistent indentation of signatures
jjg
parents:
9083
diff
changeset
|
57 |
"java.util.List><br>java.lang.Object</code></td>" |
9083
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
58 |
}, |
23971 | 59 |
{BUG_ID + "/pkg/C.html", |
9083
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
60 |
"<code><T> java.lang.Object</code>" |
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
61 |
}, |
23971 | 62 |
{BUG_ID + "/pkg/package-summary.html", |
9083
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
63 |
"C</a><E extends <a href=\"../pkg/Parent.html\" " + |
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
64 |
"title=\"class in pkg\">Parent</a>>" |
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
65 |
}, |
23971 | 66 |
{BUG_ID + "/pkg/class-use/Foo4.html", |
9083
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
67 |
"<a href=\"../../pkg/ClassUseTest3.html\" title=\"class in pkg\">" + |
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
68 |
"ClassUseTest3</a><T extends <a href=\"../../pkg/ParamTest2.html\" " + |
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
69 |
"title=\"class in pkg\">ParamTest2</a><java.util.List<? extends " + |
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
70 |
"<a href=\"../../pkg/Foo4.html\" title=\"class in pkg\">Foo4</a>>>>" |
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
71 |
}, |
10 | 72 |
//Nested type parameters |
23971 | 73 |
{BUG_ID + "/pkg/C.html", |
74 |
"<a name=\"formatDetails-java.util.Collection-java.util.Collection-\">\n" + |
|
75 |
"<!-- -->\n" + |
|
9083
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
76 |
"</a>" |
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
77 |
}, |
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
78 |
}; |
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
79 |
private static final String[][] TEST2 = { |
23971 | 80 |
{BUG_ID + "/pkg/ClassUseTest3.html", |
9083
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
81 |
"public class <a href=\"../src-html/pkg/ClassUseTest3.html#line.28\">" + |
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
82 |
"ClassUseTest3</a><T extends <a href=\"../pkg/ParamTest2.html\" " + |
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
83 |
"title=\"class in pkg\">ParamTest2</a><java.util.List<? extends " + |
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
84 |
"<a href=\"../pkg/Foo4.html\" title=\"class in pkg\">Foo4</a>>>>" |
63f3c4d2d992
7010344: Some of the html files do not have element <a> in right context.
bpatel
parents:
7681
diff
changeset
|
85 |
} |
10 | 86 |
}; |
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 |
TestTypeParameters tester = new TestTypeParameters(); |
|
24071 | 94 |
tester.run(ARGS1, TEST1, NO_TEST); |
95 |
tester.run(ARGS2, TEST2, NO_TEST); |
|
10 | 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 |
} |