|
1 /* |
|
2 * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. |
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 * |
|
5 * This code is free software; you can redistribute it and/or modify it |
|
6 * under the terms of the GNU General Public License version 2 only, as |
|
7 * published by the Free Software Foundation. |
|
8 * |
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
|
13 * accompanied this code). |
|
14 * |
|
15 * You should have received a copy of the GNU General Public License version |
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 * |
|
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
|
20 * CA 95054 USA or visit www.sun.com if you need additional information or |
|
21 * have any questions. |
|
22 */ |
|
23 |
|
24 /* |
|
25 * @test |
|
26 * @bug 4657239 4775743 |
|
27 * @summary Make sure a notification is printed when an output directory must |
|
28 * be created. |
|
29 * Make sure classname is not include in javadoc usage message. |
|
30 * @author jamieh |
|
31 * @library ../lib/ |
|
32 * @build JavadocTester |
|
33 * @build TestNotifications |
|
34 * @run main TestNotifications |
|
35 */ |
|
36 |
|
37 public class TestNotifications extends JavadocTester { |
|
38 |
|
39 //Test information. |
|
40 private static final String BUG_ID = "4657239"; |
|
41 |
|
42 //Javadoc arguments. |
|
43 private static final String[] ARGS = new String[] { |
|
44 "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" |
|
45 }; |
|
46 |
|
47 private static final String[] ARGS2 = new String[] { |
|
48 "-help" |
|
49 }; |
|
50 |
|
51 //Input for string search tests. |
|
52 private static final String[][] TEST = { |
|
53 {NOTICE_OUTPUT, "Creating destination directory: \"4657239"} |
|
54 }; |
|
55 private static final String[][] NEGATED_TEST = { |
|
56 {NOTICE_OUTPUT, "Creating destination directory: \"4657239"} |
|
57 }; |
|
58 |
|
59 private static final String[][] NEGATED_TEST2 = { |
|
60 {NOTICE_OUTPUT, "[classnames]"} |
|
61 }; |
|
62 |
|
63 /** |
|
64 * The entry point of the test. |
|
65 * @param args the array of command line arguments. |
|
66 */ |
|
67 public static void main(String[] args) { |
|
68 TestNotifications tester = new TestNotifications(); |
|
69 // Notify that the destination directory must be created. |
|
70 run(tester, ARGS, TEST, NO_TEST); |
|
71 // No need to notify that the destination must be created because |
|
72 // it already exists. |
|
73 run(tester, ARGS, NO_TEST, NEGATED_TEST); |
|
74 //Make sure classname is not include in javadoc usage message. |
|
75 run(tester, ARGS2, NO_TEST, NEGATED_TEST2); |
|
76 tester.printSummary(); |
|
77 } |
|
78 |
|
79 /** |
|
80 * {@inheritDoc} |
|
81 */ |
|
82 public String getBugId() { |
|
83 return BUG_ID; |
|
84 } |
|
85 |
|
86 /** |
|
87 * {@inheritDoc} |
|
88 */ |
|
89 public String getBugName() { |
|
90 return getClass().getName(); |
|
91 } |
|
92 } |