Package org.eclipse.jdt.junit.launcher

## Class JUnitLaunchConfigurationDelegate

- java.lang.Object
- - org.eclipse.debug.core.model.LaunchConfigurationDelegate
  - - org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate
    - - org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate

All Implemented Interfaces:
  `IDebugEventSetListener`, `ILaunchConfigurationDelegate`, `ILaunchConfigurationDelegate2`

Direct Known Subclasses:
  `AdvancedJUnitLaunchConfigurationDelegate`

    public class JUnitLaunchConfigurationDelegate
    extends AbstractJavaLaunchConfigurationDelegate

Launch configuration delegate for a JUnit test as a Java application.

Clients can instantiate and extend this class.

Since:
  3.3

### Field Summary

### Fields inherited from class org.eclipse.debug.core.model.LaunchConfigurationDelegate

`complileErrorProjectPromptStatus, complileErrorPromptStatus, promptStatus, saveScopedDirtyEditors, switchToDebugPromptStatus`

### Constructor Summary

Constructors
`JUnitLaunchConfigurationDelegate()`

### Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods
`protected void` `abort​(String message, Throwable exception, int code)` Throws a core exception with an error status object built from the given message, lower level exception, and error code.
`protected void` `collectExecutionArguments​(ILaunchConfiguration configuration, List<String> vmArguments, List<String> programArguments)` Collects all VM and program arguments.
`protected IMember[]` `evaluateTests​(ILaunchConfiguration configuration, IProgressMonitor monitor)` Evaluates all test elements selected by the given launch configuration.
`String[]` `getClasspath​(ILaunchConfiguration configuration)` Deprecated. The call to `getClasspath(ILaunchConfiguration)` in `launch(...)` has been replaced with the call to `getClasspathAndModulepath(ILaunchConfiguration)`.
`String[][]` `getClasspathAndModulepath​(ILaunchConfiguration configuration)` Returns the entries that should appear on the user portion of the classpath and modulepath as specified by the given launch configuration, as an array of resolved strings.
`void` `launch​(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)`
`protected void` `preLaunchCheck​(ILaunchConfiguration configuration, ILaunch launch, IProgressMonitor monitor)` Performs a check on the launch configuration's attributes.
`String` `showCommandLine​(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)`
`String` `verifyMainTypeName​(ILaunchConfiguration configuration)` Verifies a main type name is specified by the given launch configuration, and returns the main type name.

### Methods inherited from class org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate

`allowAdvancedSourcelookup, getBootpath, getBootpathExt, getBreakpoints, getBuildOrder, getDefaultWorkingDirectory, getEnvironment, getJavaLibraryPath, getJavaProject, getJavaProjectName, getLaunch, getLaunchManager, getMainTypeName, getModuleCLIOptions, getProgramArguments, getProjectsForProblemSearch, getVMArguments, getVMArguments, getVMConnectorId, getVMInstall, getVMInstallName, getVMInstallType, getVMInstallTypeId, getVMRunner, getVMSpecificAttributesMap, getWorkingDirectory, getWorkingDirectoryPath, handleDebugEvents, isAllowTerminate, isLaunchProblem, isStopInMain, preLaunchCheck, prepareStopInMain, setDefaultSourceLocator, supportsModule, verifyJavaProject, verifyVMInstall, verifyWorkingDirectory`

### Methods inherited from class org.eclipse.debug.core.model.LaunchConfigurationDelegate

`addReferencedProjects, buildForLaunch, buildProjects, computeBuildOrder, computeReferencedBuildOrder, existsProblems, finalLaunchCheck, saveBeforeLaunch`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### JUnitLaunchConfigurationDelegate

    public JUnitLaunchConfigurationDelegate()

### Method Detail

#### showCommandLine

    public String showCommandLine​(ILaunchConfiguration configuration,
                                  String mode,
                                  ILaunch launch,
                                  IProgressMonitor monitor)
                           throws CoreException

Throws:
  `CoreException`

#### launch

    public void launch​(ILaunchConfiguration configuration,
                       String mode,
                       ILaunch launch,
                       IProgressMonitor monitor)
                throws CoreException

Throws:
  `CoreException`

#### preLaunchCheck

    protected void preLaunchCheck​(ILaunchConfiguration configuration,
                                  ILaunch launch,
                                  IProgressMonitor monitor)
                           throws CoreException

Performs a check on the launch configuration's attributes. If an attribute contains an invalid value, a `CoreException` with the error is thrown.

Parameters:
  `configuration` - the launch configuration to verify
  `launch` - the launch to verify
  `monitor` - the progress monitor to use
Throws:
  `CoreException` - an exception is thrown when the verification fails

#### verifyMainTypeName

    public String verifyMainTypeName​(ILaunchConfiguration configuration)
                              throws CoreException

Description copied from class: `AbstractJavaLaunchConfigurationDelegate`
Verifies a main type name is specified by the given launch configuration, and returns the main type name.

Overrides:
  `verifyMainTypeName` in class `AbstractJavaLaunchConfigurationDelegate`
Parameters:
  `configuration` - launch configuration
Returns:
  the main type name specified by the given launch configuration
Throws:
  `CoreException` - if unable to retrieve the attribute or the attribute is unspecified

#### evaluateTests

    protected IMember[] evaluateTests​(ILaunchConfiguration configuration,
                                      IProgressMonitor monitor)
                               throws CoreException

Evaluates all test elements selected by the given launch configuration. The elements are of type `IType` or `IMethod`. At the moment it is only possible to run a single method or a set of types, but not mixed or more than one method at a time.

Parameters:
  `configuration` - the launch configuration to inspect
  `monitor` - the progress monitor
Returns:
  returns all types or methods that should be ran
Throws:
  `CoreException` - an exception is thrown when the search for tests failed

#### collectExecutionArguments

    protected void collectExecutionArguments​(ILaunchConfiguration configuration,
                                             List<String> vmArguments,
                                             List<String> programArguments)
                                      throws CoreException

Collects all VM and program arguments. Implementors can modify and add arguments.

Parameters:
  `configuration` - the configuration to collect the arguments for
  `vmArguments` - a `List` of `String` representing the resulting VM arguments
  `programArguments` - a `List` of `String` representing the resulting program arguments
Throws:
  `CoreException` - if unable to collect the execution arguments

#### getClasspathAndModulepath

    public String[][] getClasspathAndModulepath​(ILaunchConfiguration configuration)
                                         throws CoreException

Description copied from class: `AbstractJavaLaunchConfigurationDelegate`
Returns the entries that should appear on the user portion of the classpath and modulepath as specified by the given launch configuration, as an array of resolved strings. The returned array is empty if no classpath and modulepath is specified.

Overrides:
  `getClasspathAndModulepath` in class `AbstractJavaLaunchConfigurationDelegate`
Parameters:
  `configuration` - launch configuration
Returns:
  the classpath and modulepath specified by the given launch configuration, possibly an empty array
Throws:
  `CoreException` - if unable to retrieve the attribute

#### getClasspath

    @Deprecated
    public String[] getClasspath​(ILaunchConfiguration configuration)
                          throws CoreException

Deprecated.
The call to `getClasspath(ILaunchConfiguration)` in `launch(...)` has been replaced with the call to `getClasspathAndModulepath(ILaunchConfiguration)`.
Description copied from class: `AbstractJavaLaunchConfigurationDelegate`
Returns the entries that should appear on the user portion of the classpath as specified by the given launch configuration, as an array of resolved strings. The returned array is empty if no classpath is specified.

Overrides:
  `getClasspath` in class `AbstractJavaLaunchConfigurationDelegate`
Parameters:
  `configuration` - launch configuration
Returns:
  the classpath specified by the given launch configuration, possibly an empty array
Throws:
  `CoreException` - if unable to retrieve the attribute

#### abort

    protected void abort​(String message,
                         Throwable exception,
                         int code)
                  throws CoreException

Description copied from class: `AbstractJavaLaunchConfigurationDelegate`
Throws a core exception with an error status object built from the given message, lower level exception, and error code.

Overrides:
  `abort` in class `AbstractJavaLaunchConfigurationDelegate`
Parameters:
  `message` - the status message
  `exception` - lower level exception associated with the error, or `null` if none
  `code` - error code
Throws:
  `CoreException` - the "abort" core exception