--- a/langtools/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java Fri May 09 23:31:05 2014 +0200
+++ b/langtools/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java Fri May 09 15:37:12 2014 -0700
@@ -30,66 +30,61 @@
* 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 TestTypeParameters
+ * @library ../lib
+ * @build JavadocTester
* @run main TestTypeParameters
*/
public class TestTypeParameters extends JavadocTester {
- //Javadoc arguments.
- private static final String[] ARGS1 = new String[]{
- "-d", OUTPUT_DIR + "-1", "-use", "-sourcepath", SRC_DIR,
- "pkg"
- };
- private static final String[] ARGS2 = new String[]{
- "-d", OUTPUT_DIR + "-2", "-linksource", "-sourcepath", SRC_DIR,
- "pkg"
- };
+ public static void main(String... args) throws Exception {
+ TestTypeParameters tester = new TestTypeParameters();
+ tester.runTests();
+ }
+
+ @Test
+ void test1() {
+ javadoc("-d", "out-1",
+ "-use",
+ "-sourcepath", testSrc,
+ "pkg");
+ checkExit(Exit.OK);
+
+ checkOutput("pkg/C.html", true,
+ "<td class=\"colFirst\"><code><W extends java.lang.String,V extends "
+ + "java.util.List><br>java.lang.Object</code></td>",
+ "<code><T> java.lang.Object</code>");
+
+ checkOutput("pkg/package-summary.html", true,
+ "C</a><E extends <a href=\"../pkg/Parent.html\" "
+ + "title=\"class in pkg\">Parent</a>>");
- //Input for string search tests.
- private static final String[][] TEST1 = {
- { "pkg/C.html",
- "<td class=\"colFirst\"><code><W extends java.lang.String,V extends " +
- "java.util.List><br>java.lang.Object</code></td>"
- },
- { "pkg/C.html",
- "<code><T> java.lang.Object</code>"
- },
- { "pkg/package-summary.html",
- "C</a><E extends <a href=\"../pkg/Parent.html\" " +
- "title=\"class in pkg\">Parent</a>>"
- },
- { "pkg/class-use/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
- { "pkg/C.html",
- "<a name=\"formatDetails-java.util.Collection-java.util.Collection-\">\n" +
- "<!-- -->\n" +
- "</a>"
- },
- };
- private static final String[][] TEST2 = {
- { "pkg/ClassUseTest3.html",
+ checkOutput("pkg/class-use/Foo4.html", true,
+ "<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
+ checkOutput("pkg/C.html", true,
+ "<a name=\"formatDetails-java.util.Collection-java.util.Collection-\">\n"
+ + "<!-- -->\n"
+ + "</a>");
+ }
+
+
+ @Test
+ void test2() {
+ javadoc("-d", "out-2",
+ "-linksource",
+ "-sourcepath", testSrc,
+ "pkg");
+ checkExit(Exit.OK);
+
+ checkOutput("pkg/ClassUseTest3.html", true,
"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>>>>"
- }
- };
-
- /**
- * The entry point of the test.
- * @param args the array of command line arguments.
- */
- public static void main(String[] args) {
- TestTypeParameters tester = new TestTypeParameters();
- tester.run(ARGS1, TEST1, NO_TEST);
- tester.run(ARGS2, TEST2, NO_TEST);
- tester.printSummary();
+ "<a href=\"../pkg/Foo4.html\" title=\"class in pkg\">Foo4</a>>>>");
}
}