author | bpatel |
Wed, 01 Dec 2010 11:02:38 -0800 | |
changeset 7614 | cfadc977ca75 |
parent 5520 | 86e4b9a9da40 |
child 7681 | 1f0819a3341f |
permissions | -rw-r--r-- |
10 | 1 |
/* |
5520 | 2 |
* Copyright (c) 2004, 2007, 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 4665566 4855876 |
|
27 |
* @summary Verify that the output has the right javascript. |
|
28 |
* @author jamieh |
|
29 |
* @library ../lib/ |
|
30 |
* @build JavadocTester |
|
31 |
* @build TestJavascript |
|
32 |
* @run main TestJavascript |
|
33 |
*/ |
|
34 |
||
35 |
public class TestJavascript extends JavadocTester { |
|
36 |
||
37 |
//Test information. |
|
38 |
private static final String BUG_ID = "4665566-4855876"; |
|
39 |
||
40 |
//Javadoc arguments. |
|
41 |
private static final String[] ARGS = new String[] { |
|
42 |
"-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", SRC_DIR + FS + "TestJavascript.java" |
|
43 |
}; |
|
44 |
||
45 |
//Input for string search tests. |
|
46 |
private static final String[][] TEST = { |
|
47 |
{BUG_ID + FS + "pkg" + FS + "C.html", |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
48 |
"<a href=\"../index.html?pkg/C.html\" target=\"_top\">FRAMES</a>"}, |
10 | 49 |
{BUG_ID + FS + "TestJavascript.html", |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
50 |
"<a href=\"index.html?TestJavascript.html\" target=\"_top\">FRAMES</a>"}, |
10 | 51 |
{BUG_ID + FS + "index.html", |
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
52 |
"<script type=\"text/javascript\">" + NL + |
10 | 53 |
" targetPage = \"\" + window.location.search;" + NL + |
54 |
" if (targetPage != \"\" && targetPage != \"undefined\")" + NL + |
|
55 |
" targetPage = targetPage.substring(1);" + NL + |
|
56 |
" if (targetPage.indexOf(\":\") != -1)" + NL + |
|
57 |
" targetPage = \"undefined\";" + NL + |
|
58 |
" function loadFrames() {" + NL + |
|
59 |
" if (targetPage != \"\" && targetPage != \"undefined\")" + NL + |
|
60 |
" top.classFrame.location = top.targetPage;" + NL + |
|
61 |
" }" + NL + |
|
7614
cfadc977ca75
6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents:
5520
diff
changeset
|
62 |
"</script>"}, |
10 | 63 |
|
64 |
//Make sure title javascript only runs if is-external is not true |
|
65 |
{BUG_ID + FS + "pkg" + FS + "C.html", |
|
66 |
" if (location.href.indexOf('is-external=true') == -1) {" + NL + |
|
67 |
" parent.document.title=\"C\";" + NL + |
|
68 |
" }"}, |
|
69 |
}; |
|
70 |
||
71 |
private static final String[][] NEGATED_TEST = NO_TEST; |
|
72 |
||
73 |
/** |
|
74 |
* The entry point of the test. |
|
75 |
* @param args the array of command line arguments. |
|
76 |
*/ |
|
77 |
public static void main(String[] args) { |
|
78 |
TestJavascript tester = new TestJavascript(); |
|
79 |
run(tester, ARGS, TEST, NEGATED_TEST); |
|
80 |
tester.printSummary(); |
|
81 |
} |
|
82 |
||
83 |
/** |
|
84 |
* {@inheritDoc} |
|
85 |
*/ |
|
86 |
public String getBugId() { |
|
87 |
return BUG_ID; |
|
88 |
} |
|
89 |
||
90 |
/** |
|
91 |
* {@inheritDoc} |
|
92 |
*/ |
|
93 |
public String getBugName() { |
|
94 |
return getClass().getName(); |
|
95 |
} |
|
96 |
} |