langtools/test/com/sun/javadoc/testAbsLinkPath/TestAbsLinkPath.java
changeset 24399 af1a0220d0fa
parent 24072 e7549dcbc4af
child 30730 d3ce7619db2c
--- a/langtools/test/com/sun/javadoc/testAbsLinkPath/TestAbsLinkPath.java	Fri May 09 23:31:05 2014 +0200
+++ b/langtools/test/com/sun/javadoc/testAbsLinkPath/TestAbsLinkPath.java	Fri May 09 15:37:12 2014 -0700
@@ -26,33 +26,31 @@
  * @bug 4640745
  * @summary This test verifys that the -link option handles absolute paths.
  * @author jamieh
- * @library ../lib/
+ * @library ../lib
  * @build JavadocTester
- * @build TestAbsLinkPath
  * @run main TestAbsLinkPath
  */
 
 public class TestAbsLinkPath extends JavadocTester {
 
-    private static final String[][] TEST = {
-        { "pkg1/C1.html", "C2.html"}};
+    public static void main(String... args) throws Exception {
+        TestAbsLinkPath tester = new TestAbsLinkPath();
+        tester.runTests();
+    }
 
-    private static final String[] ARGS1 =
-        new String[] {
-            "-d", "tmp2", "-sourcepath", SRC_DIR, "pkg2"};
-    private static final String[] ARGS2 =
-        new String[] {
-            "-d", "tmp", "-sourcepath", SRC_DIR,
-            "-link", "../tmp2", "pkg1"};
+    @Test
+    void test1() {
+        String out1 = "out1";
+        javadoc("-d", out1, "-sourcepath", testSrc, "pkg2");
+        checkExit(Exit.OK);
 
-    /**
-     * The entry point of the test.
-     * @param args the array of command line arguments.
-     */
-    public static void main(String[] args) {
-        TestAbsLinkPath tester = new TestAbsLinkPath();
-        tester.run(ARGS1, NO_TEST, NO_TEST);
-        tester.run(ARGS2,  TEST, NO_TEST);
-        tester.printSummary();
+        javadoc("-d", "out2",
+                "-sourcepath", testSrc,
+                "-link", "../" + out1,
+                "pkg1");
+        checkExit(Exit.OK);
+
+        checkOutput("pkg1/C1.html", true,
+                "C2.html");
     }
 }