10
|
1 |
/*
|
23971
|
2 |
* Copyright (c) 2002, 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
|
|
26 |
* @bug 4766385
|
|
27 |
* @summary Test that the header option for upper left frame
|
|
28 |
* is present for three sets of options: (1) -header,
|
|
29 |
* (2) -packagesheader, and (3) -header -packagesheader
|
|
30 |
* @author dkramer
|
|
31 |
* @library ../lib/
|
|
32 |
* @build JavadocTester
|
|
33 |
* @build PackagesHeader
|
|
34 |
* @run main PackagesHeader
|
|
35 |
*/
|
|
36 |
|
|
37 |
public class PackagesHeader extends JavadocTester {
|
|
38 |
|
|
39 |
//Test information.
|
24072
|
40 |
private static final String OUTPUT_DIR1 = OUTPUT_DIR + "-1/";
|
|
41 |
private static final String OUTPUT_DIR2 = OUTPUT_DIR + "-2/";
|
|
42 |
private static final String OUTPUT_DIR3 = OUTPUT_DIR + "-3/";
|
10
|
43 |
|
|
44 |
/**
|
|
45 |
* Assign value for [ fileToSearch, stringToFind ]
|
|
46 |
*/
|
|
47 |
private static final String[][] TESTARRAY1 = {
|
|
48 |
|
|
49 |
// Test that the -header shows up in the packages frame
|
24072
|
50 |
{ "overview-frame.html",
|
10
|
51 |
"Main Frame Header" }
|
|
52 |
};
|
|
53 |
|
|
54 |
private static final String[][] TESTARRAY2 = {
|
|
55 |
|
|
56 |
// Test that the -packagesheader string shows
|
|
57 |
// up in the packages frame
|
|
58 |
|
24072
|
59 |
{ "overview-frame.html",
|
10
|
60 |
"Packages Frame Header" }
|
|
61 |
};
|
|
62 |
|
|
63 |
private static final String[][] TESTARRAY3 = {
|
|
64 |
|
|
65 |
// Test that the both headers show up and are different
|
|
66 |
|
24072
|
67 |
{ "overview-frame.html",
|
10
|
68 |
"Packages Frame Header" },
|
|
69 |
|
24072
|
70 |
{ "overview-summary.html",
|
10
|
71 |
"Main Frame Header" }
|
|
72 |
};
|
|
73 |
|
|
74 |
// First test with -header only
|
|
75 |
private static final String[] JAVADOC_ARGS1 = new String[] {
|
|
76 |
"-d", OUTPUT_DIR1,
|
|
77 |
"-header", "Main Frame Header",
|
|
78 |
"-sourcepath", SRC_DIR,
|
|
79 |
"p1", "p2"};
|
|
80 |
|
|
81 |
// Second test with -packagesheader only
|
|
82 |
private static final String[] JAVADOC_ARGS2 = new String[] {
|
|
83 |
"-d", OUTPUT_DIR2,
|
|
84 |
"-packagesheader", "Packages Frame Header",
|
|
85 |
"-sourcepath", SRC_DIR,
|
|
86 |
"p1", "p2"};
|
|
87 |
|
|
88 |
// Third test with both -packagesheader and -header
|
|
89 |
private static final String[] JAVADOC_ARGS3 = new String[] {
|
|
90 |
"-d", OUTPUT_DIR3,
|
|
91 |
"-packagesheader", "Packages Frame Header",
|
|
92 |
"-header", "Main Frame Header",
|
|
93 |
"-sourcepath", SRC_DIR,
|
|
94 |
"p1", "p2"};
|
|
95 |
|
|
96 |
|
|
97 |
/**
|
|
98 |
* The entry point of the test.
|
|
99 |
* @param args the array of command line arguments.
|
|
100 |
*/
|
|
101 |
public static void main(String[] args) {
|
|
102 |
JavadocTester tester = new PackagesHeader();
|
|
103 |
|
24071
|
104 |
tester.run(JAVADOC_ARGS1, TESTARRAY1, NO_TEST);
|
|
105 |
tester.run(JAVADOC_ARGS2, TESTARRAY2, NO_TEST);
|
|
106 |
tester.run(JAVADOC_ARGS3, TESTARRAY3, NO_TEST);
|
10
|
107 |
|
|
108 |
tester.printSummary();
|
|
109 |
}
|
|
110 |
}
|