Is it possible to “forkEvery” by method, rather than by class?
I want to use a JUnit test suite, which is basically a single class that calls multiple methods.
I believe that the problem I am having is that Gradle recognizes the entire test suite as a single class ( typically called “AllTests.class” ) and doesn’t fork upon all the methods that are found within the embedded class references within the entire suite.
Is it possible to “forkEvery=method” or something like that?
Until I figure it out, it seems that my Gradle “Junit Suite” runs on only one thread.
In my project (see links below) i have a runAllTests task that runs the JUnit suite on one thread . I also have a runSkipSuite task that skips the suite class and filters by test classes in the gradle task which is a method that works and forks properly but I would have preferred the suite method.
I still can’t quite get it working using a standard JUnit test suite class BUT I am able to get it working by using the Gradle forking method with a class filter. (See the link above)
So, I am still hoping someone can answer my question.
Because of this problem I am unable to run static shared instances of HTTP server or JSON-RemoteWebDriver servers because if I do initialize those in a AllTests suite class then the tests run sequentially rather than forked.
Perhaps I could run a static server from the Gradle task, but is that what is recommended?