--- a/langtools/test/com/sun/javadoc/testAbstractMethod/TestAbstractMethod.java Fri May 09 23:31:05 2014 +0200
+++ b/langtools/test/com/sun/javadoc/testAbstractMethod/TestAbstractMethod.java Fri May 09 15:37:12 2014 -0700
@@ -27,80 +27,72 @@
* @summary Make sure that the abstract method is identified correctly
* if the abstract modifier is present explicitly or implicitly.
* @author bpatel
- * @library ../lib/
- * @build JavadocTester TestAbstractMethod
+ * @library ../lib
+ * @build JavadocTester
* @run main TestAbstractMethod
*/
public class TestAbstractMethod extends JavadocTester {
- //Test information.
+ public static void main(String... args) throws Exception {
+ TestAbstractMethod tester = new TestAbstractMethod();
+ tester.runTests();
+ }
+
+ @Test
+ void test() {
+ javadoc("-d", "out",
+ "-sourcepath", testSrc,
+ "pkg");
+ checkExit(Exit.OK);
- //Javadoc arguments.
- private static final String[] ARGS = new String[] {
- "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"
- };
+ checkOutput("pkg/A.html", true,
+ "<td class=\"colFirst\"><code>default void</code></td>",
+ "<caption><span id=\"t0\" class=\"activeTableTab\"><span>"
+ + "All Methods</span><span class=\"tabEnd\"> </span></span>"
+ + "<span id=\"t2\" class=\"tableTab\"><span>"
+ + "<a href=\"javascript:show(2);\">Instance Methods</a></span>"
+ + "<span class=\"tabEnd\"> </span></span><span id=\"t3\" "
+ + "class=\"tableTab\"><span><a href=\"javascript:show(4);\">"
+ + "Abstract Methods</a></span><span class=\"tabEnd\"> </span>"
+ + "</span><span id=\"t5\" class=\"tableTab\"><span>"
+ + "<a href=\"javascript:show(16);\">Default Methods</a></span>"
+ + "<span class=\"tabEnd\"> </span></span></caption>");
- //Input for string search tests.
- private static final String[][] TEST = {
- { "pkg/A.html",
- "<td class=\"colFirst\"><code>default void</code></td>"},
- { "pkg/A.html",
- "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" +
- "All Methods</span><span class=\"tabEnd\"> </span></span>" +
- "<span id=\"t2\" class=\"tableTab\"><span>" +
- "<a href=\"javascript:show(2);\">Instance Methods</a></span>" +
- "<span class=\"tabEnd\"> </span></span><span id=\"t3\" " +
- "class=\"tableTab\"><span><a href=\"javascript:show(4);\">" +
- "Abstract Methods</a></span><span class=\"tabEnd\"> </span>" +
- "</span><span id=\"t5\" class=\"tableTab\"><span>" +
- "<a href=\"javascript:show(16);\">Default Methods</a></span>" +
- "<span class=\"tabEnd\"> </span></span></caption>"},
- { "pkg/B.html",
- "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" +
- "All Methods</span><span class=\"tabEnd\"> </span></span>" +
- "<span id=\"t2\" class=\"tableTab\"><span>" +
- "<a href=\"javascript:show(2);\">Instance Methods</a></span>" +
- "<span class=\"tabEnd\"> </span></span><span id=\"t3\" " +
- "class=\"tableTab\"><span><a href=\"javascript:show(4);\">Abstract " +
- "Methods</a></span><span class=\"tabEnd\"> </span></span>" +
- "<span id=\"t4\" class=\"tableTab\"><span>" +
- "<a href=\"javascript:show(8);\">Concrete Methods</a></span>" +
- "<span class=\"tabEnd\"> </span></span></caption>"},
- { "pkg/B.html",
- "<td class=\"colFirst\"><code>abstract void</code></td>"},
- { "pkg/C.html",
- "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" +
- "All Methods</span><span class=\"tabEnd\"> </span></span>" +
- "<span id=\"t2\" class=\"tableTab\"><span>" +
- "<a href=\"javascript:show(2);\">Instance Methods</a></span>" +
- "<span class=\"tabEnd\"> </span></span>" +
- "<span id=\"t5\" class=\"tableTab\"><span>" +
- "<a href=\"javascript:show(16);\">Default Methods</a></span>" +
- "<span class=\"tabEnd\"> </span></span></caption>"},
- { "pkg/C.html",
- "<td class=\"colFirst\"><code>default void</code></td>"}
- };
- private static final String[][] NEGATED_TEST = {
- { "pkg/A.html",
- "<td class=\"colFirst\"><code>abstract void</code></td>"},
- { "pkg/B.html",
- "<span><a href=\"javascript:show(16);\">Default Methods</a></span>" +
- "<span class=\"tabEnd\"> </span>"},
- { "pkg/B.html",
- "<td class=\"colFirst\"><code>default void</code></td>"},
- { "pkg/C.html",
- "<span><a href=\"javascript:show(4);\">Abstract Methods</a></span>" +
- "<span class=\"tabEnd\"> </span>"}
- };
+ checkOutput("pkg/B.html", true,
+ "<caption><span id=\"t0\" class=\"activeTableTab\"><span>"
+ + "All Methods</span><span class=\"tabEnd\"> </span></span>"
+ + "<span id=\"t2\" class=\"tableTab\"><span>"
+ + "<a href=\"javascript:show(2);\">Instance Methods</a></span>"
+ + "<span class=\"tabEnd\"> </span></span><span id=\"t3\" "
+ + "class=\"tableTab\"><span><a href=\"javascript:show(4);\">Abstract "
+ + "Methods</a></span><span class=\"tabEnd\"> </span></span>"
+ + "<span id=\"t4\" class=\"tableTab\"><span>"
+ + "<a href=\"javascript:show(8);\">Concrete Methods</a></span>"
+ + "<span class=\"tabEnd\"> </span></span></caption>",
+ "<td class=\"colFirst\"><code>abstract void</code></td>");
- /**
- * The entry point of the test.
- * @param args the array of command line arguments.
- */
- public static void main(String[] args) {
- TestAbstractMethod tester = new TestAbstractMethod();
- tester.run(ARGS, TEST, NEGATED_TEST);
- tester.printSummary();
+ checkOutput("pkg/C.html", true,
+ "<caption><span id=\"t0\" class=\"activeTableTab\"><span>"
+ + "All Methods</span><span class=\"tabEnd\"> </span></span>"
+ + "<span id=\"t2\" class=\"tableTab\"><span>"
+ + "<a href=\"javascript:show(2);\">Instance Methods</a></span>"
+ + "<span class=\"tabEnd\"> </span></span>"
+ + "<span id=\"t5\" class=\"tableTab\"><span>"
+ + "<a href=\"javascript:show(16);\">Default Methods</a></span>"
+ + "<span class=\"tabEnd\"> </span></span></caption>",
+ "<td class=\"colFirst\"><code>default void</code></td>");
+
+ checkOutput("pkg/A.html", false,
+ "<td class=\"colFirst\"><code>abstract void</code></td>");
+
+ checkOutput("pkg/B.html", false,
+ "<span><a href=\"javascript:show(16);\">Default Methods</a></span>"
+ + "<span class=\"tabEnd\"> </span>",
+ "<td class=\"colFirst\"><code>default void</code></td>");
+
+ checkOutput("pkg/C.html", false,
+ "<span><a href=\"javascript:show(4);\">Abstract Methods</a></span>"
+ + "<span class=\"tabEnd\"> </span>");
}
}