This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have created a JUnittest class in which I would like the various "test" methods to be run in a specific order. I have found that the test methods execute in different sequences depending upon the JVM that the JUnit test class is run in. Looking at the API, I thought that overriding runTest() was the answer but this apparently executes once for each "test" method in the JUnit test class (and there are 8 in my test class). So, it executes the test methods in the proper order but it does so 8 times in my JUnit test class! My immediate solution is to use a static count variable, check and increment it during runTest() execution. The other possible solution would be to rename all the "test" methods on the JUnit test class. However, it seems there should be an easier way. I would appreciate any suggestions.