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