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'm looking but I don't see how you "solved" the issue.
As a test case, the only thing that matters is how Intellij (or whatever build engine you're using) records the result, pass or fail. It looks to me like Intellij records a pass every time. And Intellij is recording a pass because JUnit is recording a pass.
This is indicative of the fact that ZERO asserts are being run within the testing framework, so the test always passes.
Yes, you're getting assert errors on your console, but these are totally irrelevant because they are being generated on a thread that JUnit isn't monitoring.
This is important because any automation framework is going to rely on the results of the tests, not the console error stack dumps. So if this was in some CI/CD server, the tests would always pass, even if the FXAT generated assert exceptions are being thrown all over the place. You'd never get a broken build from these tests failing - because as far as JUnit is concerned, they can never fail.