langtools/test/com/sun/javadoc/testNotifications/TestNotifications.java
changeset 24399 af1a0220d0fa
parent 24217 25b12d4d4192
child 30730 d3ce7619db2c
--- a/langtools/test/com/sun/javadoc/testNotifications/TestNotifications.java	Fri May 09 23:31:05 2014 +0200
+++ b/langtools/test/com/sun/javadoc/testNotifications/TestNotifications.java	Fri May 09 15:37:12 2014 -0700
@@ -28,50 +28,43 @@
  *           be created.
  *           Make sure classname is not include in javadoc usage message.
  * @author   jamieh
- * @library  ../lib/
+ * @library ../lib
  * @build    JavadocTester
- * @build    TestNotifications
  * @run main TestNotifications
  */
 
 public class TestNotifications extends JavadocTester {
 
-    //Javadoc arguments.
-    private static final String[] ARGS = new String[] {
-        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"
-    };
-
-    private static final String[] ARGS2 = new String[] {
-        "-help"
-    };
+    public static void main(String... args) throws Exception {
+        TestNotifications tester = new TestNotifications();
+        tester.runTests();
+    }
 
-    //Input for string search tests.
-    private static final String[][] TEST = {
-        {NOTICE_OUTPUT, "Creating destination directory: \"" + OUTPUT_DIR}
-    };
-    private static final String[][] NEGATED_TEST = {
-        {NOTICE_OUTPUT, "Creating destination directory: \"" + OUTPUT_DIR}
-    };
+    @Test
+    void test1() {
+        String outDir = "out";
 
-    private static final String[][] NEGATED_TEST2 = {
-        {NOTICE_OUTPUT, "[classnames]"}
-    };
+        // Notify that the destination directory must be created.
+        javadoc("-d", outDir, "-sourcepath", testSrc, "pkg");
+        checkExit(Exit.OK);
+        checkOutput(Output.NOTICE, true,
+                "Creating destination directory: \"" + outDir);
 
-    /**
-     * The entry point of the test.
-     * @param args the array of command line arguments.
-     */
-    public static void main(String[] args) {
-        TestNotifications tester = new TestNotifications();
-        // Notify that the destination directory must be created.
-        tester.run(ARGS, TEST, NO_TEST);
         // No need to notify that the destination must be created because
         // it already exists.
-        tester.setCheckOutputDirectoryCheck(DirectoryCheck.NONE);
-        tester.run(ARGS, NO_TEST, NEGATED_TEST);
-        tester.setCheckOutputDirectoryCheck(DirectoryCheck.NO_HTML_FILES);
+        setOutputDirectoryCheck(DirectoryCheck.NONE);
+        javadoc("-d", outDir, "-sourcepath", testSrc, "pkg");
+        checkExit(Exit.OK);
+        checkOutput(Output.NOTICE, false,
+                "Creating destination directory: \"" + outDir);
+    }
+
+    @Test
+    void test() {
         //Make sure classname is not include in javadoc usage message.
-        tester.run(ARGS2, NO_TEST, NEGATED_TEST2);
-        tester.printSummary();
+        setOutputDirectoryCheck(DirectoryCheck.NO_HTML_FILES);
+        javadoc("-help");
+        checkOutput(Output.NOTICE, false,
+                "[classnames]");
     }
 }