BellSoft
banner
bellsoft.bsky.social
BellSoft
@bellsoft.bsky.social
Delivering #LibericaJDK: supported, #Java standard compatible binaries. Among Top-5 #OpenJDK contributors.
The demo apps used Java 21 + TestFX + JUnit5 + AssertJ + Monocle. Full write-up with configs and explanations here: dzone.com/articles/top...
Top 7 Mistakes When Testing JavaFX Applications
Testing JavaFX programs may seem non-trivial at first. This article describes the most common mistakes when testing desktop apps, their causes, and solutions.
dzone.com
October 23, 2025 at 12:54 PM
Mistake 7: mixing domain logic with UI in tests.
Business logic should live in view models and be tested with plain JUnit. Keep UI tests for rendering and interaction.
October 23, 2025 at 12:54 PM
Mistake 6: misconfigured headless CI.
Simply adding Monocle isn’t enough. Run with --add-opens, disable parallel UI tests, install native libs, and don’t assert fullscreen in headless.
October 23, 2025 at 12:54 PM
Mistake 5: pixel-perfect equality across platforms.
HiDPI, AA, GPU vs Monocle in CI → colors shift. Add tolerance and never assume an exact RGB match across OS/CI.
October 23, 2025 at 12:54 PM
Mistake 4: racing the FX event queue.
Assertions run before layout or scene switches complete.
❌ immediate assert
✅ wait for queue drain
October 23, 2025 at 12:54 PM
Mistake 3: triggering handlers directly instead of simulating input. button. fire() bypasses pointer/focus bugs that real users hit.
October 23, 2025 at 12:54 PM
Mistake 2: bootstrapping with mismatched loaders in Spring + TestFX.
TestFX owns the Stage, Spring owns the beans. If you let FXMLLoader use the wrong loader, you’ll get NPEs.
October 23, 2025 at 12:54 PM
Mistake 1: touching UI off the FX thread.
JUnit runs on its own thread, but only the FX thread can mutate controls.
October 23, 2025 at 12:54 PM