author | bpatel |
Thu, 18 Sep 2014 00:50:48 -0700 | |
changeset 26665 | e813baa25bf2 |
parent 24399 | af1a0220d0fa |
child 30730 | d3ce7619db2c |
permissions | -rw-r--r-- |
19663
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
1 |
/* |
23971 | 2 |
* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. |
19663
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
4 |
* |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
8 |
* |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
13 |
* accompanied this code). |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
14 |
* |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
18 |
* |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
21 |
* questions. |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
22 |
*/ |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
23 |
|
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
24 |
/* |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
25 |
* @test |
26665
e813baa25bf2
8047745: Javadoc should include encoding information in generated html files
bpatel
parents:
24399
diff
changeset
|
26 |
* @bug 7052170 8047745 |
19663
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
27 |
* @summary Run a test on -charset to make sure the charset gets generated as a |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
28 |
* part of the meta tag. |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
29 |
* @author Bhavesh Patel |
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
30 |
* @library ../lib |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
31 |
* @build JavadocTester |
19663
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
32 |
* @run main TestCharset |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
33 |
*/ |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
34 |
|
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
35 |
public class TestCharset extends JavadocTester { |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
36 |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
37 |
public static void main(String... args) throws Exception { |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
38 |
TestCharset tester = new TestCharset(); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
39 |
tester.runTests(); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
40 |
} |
19663
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
41 |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
42 |
@Test |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
43 |
void test() { |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
44 |
javadoc("-d", "out", |
26665
e813baa25bf2
8047745: Javadoc should include encoding information in generated html files
bpatel
parents:
24399
diff
changeset
|
45 |
"-charset", "ISO-8859-1", |
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
46 |
"-sourcepath", testSrc, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
47 |
"pkg"); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
48 |
checkExit(Exit.OK); |
19663
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
49 |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
50 |
checkOutput("index.html", true, |
26665
e813baa25bf2
8047745: Javadoc should include encoding information in generated html files
bpatel
parents:
24399
diff
changeset
|
51 |
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">"); |
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
52 |
checkOutput("pkg/Foo.html", true, |
26665
e813baa25bf2
8047745: Javadoc should include encoding information in generated html files
bpatel
parents:
24399
diff
changeset
|
53 |
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">"); |
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
54 |
|
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
55 |
checkOutput("index.html", false, |
26665
e813baa25bf2
8047745: Javadoc should include encoding information in generated html files
bpatel
parents:
24399
diff
changeset
|
56 |
"<meta http-equiv=\"Content-Type\" content=\"text/html\" charset=\"ISO-8859-1\">"); |
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
57 |
checkOutput("pkg/Foo.html", false, |
26665
e813baa25bf2
8047745: Javadoc should include encoding information in generated html files
bpatel
parents:
24399
diff
changeset
|
58 |
"<meta http-equiv=\"Content-Type\" content=\"text/html\" charset=\"ISO-8859-1\">"); |
e813baa25bf2
8047745: Javadoc should include encoding information in generated html files
bpatel
parents:
24399
diff
changeset
|
59 |
} |
e813baa25bf2
8047745: Javadoc should include encoding information in generated html files
bpatel
parents:
24399
diff
changeset
|
60 |
|
e813baa25bf2
8047745: Javadoc should include encoding information in generated html files
bpatel
parents:
24399
diff
changeset
|
61 |
@Test |
e813baa25bf2
8047745: Javadoc should include encoding information in generated html files
bpatel
parents:
24399
diff
changeset
|
62 |
void test1() { |
e813baa25bf2
8047745: Javadoc should include encoding information in generated html files
bpatel
parents:
24399
diff
changeset
|
63 |
javadoc("-d", "out-1", |
e813baa25bf2
8047745: Javadoc should include encoding information in generated html files
bpatel
parents:
24399
diff
changeset
|
64 |
"-sourcepath", testSrc, |
e813baa25bf2
8047745: Javadoc should include encoding information in generated html files
bpatel
parents:
24399
diff
changeset
|
65 |
"pkg"); |
e813baa25bf2
8047745: Javadoc should include encoding information in generated html files
bpatel
parents:
24399
diff
changeset
|
66 |
checkExit(Exit.OK); |
e813baa25bf2
8047745: Javadoc should include encoding information in generated html files
bpatel
parents:
24399
diff
changeset
|
67 |
|
e813baa25bf2
8047745: Javadoc should include encoding information in generated html files
bpatel
parents:
24399
diff
changeset
|
68 |
checkOutput("index.html", true, |
e813baa25bf2
8047745: Javadoc should include encoding information in generated html files
bpatel
parents:
24399
diff
changeset
|
69 |
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"); |
e813baa25bf2
8047745: Javadoc should include encoding information in generated html files
bpatel
parents:
24399
diff
changeset
|
70 |
checkOutput("pkg/Foo.html", true, |
e813baa25bf2
8047745: Javadoc should include encoding information in generated html files
bpatel
parents:
24399
diff
changeset
|
71 |
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"); |
19663
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
72 |
} |
9a3447cabe1a
7052170: javadoc -charset option generates wrong meta tag
bpatel
parents:
diff
changeset
|
73 |
} |