I wrote several tests, divided not only into separate classes, but, depending on in which area of my application they are tested, into separate subpackages. So my package structure looks something like this:
my.package.tests my.package.tests.four my.package.tests.one my.package.tests.three my.package.tests.two
In the package my.package.tests , I have a parent class that passes all the tests in subpackages from one to four. Now I would like to choose the order of the tests; not included in the classes (which is possible using the FixMethodOrder annotation ), but the order of the classes themselves or subpackages (so those are the one package, then those that are listed in two , ect.). Some test classes use a Parameterized runner , in case it matters. The choice of tests is not required for the tests to be successful, they are independent of each other; however, it would be useful to sort them to reflect the order in which the various parts of the program are usually used, as this facilitates analysis.
Now, ideally, I would like to have some kind of configuration file that tells JUnit to order tests; I suppose, however, that it will not be so simple. What options do I have and what would be the easiest? I would also prefer only to list subpackages rather than the various classes in packages or even the testing functions in classes.
I am using Java 1.6.0_26 (I have no choice here) and JUnit 4.11.
source share