Skip to content

Commit

Permalink
Don't use private javafx impl in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheikah45 committed Sep 19, 2023
1 parent 9f9a651 commit ef64c1d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/test/java/com/faforever/client/test/PlatformTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

import com.faforever.client.fx.Controller;
import com.faforever.client.fx.FxApplicationThreadExecutor;
import com.sun.javafx.application.PlatformImpl;
import javafx.application.Platform;
import javafx.fxml.FXMLLoader;
import javafx.util.Callback;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;
Expand Down Expand Up @@ -51,9 +50,12 @@ public PlatformTest() {
});
}

@BeforeEach
public void setupPlatform() {
PlatformImpl.startup(() -> {});
@BeforeAll
public static void setupPlatform() {
try {
Platform.startup(() -> {});
} catch (IllegalStateException ignored) {
}
}

protected void loadFxml(String fileName,
Expand Down

0 comments on commit ef64c1d

Please sign in to comment.