This problem is specifically linked to using Gradle with javafx, testFX for the gui testing integration, and Junit for the actual unit tests.
The problem is that due to the nature of our particular test suite requires the application to restart and the automated tests to run through EVERY stage of the applications life cycle for every single junit test class. Due to this requirement, when gradle runs multiple tests, it tries to call my launchApplication() method multiple times under the same instance of the jvm, which gives the error:
Exception in thread "thread-10" java.lang.IllegalStateException: Application launch must not be called more than once
I’m fairly certain I can solve this problem with making every individual class a testSuite and then using the @category tag, but considering I have over 100 various classes that all require this sort of setup, it would be more than a little cumbersome. So, is there any way to force gradle to do a full restart of the jvm between unit test classes? or am I (for now) limited to the above solution, or trying to find a different way around it?
here is the stack trace after running gradlew test --info, keep in mind i DID try to run this without the daemon, with the same results.
you can see the stack trace here: http://pastebin.com/CLsxFVWY