25 * @test |
25 * @test |
26 * @bug 4691095 6306394 |
26 * @bug 4691095 6306394 |
27 * @summary Test to make sure that Javadoc emits a useful warning |
27 * @summary Test to make sure that Javadoc emits a useful warning |
28 * when a bad package.html file is in the JAR. |
28 * when a bad package.html file is in the JAR. |
29 * @author jamieh |
29 * @author jamieh |
30 * @library ../lib/ |
30 * @library ../lib |
31 * @build JavadocTester |
31 * @build JavadocTester |
32 * @build TestBadPackageFileInJar |
|
33 * @run main TestBadPackageFileInJar |
32 * @run main TestBadPackageFileInJar |
34 */ |
33 */ |
35 |
34 |
36 public class TestBadPackageFileInJar extends JavadocTester { |
35 public class TestBadPackageFileInJar extends JavadocTester { |
37 |
36 |
38 private static final String[][] TEST = |
37 public static void main(String... args) throws Exception { |
39 new String[][] { |
38 TestBadPackageFileInJar tester = new TestBadPackageFileInJar(); |
40 {ERROR_OUTPUT, |
39 tester.runTests(); |
41 "badPackageFileInJar.jar" + FS + "pkg/package.html: error - Body tag missing from HTML"} |
40 } |
42 }; |
|
43 |
41 |
44 private static final String[] ARGS = |
42 @Test |
45 new String[] { |
43 void test() { |
46 "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-classpath", |
44 javadoc("-d", "out", |
47 SRC_DIR + "/badPackageFileInJar.jar", "pkg"}; |
45 "-sourcepath", testSrc, |
|
46 "-classpath", testSrc("badPackageFileInJar.jar"), |
|
47 "pkg"); |
|
48 checkExit(Exit.FAILED); |
48 |
49 |
49 |
50 checkOutput(Output.ERROR, true, |
50 /** |
51 "badPackageFileInJar.jar" + FS + "pkg/package.html: error - Body tag missing from HTML"); |
51 * The entry point of the test. |
|
52 * @param args the array of command line arguments. |
|
53 */ |
|
54 public static void main(String[] args) { |
|
55 TestBadPackageFileInJar tester = new TestBadPackageFileInJar(); |
|
56 tester.run(ARGS, TEST, NO_TEST); |
|
57 tester.printSummary(); |
|
58 } |
52 } |
59 } |
53 } |