Archive for the ‘junit’ Tag
JUnit4: TestSuite of TestSuite
Again talking about JUnit 4. I’m used to use TestSuite to group tests. And add them to the AllTests class. In JUnit 4 it’s quite similar to the 3.x method, just using Java Annotation instead of the old TestSuite class.
Here is the pdf with the example code for having a TestSuite of TestSuite in JUnit 4.
JUnit 4 migration
Finally even me landed in the JUnit 4 planet.
The main difficulty in migration from 3.8.* is the class AllTests : a class with all the tests in it from where you can run all application tests in one shot.
The 4.x way is to use JDK (>=5) annotation, but if you for some reason have to use the JDK 1.4 you have two solutions. The one I prefer is to use junit 3.8.x but if you cannot tolerate the missing of JUnit 4.x in the attached PDF you’ll find the standard 4.x way (with annotation) and a workaround for using the old JUnit TestSuite syntax.
Leave a Comment
Comments (1)