You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create new package mypackage with these 2 new test classes:
public class A extends AbstractPlainJavaFxTest {
@Test
public void test() {
assertTrue(true);
WaitForAsyncUtils.waitForFxEvents();
}
}
public class B {
@Test
public void test() {
assertTrue(true);
WaitForAsyncUtils.waitForFxEvents();
}
}
Run entire package, for example gradle test --tests com.faforever.client.mypackage.*
-> Both tests will succeed
Run ONLY test class B
-> Test will fail because it is missing parent class AbstractPlainJavaFxTest for JavaFX toolkit initialization
AbstractPlainJavaFxTest is "leaking" the toolkit initialization into other classes.
The text was updated successfully, but these errors were encountered:
Katharsas
changed the title
Tests: JavaFX Toolkit state is not cleanup after test class
Tests: JavaFX Toolkit state is not cleaned up after test class
Aug 12, 2019
I believe this issue is because the application persists for the entire execution. JavaFx does not allow you to have two applications running at once as you cannot call the launch method twice in the same session. TestFx sets the application so that it won't close when all the windows are closed so that it continues to run for the entire session.
I do not believe there is a way to get around this behavior.
How to reproduce:
mypackage
with these 2 new test classes:gradle test --tests com.faforever.client.mypackage.*
-> Both tests will succeed
B
-> Test will fail because it is missing parent class
AbstractPlainJavaFxTest
for JavaFX toolkit initializationAbstractPlainJavaFxTest
is "leaking" the toolkit initialization into other classes.The text was updated successfully, but these errors were encountered: