--- a/langtools/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java Sun Apr 03 17:00:50 2011 -0700
+++ b/langtools/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java Mon Apr 04 10:14:23 2011 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,55 +23,77 @@
/*
* @test
- * @bug 4927167 4974929
+ * @bug 4927167 4974929 7010344
* @summary When the type parameters are more than 10 characters in length,
* make sure there is a line break between type params and return type
- * in member summary.
+ * in member summary. Also, test for type parameter links in package-summary and
+ * class-use pages. The class/annotation pages should check for type
+ * parameter links in the class/annotation signature section when -linksource is set.
* @author jamieh
* @library ../lib/
- * @build JavadocTester
- * @build TestTypeParameters
+ * @build JavadocTester TestTypeParameters
* @run main TestTypeParameters
*/
public class TestTypeParameters extends JavadocTester {
//Test information.
- private static final String BUG_ID = "4927167-4974929";
+ private static final String BUG_ID = "4927167-4974929-7010344";
//Javadoc arguments.
- private static final String[] ARGS = new String[] {
- "-d", BUG_ID, "-source", "1.5", "-sourcepath", SRC_DIR,
- "pkg"
+ private static final String[] ARGS1 = new String[]{
+ "-d", BUG_ID, "-use", "-source", "1.5", "-sourcepath", SRC_DIR,
+ "pkg"
+ };
+ private static final String[] ARGS2 = new String[]{
+ "-d", BUG_ID, "-linksource", "-source", "1.5", "-sourcepath", SRC_DIR,
+ "pkg"
};
//Input for string search tests.
- private static final String[][] TEST =
- {
+ private static final String[][] TEST1 = {
{BUG_ID + FS + "pkg" + FS + "C.html",
"<td class=\"colFirst\"><code><W extends java.lang.String,V extends " +
- "java.util.List> <br>java.lang.Object</code></td>"},
+ "java.util.List> <br>java.lang.Object</code></td>"
+ },
{BUG_ID + FS + "pkg" + FS + "C.html",
- "<code><T> java.lang.Object</code>"},
+ "<code><T> java.lang.Object</code>"
+ },
{BUG_ID + FS + "pkg" + FS + "package-summary.html",
- "C<E extends Parent>"},
+ "C</a><E extends <a href=\"../pkg/Parent.html\" " +
+ "title=\"class in pkg\">Parent</a>>"
+ },
+ {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "Foo4.html",
+ "<a href=\"../../pkg/ClassUseTest3.html\" title=\"class in pkg\">" +
+ "ClassUseTest3</a><T extends <a href=\"../../pkg/ParamTest2.html\" " +
+ "title=\"class in pkg\">ParamTest2</a><java.util.List<? extends " +
+ "<a href=\"../../pkg/Foo4.html\" title=\"class in pkg\">Foo4</a>>>>"
+ },
//Nested type parameters
{BUG_ID + FS + "pkg" + FS + "C.html",
"<a name=\"formatDetails(java.util.Collection, java.util.Collection)\">" + NL +
"<!-- -->" + NL +
- "</a>"},
-
+ "</a>"
+ },
+ };
+ private static final String[][] TEST2 = {
+ {BUG_ID + FS + "pkg" + FS + "ClassUseTest3.html",
+ "public class <a href=\"../src-html/pkg/ClassUseTest3.html#line.28\">" +
+ "ClassUseTest3</a><T extends <a href=\"../pkg/ParamTest2.html\" " +
+ "title=\"class in pkg\">ParamTest2</a><java.util.List<? extends " +
+ "<a href=\"../pkg/Foo4.html\" title=\"class in pkg\">Foo4</a>>>>"
+ }
};
private static final String[][] NEGATED_TEST = NO_TEST;
-
/**
* The entry point of the test.
* @param args the array of command line arguments.
*/
public static void main(String[] args) {
TestTypeParameters tester = new TestTypeParameters();
- run(tester, ARGS, TEST, NEGATED_TEST);
+ run(tester, ARGS1, TEST1, NEGATED_TEST);
+ run(tester, ARGS2, TEST2, NEGATED_TEST);
tester.printSummary();
}