From b457fd634e0e13043cf25358120b77972b2406c8 Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Wed, 16 Jun 2021 22:59:00 +0200 Subject: [PATCH] Styling: (try to) fix errors on GitHub Actions --- .../com/formdev/flatlaf/ui/FlatStylingTests.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/flatlaf-core/src/test/java/com/formdev/flatlaf/ui/FlatStylingTests.java b/flatlaf-core/src/test/java/com/formdev/flatlaf/ui/FlatStylingTests.java index 28e979b4..7f24d905 100644 --- a/flatlaf-core/src/test/java/com/formdev/flatlaf/ui/FlatStylingTests.java +++ b/flatlaf-core/src/test/java/com/formdev/flatlaf/ui/FlatStylingTests.java @@ -23,9 +23,8 @@ import java.util.HashMap; import java.util.Map; import javax.swing.JCheckBox; import javax.swing.JRadioButton; -import org.junit.jupiter.api.BeforeAll; +import javax.swing.UIManager; import org.junit.jupiter.api.Test; -import com.formdev.flatlaf.FlatLightLaf; import com.formdev.flatlaf.icons.FlatCheckBoxIcon; import com.formdev.flatlaf.icons.FlatRadioButtonIcon; @@ -34,11 +33,6 @@ import com.formdev.flatlaf.icons.FlatRadioButtonIcon; */ public class FlatStylingTests { - @BeforeAll - static void setup() { - FlatLightLaf.setup(); - } - @Test void parse() { assertEquals( null, FlatStyleSupport.parse( null ) ); @@ -70,7 +64,10 @@ public class FlatStylingTests @Test void checkBox() { FlatCheckBoxUI ui = new FlatCheckBoxUI( false ); - ui.installDefaults( new JCheckBox() ); // assign icon + + // assign icon + UIManager.put( "CheckBox.icon", new FlatCheckBoxIcon() ); + ui.installDefaults( new JCheckBox() ); assertTrue( ui.getDefaultIcon() instanceof FlatCheckBoxIcon ); // FlatCheckBoxUI extends FlatRadioButtonUI @@ -80,6 +77,9 @@ public class FlatStylingTests @Test void radioButton() { FlatRadioButtonUI ui = new FlatRadioButtonUI( false ); + + // assign icon + UIManager.put( "RadioButton.icon", new FlatRadioButtonIcon() ); ui.installDefaults( new JRadioButton() ); // assign icon assertTrue( ui.getDefaultIcon() instanceof FlatRadioButtonIcon );