langtools/test/com/sun/javadoc/testTopOption/TestTopOption.java
changeset 24399 af1a0220d0fa
parent 24072 e7549dcbc4af
child 24603 43e7e44d63da
--- a/langtools/test/com/sun/javadoc/testTopOption/TestTopOption.java	Fri May 09 23:31:05 2014 +0200
+++ b/langtools/test/com/sun/javadoc/testTopOption/TestTopOption.java	Fri May 09 15:37:12 2014 -0700
@@ -26,55 +26,44 @@
  * @bug      6227616
  * @summary  Test the new -top option.
  * @author   jamieh
- * @library  ../lib/
+ * @library  ../lib
  * @build    JavadocTester
- * @build    TestTopOption
  * @run main TestTopOption
  */
 
 public class TestTopOption extends JavadocTester {
 
-    //Javadoc arguments.
-    private static final String[] ARGS = new String[] {
-        "-overview", "SRC_DIR + '/' + overview.html", "-use", "-top",
-        "TOP TEXT", "-d", OUTPUT_DIR, "-sourcepath",
-        SRC_DIR, "pkg"
-    };
+    public static void main(String... args) throws Exception {
+        TestTopOption tester = new TestTopOption();
+        tester.runTests();
+    }
 
-    //Input for string search tests.
-    private static final String[][] TEST = {
-        { "pkg/AnnotationType.html",
-            "TOP TEXT"},
-        { "pkg/class-use/AnnotationType.html",
-            "TOP TEXT"},
-
-        { "pkg/Cl.html",
-            "TOP TEXT"},
-        { "pkg/class-use/Cl.html",
-            "TOP TEXT"},
+    @Test
+    void test() {
+        javadoc("-overview", testSrc("overview.html"),
+                "-use",
+                "-top", "TOP TEXT",
+                "-d", "out",
+                "-sourcepath", testSrc,
+                "pkg");
+        checkExit(Exit.OK);
 
-        { "pkg/package-summary.html",
-            "TOP TEXT"},
-        { "pkg/package-use.html",
-           "TOP TEXT"},
+        checkTopText(
+                "pkg/AnnotationType.html",
+                "pkg/class-use/AnnotationType.html",
+                "pkg/Cl.html",
+                "pkg/class-use/Cl.html",
+                "pkg/package-summary.html",
+                "pkg/package-use.html",
+                "overview-summary.html",
+                "overview-tree.html",
+                "constant-values.html",
+                "help-doc.html");
+    }
 
-        { "overview-summary.html",
-            "TOP TEXT"},
-        { "overview-tree.html",
-            "TOP TEXT"},
-        { "constant-values.html",
-            "TOP TEXT"},
-        { "help-doc.html",
-            "TOP TEXT"},
-    };
-
-    /**
-     * The entry point of the test.
-     * @param args the array of command line arguments.
-     */
-    public static void main(String[] args) {
-        TestTopOption tester = new TestTopOption();
-        tester.run(ARGS, TEST, NO_TEST);
-        tester.printSummary();
+    void checkTopText(String... files) {
+        for (String file : files) {
+            checkOutput(file, true, "TOP TEXT");
+        }
     }
 }