mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-14 15:57:12 -06:00
Styling: use TestUtils.setup() in unit tests;
This commit is contained in:
@@ -25,9 +25,9 @@ import java.util.Map;
|
|||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.table.JTableHeader;
|
import javax.swing.table.JTableHeader;
|
||||||
|
import org.junit.jupiter.api.AfterAll;
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import com.formdev.flatlaf.FlatLightLaf;
|
|
||||||
import com.formdev.flatlaf.icons.*;
|
import com.formdev.flatlaf.icons.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,7 +37,12 @@ public class TestFlatStyling
|
|||||||
{
|
{
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
static void setup() {
|
static void setup() {
|
||||||
FlatLightLaf.setup();
|
TestUtils.setup( false );
|
||||||
|
}
|
||||||
|
|
||||||
|
@AfterAll
|
||||||
|
static void cleanup() {
|
||||||
|
TestUtils.cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ import javax.swing.UIManager;
|
|||||||
import javax.swing.plaf.ColorUIResource;
|
import javax.swing.plaf.ColorUIResource;
|
||||||
import javax.swing.plaf.basic.BasicTextFieldUI;
|
import javax.swing.plaf.basic.BasicTextFieldUI;
|
||||||
import javax.swing.text.JTextComponent;
|
import javax.swing.text.JTextComponent;
|
||||||
|
import org.junit.jupiter.api.AfterAll;
|
||||||
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,58 +38,44 @@ import org.junit.jupiter.api.Test;
|
|||||||
*/
|
*/
|
||||||
public class TestFlatTextComponents
|
public class TestFlatTextComponents
|
||||||
{
|
{
|
||||||
|
@BeforeAll
|
||||||
|
static void setup() {
|
||||||
|
TestUtils.setup( false );
|
||||||
|
}
|
||||||
|
|
||||||
|
@AfterAll
|
||||||
|
static void cleanup() {
|
||||||
|
TestUtils.cleanup();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void editorPane_updateBackground() {
|
void editorPane_updateBackground() {
|
||||||
textComponent_updateBackground( "EditorPane", () -> {
|
textComponent_updateBackground( "EditorPane", JEditorPane::new );
|
||||||
JEditorPane c = new JEditorPane();
|
|
||||||
c.setUI( new FlatEditorPaneUI() );
|
|
||||||
return c;
|
|
||||||
} );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void formattedTextField_updateBackground() {
|
void formattedTextField_updateBackground() {
|
||||||
textComponent_updateBackground( "FormattedTextField", () -> {
|
textComponent_updateBackground( "FormattedTextField", JFormattedTextField::new );
|
||||||
JFormattedTextField c = new JFormattedTextField();
|
|
||||||
c.setUI( new FlatFormattedTextFieldUI() );
|
|
||||||
return c;
|
|
||||||
} );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void passwordField_updateBackground() {
|
void passwordField_updateBackground() {
|
||||||
textComponent_updateBackground( "PasswordField", () -> {
|
textComponent_updateBackground( "PasswordField", JPasswordField::new );
|
||||||
JPasswordField c = new JPasswordField();
|
|
||||||
c.setUI( new FlatPasswordFieldUI() );
|
|
||||||
return c;
|
|
||||||
} );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void textArea_updateBackground() {
|
void textArea_updateBackground() {
|
||||||
textComponent_updateBackground( "TextArea", () -> {
|
textComponent_updateBackground( "TextArea", JTextArea::new );
|
||||||
JTextArea c = new JTextArea();
|
|
||||||
c.setUI( new FlatTextAreaUI() );
|
|
||||||
return c;
|
|
||||||
} );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void textField_updateBackground() {
|
void textField_updateBackground() {
|
||||||
textComponent_updateBackground( "TextField", () -> {
|
textComponent_updateBackground( "TextField", JTextField::new );
|
||||||
JTextField c = new JTextField();
|
|
||||||
c.setUI( new FlatTextFieldUI() );
|
|
||||||
return c;
|
|
||||||
} );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void textPane_updateBackground() {
|
void textPane_updateBackground() {
|
||||||
textComponent_updateBackground( "TextPane", () -> {
|
textComponent_updateBackground( "TextPane", JTextPane::new );
|
||||||
JTextPane c = new JTextPane();
|
|
||||||
c.setUI( new FlatTextPaneUI() );
|
|
||||||
return c;
|
|
||||||
} );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user