|
1 /* |
|
2 * Copyright 2003-2004 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 4927552 |
|
27 * @summary <DESC> |
|
28 * @author jamieh |
|
29 * @library ../lib/ |
|
30 * @build JavadocTester |
|
31 * @build TestDeprecatedDocs |
|
32 * @run main TestDeprecatedDocs |
|
33 */ |
|
34 |
|
35 public class TestDeprecatedDocs extends JavadocTester { |
|
36 |
|
37 //Test information. |
|
38 private static final String BUG_ID = "4927552"; |
|
39 |
|
40 //Javadoc arguments. |
|
41 private static final String[] ARGS = new String[] { |
|
42 "-d", BUG_ID, "-source", "1.5", "-sourcepath", SRC_DIR, "pkg" |
|
43 }; |
|
44 |
|
45 private static final String TARGET_FILE = |
|
46 BUG_ID + FS + "deprecated-list.html"; |
|
47 |
|
48 private static final String TARGET_FILE2 = |
|
49 BUG_ID + FS + "pkg" + FS + "DeprecatedClassByAnnotation.html"; |
|
50 |
|
51 //Input for string search tests. |
|
52 private static final String[][] TEST = { |
|
53 {TARGET_FILE, "annotation_test1 passes"}, |
|
54 {TARGET_FILE, "annotation_test2 passes"}, |
|
55 {TARGET_FILE, "annotation_test3 passes"}, |
|
56 {TARGET_FILE, "class_test1 passes"}, |
|
57 {TARGET_FILE, "class_test2 passes"}, |
|
58 {TARGET_FILE, "class_test3 passes"}, |
|
59 {TARGET_FILE, "class_test4 passes"}, |
|
60 {TARGET_FILE, "enum_test1 passes"}, |
|
61 {TARGET_FILE, "enum_test2 passes"}, |
|
62 {TARGET_FILE, "error_test1 passes"}, |
|
63 {TARGET_FILE, "error_test2 passes"}, |
|
64 {TARGET_FILE, "error_test3 passes"}, |
|
65 {TARGET_FILE, "error_test4 passes"}, |
|
66 {TARGET_FILE, "exception_test1 passes"}, |
|
67 {TARGET_FILE, "exception_test2 passes"}, |
|
68 {TARGET_FILE, "exception_test3 passes"}, |
|
69 {TARGET_FILE, "exception_test4 passes"}, |
|
70 {TARGET_FILE, "interface_test1 passes"}, |
|
71 {TARGET_FILE, "interface_test2 passes"}, |
|
72 {TARGET_FILE, "interface_test3 passes"}, |
|
73 {TARGET_FILE, "interface_test4 passes"}, |
|
74 {TARGET_FILE, "pkg.DeprecatedClassByAnnotation"}, |
|
75 {TARGET_FILE, "pkg.DeprecatedClassByAnnotation()"}, |
|
76 {TARGET_FILE, "pkg.DeprecatedClassByAnnotation.method()"}, |
|
77 {TARGET_FILE, "pkg.DeprecatedClassByAnnotation.field"}, |
|
78 |
|
79 {TARGET_FILE2, "<B>Deprecated.</B>" + NL + |
|
80 "<P>" + NL + |
|
81 "<DL>" + NL + |
|
82 "<DT><PRE><FONT SIZE=\"-1\">@Deprecated" + NL + |
|
83 "</FONT>public class <B>DeprecatedClassByAnnotation</B>"}, |
|
84 |
|
85 {TARGET_FILE2, "public int <B>field</B></PRE>" + NL + |
|
86 "<DL>" + NL + |
|
87 "<DD><B>Deprecated.</B> <DL>"}, |
|
88 |
|
89 {TARGET_FILE2, "<FONT SIZE=\"-1\">@Deprecated" + NL + |
|
90 "</FONT>public <B>DeprecatedClassByAnnotation</B>()</PRE>" + NL + |
|
91 "<DL>" + NL + |
|
92 "<DD><B>Deprecated.</B>"}, |
|
93 |
|
94 {TARGET_FILE2, "<FONT SIZE=\"-1\">@Deprecated" + NL + |
|
95 "</FONT>public void <B>method</B>()</PRE>" + NL + |
|
96 "<DL>" + NL + |
|
97 "<DD><B>Deprecated.</B>"}, |
|
98 }; |
|
99 |
|
100 private static final String[][] NEGATED_TEST = NO_TEST; |
|
101 |
|
102 /** |
|
103 * The entry point of the test. |
|
104 * @param args the array of command line arguments. |
|
105 */ |
|
106 public static void main(String[] args) { |
|
107 TestDeprecatedDocs tester = new TestDeprecatedDocs(); |
|
108 run(tester, ARGS, TEST, NEGATED_TEST); |
|
109 tester.printSummary(); |
|
110 } |
|
111 |
|
112 /** |
|
113 * {@inheritDoc} |
|
114 */ |
|
115 public String getBugId() { |
|
116 return BUG_ID; |
|
117 } |
|
118 |
|
119 /** |
|
120 * {@inheritDoc} |
|
121 */ |
|
122 public String getBugName() { |
|
123 return getClass().getName(); |
|
124 } |
|
125 } |