sialcasa / mvvmFX

an Application Framework for implementing the MVVM Pattern with JavaFX
Apache License 2.0
489 stars 104 forks source link

[#545] NotificationTestHelper should not start JavaFX thread #550

Closed nils-christian closed 6 years ago

nils-christian commented 6 years ago

Hi,

This is a pull request for #545. I added a new class named ThreadlessNotificationTestHelper which can be used as an alternative to the NotificationTestHelper. I added also some unit tests for the new class. Furthermore, I fixed the issue for an environment without any toolkit as discussed. The toolkit initializer still prints an exception (this cannot be corrected easily, as com.sun.javafx.tk.Toolkit.getToolkit() simply calls printStackTrace), but the exception is now caught by mvvmFX and handled correctly. I tested this in a simple docker container and now the publish method from the view model works even in an environment without toolkit.

Best regards

Nils

manuel-mauky commented 6 years ago

Thanks for this contribution.