I've recently started the upgrade from JUnit 4 to JUnit5 and the subsequent update to Ant 1.10.8 as well.
What I'm seeing when I run the tests is that it appears we're not forking the JVM like it did in previous versions. The results are indicating that we're reusing the JVM between tests which means we're hitting issue with static classes between runs.
<junitlauncher>
<classpath>
...
</classpath>
<testclasses>
<fork dir="${baseDirectory}">
....
</fork>
</testclasses>
</junitlauncher>
Is there something I'm missing here with the fork functionality on Ant? Or is there another way around this that operates like the 'old ant & junit combo'?
*sigh
So for those interested parties - the answer is in the details:
The fork nested element can be used to run the tests in a newly forked JVM. All tests that are part of this testclasses element will run in one single instance of the newly forked JVM.
So JUnit5 doesn't fork for each test - it forks for all the items in the testclasses attribute. In order to have a resource to be looped through with a JVM for each test class - that is going to require some magic on the outside of that testclasses block.