I wanted to choose the order to execute the JUnit tests. I have 4 classes with several test methods in it, my goal is to execute, for instance, method Y of class A, then met
The JUnit answer to that question is to create one test method like this:
@Test public void testAll() {
classA.y();
classB.x();
classA.z();
}
That is obviously an unsatisfying answer in certain cases (where setup and teardown matter), but the JUnit view of unit testing is that if tests are not independant, you are doing something wrong.
If the above doesn't meet your needs, have a look at TestNG.