1<html> 2 <head> 3 <title>TestNG - IDEA Plugin</title> 4 <script type="text/javascript" src="banner.js"></script> 5 <link rel="stylesheet" href="testng.css" type="text/css" /> 6 </head> 7<body> 8 9<script type="text/javascript"> 10 displayMenu("idea.html") 11</script> 12 13<h2 align="center">TestNG IDEA Plug-in</h2> 14 15 16 17<p align="center"> 18<img src="http://testng.org/pictures/idea-output.png" /> 19</p> 20 21<h3>IDEA 7</h3> 22 23TestNG is bundled in IDEA 7 onwards, no extra plugins need to be installed. The full documentation can be found <a href="http://www.jetbrains.com/idea/features/junit_testng.html#TestNG">here</a>. 24 25<h3>IDEA 6 and older </h3> 26 27 28TestNG 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. 29 30Installation 31 32<ul> 33 <li>From IDEA, go to Preferences -> Plugins.</li> 34 <li>Click over to the Available Plugins tab.</li> 35</ul> 36<p>The latest version of the TestNG plugin will be listed there, ready to download and install. 37Also, you can go to the <a href="http://svn.jetbrains.org/idea/Trunk/bundled/testng"> 38TestNG IDEA plug-in project page</a> and download its source from there.</p> 39<p>Please note that this plug-in only works on IDEA 5.0 and 6.0.</p> 40 41<p><b>Creating a TestNG Run/Debug configuration</b></p> 42<p>Once you have installed the plug-in and restarted IDEA, and have some TestNG classes you would like to run, simply 43open the Run/Debug window. You will see a TestNG tab, where you can add a configuration. 44 45</p> 46<p>There are a number of methods for determining the set of tests that will be run. These are:</p> 47<ul> 48 <li>Package: Specify a package to run. All tests in this package and below will be included.</li> 49 <li>Group: Specify a TestNG group to run.</li> 50 <li>Suite: Specify an external testng.xml file to run.</li> 51 <li>Class: Run all tests in a single class.</li> 52 <li>Method: Run a single test method. 53 54</li> 55</ul> 56<p>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. 57</p> 58 59<p align="center"> 60<img src="http://testng.org/pictures/idea-rundialog.png" /> 61</p> 62 63 64<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> 65</script> 66<script type="text/javascript"> 67_uacct = "UA-238215-2"; 68urchinTracker(); 69</script> 70 71</body> 72 73</html> 74