1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java Wed Apr 27 01:34:52 2016 +0800 1.3 @@ -0,0 +1,120 @@ 1.4 +/* 1.5 + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. 1.11 + * 1.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.15 + * version 2 for more details (a copy is included in the LICENSE file that 1.16 + * accompanied this code). 1.17 + * 1.18 + * You should have received a copy of the GNU General Public License version 1.19 + * 2 along with this work; if not, write to the Free Software Foundation, 1.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.21 + * 1.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.23 + * or visit www.oracle.com if you need additional information or have any 1.24 + * questions. 1.25 + */ 1.26 + 1.27 +/* 1.28 + * @test 1.29 + * @bug 4927552 8026567 1.30 + * @summary <DESC> 1.31 + * @author jamieh 1.32 + * @library ../lib/ 1.33 + * @build JavadocTester TestDeprecatedDocs 1.34 + * @run main TestDeprecatedDocs 1.35 + */ 1.36 + 1.37 +public class TestDeprecatedDocs extends JavadocTester { 1.38 + 1.39 + //Test information. 1.40 + private static final String BUG_ID = "4927552"; 1.41 + 1.42 + //Javadoc arguments. 1.43 + private static final String[] ARGS = new String[] { 1.44 + "-d", BUG_ID, "-source", "1.5", "-sourcepath", SRC_DIR, "pkg" 1.45 + }; 1.46 + 1.47 + private static final String TARGET_FILE = 1.48 + BUG_ID + FS + "deprecated-list.html"; 1.49 + 1.50 + private static final String TARGET_FILE2 = 1.51 + BUG_ID + FS + "pkg" + FS + "DeprecatedClassByAnnotation.html"; 1.52 + 1.53 + //Input for string search tests. 1.54 + private static final String[][] TEST = { 1.55 + {TARGET_FILE, "annotation_test1 passes"}, 1.56 + {TARGET_FILE, "annotation_test2 passes"}, 1.57 + {TARGET_FILE, "annotation_test3 passes"}, 1.58 + {TARGET_FILE, "class_test1 passes"}, 1.59 + {TARGET_FILE, "class_test2 passes"}, 1.60 + {TARGET_FILE, "class_test3 passes"}, 1.61 + {TARGET_FILE, "class_test4 passes"}, 1.62 + {TARGET_FILE, "enum_test1 passes"}, 1.63 + {TARGET_FILE, "enum_test2 passes"}, 1.64 + {TARGET_FILE, "error_test1 passes"}, 1.65 + {TARGET_FILE, "error_test2 passes"}, 1.66 + {TARGET_FILE, "error_test3 passes"}, 1.67 + {TARGET_FILE, "error_test4 passes"}, 1.68 + {TARGET_FILE, "exception_test1 passes"}, 1.69 + {TARGET_FILE, "exception_test2 passes"}, 1.70 + {TARGET_FILE, "exception_test3 passes"}, 1.71 + {TARGET_FILE, "exception_test4 passes"}, 1.72 + {TARGET_FILE, "interface_test1 passes"}, 1.73 + {TARGET_FILE, "interface_test2 passes"}, 1.74 + {TARGET_FILE, "interface_test3 passes"}, 1.75 + {TARGET_FILE, "interface_test4 passes"}, 1.76 + {TARGET_FILE, "pkg.DeprecatedClassByAnnotation"}, 1.77 + {TARGET_FILE, "pkg.DeprecatedClassByAnnotation()"}, 1.78 + {TARGET_FILE, "pkg.DeprecatedClassByAnnotation.method()"}, 1.79 + {TARGET_FILE, "pkg.DeprecatedClassByAnnotation.field"}, 1.80 + 1.81 + {TARGET_FILE2, "<pre>@Deprecated" + NL + 1.82 + "public class <span class=\"typeNameLabel\">DeprecatedClassByAnnotation</span>" + NL + 1.83 + "extends java.lang.Object</pre>"}, 1.84 + 1.85 + {TARGET_FILE2, "<pre>@Deprecated" + NL + 1.86 + "public int field</pre>" + NL + 1.87 + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> </div>"}, 1.88 + 1.89 + {TARGET_FILE2, "<pre>@Deprecated" + NL + 1.90 + "public DeprecatedClassByAnnotation()</pre>" + NL + 1.91 + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> </div>"}, 1.92 + 1.93 + {TARGET_FILE2, "<pre>@Deprecated" + NL + 1.94 + "public void method()</pre>" + NL + 1.95 + "<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> </div>"}, 1.96 + }; 1.97 + 1.98 + private static final String[][] NEGATED_TEST = NO_TEST; 1.99 + 1.100 + /** 1.101 + * The entry point of the test. 1.102 + * @param args the array of command line arguments. 1.103 + */ 1.104 + public static void main(String[] args) { 1.105 + TestDeprecatedDocs tester = new TestDeprecatedDocs(); 1.106 + run(tester, ARGS, TEST, NEGATED_TEST); 1.107 + tester.printSummary(); 1.108 + } 1.109 + 1.110 + /** 1.111 + * {@inheritDoc} 1.112 + */ 1.113 + public String getBugId() { 1.114 + return BUG_ID; 1.115 + } 1.116 + 1.117 + /** 1.118 + * {@inheritDoc} 1.119 + */ 1.120 + public String getBugName() { 1.121 + return getClass().getName(); 1.122 + } 1.123 +}