Headless execution of component tests

You can run Java component tests from a command line in a "headless" workbench (with no user interface for the development environment). This can be useful if you want to run component tests unattended, on a regular basis, or if you want to include them in an Ant script.

Before running component tests in headless mode, you must have a workspace containing one or more component test launch configurations. You can create launch configurations when you run a test for the first time. The development environment does not need to be running. Headless execution can run only Java component tests. EJB and Web service component tests cannot be run in headless mode.

A command line interface allows you to specify your workspace and any optional parameters. The command line launches a headless Eclipse environment with only the core features required to run component tests and without the user interface features. By default, it then runs all the component test launch configurations that are found in the workspace.

Options are available to run the component tests with profiling engaged, to launch only specified launch configurations, or to specify the report output format. All command line parameters are described in the reference section.

You cannot run several headless workbenches on the same workspace at the same time, nor can you use a headless workbench while an Eclipse graphical user interface has locked the workspace.

Example

The following command line runs component test launch configurations Config1 and Config2 from the workspace D:\workspace on a Windows operating system. Profiling is engaged. An HTML report made of multiple files is produced in D:\workspace\report.
D:\eclipse\jre\bin\java -Xj9 -Dorg.eclipse.emf.ecore.EPackage.Registry.INSTANCE=org.eclipse.emf.ecore.impl.EPackageRegistryImpl -cp D:\eclipse\startup.jar org.eclipse.core.launcher.Main -application com.ibm.r2a.command.line.mode.CommandLineModeApplication -onlyClient ComponentTest -data "D:\\workspace" -profile -launch Config1 Config2 -reportDirectory "D:\\workspace\\report"
Note: You might need to append additional parameters to the commands, depending on your operating system configuration. The parameters for launching the workbench in your environment are located in the system configuration details under System properties in Help > About > Configuration Details.
Related tasks
Running component tests from a command line
Running component tests from an Ant script
Related reference
Component test headless mode reference
Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.