Path: blob/aarch64-shenandoah-jdk8u272-b10/langtools/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java
48433 views
/*1* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223/*24* @test25* @bug 4927552 802656726* @summary <DESC>27* @author jamieh28* @library ../lib/29* @build JavadocTester TestDeprecatedDocs30* @run main TestDeprecatedDocs31*/3233public class TestDeprecatedDocs extends JavadocTester {3435//Test information.36private static final String BUG_ID = "4927552";3738//Javadoc arguments.39private static final String[] ARGS = new String[] {40"-d", BUG_ID, "-source", "1.5", "-sourcepath", SRC_DIR, "pkg"41};4243private static final String TARGET_FILE =44BUG_ID + FS + "deprecated-list.html";4546private static final String TARGET_FILE2 =47BUG_ID + FS + "pkg" + FS + "DeprecatedClassByAnnotation.html";4849//Input for string search tests.50private static final String[][] TEST = {51{TARGET_FILE, "annotation_test1 passes"},52{TARGET_FILE, "annotation_test2 passes"},53{TARGET_FILE, "annotation_test3 passes"},54{TARGET_FILE, "class_test1 passes"},55{TARGET_FILE, "class_test2 passes"},56{TARGET_FILE, "class_test3 passes"},57{TARGET_FILE, "class_test4 passes"},58{TARGET_FILE, "enum_test1 passes"},59{TARGET_FILE, "enum_test2 passes"},60{TARGET_FILE, "error_test1 passes"},61{TARGET_FILE, "error_test2 passes"},62{TARGET_FILE, "error_test3 passes"},63{TARGET_FILE, "error_test4 passes"},64{TARGET_FILE, "exception_test1 passes"},65{TARGET_FILE, "exception_test2 passes"},66{TARGET_FILE, "exception_test3 passes"},67{TARGET_FILE, "exception_test4 passes"},68{TARGET_FILE, "interface_test1 passes"},69{TARGET_FILE, "interface_test2 passes"},70{TARGET_FILE, "interface_test3 passes"},71{TARGET_FILE, "interface_test4 passes"},72{TARGET_FILE, "pkg.DeprecatedClassByAnnotation"},73{TARGET_FILE, "pkg.DeprecatedClassByAnnotation()"},74{TARGET_FILE, "pkg.DeprecatedClassByAnnotation.method()"},75{TARGET_FILE, "pkg.DeprecatedClassByAnnotation.field"},7677{TARGET_FILE2, "<pre>@Deprecated" + NL +78"public class <span class=\"typeNameLabel\">DeprecatedClassByAnnotation</span>" + NL +79"extends java.lang.Object</pre>"},8081{TARGET_FILE2, "<pre>@Deprecated" + NL +82"public int field</pre>" + NL +83"<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> </div>"},8485{TARGET_FILE2, "<pre>@Deprecated" + NL +86"public DeprecatedClassByAnnotation()</pre>" + NL +87"<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> </div>"},8889{TARGET_FILE2, "<pre>@Deprecated" + NL +90"public void method()</pre>" + NL +91"<div class=\"block\"><span class=\"deprecatedLabel\">Deprecated.</span> </div>"},92};9394private static final String[][] NEGATED_TEST = NO_TEST;9596/**97* The entry point of the test.98* @param args the array of command line arguments.99*/100public static void main(String[] args) {101TestDeprecatedDocs tester = new TestDeprecatedDocs();102run(tester, ARGS, TEST, NEGATED_TEST);103tester.printSummary();104}105106/**107* {@inheritDoc}108*/109public String getBugId() {110return BUG_ID;111}112113/**114* {@inheritDoc}115*/116public String getBugName() {117return getClass().getName();118}119}120121122