langtools/test/com/sun/javadoc/T6735320/T6735320.java
changeset 24399 af1a0220d0fa
parent 24072 e7549dcbc4af
child 30730 d3ce7619db2c
--- a/langtools/test/com/sun/javadoc/T6735320/T6735320.java	Fri May 09 23:31:05 2014 +0200
+++ b/langtools/test/com/sun/javadoc/T6735320/T6735320.java	Fri May 09 15:37:12 2014 -0700
@@ -25,24 +25,24 @@
  * @test
  * @bug 6735320
  * @summary javadoc throws exception if serialField value is missing
- * @library  ../lib/
- * @build    JavadocTester T6735320
+ * @library ../lib
+ * @build JavadocTester
  * @run main T6735320
  */
+
 public class T6735320 extends JavadocTester {
 
-    private static final String[] ARGS = new String[]{
-        "-d", OUTPUT_DIR + ".out",
-        SRC_DIR + "/SerialFieldTest.java"
-    };
-
-    public static void main(String... args) {
+    public static void main(String... args) throws Exception {
         T6735320 tester = new T6735320();
-        if (tester.runJavadoc(ARGS) == 0) {
-            throw new AssertionError("zero return code from javadoc");
-        }
-        if (tester.getErrorOutput().contains("StringIndexOutOfBoundsException")) {
-            throw new AssertionError("javadoc threw StringIndexOutOfBoundsException");
-        }
+        tester.runTests();
+    }
+
+    @Test
+    void test() {
+        javadoc("-d", "out",
+                testSrc("SerialFieldTest.java"));
+        checkExit(Exit.FAILED);
+        checkOutput(Output.STDERR, false,
+                "StringIndexOutOfBoundsException");
     }
 }