langtools/test/com/sun/javadoc/testCharset/TestCharset.java
changeset 24399 af1a0220d0fa
parent 24072 e7549dcbc4af
child 26665 e813baa25bf2
--- a/langtools/test/com/sun/javadoc/testCharset/TestCharset.java	Fri May 09 23:31:05 2014 +0200
+++ b/langtools/test/com/sun/javadoc/testCharset/TestCharset.java	Fri May 09 15:37:12 2014 -0700
@@ -27,39 +27,34 @@
  * @summary  Run a test on -charset to make sure the charset gets generated as a
  *           part of the meta tag.
  * @author   Bhavesh Patel
- * @library  ../lib/
- * @build    JavadocTester TestCharset
+ * @library  ../lib
+ * @build    JavadocTester
  * @run main TestCharset
  */
 
 public class TestCharset extends JavadocTester {
 
-    //Javadoc arguments.
-    private static final String[] ARGS = new String[] {
-        "-d", OUTPUT_DIR, "-charset", "UTF-8", "-sourcepath", SRC_DIR, "pkg"
-    };
-
-    private static final String[][] TEST = {
-        { "index.html",
-            "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">"},
-        { "pkg/Foo.html",
-            "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">"}
-    };
+    public static void main(String... args) throws Exception {
+        TestCharset tester = new TestCharset();
+        tester.runTests();
+    }
 
-    private static final String[][] NEGATED_TEST = {
-        { "index.html",
-            "<meta http-equiv=\"Content-Type\" content=\"text/html\" charset=\"UTF-8\">"},
-        { "pkg/Foo.html",
-            "<meta http-equiv=\"Content-Type\" content=\"text/html\" charset=\"UTF-8\">"}
-    };
+    @Test
+    void test() {
+        javadoc("-d", "out",
+                "-charset", "UTF-8",
+                "-sourcepath", testSrc,
+                "pkg");
+        checkExit(Exit.OK);
 
-    /**
-     * The entry point of the test.
-     * @param args the array of command line arguments.
-     */
-    public static void main(String[] args) {
-        TestCharset tester = new TestCharset();
-        tester.run(ARGS, TEST, NEGATED_TEST);
-        tester.printSummary();
+        checkOutput("index.html", true,
+            "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">");
+        checkOutput("pkg/Foo.html", true,
+            "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">");
+
+        checkOutput("index.html", false,
+            "<meta http-equiv=\"Content-Type\" content=\"text/html\" charset=\"UTF-8\">");
+        checkOutput("pkg/Foo.html", false,
+            "<meta http-equiv=\"Content-Type\" content=\"text/html\" charset=\"UTF-8\">");
     }
 }