aoqi@0: /* aoqi@0: * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. aoqi@0: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: * aoqi@0: * This code is free software; you can redistribute it and/or modify it aoqi@0: * under the terms of the GNU General Public License version 2 only, as aoqi@0: * published by the Free Software Foundation. Oracle designates this aoqi@0: * particular file as subject to the "Classpath" exception as provided aoqi@0: * by Oracle in the LICENSE file that accompanied this code. aoqi@0: * aoqi@0: * This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: * version 2 for more details (a copy is included in the LICENSE file that aoqi@0: * accompanied this code). aoqi@0: * aoqi@0: * You should have received a copy of the GNU General Public License version aoqi@0: * 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: * aoqi@0: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: * or visit www.oracle.com if you need additional information or have any aoqi@0: * questions. aoqi@0: */ aoqi@0: aoqi@0: /* aoqi@0: * @test aoqi@0: * @bug 6802694 8025633 8026567 aoqi@0: * @summary This test verifies deprecation info in serialized-form.html. aoqi@0: * @author Bhavesh Patel aoqi@0: * @library ../lib/ aoqi@0: * @build JavadocTester aoqi@0: * @build TestSerializedFormDeprecationInfo aoqi@0: * @run main TestSerializedFormDeprecationInfo aoqi@0: */ aoqi@0: aoqi@0: public class TestSerializedFormDeprecationInfo extends JavadocTester { aoqi@0: aoqi@0: private static final String BUG_ID = "6802694"; aoqi@0: aoqi@0: // Test for normal run of javadoc. The serialized-form.html should aoqi@0: // display the inline comments, tags and deprecation information if any. aoqi@0: private static final String[][] TEST_CMNT_DEPR = { aoqi@0: {BUG_ID + FS + "serialized-form.html", "
" + NL + aoqi@0: "
Throws:
" + NL + "
" + aoqi@0: "java.io.IOException
"+ NL + "
See Also:" + aoqi@0: "
" + NL + "
" + aoqi@0: "C1.setUndecorated(boolean)
" + NL + "
"}, aoqi@0: {BUG_ID + FS + "serialized-form.html", "Deprecated." + aoqi@0: " As of JDK version 1.5, replaced by" + NL + aoqi@0: " " + aoqi@0: "setUndecorated(boolean)." + NL + aoqi@0: "
This field indicates whether the C1 " + aoqi@0: "is undecorated.
" + NL + " " + NL + aoqi@0: "
" + NL + "
Since:
" + NL + aoqi@0: "
1.4
" + NL + "
See Also:" + aoqi@0: "
" + NL + "
" + aoqi@0: "C1.setUndecorated(boolean)
" + NL + "
"}, aoqi@0: {BUG_ID + FS + "serialized-form.html", "Deprecated." + aoqi@0: " As of JDK version 1.5, replaced by" + NL + aoqi@0: " " + aoqi@0: "setUndecorated(boolean)." + NL + aoqi@0: "
Reads the object stream.
" + NL + aoqi@0: "
" + NL + "
Throws:
" + NL + "
" + aoqi@0: "IOException
" + NL + aoqi@0: "
java.io.IOException
" + NL + "
"}, aoqi@0: {BUG_ID + FS + "serialized-form.html", "Deprecated." + aoqi@0: " " + NL + "
" + aoqi@0: "The name for this class.
"}}; aoqi@0: aoqi@0: // Test with -nocomment option. The serialized-form.html should aoqi@0: // not display the inline comments and tags but should display deprecation aoqi@0: // information if any. aoqi@0: private static final String[][] TEST_NOCMNT = { aoqi@0: {BUG_ID + FS + "serialized-form.html", "
boolean undecorated
" + NL + aoqi@0: "
Deprecated. " + aoqi@0: "As of JDK version 1.5, replaced by" + NL + aoqi@0: " " + aoqi@0: "setUndecorated(boolean).
" + NL + ""}, aoqi@0: {BUG_ID + FS + "serialized-form.html", "" + aoqi@0: "Deprecated. As of JDK version" + aoqi@0: " 1.5, replaced by" + NL + aoqi@0: " " + aoqi@0: "setUndecorated(boolean)." + NL + ""}}; aoqi@0: aoqi@0: // Test with -nodeprecated option. The serialized-form.html should aoqi@0: // ignore the -nodeprecated tag and display the deprecation info. This aoqi@0: // test is similar to the normal run of javadoc in which inline comment, tags aoqi@0: // and deprecation information will be displayed. aoqi@0: private static final String[][] TEST_NODEPR = TEST_CMNT_DEPR; aoqi@0: aoqi@0: // Test with -nodeprecated and -nocomment options. The serialized-form.html should aoqi@0: // ignore the -nodeprecated tag and display the deprecation info but should not aoqi@0: // display the inline comments and tags. This test is similar to the test with aoqi@0: // -nocomment option. aoqi@0: private static final String[][] TEST_NOCMNT_NODEPR = TEST_NOCMNT; aoqi@0: aoqi@0: private static final String[] ARGS1 = aoqi@0: new String[] { aoqi@0: "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"}; aoqi@0: aoqi@0: private static final String[] ARGS2 = aoqi@0: new String[] { aoqi@0: "-d", BUG_ID, "-nocomment", "-sourcepath", SRC_DIR, "pkg1"}; aoqi@0: aoqi@0: private static final String[] ARGS3 = aoqi@0: new String[] { aoqi@0: "-d", BUG_ID, "-nodeprecated", "-sourcepath", SRC_DIR, "pkg1"}; aoqi@0: aoqi@0: private static final String[] ARGS4 = aoqi@0: new String[] { aoqi@0: "-d", BUG_ID, "-nocomment", "-nodeprecated", "-sourcepath", SRC_DIR, "pkg1"}; aoqi@0: aoqi@0: /** aoqi@0: * The entry point of the test. aoqi@0: * @param args the array of command line arguments. aoqi@0: */ aoqi@0: public static void main(String[] args) { aoqi@0: TestSerializedFormDeprecationInfo tester = new TestSerializedFormDeprecationInfo(); aoqi@0: tester.exactNewlineMatch = false; aoqi@0: run(tester, ARGS1, TEST_CMNT_DEPR, TEST_NOCMNT); aoqi@0: run(tester, ARGS2, TEST_NOCMNT, TEST_CMNT_DEPR); aoqi@0: run(tester, ARGS3, TEST_NODEPR, TEST_NOCMNT_NODEPR); aoqi@0: run(tester, ARGS4, TEST_NOCMNT_NODEPR, TEST_NODEPR); aoqi@0: tester.printSummary(); aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * {@inheritDoc} aoqi@0: */ aoqi@0: public String getBugId() { aoqi@0: return BUG_ID; aoqi@0: } aoqi@0: aoqi@0: /** aoqi@0: * {@inheritDoc} aoqi@0: */ aoqi@0: public String getBugName() { aoqi@0: return getClass().getName(); aoqi@0: } aoqi@0: }