I’ve got 100s of Junit test classes, I want to group them into batches in order to run them in sequence or in parallel.
I want to be able to execute **/*Test.java (ideally *Test.groovy too) and then define the order in which the matching tests are run. The configuration could be by a particular annotation or some other matching criteria to determine the batch.
I would like to do this because ant, by default, selects test classes for execution in alphabetical order of their full class names eg. [com.bar.Test, com.foo.Test]. However a sparse selection of test classes in our codebase use custom spring application contexts and it might speed up test execution if I could order test classes by their Spring application context i.e. by the value in the @ContextConfiguration annotation.
Any suggestions of how I could do this?