Wednesday, October 3, 2012

Say "NO" to JUnit and "YES" to TestNG

The truth is JUnit is pretty sucky for anything but the simplest form of unit testing. Don't get me wrong, JUnit will always have a place in my heart but its functionality leaves much to be desired, especially compared to TestNG. If you are starting a new project you should most definitely say "NO" to JUnit and say "YES" to TestNG

Support for TestNG is robust on pretty much all the standard IDEs now (Netbeans, Eclipse, IDEA) which is an indication that there's wide adoption and support for it. With the Eclipse TestNG plugin there's even the ability to convert your old JUnit tests to TestNG tests. It's not a perfect and straight conversion and you will have to do some massaging but it beats doing it all manually.

If you are ready to make the switch mkyong.com has a pretty good comparison  between JUnit and TestNG.

No comments: