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