Skip to content

Commit 299e115

Browse files
committed
8198395: Test javax/swing/plaf/metal/MetalLookAndFeel/Test8039750.java fails in mach5
Reviewed-by: prr
1 parent a5b7bc5 commit 299e115

File tree

1 file changed

+29
-26
lines changed

1 file changed

+29
-26
lines changed

test/jdk/javax/swing/plaf/metal/MetalLookAndFeel/Test8039750.java

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
*/
2323

2424
import javax.swing.UIDefaults;
25+
import javax.swing.SwingUtilities;
2526
import javax.swing.border.CompoundBorder;
2627
import javax.swing.plaf.metal.MetalLookAndFeel;
2728

@@ -32,35 +33,37 @@
3233
* @author Sergey Malenkov
3334
*/
3435
public class Test8039750 {
35-
public static void main(String[] args) {
36-
UIDefaults table= new MetalLookAndFeel().getDefaults();
37-
test(table.get("ToolBar.rolloverBorder"),
38-
"javax.swing.plaf.metal.MetalBorders$ButtonBorder",
39-
"javax.swing.plaf.metal.MetalBorders$RolloverMarginBorder");
40-
test(table.get("ToolBar.nonrolloverBorder"),
41-
"javax.swing.plaf.metal.MetalBorders$ButtonBorder",
42-
"javax.swing.plaf.metal.MetalBorders$RolloverMarginBorder");
43-
test(table.get("RootPane.frameBorder"),
44-
"javax.swing.plaf.metal.MetalBorders$FrameBorder");
45-
test(table.get("RootPane.plainDialogBorder"),
46-
"javax.swing.plaf.metal.MetalBorders$DialogBorder");
47-
test(table.get("RootPane.informationDialogBorder"),
48-
"javax.swing.plaf.metal.MetalBorders$DialogBorder");
49-
test(table.get("RootPane.errorDialogBorder"),
50-
"javax.swing.plaf.metal.MetalBorders$ErrorDialogBorder");
51-
test(table.get("RootPane.colorChooserDialogBorder"),
52-
"javax.swing.plaf.metal.MetalBorders$QuestionDialogBorder");
53-
test(table.get("RootPane.fileChooserDialogBorder"),
54-
"javax.swing.plaf.metal.MetalBorders$QuestionDialogBorder");
55-
test(table.get("RootPane.questionDialogBorder"),
56-
"javax.swing.plaf.metal.MetalBorders$QuestionDialogBorder");
57-
test(table.get("RootPane.warningDialogBorder"),
58-
"javax.swing.plaf.metal.MetalBorders$WarningDialogBorder");
36+
public static void main(String[] args) throws Exception {
37+
SwingUtilities.invokeAndWait(() -> {
38+
UIDefaults table= new MetalLookAndFeel().getDefaults();
39+
test(table.get("ToolBar.rolloverBorder"),
40+
"javax.swing.plaf.metal.MetalBorders$ButtonBorder",
41+
"javax.swing.plaf.metal.MetalBorders$RolloverMarginBorder");
42+
test(table.get("ToolBar.nonrolloverBorder"),
43+
"javax.swing.plaf.metal.MetalBorders$ButtonBorder",
44+
"javax.swing.plaf.metal.MetalBorders$RolloverMarginBorder");
45+
test(table.get("RootPane.frameBorder"),
46+
"javax.swing.plaf.metal.MetalBorders$FrameBorder");
47+
test(table.get("RootPane.plainDialogBorder"),
48+
"javax.swing.plaf.metal.MetalBorders$DialogBorder");
49+
test(table.get("RootPane.informationDialogBorder"),
50+
"javax.swing.plaf.metal.MetalBorders$DialogBorder");
51+
test(table.get("RootPane.errorDialogBorder"),
52+
"javax.swing.plaf.metal.MetalBorders$ErrorDialogBorder");
53+
test(table.get("RootPane.colorChooserDialogBorder"),
54+
"javax.swing.plaf.metal.MetalBorders$QuestionDialogBorder");
55+
test(table.get("RootPane.fileChooserDialogBorder"),
56+
"javax.swing.plaf.metal.MetalBorders$QuestionDialogBorder");
57+
test(table.get("RootPane.questionDialogBorder"),
58+
"javax.swing.plaf.metal.MetalBorders$QuestionDialogBorder");
59+
test(table.get("RootPane.warningDialogBorder"),
60+
"javax.swing.plaf.metal.MetalBorders$WarningDialogBorder");
61+
});
5962
}
6063

6164
private static void test(Object value, String name) {
6265
if (!value.getClass().getName().equals(name)) {
63-
throw new Error(name);
66+
throw new RuntimeException(name);
6467
}
6568
}
6669

@@ -70,7 +73,7 @@ private static void test(Object value, String one, String two) {
7073
test(border.getOutsideBorder(), one);
7174
test(border.getInsideBorder(), two);
7275
} else {
73-
throw new Error("CompoundBorder");
76+
throw new RuntimeException("CompoundBorder");
7477
}
7578
}
7679
}

0 commit comments

Comments
 (0)