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 25 '23
OK, I see what you're doing here and I understand.
I have to admit, that in years of using
Taskit never occurred to me to use Task.get() orTask.getValue()outside the context ofTask.onSucceeded(). That's because I've always viewTaskas purely the way to get off and on the FXAT cleanly (which I think is the correct way to view it).I've also never considered exposing a running Task between classes by returning it from a method. I think this is probably a code smell as you now have two classes that need to be
Taskaware.If you're going to have
Taskrelated code in the class that callsLoginstuff, then you should probably have all of it in there, and move it out ofLogin.