24 /* |
24 /* |
25 * @test |
25 * @test |
26 * @bug 4637604 4775148 |
26 * @bug 4637604 4775148 |
27 * @summary Test the tables for summary attribute |
27 * @summary Test the tables for summary attribute |
28 * @author dkramer |
28 * @author dkramer |
29 * @library ../lib/ |
29 * @library ../lib |
30 * @build JavadocTester |
30 * @build JavadocTester |
31 * @build AccessSummary |
|
32 * @run main AccessSummary |
31 * @run main AccessSummary |
33 */ |
32 */ |
34 |
33 |
35 public class AccessSummary extends JavadocTester { |
34 public class AccessSummary extends JavadocTester { |
36 |
|
37 /** |
|
38 * Assign value for [ fileToSearch, stringToFind ] |
|
39 */ |
|
40 private static final String[][] TESTARRAY1 = { |
|
41 |
|
42 // Test that the summary attribute appears |
|
43 { "overview-summary.html", |
|
44 "summary=\"Packages table, listing packages, and an explanation\"" }, |
|
45 |
|
46 // Test that the summary attribute appears |
|
47 { "p1/C1.html", |
|
48 "summary=\"Constructor Summary table, listing constructors, and an explanation\"" }, |
|
49 |
|
50 // Test that the summary attribute appears |
|
51 { "constant-values.html", |
|
52 "summary=\"Constant Field Values table, listing constant fields, and values\"" } |
|
53 }; |
|
54 |
|
55 // First test with -header only |
|
56 private static final String[] JAVADOC_ARGS = new String[] { |
|
57 "-d", OUTPUT_DIR, |
|
58 "-sourcepath", SRC_DIR, |
|
59 "p1", "p2"}; |
|
60 |
|
61 /** |
35 /** |
62 * The entry point of the test. |
36 * The entry point of the test. |
63 * @param args the array of command line arguments. |
37 * @param args the array of command line arguments. |
|
38 * @throws Exception if the test fails |
64 */ |
39 */ |
65 public static void main(String[] args) { |
40 public static void main(String... args) throws Exception { |
66 JavadocTester tester = new AccessSummary(); |
41 AccessSummary tester = new AccessSummary(); |
67 tester.run(JAVADOC_ARGS, TESTARRAY1, new String[][] {}); |
42 tester.runTests(); |
68 tester.printSummary(); // Necessary for string search |
43 } |
|
44 |
|
45 @Test |
|
46 void testAccessSummary() { |
|
47 javadoc("-d", "out", "-sourcepath", testSrc, "p1", "p2"); |
|
48 checkExit(Exit.OK); |
|
49 checkOutput("overview-summary.html", true, |
|
50 "summary=\"Packages table, listing packages, and an explanation\""); |
|
51 |
|
52 // Test that the summary attribute appears |
|
53 checkOutput("p1/C1.html", true, |
|
54 "summary=\"Constructor Summary table, listing constructors, and an explanation\""); |
|
55 |
|
56 // Test that the summary attribute appears |
|
57 checkOutput("constant-values.html", true, |
|
58 "summary=\"Constant Field Values table, listing constant fields, and values\""); |
69 } |
59 } |
70 } |
60 } |