blob: 134998b9fa17a753e65c65565c17fcf157d02a1d [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>JUnit Plug-in Test Launcher</title>
<link href="../../book.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
font-size: 18px;
font-weight: bold;
}
.style2 {
font-size: 12pt;
font-weight: bold;
}
-->
</style>
</head>
<body>
<p class="style1">JUnit Plug-in Test Launcher</p>
<p>PDE provides JUnit support for testing plug-ins by contributing a <em>JUnit Plug-in Test</em> launcher to the SDK. As with all other launchers in Eclipse (e.g. the <em>Java Application</em> and <em>Java Applet</em> launchers,...), the <em>JUnit Plug-in Test</em> launcher can be invoked via a shortcut and its launch configurations are centrally managed in the <strong>Launch Configuration Dialog</strong>. </p>
<p>&nbsp;</p>
<p class="style2">UI Tests vs. Headless Tests </p>
<p>When a <em>JUnit Plug-in Test</em> launch configuration is launched, a lightweight PDE application is the main entry point to the runtime Eclipse instance. If the application being tested by the user requires a user interface, the PDE application spawns the workbench for that application. Once the workbench is up, the test harness runs inside the workbench. After all tests are run, the PDE application closes the workbench and exits; thus, terminating the test run.</p>
<p>If the tests being run do not require a user interface (i.e. headless mode), then the lightweight PDE application runs the test without launching a workbench. After all tests are run, the PDE application exits.</p>
<p>Refer to the <a href="junit_main.htm">Main tab</a> of the <em>JUnit Plug-in Test</em> launch configuration for details on how to run the different types of tests. </p>
<p>&nbsp;</p>
<p class="style2">Launching via a Shortcut</p>
<p>A quick way to run a JUnit plug-in test is via the <strong>Run As &gt; JUnit Plug-in Test </strong> from the context menu of a plug-in project. To launch in debug mode, choose <strong>Debug As &gt; JUnit Plug-in Test </strong> from the context menu of the plug-in project. These actions are also available in the context menus of source folders, packages, source files and methods inside a plug-in project. </p>
<p>When creating a new launch configuration via a shortcut, PDE examines the dependencies of the enclosing plug-in. If the plug-in requires the <em>org.eclipse.swt</em> plug-in directly or indirectly, then the launch configuration that is created is customized to run UI tests; otherwise, the launch configuration is customized to run headless tests. </p>
<p>&nbsp;</p>
<p class="style2">Customizing a Launch Configuration</p>
<p>In order to have full control over launching a <em>JUnit Plug-in Test</em>, you can create and customize a launch configuration in the <strong>Launch Configuration Dialog</strong>.</p>
<p>The <strong>Launch Configuration Dialog</strong> can be invoked via <strong>Run &gt; Run...</strong> or <strong>Debug &gt; Debug...</strong> from the top level menu. A new <em>JUnit Plug-in Test</em> launch configuration can be created by double-clicking on the <strong>JUnit Plug-in Test </strong> node in the tree viewer to the left. </p>
<p>A <em>JUnit Plug-in Test</em> launch configuration contains eight tabs allowing you to customize all aspects of the test launch. Refer to the following documents for more details: </p>
<ul>
<li><a href="junit_test.htm">Test Tab</a></li>
<li><a href="junit_main.htm">Main Tab </a></li>
<li><a href="junit_plugins.htm">Plug-ins Tab</a></li>
<li><a href="eclipse_args.htm">Arguments Tab </a></li>
<li><a href="junit_configuration.htm">Configuration Tab </a></li>
<li><a href="tracing.htm">Tracing Tab</a></li>
<li><a href="environment.htm">Environment Tab</a></li>
<li><a href="common.htm">Common Tab</a></li>
</ul>
<p>&nbsp;</p>
</body>
</html>