/* * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* * @test * @bug 4927552 8026567 8071982 8162674 8175200 * @summary * @author jamieh * @library ../lib * @modules jdk.javadoc/jdk.javadoc.internal.tool * @build JavadocTester * @run main TestDeprecatedDocs */ public class TestDeprecatedDocs extends JavadocTester { public static void main(String... args) throws Exception { TestDeprecatedDocs tester = new TestDeprecatedDocs(); tester.runTests(); } @Test void test() { javadoc("-d", "out", "-sourcepath", testSrc, "pkg"); checkExit(Exit.OK); checkOutput("deprecated-list.html", true, "annotation_test1 passes", "annotation_test2 passes", "annotation_test3 passes", "annotation_test4 passes.", "class_test1 passes", "class_test2 passes", "class_test3 passes", "class_test4 passes", "enum_test1 passes", "enum_test2 passes", "error_test1 passes", "error_test2 passes", "error_test3 passes", "error_test4 passes", "exception_test1 passes", "exception_test2 passes", "exception_test3 passes", "exception_test4 passes", "interface_test1 passes", "interface_test2 passes", "interface_test3 passes", "interface_test4 passes", "pkg.DeprecatedClassByAnnotation", "pkg.DeprecatedClassByAnnotation()", "pkg.DeprecatedClassByAnnotation.method()", "pkg.DeprecatedClassByAnnotation.field" ); checkOutput("pkg/DeprecatedClassByAnnotation.html", true, "
@Deprecated\n"
                + "public class DeprecatedClassByAnnotation\n"
                + "extends java.lang.Object
", "
@Deprecated(forRemoval=true)\n"
                + "public int field
\n" + "
Deprecated, for removal: This API element is subject to removal in a future version.  
", "
@Deprecated(forRemoval=true)\n"
                + "public DeprecatedClassByAnnotation​()
\n" + "
Deprecated, for removal: This API element is subject to removal in a future version.  
", "
@Deprecated\n"
                + "public void method​()
\n" + "
Deprecated. 
"); checkOutput("pkg/TestAnnotationType.html", true, "
Deprecated, for removal: This API element is subject to removal in a future version.  \n" + "
annotation_test1 passes.
\n" + "
\n" + "
\n" + "
@Deprecated(forRemoval=true)\n"
                + "@Documented\n"
                + "public @interface TestAnnotationType
", "
@Deprecated(forRemoval=true)\n"
                + "static final int field
\n" + "
Deprecated, for removal: This " + "API element is subject to removal in a future version.  annotation_test4 passes.
", "
@Deprecated(forRemoval=true)\n"
                + "int required
\n" + "
Deprecated, for removal: This API element is subject to removal in a future version.  " + "annotation_test3 passes.
", "
java.lang.String optional
\n" + "
Deprecated. annotation_test2 passes.
"); checkOutput("pkg/TestClass.html", true, "
Deprecated, for removal: This API element is subject to removal in a future version.  \n" + "
class_test1 passes.
\n" + "
\n" + "
\n" + "
@Deprecated(forRemoval=true)\n"
                + "public class TestClass\n"
                + "extends java.lang.Object
", "
@Deprecated(forRemoval=true)\n"
                + "public TestClass​()
\n" + "
Deprecated, for removal: This API element is subject to removal in a future version.  " + "class_test3 passes.
"); checkOutput("pkg/TestEnum.html", true, "
Deprecated, for removal: This API element is subject to removal in a future version.  \n" + "
enum_test1 passes.
\n" + "
\n" + "
\n" + "
@Deprecated(forRemoval=true)\n"
                + "public enum TestEnum\n"
                + "extends java.lang.Enum<TestEnum>
", "
@Deprecated(forRemoval=true)\n"
                + "public static final TestEnum FOR_REMOVAL
\n" + "
Deprecated, for removal: This API element is subject to removal in a future version.  " + "enum_test3 passes.
"); checkOutput("pkg/TestError.html", true, "
Deprecated, for removal: This API element is subject to removal in a future version.  \n" + "
error_test1 passes.
\n" + "
\n" + "
\n" + "
@Deprecated(forRemoval=true)\n"
                + "public class TestError\n"
                + "extends java.lang.Error
"); checkOutput("pkg/TestException.html", true, "
Deprecated, for removal: This API element is subject to removal in a future version.  \n" + "
exception_test1 passes.
\n" + "
\n" + "
\n" + "
@Deprecated(forRemoval=true)\n"
                + "public class TestException\n"
                + "extends java.lang.Exception
"); checkOutput("pkg/TestInterface.html", true, "
Deprecated, for removal: This API element is subject to removal in a future version.  \n" + "
interface_test1 passes.
\n" + "
\n" + "
\n" + "
@Deprecated(forRemoval=true)\n"
                + "public class TestInterface\n"
                + "extends java.lang.Object
"); checkOutput("deprecated-list.html", true, "", "", "\n" + "\n" + "\n" + "\n" + "\n" + "", "
Deprecated For Removal 
ElementDescription
\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "
Deprecated Enums 
EnumDescription
pkg.TestEnum\n" + "
enum_test1 passes.
\n" + "
", "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "
Deprecated Exceptions 
ExceptionsDescription
pkg.TestException\n" + "
exception_test1 passes.
\n" + "
"); } }