Skip to content

Commit

Permalink
fix: update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
miurahr committed Sep 20, 2024
1 parent 56bf803 commit 6e37552
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
13 changes: 4 additions & 9 deletions src/test/java/org/omegat/swing/extra/TestColorChooser.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions src/test/java/org/omegat/swing/extra/TestFileChooser.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/test/java/org/omegat/swing/extra/TestOptionPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6e37552

Please sign in to comment.