author | iris |
Thu, 23 Jul 2015 13:19:54 -0700 | |
changeset 33994 | bf31c6908a70 |
parent 30730 | d3ce7619db2c |
permissions | -rw-r--r-- |
15370 | 1 |
/* |
30730
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
15370
diff
changeset
|
2 |
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. |
15370 | 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 |
* |
|
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. |
|
22 |
*/ |
|
23 |
||
24 |
/** |
|
25 |
* @test |
|
26 |
* @bug 8006263 |
|
27 |
* @summary Supplementary test cases needed for doclint |
|
30730
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
15370
diff
changeset
|
28 |
* @modules jdk.compiler/com.sun.tools.doclint |
15370 | 29 |
*/ |
30 |
||
31 |
import com.sun.tools.doclint.Checker; |
|
32 |
import com.sun.tools.doclint.Entity; |
|
33 |
import com.sun.tools.doclint.HtmlTag; |
|
34 |
import com.sun.tools.doclint.Messages; |
|
35 |
import java.util.Objects; |
|
36 |
||
37 |
public class CoverageExtras { |
|
38 |
public static void main(String... args) { |
|
39 |
new CoverageExtras().run(); |
|
40 |
} |
|
41 |
||
42 |
void run() { |
|
43 |
check(HtmlTag.A, HtmlTag.valueOf("A"), HtmlTag.values()); |
|
44 |
check(HtmlTag.Attr.ABBR, HtmlTag.Attr.valueOf("ABBR"), HtmlTag.Attr.values()); |
|
45 |
check(HtmlTag.AttrKind.INVALID, HtmlTag.AttrKind.valueOf("INVALID"), HtmlTag.AttrKind.values()); |
|
46 |
check(HtmlTag.BlockType.BLOCK, HtmlTag.BlockType.valueOf("BLOCK"), HtmlTag.BlockType.values()); |
|
47 |
check(HtmlTag.EndKind.NONE, HtmlTag.EndKind.valueOf("NONE"), HtmlTag.EndKind.values()); |
|
48 |
check(HtmlTag.Flag.EXPECT_CONTENT, HtmlTag.Flag.valueOf("EXPECT_CONTENT"), HtmlTag.Flag.values()); |
|
49 |
||
50 |
check(Checker.Flag.TABLE_HAS_CAPTION, Checker.Flag.valueOf("TABLE_HAS_CAPTION"), Checker.Flag.values()); |
|
51 |
||
52 |
check(Entity.nbsp, Entity.valueOf("nbsp"), Entity.values()); |
|
53 |
||
54 |
check(Messages.Group.ACCESSIBILITY, Messages.Group.valueOf("ACCESSIBILITY"), Messages.Group.values()); |
|
55 |
} |
|
56 |
||
57 |
<T extends Enum<T>> void check(T expect, T value, T[] values) { |
|
58 |
if (!Objects.equals(expect, value)) { |
|
59 |
error("Mismatch: '" + expect + "', '" + value + "'"); |
|
60 |
} |
|
61 |
if (!Objects.equals(expect, values[0])) { |
|
62 |
error("Mismatch: '" + expect + "', '" + values[0] + "'"); |
|
63 |
} |
|
64 |
} |
|
65 |
||
66 |
void error(String msg) { |
|
67 |
System.err.println("Error: " + msg); |
|
68 |
errors++; |
|
69 |
} |
|
70 |
||
71 |
int errors; |
|
72 |
} |