/* * Copyright (c) 2009, 2015, 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 6786690 6820360 8025633 8026567 * @summary This test verifies the nesting of definition list tags. * @author Bhavesh Patel * @library ../lib * @modules jdk.javadoc * @build JavadocTester * @run main TestHtmlDefinitionListTag */ import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class TestHtmlDefinitionListTag extends JavadocTester { public static void main(String... args) throws Exception { TestHtmlDefinitionListTag tester = new TestHtmlDefinitionListTag(); tester.runTests(); } @Test void test_Comment_Deprecated() { // tester.run(ARGS1, TEST_ALL, NEGATED_TEST_NO_C5); // tester.runTestsOnHTML(NO_TEST, NEGATED_TEST_C5); // tester.runTestsOnHTML(TEST_CMNT_DEPR, NO_TEST); javadoc("-Xdoclint:none", "-d", "out-1", "-sourcepath", testSrc, "pkg1"); checkExit(Exit.OK); checkCommon(true); checkCommentDeprecated(true); } @Test void test_NoComment_Deprecated() { // tester.run(ARGS2, TEST_ALL, NEGATED_TEST_NO_C5); // tester.runTestsOnHTML(NO_TEST, NEGATED_TEST_C5); // tester.runTestsOnHTML(NO_TEST, TEST_CMNT_DEPR); javadoc("-Xdoclint:none", "-d", "out-2", "-nocomment", "-sourcepath", testSrc, "pkg1"); checkExit(Exit.OK); checkCommon(true); checkCommentDeprecated(false); // ?? } @Test void test_Comment_NoDeprecated() { // tester.run(ARGS3, TEST_ALL, NEGATED_TEST_NO_C5); // tester.runTestsOnHTML(TEST_NODEPR, TEST_NOCMNT_NODEPR); javadoc("-Xdoclint:none", "-d", "out-3", "-nodeprecated", "-sourcepath", testSrc, "pkg1"); checkExit(Exit.OK); checkCommon(false); checkNoDeprecated(); checkNoCommentNoDeprecated(false); } @Test void testNoCommentNoDeprecated() { // tester.run(ARGS4, TEST_ALL, NEGATED_TEST_NO_C5); // tester.runTestsOnHTML(TEST_NOCMNT_NODEPR, TEST_CMNT_DEPR); javadoc("-Xdoclint:none", "-d", "out-4", "-nocomment", "-nodeprecated", "-sourcepath", testSrc, "pkg1"); checkExit(Exit.OK); checkCommon(false); checkNoCommentNoDeprecated(true); checkCommentDeprecated(false); } void checkCommon(boolean checkC5) { // 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. checkOutput("pkg1/C1.html", true, "
public class C1\n" +
"extends java.lang.Object\n" +
"implements java.io.Serializable
");
checkOutput("pkg1/C4.html", true,
""
+ "C2
, \n"
+ ""
+ "Serialized FormsetUndecorated(boolean)
title
- the titletest
- boolean value"
+ "java.lang.IllegalArgumentException
- if the "
+ "owner
's\n"
+ " GraphicsConfiguration
is not from a screen "
+ "deviceHeadlessException
undecorated"
+ "
- true
if no decorations are\n"
+ " to be enabled;\n"
+ " false
"
+ "if decorations are to be enabled.readObject()"
+ "
java.io.IOException
setUndecorated(boolean)
set
- boolean"
+ "java.io.IOException
C1.setUndecorated(boolean)
setUndecorated(boolean)
.\n"
+ "C1.setUndecorated(boolean)
setUndecorated(boolean)
.\n"
+ "java.io.IOException
C2
, \n" +
"" +
"Serialized Formtitle
- the title"
+ "test
- boolean valuejava.lang.IllegalArgumentException"
+ "
- if the owner
's\n"
+ " GraphicsConfiguration"
+ "
is not from a screen device"
+ "HeadlessException
undecorated
- true
"
+ " if no decorations are\n"
+ " to be enabled;\n"
+ " false
if decorations are to be enabled."
+ "readObject()
java.io.IOException
setUndecorated(boolean)
"
+ "java.io.IOException
C1.setUndecorated(boolean)
setUndecorated(boolean)
.\n"
+ "C1.setUndecorated(boolean)
setUndecorated(boolean)
.\n"
+ "java.io.IOException
public void readObject()\n" + " throws java.io.IOException\n" + ""); checkOutput("pkg1/C2.html", expectFound, "
public C2()\n" + ""); checkOutput("pkg1/C1.ModalExclusionType.html", expectFound, "
public " + "static final C1.ModalExclusionType " + "APPLICATION_EXCLUDE\n" + ""); checkOutput("serialized-form.html", expectFound, "
boolean " + "undecorated\n" + "
" +
"setUndecorated(boolean)
.setUndecorated(boolean)
.\n" +
"");
}
}