Wed, 18 Sep 2013 22:47:06 -0700
8024096: some javadoc tests may contain false positive results
Reviewed-by: jjg
duke@1 | 1 | /* |
jjg@1741 | 2 | * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. |
duke@1 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@1 | 4 | * |
duke@1 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@1 | 6 | * under the terms of the GNU General Public License version 2 only, as |
duke@1 | 7 | * published by the Free Software Foundation. |
duke@1 | 8 | * |
duke@1 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@1 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@1 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@1 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@1 | 13 | * accompanied this code). |
duke@1 | 14 | * |
duke@1 | 15 | * You should have received a copy of the GNU General Public License version |
duke@1 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@1 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@1 | 18 | * |
ohair@554 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@554 | 20 | * or visit www.oracle.com if you need additional information or have any |
ohair@554 | 21 | * questions. |
duke@1 | 22 | */ |
duke@1 | 23 | |
duke@1 | 24 | /* |
duke@1 | 25 | * @test |
bpatel@958 | 26 | * @bug 4927167 4974929 7010344 |
duke@1 | 27 | * @summary When the type parameters are more than 10 characters in length, |
duke@1 | 28 | * make sure there is a line break between type params and return type |
bpatel@958 | 29 | * in member summary. Also, test for type parameter links in package-summary and |
bpatel@958 | 30 | * class-use pages. The class/annotation pages should check for type |
bpatel@958 | 31 | * parameter links in the class/annotation signature section when -linksource is set. |
duke@1 | 32 | * @author jamieh |
duke@1 | 33 | * @library ../lib/ |
bpatel@958 | 34 | * @build JavadocTester TestTypeParameters |
duke@1 | 35 | * @run main TestTypeParameters |
duke@1 | 36 | */ |
duke@1 | 37 | |
duke@1 | 38 | public class TestTypeParameters extends JavadocTester { |
duke@1 | 39 | |
duke@1 | 40 | //Test information. |
bpatel@958 | 41 | private static final String BUG_ID = "4927167-4974929-7010344"; |
duke@1 | 42 | |
duke@1 | 43 | //Javadoc arguments. |
bpatel@958 | 44 | private static final String[] ARGS1 = new String[]{ |
bpatel@958 | 45 | "-d", BUG_ID, "-use", "-source", "1.5", "-sourcepath", SRC_DIR, |
bpatel@958 | 46 | "pkg" |
bpatel@958 | 47 | }; |
bpatel@958 | 48 | private static final String[] ARGS2 = new String[]{ |
bpatel@958 | 49 | "-d", BUG_ID, "-linksource", "-source", "1.5", "-sourcepath", SRC_DIR, |
bpatel@958 | 50 | "pkg" |
duke@1 | 51 | }; |
duke@1 | 52 | |
duke@1 | 53 | //Input for string search tests. |
bpatel@958 | 54 | private static final String[][] TEST1 = { |
duke@1 | 55 | {BUG_ID + FS + "pkg" + FS + "C.html", |
bpatel@766 | 56 | "<td class=\"colFirst\"><code><W extends java.lang.String,V extends " + |
jjg@1741 | 57 | "java.util.List><br>java.lang.Object</code></td>" |
bpatel@958 | 58 | }, |
duke@1 | 59 | {BUG_ID + FS + "pkg" + FS + "C.html", |
bpatel@958 | 60 | "<code><T> java.lang.Object</code>" |
bpatel@958 | 61 | }, |
duke@1 | 62 | {BUG_ID + FS + "pkg" + FS + "package-summary.html", |
bpatel@958 | 63 | "C</a><E extends <a href=\"../pkg/Parent.html\" " + |
bpatel@958 | 64 | "title=\"class in pkg\">Parent</a>>" |
bpatel@958 | 65 | }, |
bpatel@958 | 66 | {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "Foo4.html", |
bpatel@958 | 67 | "<a href=\"../../pkg/ClassUseTest3.html\" title=\"class in pkg\">" + |
bpatel@958 | 68 | "ClassUseTest3</a><T extends <a href=\"../../pkg/ParamTest2.html\" " + |
bpatel@958 | 69 | "title=\"class in pkg\">ParamTest2</a><java.util.List<? extends " + |
bpatel@958 | 70 | "<a href=\"../../pkg/Foo4.html\" title=\"class in pkg\">Foo4</a>>>>" |
bpatel@958 | 71 | }, |
duke@1 | 72 | //Nested type parameters |
duke@1 | 73 | {BUG_ID + FS + "pkg" + FS + "C.html", |
bpatel@766 | 74 | "<a name=\"formatDetails(java.util.Collection, java.util.Collection)\">" + NL + |
bpatel@766 | 75 | "<!-- -->" + NL + |
bpatel@958 | 76 | "</a>" |
bpatel@958 | 77 | }, |
bpatel@958 | 78 | }; |
bpatel@958 | 79 | private static final String[][] TEST2 = { |
bpatel@958 | 80 | {BUG_ID + FS + "pkg" + FS + "ClassUseTest3.html", |
bpatel@958 | 81 | "public class <a href=\"../src-html/pkg/ClassUseTest3.html#line.28\">" + |
bpatel@958 | 82 | "ClassUseTest3</a><T extends <a href=\"../pkg/ParamTest2.html\" " + |
bpatel@958 | 83 | "title=\"class in pkg\">ParamTest2</a><java.util.List<? extends " + |
bpatel@958 | 84 | "<a href=\"../pkg/Foo4.html\" title=\"class in pkg\">Foo4</a>>>>" |
bpatel@958 | 85 | } |
duke@1 | 86 | }; |
duke@1 | 87 | private static final String[][] NEGATED_TEST = NO_TEST; |
duke@1 | 88 | |
duke@1 | 89 | /** |
duke@1 | 90 | * The entry point of the test. |
duke@1 | 91 | * @param args the array of command line arguments. |
duke@1 | 92 | */ |
duke@1 | 93 | public static void main(String[] args) { |
duke@1 | 94 | TestTypeParameters tester = new TestTypeParameters(); |
bpatel@958 | 95 | run(tester, ARGS1, TEST1, NEGATED_TEST); |
bpatel@958 | 96 | run(tester, ARGS2, TEST2, NEGATED_TEST); |
duke@1 | 97 | tester.printSummary(); |
duke@1 | 98 | } |
duke@1 | 99 | |
duke@1 | 100 | /** |
duke@1 | 101 | * {@inheritDoc} |
duke@1 | 102 | */ |
duke@1 | 103 | public String getBugId() { |
duke@1 | 104 | return BUG_ID; |
duke@1 | 105 | } |
duke@1 | 106 | |
duke@1 | 107 | /** |
duke@1 | 108 | * {@inheritDoc} |
duke@1 | 109 | */ |
duke@1 | 110 | public String getBugName() { |
duke@1 | 111 | return getClass().getName(); |
duke@1 | 112 | } |
duke@1 | 113 | } |