diff --git a/src/test/java/org/omegat/swing/extra/TestColorChooser.java b/src/test/java/org/omegat/swing/extra/TestColorChooser.java index 49aa2b3..d6f92aa 100644 --- a/src/test/java/org/omegat/swing/extra/TestColorChooser.java +++ b/src/test/java/org/omegat/swing/extra/TestColorChooser.java @@ -16,7 +16,6 @@ import org.assertj.swing.fixture.FrameFixture; import org.assertj.swing.junit.testcase.AssertJSwingJUnitTestCase; import org.junit.Assume; -import org.junit.BeforeClass; import org.junit.Test; import org.omegat.swing.utils.JButtonTextMatcher; import org.omegat.swing.utils.JLabelTextMatcher; @@ -25,7 +24,7 @@ public class TestColorChooser extends AssertJSwingJUnitTestCase { private static final String GTK_LAF = "GTK"; - private static String lafId; + private String lafId; protected FrameFixture window; protected JFrame parent; @@ -39,14 +38,9 @@ public class TestColorChooser extends AssertJSwingJUnitTestCase { private String[] rgbLabels; private String[] cmykLabels; - @BeforeClass - public static void setUpClass() throws Exception { - lafId = UIManager.getLookAndFeel().getID(); - ExtraLocales.initialize(); - } - @Override - protected void onSetUp() throws Exception { + protected void onSetUp() { + lafId = UIManager.getLookAndFeel().getID(); language = Locale.getDefault().getLanguage(); Assume.assumeTrue(Arrays.stream(SUPPORTED).anyMatch(s -> language.equals(s))); ResourceBundle bundle = ResourceBundle.getBundle(EXTRA_BASIC); @@ -89,6 +83,7 @@ protected void onSetUp() throws Exception { "ColorChooser.cmykAlpha.textAndMnemonic"); // preparation parent = GuiActionRunner.execute(() -> { + ExtraLocales.initialize(); JFrame frame = new JFrame(); frame.setPreferredSize(new Dimension(800, 600)); return frame; diff --git a/src/test/java/org/omegat/swing/extra/TestFileChooser.java b/src/test/java/org/omegat/swing/extra/TestFileChooser.java index 7cbece5..925c326 100644 --- a/src/test/java/org/omegat/swing/extra/TestFileChooser.java +++ b/src/test/java/org/omegat/swing/extra/TestFileChooser.java @@ -15,7 +15,6 @@ import org.assertj.swing.fixture.FrameFixture; import org.assertj.swing.junit.testcase.AssertJSwingJUnitTestCase; import org.junit.Assume; -import org.junit.BeforeClass; import org.junit.Test; public class TestFileChooser extends AssertJSwingJUnitTestCase { @@ -30,7 +29,7 @@ public class TestFileChooser extends AssertJSwingJUnitTestCase { String[] buttonLabels; @Override - protected void onSetUp() throws Exception { + protected void onSetUp() { language = Locale.getDefault().getLanguage(); Assume.assumeTrue(Arrays.stream(SUPPORTED).anyMatch(s -> language.equals(s))); // expectations diff --git a/src/test/java/org/omegat/swing/extra/TestOptionPane.java b/src/test/java/org/omegat/swing/extra/TestOptionPane.java index 7332aae..be398f0 100644 --- a/src/test/java/org/omegat/swing/extra/TestOptionPane.java +++ b/src/test/java/org/omegat/swing/extra/TestOptionPane.java @@ -16,7 +16,6 @@ import org.assertj.swing.fixture.FrameFixture; import org.assertj.swing.junit.testcase.AssertJSwingJUnitTestCase; import org.junit.Assume; -import org.junit.BeforeClass; import org.junit.Test; public class TestOptionPane extends AssertJSwingJUnitTestCase {