24 /* |
24 /* |
25 * @test |
25 * @test |
26 * @bug 8006124 8009684 8015663 8015496 8026567 |
26 * @bug 8006124 8009684 8015663 8015496 8026567 |
27 * @summary Test javadoc options support for profiles. |
27 * @summary Test javadoc options support for profiles. |
28 * @author Evgeniya Stepanova |
28 * @author Evgeniya Stepanova |
29 * @library ../lib/ |
29 * @library ../lib |
30 * @build JavadocTester TestProfilesConfiguration |
30 * @build JavadocTester |
31 * @run main TestProfilesConfiguration |
31 * @run main TestProfilesConfiguration |
32 */ |
32 */ |
33 public class TestProfilesConfiguration extends JavadocTester { |
33 public class TestProfilesConfiguration extends JavadocTester { |
34 |
34 |
35 //Test information. |
35 public static void main(String... args) throws Exception { |
36 private static final String PROFILE_CONFIGURATION_OUTPUT_DIR = OUTPUT_DIR + "-3"; |
36 TestProfilesConfiguration tester = new TestProfilesConfiguration(); |
37 private static final String NODEPR_NOPKGS_OUTPUT_DIR = OUTPUT_DIR + "-4"; |
37 tester.runTests(); |
38 //Javadoc arguments. |
38 // tester.run(ARGS3, PROFILES_CONFIGURATION_TEST, PROFILES_CONFIGURATION_NEGATED_TEST); |
39 private static final String[] ARGS3 = new String[]{ |
39 // tester.run(ARGS4, NODEPR_NOPKGS_TEST, NODEPR_NOPKGS_NEGATED_TEST); |
40 "-d", PROFILE_CONFIGURATION_OUTPUT_DIR, "-sourcepath", SRC_DIR, |
40 // tester.printSummary(); |
41 "-nocomment", "-keywords", "-Xprofilespath", SRC_DIR + |
41 } |
42 "/profile-rtjar-includes.txt", "-doctitle", "Simple doctitle", |
|
43 "-use", "pkg3", "pkg1", "pkg2", "pkg4", |
|
44 "pkg5", "-packagesheader", "Simple packages header","pkgDeprecated" |
|
45 }; |
|
46 private static final String[] ARGS4 = new String[]{ |
|
47 "-d", NODEPR_NOPKGS_OUTPUT_DIR, "-sourcepath", SRC_DIR, "-nocomment", |
|
48 "-nodeprecated", "-keywords", "-Xprofilespath", SRC_DIR + |
|
49 "/profile-rtjar-includes-nopkgs.txt", "-doctitle", "Simple doctitle", |
|
50 "-use", "-packagesheader", "Simple packages header", |
|
51 "pkg1", "pkg2", "pkg3", "pkg4", "pkg5", "pkgDeprecated" |
|
52 }; |
|
53 private static final String[][] NODEPR_NOPKGS_TEST = { |
|
54 { "overview-summary.html", |
|
55 "<ul>\n" + |
|
56 "<li><a href=\"compact2-summary.html\" target=\"classFrame\">" + |
|
57 "compact2</a></li>\n" + |
|
58 "<li><a href=\"compact3-summary.html\" target=\"" + |
|
59 "classFrame\">compact3</a></li>\n" + |
|
60 "</ul>" |
|
61 }, |
|
62 { "profile-overview-frame.html", |
|
63 "<ul title=\"Profiles\">\n" + |
|
64 "<li><a href=\"compact2-frame.html\" target=\"packageListFrame\">" + |
|
65 "compact2</a></li>\n" + |
|
66 "<li><a href=\"compact3-frame.html\" target=\"" + |
|
67 "packageListFrame\">compact3</a></li>\n" + |
|
68 "</ul>" |
|
69 } |
|
70 }; |
|
71 private static final String[][] NODEPR_NOPKGS_NEGATED_TEST = { |
|
72 { "overview-summary.html", |
|
73 "compact1" |
|
74 } |
|
75 }; |
|
76 |
42 |
77 private static final String[][] PROFILES_CONFIGURATION_TEST = { |
43 @Test |
78 //-use option test string fo profile view page |
44 void testProfiles() { |
79 { "compact1-summary.html","<li>Use</li>" |
45 javadoc("-d", "out-profiles", |
80 }, |
46 "-sourcepath", testSrc, |
81 //-doctitle option test string |
47 "-nocomment", |
82 { "overview-summary.html", |
48 "-keywords", |
83 "<div class=\"header\">\n" + |
49 "-Xprofilespath", testSrc("profile-rtjar-includes.txt"), |
84 "<h1 class=\"title\">Simple doctitle</h1>" |
50 "-doctitle", "Simple doctitle", |
85 }, |
51 "-use", |
86 //-packagesheader option test string fo profiles |
52 "-packagesheader", "Simple packages header", |
87 { "profile-overview-frame.html", |
53 "pkg3", "pkg1", "pkg2", "pkg4", "pkg5", "pkgDeprecated"); |
88 "<h1 title=\"Simple packages header\" class=\"bar\">Simple packages header</h1>" |
54 checkExit(Exit.OK); |
89 }, |
55 |
90 //-keywords option test string for profiles |
56 checkOutput("compact1-summary.html", true, |
91 { "compact1-summary.html", |
57 //-use option test string fo profile view page |
92 "<meta name=\"keywords\" content=\"compact1 profile\">" |
58 "<li>Use</li>", |
93 }, |
59 // -keywords option test string for profiles |
94 //Deprecated information on a package |
60 "<meta name=\"keywords\" content=\"compact1 profile\">", |
95 { "compact1-summary.html", |
61 // Deprecated information on a package |
96 "<h3><a href=\"pkgDeprecated/compact1-package-summary.html\" target=\"" + |
62 "<h3><a href=\"pkgDeprecated/compact1-package-summary.html\" target=\"" |
97 "classFrame\">pkgDeprecated</a></h3>\n" + |
63 + "classFrame\">pkgDeprecated</a></h3>\n" |
98 "<div class=\"deprecatedContent\">" + |
64 + "<div class=\"deprecatedContent\">" |
99 "<span class=\"deprecatedLabel\">Deprecated.</span></div>" |
65 + "<span class=\"deprecatedLabel\">Deprecated.</span></div>" |
100 } |
66 ); |
101 }; |
67 |
102 private static final String[][] PROFILES_CONFIGURATION_NEGATED_TEST = { |
|
103 //-nocomments option test string |
68 //-nocomments option test string |
104 { "compact1-summary.html", |
69 checkOutput("compact1-summary.html", false, |
105 "<div class=\"block\"><i>Class1Pkg2.</i></div>" |
70 "<div class=\"block\"><i>Class1Pkg2.</i></div>" |
106 } |
71 ); |
107 }; |
|
108 |
72 |
109 /** |
73 // -doctitle option test string |
110 * The entry point of the test. |
74 checkOutput("overview-summary.html", true, |
111 * |
75 "<div class=\"header\">\n" |
112 * @param args the array of command line arguments. |
76 + "<h1 class=\"title\">Simple doctitle</h1>" |
113 */ |
77 ); |
114 public static void main(String[] args) { |
78 |
115 TestProfilesConfiguration tester = new TestProfilesConfiguration(); |
79 // -packagesheader option test string fo profiles |
116 tester.run(ARGS3, PROFILES_CONFIGURATION_TEST, |
80 checkOutput("profile-overview-frame.html", true, |
117 PROFILES_CONFIGURATION_NEGATED_TEST); |
81 "<h1 title=\"Simple packages header\" class=\"bar\">Simple packages header</h1>" |
118 tester.run(ARGS4, NODEPR_NOPKGS_TEST, |
82 ); |
119 NODEPR_NOPKGS_NEGATED_TEST); |
83 } |
120 tester.printSummary(); |
84 |
|
85 |
|
86 @Test |
|
87 void testNoDeprNoPackages() { |
|
88 javadoc("-d", "out-noDeprNoPackages", |
|
89 "-sourcepath", testSrc, |
|
90 "-nocomment", |
|
91 "-nodeprecated", |
|
92 "-keywords", |
|
93 "-Xprofilespath", testSrc("profile-rtjar-includes-nopkgs.txt"), |
|
94 "-doctitle", "Simple doctitle", |
|
95 "-use", |
|
96 "-packagesheader", "Simple packages header", |
|
97 "pkg1", "pkg2", "pkg3", "pkg4", "pkg5", "pkgDeprecated"); |
|
98 checkExit(Exit.OK); |
|
99 |
|
100 checkOutput("overview-summary.html", true, |
|
101 "<ul>\n" |
|
102 + "<li><a href=\"compact2-summary.html\" target=\"classFrame\">" |
|
103 + "compact2</a></li>\n" |
|
104 + "<li><a href=\"compact3-summary.html\" target=\"" |
|
105 + "classFrame\">compact3</a></li>\n" |
|
106 + "</ul>" |
|
107 ); |
|
108 |
|
109 checkOutput("profile-overview-frame.html", true, |
|
110 "<ul title=\"Profiles\">\n" |
|
111 + "<li><a href=\"compact2-frame.html\" target=\"packageListFrame\">" |
|
112 + "compact2</a></li>\n" |
|
113 + "<li><a href=\"compact3-frame.html\" target=\"" |
|
114 + "packageListFrame\">compact3</a></li>\n" |
|
115 + "</ul>" |
|
116 ); |
|
117 |
|
118 checkOutput("overview-summary.html", false, |
|
119 "compact1" |
|
120 ); |
|
121 |
121 } |
122 } |
122 } |
123 } |