JUnitConverter
JUnitConverter is a tool for converting existing TestCase
s from JUnit 3.x to JUnit 4.
This includes:
- Adding the @Test annotation before test methods.
- Adding the @Before annotation before the setUp() method.
- Adding the @After annotation after the tearDown() method.
- Adding a static import for adding the different assert() methods.
This reduces the amount of no-human-required activities, hopefully to one day reduce it to zero.
This means that you can move your project to use JUnit 4 pretty easily, with almost all of the redundant work done automatically for you!
Note: JUnitConverter doesn't convert TestSuites! You'll have to convert them manually.
Maintainer's Note: I currently do not have time to provide a more stable and usable version of this software.
If anyone wants to contribute, please feel free to contact me.
Usage:
Simply run:
java -cp junitconverter.jar:your-project.jar -jar junitconverter.jar [--nostats] <source directory>
The source directory will be updated for you!
The --nostats
flag will prevent usage statistics from being sent. Please note the statistics are meant to help JUnitConverter, and do not contain any information about the code it is executed on - your privacy is respected.
Download:
You can get the jar file from here.
Source code:
You can access the subversion repository here.