TestNG IDEA Plug-in

IDEA 7

TestNG is supported natively in IDEA 7. The full documentation can be found here.

IDEA 6 and older

TestNG has an IDEA plug-in that mirrors much of the behavior of the built-in JUnit support. You should be able to run tests within IDEA without defining any files externally, as well as quickly and easily migrate JUnit code. The plug-in also provides the same output test view as JUnit tests. Installation New versions of the plugin are constantly uploaded to the IDEA plug-in repository.

The latest version of the TestNG plugin will be listed there, ready to download and install.  Also, you can go to the TestNG IDEA plug-in project page and download its source from there.

Please note that this plug-in only works on IDEA 5.0 and 6.0.

Creating a TestNG Run/Debug configuration

Once you have installed the plug-in and restarted IDEA, and have some TestNG classes you would like to run, simply open the Run/Debug window. You will see a TestNG tab, where you can add a configuration.

There are a number of methods for determining the set of tests that will be run. These are:

Once you create the run configuration, you can run it. Upon running, the plug-in will launch an external process to run your tests. The test results will be display in a tree view, with passed and failed tests highlighted. You can narrow down on the console output for a specify test by clicking on it, while double clicking a test will navigate to its source code.