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