author | jjg |
Tue, 22 Apr 2014 17:57:40 -0700 | |
changeset 24072 | e7549dcbc4af |
parent 24071 | b0845717434e |
child 24399 | af1a0220d0fa |
permissions | -rw-r--r-- |
10 | 1 |
/* |
23971 | 2 |
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. |
10 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5520 | 19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
10 | 22 |
*/ |
23 |
||
24 |
/* |
|
25 |
* @test |
|
9608 | 26 |
* @bug 4934778 4777599 6553182 |
10 | 27 |
* @summary Make sure that the -help option works properly. Make sure |
28 |
* the help link appears in the documentation. |
|
29 |
* @author jamieh |
|
30 |
* @library ../lib/ |
|
9608 | 31 |
* @build JavadocTester TestHelpOption |
10 | 32 |
* @run main TestHelpOption |
33 |
*/ |
|
34 |
||
35 |
public class TestHelpOption extends JavadocTester { |
|
36 |
||
37 |
//Javadoc arguments. |
|
38 |
private static final String[] ARGS = new String[] { |
|
24072 | 39 |
"-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "-help", |
23971 | 40 |
SRC_DIR + "/TestHelpOption.java" |
10 | 41 |
}; |
42 |
||
43 |
private static final String[] ARGS2 = new String[] { |
|
24072 | 44 |
"-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, |
23971 | 45 |
SRC_DIR + "/TestHelpOption.java" |
10 | 46 |
}; |
47 |
||
48 |
private static final String[][] TEST = { |
|
49 |
{STANDARD_OUTPUT, "-d "}, |
|
50 |
{STANDARD_OUTPUT, "-use "}, |
|
51 |
{STANDARD_OUTPUT, "-version "}, |
|
52 |
{STANDARD_OUTPUT, "-author "}, |
|
53 |
{STANDARD_OUTPUT, "-docfilessubdirs "}, |
|
54 |
{STANDARD_OUTPUT, "-splitindex "}, |
|
55 |
{STANDARD_OUTPUT, "-windowtitle "}, |
|
56 |
{STANDARD_OUTPUT, "-doctitle "}, |
|
57 |
{STANDARD_OUTPUT, "-header "}, |
|
58 |
{STANDARD_OUTPUT, "-footer "}, |
|
59 |
{STANDARD_OUTPUT, "-bottom "}, |
|
60 |
{STANDARD_OUTPUT, "-link "}, |
|
61 |
{STANDARD_OUTPUT, "-linkoffline "}, |
|
62 |
{STANDARD_OUTPUT, "-excludedocfilessubdir "}, |
|
63 |
{STANDARD_OUTPUT, "-group "}, |
|
64 |
{STANDARD_OUTPUT, "-nocomment "}, |
|
65 |
{STANDARD_OUTPUT, "-nodeprecated "}, |
|
66 |
{STANDARD_OUTPUT, "-noqualifier "}, |
|
67 |
{STANDARD_OUTPUT, "-nosince "}, |
|
68 |
{STANDARD_OUTPUT, "-notimestamp "}, |
|
69 |
{STANDARD_OUTPUT, "-nodeprecatedlist "}, |
|
70 |
{STANDARD_OUTPUT, "-notree "}, |
|
71 |
{STANDARD_OUTPUT, "-noindex "}, |
|
72 |
{STANDARD_OUTPUT, "-nohelp "}, |
|
73 |
{STANDARD_OUTPUT, "-nonavbar "}, |
|
74 |
{STANDARD_OUTPUT, "-serialwarn "}, |
|
75 |
{STANDARD_OUTPUT, "-tag "}, |
|
76 |
{STANDARD_OUTPUT, "-taglet "}, |
|
77 |
{STANDARD_OUTPUT, "-tagletpath "}, |
|
78 |
{STANDARD_OUTPUT, "-charset "}, |
|
79 |
{STANDARD_OUTPUT, "-helpfile "}, |
|
80 |
{STANDARD_OUTPUT, "-linksource "}, |
|
81 |
{STANDARD_OUTPUT, "-sourcetab "}, |
|
82 |
{STANDARD_OUTPUT, "-keywords "}, |
|
83 |
{STANDARD_OUTPUT, "-stylesheetfile "}, |
|
84 |
{STANDARD_OUTPUT, "-docencoding "}, |
|
85 |
}; |
|
86 |
||
87 |
private static final String[][] TEST2 = { |
|
24072 | 88 |
{ "TestHelpOption.html", |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
89 |
"<li><a href=\"help-doc.html\">Help</a></li>" |
10 | 90 |
}, |
91 |
}; |
|
92 |
||
93 |
//The help option should not crash the doclet. |
|
94 |
private static final int EXPECTED_EXIT_CODE = 0; |
|
95 |
||
96 |
/** |
|
97 |
* The entry point of the test. |
|
98 |
* @param args the array of command line arguments. |
|
99 |
*/ |
|
100 |
public static void main(String[] args) { |
|
101 |
TestHelpOption tester = new TestHelpOption(); |
|
24071 | 102 |
int actualExitCode = tester.run(ARGS, TEST, NO_TEST); |
10 | 103 |
tester.checkExitCode(EXPECTED_EXIT_CODE, actualExitCode); |
24071 | 104 |
tester.run(ARGS2, TEST2, NO_TEST); |
10 | 105 |
tester.printSummary(); |
106 |
} |
|
107 |
} |