Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FXUtils.assertJavaFxThread() fails with @ParametrizedTest #543

Open
MarsBlessed opened this issue Aug 24, 2022 · 2 comments
Open

FXUtils.assertJavaFxThread() fails with @ParametrizedTest #543

MarsBlessed opened this issue Aug 24, 2022 · 2 comments

Comments

@MarsBlessed
Copy link
Contributor

Describe the bug
FXUtils.assertJavaFxThread() fails when run in a parametrized unit test

To Reproduce
try these tests:

@ExtendWith(ApplicationExtension.class)
@ExtendWith(JavaFxInterceptor.class)
public class ParametrizedExampleTest {
    @Start
    public void start(Stage stage) {
        stage.setScene(new Scene(new StackPane(), 120, 200));
        stage.show();
    }

    @ParameterizedTest
    @ValueSource(booleans = {true, false})
    public void test(boolean value) {
        FXUtils.assertJavaFxThread();
    }
}
@ExtendWith(ApplicationExtension.class)
@ExtendWith(SelectiveJavaFxInterceptor.class)
public class ParametrizedExampleTest {
    @Start
    public void start(Stage stage) {
        stage.setScene(new Scene(new StackPane(), 120, 200));
        stage.show();
    }

    @TestFx
    @ParameterizedTest
    @ValueSource(booleans = {true, false})
    public void test(boolean value) {
        FXUtils.assertJavaFxThread();
    }
}

Environment:

  • OS: Windows 7
  • Java version: temurin-11.0.16
  • JavaFx version: 13
  • ChartFx version: master, 11.2.7
@MarsBlessed
Copy link
Contributor Author

it is not a blocker so far but duplicating the test code doesn't look quite good when it could be done using @ParametrizedTest

@MarsBlessed
Copy link
Contributor Author

MarsBlessed commented Aug 24, 2022

Note also that in the second example @TestFx forces the test to run one extra time with ParameterResolutionException: No ParameterResolver registered

@MarsBlessed MarsBlessed changed the title FXUtils.assertJavaFxThread(); fails with @ParametrizedTest FXUtils.assertJavaFxThread() fails with @ParametrizedTest Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant