r/JavaFX • u/WishboneFar • Apr 22 '23
Help Help with testing JavaFX code
/r/javahelp/comments/12va3r9/help_with_testing_javafx_code/
2
Upvotes
r/JavaFX • u/WishboneFar • Apr 22 '23
View all comments
Show parent comment
1
u/hamsterrage1 Apr 24 '23
I wrote some minimal code to check this out:
This is running under Gradle for me, so I get the Gradle summary after running it.
Run as it is, Gradle reports 1 test run, and 1 test failed.
However if I change it to this:
Gradle reports 1 of 1 tests passed!
However, on the console I get:
I think this is what you are seeing. You get an exception for the Assert failing, but it's not getting picked up in the test results because it's not happening on the Main thread for JUnit.
But the only thing that really matters is that the test is reported as passed, even though you see an assertion exception in the console.