0N/A/*
996N/A * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/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.
0N/A */
0N/A
0N/A/*
0N/A * @test
996N/A * @bug 4934778 4777599 6553182
0N/A * @summary Make sure that the -help option works properly. Make sure
0N/A * the help link appears in the documentation.
0N/A * @author jamieh
0N/A * @library ../lib/
996N/A * @build JavadocTester TestHelpOption
0N/A * @run main TestHelpOption
0N/A */
0N/A
0N/Apublic class TestHelpOption extends JavadocTester {
0N/A
0N/A //Test information.
996N/A private static final String BUG_ID = "4934778-4777599-6553182";
0N/A
0N/A //Javadoc arguments.
0N/A private static final String[] ARGS = new String[] {
0N/A "-d", BUG_ID, "-sourcepath", SRC_DIR, "-help",
0N/A SRC_DIR + FS + "TestHelpOption.java"
0N/A };
0N/A
0N/A private static final String[] ARGS2 = new String[] {
0N/A "-d", BUG_ID, "-sourcepath", SRC_DIR,
0N/A SRC_DIR + FS + "TestHelpOption.java"
0N/A };
0N/A
0N/A private static final String[][] TEST = {
0N/A {STANDARD_OUTPUT, "-d "},
0N/A {STANDARD_OUTPUT, "-use "},
0N/A {STANDARD_OUTPUT, "-version "},
0N/A {STANDARD_OUTPUT, "-author "},
0N/A {STANDARD_OUTPUT, "-docfilessubdirs "},
0N/A {STANDARD_OUTPUT, "-splitindex "},
0N/A {STANDARD_OUTPUT, "-windowtitle "},
0N/A {STANDARD_OUTPUT, "-doctitle "},
0N/A {STANDARD_OUTPUT, "-header "},
0N/A {STANDARD_OUTPUT, "-footer "},
0N/A {STANDARD_OUTPUT, "-bottom "},
0N/A {STANDARD_OUTPUT, "-link "},
0N/A {STANDARD_OUTPUT, "-linkoffline "},
0N/A {STANDARD_OUTPUT, "-excludedocfilessubdir "},
0N/A {STANDARD_OUTPUT, "-group "},
0N/A {STANDARD_OUTPUT, "-nocomment "},
0N/A {STANDARD_OUTPUT, "-nodeprecated "},
0N/A {STANDARD_OUTPUT, "-noqualifier "},
0N/A {STANDARD_OUTPUT, "-nosince "},
0N/A {STANDARD_OUTPUT, "-notimestamp "},
0N/A {STANDARD_OUTPUT, "-nodeprecatedlist "},
0N/A {STANDARD_OUTPUT, "-notree "},
0N/A {STANDARD_OUTPUT, "-noindex "},
0N/A {STANDARD_OUTPUT, "-nohelp "},
0N/A {STANDARD_OUTPUT, "-nonavbar "},
0N/A {STANDARD_OUTPUT, "-serialwarn "},
0N/A {STANDARD_OUTPUT, "-tag "},
0N/A {STANDARD_OUTPUT, "-taglet "},
0N/A {STANDARD_OUTPUT, "-tagletpath "},
996N/A {STANDARD_OUTPUT, "-Xdocrootparent "},
0N/A {STANDARD_OUTPUT, "-charset "},
0N/A {STANDARD_OUTPUT, "-helpfile "},
0N/A {STANDARD_OUTPUT, "-linksource "},
0N/A {STANDARD_OUTPUT, "-sourcetab "},
0N/A {STANDARD_OUTPUT, "-keywords "},
0N/A {STANDARD_OUTPUT, "-stylesheetfile "},
0N/A {STANDARD_OUTPUT, "-docencoding "},
0N/A };
0N/A private static final String[][] NEGATED_TEST = NO_TEST;
0N/A
0N/A private static final String[][] TEST2 = {
0N/A {BUG_ID + FS + "TestHelpOption.html",
765N/A "<li><a href=\"help-doc.html\">Help</a></li>"
0N/A },
0N/A };
0N/A private static final String[][] NEGATED_TEST2 = NO_TEST;
0N/A
0N/A //The help option should not crash the doclet.
0N/A private static final int EXPECTED_EXIT_CODE = 0;
0N/A
0N/A /**
0N/A * The entry point of the test.
0N/A * @param args the array of command line arguments.
0N/A */
0N/A public static void main(String[] args) {
0N/A TestHelpOption tester = new TestHelpOption();
0N/A int actualExitCode = run(tester, ARGS, TEST, NEGATED_TEST);
0N/A tester.checkExitCode(EXPECTED_EXIT_CODE, actualExitCode);
0N/A run(tester, ARGS2, TEST2, NEGATED_TEST2);
0N/A tester.printSummary();
0N/A }
0N/A
0N/A /**
0N/A * {@inheritDoc}
0N/A */
0N/A public String getBugId() {
0N/A return BUG_ID;
0N/A }
0N/A
0N/A /**
0N/A * {@inheritDoc}
0N/A */
0N/A public String getBugName() {
0N/A return getClass().getName();
0N/A }
0N/A}