Skip to content

Commit ef64c1d

Browse files
committed
Don't use private javafx impl in tests
1 parent 9f9a651 commit ef64c1d

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/test/java/com/faforever/client/test/PlatformTest.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
import com.faforever.client.fx.Controller;
44
import com.faforever.client.fx.FxApplicationThreadExecutor;
5-
import com.sun.javafx.application.PlatformImpl;
65
import javafx.application.Platform;
76
import javafx.fxml.FXMLLoader;
87
import javafx.util.Callback;
98
import lombok.Data;
109
import lombok.extern.slf4j.Slf4j;
11-
import org.junit.jupiter.api.BeforeEach;
10+
import org.junit.jupiter.api.BeforeAll;
1211
import org.junit.jupiter.api.extension.ExtendWith;
1312
import org.junit.jupiter.api.parallel.Execution;
1413
import org.junit.jupiter.api.parallel.ExecutionMode;
@@ -51,9 +50,12 @@ public PlatformTest() {
5150
});
5251
}
5352

54-
@BeforeEach
55-
public void setupPlatform() {
56-
PlatformImpl.startup(() -> {});
53+
@BeforeAll
54+
public static void setupPlatform() {
55+
try {
56+
Platform.startup(() -> {});
57+
} catch (IllegalStateException ignored) {
58+
}
5759
}
5860

5961
protected void loadFxml(String fileName,

0 commit comments

Comments
 (0)