Skip to content

Commit 2224bbd

Browse files
authored
Merge pull request #88 from arnobl/fix-tests-fxapp
fix(test): Each test class that uses JFX must init the JFX toolkit
2 parents 8f44d4c + ff78983 commit 2224bbd

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

src/test/java/io/reactivex/rxjavafx/schedulers/JavaFxSchedulerTest.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,13 @@ public void start(Stage primaryStage) throws Exception {
5858
}
5959
}
6060

61-
@BeforeClass
62-
public static void initJFX() {
63-
javafx.application.Platform.startup(() ->{});
64-
}
61+
@BeforeClass
62+
public static void initJFX() {
63+
try {
64+
javafx.application.Platform.startup(() ->{});
65+
}catch(final IllegalStateException ignore) {
66+
}
67+
}
6568

6669
@Test
6770
public void testPeriodicScheduling() throws Exception {

src/test/java/io/reactivex/rxjavafx/sources/JavaFxObservableTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@
3636

3737
public final class JavaFxObservableTest {
3838

39+
@BeforeClass
40+
public static void initJFX() {
41+
try {
42+
javafx.application.Platform.startup(() ->{});
43+
}catch(final IllegalStateException ignore) {
44+
}
45+
}
46+
3947
@Test
4048
public void testIntervalSource() {
4149

0 commit comments

Comments
 (0)