Nelz's Blog

Mah blogginess

Migrating From JUnit to TestNG

I found an interesting and helpful bit of info, that I’d like to share.

My company has a bunch of older tests set up using JUnit V.3.8.1. I am trying to convert it over to TestNG.

TestNG has a page explaining the migration utility. One of the things that freaked me out was all the exceptions blown by the utility before actually adding the TestNG annotations.

Luckily, I found this article on TestNG migration this morning. The following quote explained what I was seeing:

"Note that the command will likely spit out a whole bunch of errors about classes that aren’t found; these can be safely ignored since they are emitted by javadoc which is used internally by the utility, and so cannot be suppressed. Your sources will now be annotated, and you will have a testng.xml in the src/test directory."