diff -r 601a611d0aee -r af1a0220d0fa langtools/test/com/sun/javadoc/testRelativeLinks/TestRelativeLinks.java --- a/langtools/test/com/sun/javadoc/testRelativeLinks/TestRelativeLinks.java Fri May 09 23:31:05 2014 +0200 +++ b/langtools/test/com/sun/javadoc/testRelativeLinks/TestRelativeLinks.java Fri May 09 15:37:12 2014 -0700 @@ -27,81 +27,64 @@ * @summary Test to make sure that relative paths are redirected in the * output so that they are not broken. * @author jamieh - * @library ../lib/ + * @library ../lib * @build JavadocTester - * @build TestRelativeLinks * @run main TestRelativeLinks */ public class TestRelativeLinks extends JavadocTester { - //Javadoc arguments. - private static final String[] ARGS = new String[] { - "-d", OUTPUT_DIR, "-use", "-sourcepath", SRC_DIR, "pkg", "pkg2" - }; + public static void main(String... args) throws Exception { + TestRelativeLinks tester = new TestRelativeLinks(); + tester.runTests(); + } - //Input for string search tests. - private static final String[][] TEST = { - //These relative paths should stay relative because they appear - //in the right places. - { "pkg/C.html", - "relative class link"}, - { "pkg/C.html", - "relative field link"}, - { "pkg/C.html", - "relative method link"}, - { "pkg/package-summary.html", - "relative package link"}, - { "pkg/C.html", + @Test + void test() { + javadoc("-d", "out", + "-use", + "-sourcepath", testSrc, + "pkg", "pkg2"); + checkExit(Exit.OK); + + // These relative paths should stay relative because they appear + // in the right places. + checkOutput("pkg/C.html", true, + "relative class link", + "relative field link", + "relative method link", " relative-multi-line-link."}, - - //These relative paths should be redirected because they are in different - //places. + " href=\"relative-multi-line-link.html\">relative-multi-line-link."); + checkOutput("pkg/package-summary.html", true, + "relative package link"); - //INDEX PAGE - { "index-all.html", - "relative class link"}, - { "index-all.html", - "relative field link"}, - { "index-all.html", - "relative method link"}, - { "index-all.html", - "relative package link"}, - { "index-all.html", + // These relative paths should be redirected because they are in different + // places. + + // INDEX PAGE + checkOutput("index-all.html", true, + "relative class link", + "relative field link", + "relative method link", + "relative package link", " relative-multi-line-link."}, - - - //PACKAGE USE - { "pkg/package-use.html", - "relative package link."}, - { "pkg/package-use.html", - "relative class link"}, + " href=\"./pkg/relative-multi-line-link.html\">relative-multi-line-link."); - //CLASS_USE - { "pkg/class-use/C.html", - "relative field link"}, - { "pkg/class-use/C.html", - "relative method link"}, - { "pkg/class-use/C.html", - "relative package link"}, - { "pkg/class-use/C.html", - " relative-multi-line-link."}, + // PACKAGE USE + checkOutput("pkg/package-use.html", true, + "relative package link.", + "relative class link"); - //PACKAGE OVERVIEW - { "overview-summary.html", - "relative package link"}, - }; + // CLASS_USE + checkOutput("pkg/class-use/C.html", true, + "relative field link", + "relative method link", + "relative package link", + " relative-multi-line-link."); - /** - * The entry point of the test. - * @param args the array of command line arguments. - */ - public static void main(String[] args) { - TestRelativeLinks tester = new TestRelativeLinks(); - tester.run(ARGS, TEST, NO_TEST); - tester.printSummary(); + // PACKAGE OVERVIEW + checkOutput("overview-summary.html", true, + "relative package link"); } }