ApplicationTest subclassing - lifecycle and use of "start" method and @Before annotation

32 views
Skip to first unread message

Kay Pac

unread,
Jul 4, 2016, 9:48:12 PM7/4/16
to TestFX
I am writing a new test class using the latest TestFX, after having upgraded from the org.loadui artifact. Right now I am creating my "object under test" in the "start" method which is required to be implemented, and which accepts a "Stage" argument. This is because my object under test is the view itself. However, I normally create the instance "object under test" in my @Before-annotated method, so that it is created anew prior to each test.

I am considering the possibility of just putting an empty Pane as the root node in my initial scene, and then populating it - however I know I can only do this from the UI, which i think is called the javafx application thread. I know this isn't too difficult, but I forget the right classes/methods in order to do it.

Are there any best practices regarding the implementation of the "start" method and the @Before-annotated methods? I welcome any feedback.

Sincerely,

Kay

Reply all
Reply to author
Forward
0 new messages