Skip to content
Permalink
Browse files
8198395: Test javax/swing/plaf/metal/MetalLookAndFeel/Test8039750.jav…
…a fails in mach5

Reviewed-by: prr
  • Loading branch information
prsadhuk committed Oct 22, 2020
1 parent a5b7bc5 commit 299e1154af86797b80c0c6176102d42d4f9ae1c6
Showing 1 changed file with 29 additions and 26 deletions.
@@ -22,6 +22,7 @@
*/

import javax.swing.UIDefaults;
import javax.swing.SwingUtilities;
import javax.swing.border.CompoundBorder;
import javax.swing.plaf.metal.MetalLookAndFeel;

@@ -32,35 +33,37 @@
* @author Sergey Malenkov
*/
public class Test8039750 {
public static void main(String[] args) {
UIDefaults table= new MetalLookAndFeel().getDefaults();
test(table.get("ToolBar.rolloverBorder"),
"javax.swing.plaf.metal.MetalBorders$ButtonBorder",
"javax.swing.plaf.metal.MetalBorders$RolloverMarginBorder");
test(table.get("ToolBar.nonrolloverBorder"),
"javax.swing.plaf.metal.MetalBorders$ButtonBorder",
"javax.swing.plaf.metal.MetalBorders$RolloverMarginBorder");
test(table.get("RootPane.frameBorder"),
"javax.swing.plaf.metal.MetalBorders$FrameBorder");
test(table.get("RootPane.plainDialogBorder"),
"javax.swing.plaf.metal.MetalBorders$DialogBorder");
test(table.get("RootPane.informationDialogBorder"),
"javax.swing.plaf.metal.MetalBorders$DialogBorder");
test(table.get("RootPane.errorDialogBorder"),
"javax.swing.plaf.metal.MetalBorders$ErrorDialogBorder");
test(table.get("RootPane.colorChooserDialogBorder"),
"javax.swing.plaf.metal.MetalBorders$QuestionDialogBorder");
test(table.get("RootPane.fileChooserDialogBorder"),
"javax.swing.plaf.metal.MetalBorders$QuestionDialogBorder");
test(table.get("RootPane.questionDialogBorder"),
"javax.swing.plaf.metal.MetalBorders$QuestionDialogBorder");
test(table.get("RootPane.warningDialogBorder"),
"javax.swing.plaf.metal.MetalBorders$WarningDialogBorder");
public static void main(String[] args) throws Exception {
SwingUtilities.invokeAndWait(() -> {
UIDefaults table= new MetalLookAndFeel().getDefaults();
test(table.get("ToolBar.rolloverBorder"),
"javax.swing.plaf.metal.MetalBorders$ButtonBorder",
"javax.swing.plaf.metal.MetalBorders$RolloverMarginBorder");
test(table.get("ToolBar.nonrolloverBorder"),
"javax.swing.plaf.metal.MetalBorders$ButtonBorder",
"javax.swing.plaf.metal.MetalBorders$RolloverMarginBorder");
test(table.get("RootPane.frameBorder"),
"javax.swing.plaf.metal.MetalBorders$FrameBorder");
test(table.get("RootPane.plainDialogBorder"),
"javax.swing.plaf.metal.MetalBorders$DialogBorder");
test(table.get("RootPane.informationDialogBorder"),
"javax.swing.plaf.metal.MetalBorders$DialogBorder");
test(table.get("RootPane.errorDialogBorder"),
"javax.swing.plaf.metal.MetalBorders$ErrorDialogBorder");
test(table.get("RootPane.colorChooserDialogBorder"),
"javax.swing.plaf.metal.MetalBorders$QuestionDialogBorder");
test(table.get("RootPane.fileChooserDialogBorder"),
"javax.swing.plaf.metal.MetalBorders$QuestionDialogBorder");
test(table.get("RootPane.questionDialogBorder"),
"javax.swing.plaf.metal.MetalBorders$QuestionDialogBorder");
test(table.get("RootPane.warningDialogBorder"),
"javax.swing.plaf.metal.MetalBorders$WarningDialogBorder");
});
}

private static void test(Object value, String name) {
if (!value.getClass().getName().equals(name)) {
throw new Error(name);
throw new RuntimeException(name);
}
}

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

1 comment on commit 299e115

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on 299e115 Oct 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.