alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Java example source code file (TestHtmlDefinitionListTag.java)

This example Java source code file (TestHtmlDefinitionListTag.java) is included in the alvinalexander.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Learn more about this Java project at its project page.

Java - Java tags/keywords

also\:, bug_id, jdk, negated_test, see, since\:, string, test_all, throws\:

The TestHtmlDefinitionListTag.java Java example source code

/*
 * Copyright (c) 2009, 2013, 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.  Oracle designates this
 * particular file as subject to the "Classpath" exception as provided
 * by Oracle in the LICENSE file that accompanied this code.
 *
 * 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 6786690 6820360 8025633 8026567
 * @summary This test verifies the nesting of definition list tags.
 * @author Bhavesh Patel
 * @library ../lib/
 * @build JavadocTester TestHtmlDefinitionListTag
 * @run main TestHtmlDefinitionListTag
 */

public class TestHtmlDefinitionListTag extends JavadocTester {

    private static final String BUG_ID = "6786690-6820360";

    // Test common to all runs of javadoc. The class signature should print
    // properly enclosed definition list tags and the Annotation Type
    // Optional Element should print properly nested definition list tags
    // for default value.
    private static final String[][] TEST_ALL = {
        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<pre>public class " +
                 "<span class=\"typeNameLabel\">C1" + NL +
                 "extends java.lang.Object" + NL + "implements java.io.Serializable</pre>"},
        {BUG_ID + FS + "pkg1" + FS + "C4.html", "<dl>" + NL +
                 "<dt>Default:" + NL + "
true
" + NL + "</dl>"}}; // Test for normal run of javadoc in which various ClassDocs and // serialized form should have properly nested definition list tags // enclosing comments, tags and deprecated information. private static final String[][] TEST_CMNT_DEPR = { {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<dl>" + NL + "<dt>Since:" + NL + "<dd>JDK1.0" + NL + ""}, {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "
Since:
" + NL + "<dd>JDK1.0" + NL + "
See Also:
" + NL + "<dd>" + "C2</code>, " + NL + "" + "Serialized Form</a>" + NL + ""}, {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "
Since:
" + NL + "<dd>1.4" + NL + "<dt>See Also:" + NL + "
" + "<a href=\"../pkg1/C1.html#setUndecorated-boolean-\">" + "<code>setUndecorated(boolean)
" + NL + ""}, {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>"+ NL + "
Parameters:
" + NL + "
title" + "</code> - the title
" + NL + "
test - boolean value" + "</dd>" + NL + "
Throws:
" + NL + "<dd>java.lang.IllegalArgumentException - if the " + "<code>owner
's" + NL + " <code>GraphicsConfiguration is not from a screen " + "device</dd>" + NL + "
HeadlessException
" + NL + ""}, {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "
Parameters:
" + NL + "
undecorated" + "</code> - true if no decorations are" + NL + " to be enabled;" + NL + " <code>false " + "if decorations are to be enabled.</dd>" + NL + "
Since:" + "</span>
" + NL + "
1.4
" + NL + "<dt>See Also:" + NL + "
" + "<a href=\"../pkg1/C1.html#readObject--\">readObject()" + "</code>
" + NL + ""}, {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "
Throws:
" + NL + "<dd>java.io.IOException" + NL + "
See Also:" + "</span>
" + NL + "
" + "<code>setUndecorated(boolean)
" + NL + ""}, {BUG_ID + FS + "pkg1" + FS + "C2.html", "<dl>" + NL + "
Parameters:" + "</span>
" + NL + "
set - boolean
" + NL + "
" + "Since:</span>
" + NL + "
1.4
" + NL + ""}, {BUG_ID + FS + "serialized-form.html", "<dl>" + NL + "
Throws:" + "</dt>" + NL + "
" + "java.io.IOException</code>
" + NL + "
See Also:" + "</dt>" + NL + "
" + "<code>C1.setUndecorated(boolean)
" + NL + ""}, {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated." + " <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL + " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + "<code>setUndecorated(boolean).
" + NL + "<div class=\"block\">This field indicates whether the C1 is " + "undecorated.</div>" + NL + " " + NL + "
" + NL + "
Since:
" + NL + "<dd>1.4" + NL + "
See Also:" + "</dt>" + NL + "
" + "<code>C1.setUndecorated(boolean)
" + NL + "
"}, {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated." + " <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL + " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + "<code>setUndecorated(boolean)." + NL + "<div class=\"block\">Reads the object stream." + NL + "<dl>" + NL + "
Throws:" + "</span>
" + NL + "
" + "IOException</code>
" + NL + "<dd>java.io.IOException" + NL + ""}, {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated." + " </div>" + NL + "<div class=\"block\">The name for this class."}}; // Test with -nodeprecated option. The ClassDocs should have properly nested // definition list tags enclosing comments and tags. The ClassDocs should not // display definition list for deprecated information. The serialized form // should display properly nested definition list tags for comments, tags // and deprecated information. private static final String[][] TEST_NODEPR = { {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<dl>" + NL + "<dt>Since:" + NL + "<dd>JDK1.0" + NL + ""}, {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "
Since:" + "</dt>" + NL + "
JDK1.0
" + NL + "
See Also:" + "</span>
" + NL + "
" + "<code>C2, " + NL + "" + "Serialized Form</a>
" + NL + ""}, {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "
Parameters:" + "</span>
" + NL + "
title - the title
" + NL + "
" + "test</code> - boolean value
" + NL + "
Throws:" + "</span>
" + NL + "
java.lang.IllegalArgumentException" + "</code> - if the owner's" + NL + " GraphicsConfiguration" + "</code> is not from a screen device
" + NL + "
" + "HeadlessException</code>
" + NL + ""}, {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "
Parameters:" + "</span>
" + NL + "
undecorated - true" + " if no decorations are" + NL + " to be enabled;" + NL + " <code>false if decorations are to be enabled." + "</dd>" + NL + "
Since:
" + NL + "
1.4
" + NL + "<dt>See Also:" + NL + "
" + "<code>readObject()
" + NL + ""}, {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + "
Throws:" + "</dt>" + NL + "
java.io.IOException
" + NL + "
" + "<span class=\"seeLabel\">See Also:
" + NL + "
" + "<code>setUndecorated(boolean)
" + NL + ""}, {BUG_ID + FS + "serialized-form.html", "<dl>" + NL + "
Throws:" + "</dt>" + NL + "
" + "java.io.IOException</code>
" + NL + "
See Also:" + "</dt>" + NL + "
" + "<code>C1.setUndecorated(boolean)
" + NL + ""}, {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated." + " <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL + " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + "<code>setUndecorated(boolean)." + NL + "<div class=\"block\">This field indicates whether the C1 is " + "undecorated.</div>" + NL + " " + NL + "
" + NL + "
Since:
" + NL + "<dd>1.4" + NL + "
See Also:" + "</dt>" + NL + "
" + "<code>C1.setUndecorated(boolean)
" + NL + "
"}, {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated." + " <span class=\"deprecationComment\">As of JDK version 1.5, replaced by" + NL + " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + "<code>setUndecorated(boolean)." + NL + "<div class=\"block\">Reads the object stream." + NL + "<dl>" + NL + "
Throws:" + "</span>
" + NL + "
" + "IOException</code>
" + NL + "<dd>java.io.IOException" + NL + ""}, {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">Deprecated." + " </div>" + NL + "
" + "The name for this class.</div>"}}; // Test with -nocomment and -nodeprecated options. The ClassDocs whould // not display definition lists for any member details. private static final String[][] TEST_NOCMNT_NODEPR = { {BUG_ID + FS + "pkg1" + FS + "C1.html", "<pre>public void readObject()" + NL + " throws java.io.IOException</pre>" + NL + ""}, {BUG_ID + FS + "pkg1" + FS + "C2.html", "<pre>public C2()" + NL + "</li>"}, {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "<pre>public " + "static final <a href=\"../pkg1/C1.ModalExclusionType.html\" " + "title=\"enum in pkg1\">C1.ModalExclusionType</a> " + "APPLICATION_EXCLUDE</pre>" + NL + ""}, {BUG_ID + FS + "serialized-form.html", "<pre>boolean " + "undecorated</pre>" + NL + "
" + "Deprecated.</span> As of JDK version 1.5, replaced by" + NL + " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + "setUndecorated(boolean)</code>.
" + NL + ""}, {BUG_ID + FS + "serialized-form.html", "<span class=\"deprecatedLabel\">" + "Deprecated.</span> As of JDK version" + " 1.5, replaced by" + NL + " <a href=\"pkg1/C1.html#setUndecorated-boolean-\">" + "<code>setUndecorated(boolean).
" + NL + ""}}; // Test for valid HTML generation which should not comprise of empty // definition list tags. private static final String[][] NEGATED_TEST = { {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<dl>"}, {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<dl>" + NL + ""}, {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>"}, {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl>" + NL + ""}, {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "<dl>"}, {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "<dl>" + NL + ""}, {BUG_ID + FS + "pkg1" + FS + "C2.html", "<dl>"}, {BUG_ID + FS + "pkg1" + FS + "C2.html", "<dl>" + NL + ""}, {BUG_ID + FS + "pkg1" + FS + "C2.ModalType.html", "<dl>"}, {BUG_ID + FS + "pkg1" + FS + "C2.ModalType.html", "<dl>" + NL + ""}, {BUG_ID + FS + "pkg1" + FS + "C3.html", "<dl>"}, {BUG_ID + FS + "pkg1" + FS + "C3.html", "<dl>" + NL + ""}, {BUG_ID + FS + "pkg1" + FS + "C4.html", "<dl>"}, {BUG_ID + FS + "pkg1" + FS + "C4.html", "<dl>" + NL + ""}, {BUG_ID + FS + "pkg1" + FS + "C5.html", "<dl>"}, {BUG_ID + FS + "pkg1" + FS + "C5.html", "<dl>" + NL + ""}, {BUG_ID + FS + "overview-tree.html", "<dl>"}, {BUG_ID + FS + "overview-tree.html", "<dl>" + NL + ""}, {BUG_ID + FS + "serialized-form.html", "<dl>"}, {BUG_ID + FS + "serialized-form.html", "<dl>" + NL + ""}}; private static final String[] ARGS1 = new String[] { "-Xdoclint:none", "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"}; private static final String[] ARGS2 = new String[] { "-Xdoclint:none", "-d", BUG_ID, "-nocomment", "-sourcepath", SRC_DIR, "pkg1"}; private static final String[] ARGS3 = new String[] { "-Xdoclint:none", "-d", BUG_ID, "-nodeprecated", "-sourcepath", SRC_DIR, "pkg1"}; private static final String[] ARGS4 = new String[] { "-Xdoclint:none", "-d", BUG_ID, "-nocomment", "-nodeprecated", "-sourcepath", SRC_DIR, "pkg1"}; /** * The entry point of the test. * @param args the array of command line arguments. */ public static void main(String[] args) { TestHtmlDefinitionListTag tester = new TestHtmlDefinitionListTag(); tester.exactNewlineMatch = false; run(tester, ARGS1, TEST_ALL, NEGATED_TEST); run(tester, ARGS1, TEST_CMNT_DEPR, NEGATED_TEST); run(tester, ARGS2, TEST_ALL, NEGATED_TEST); run(tester, ARGS2, NO_TEST, TEST_CMNT_DEPR); run(tester, ARGS3, TEST_ALL, NEGATED_TEST); run(tester, ARGS3, TEST_NODEPR, TEST_NOCMNT_NODEPR); run(tester, ARGS4, TEST_ALL, NEGATED_TEST); run(tester, ARGS4, TEST_NOCMNT_NODEPR, TEST_CMNT_DEPR); tester.printSummary(); } /** * {@inheritDoc} */ public String getBugId() { return BUG_ID; } /** * {@inheritDoc} */ public String getBugName() { return getClass().getName(); } }

Other Java examples (source code examples)

Here is a short list of links related to this Java TestHtmlDefinitionListTag.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.