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:
org.eclipse.debug.core.IDebugEventSetListener
,org.eclipse.debug.core.model.ILaunchConfigurationDelegate
,org.eclipse.debug.core.model.ILaunchConfigurationDelegate2
- Direct Known Subclasses:
AdvancedJUnitLaunchConfigurationDelegate
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Throws a core exception with an error status object built from the given message, lower level exception, and error code.protected void
collectExecutionArguments
(org.eclipse.debug.core.ILaunchConfiguration configuration, List<String> vmArguments, List<String> programArguments) Collects all VM and program arguments.protected IMember[]
evaluateTests
(org.eclipse.debug.core.ILaunchConfiguration configuration, org.eclipse.core.runtime.IProgressMonitor monitor) Evaluates all test elements selected by the given launch configuration.String[]
getClasspath
(org.eclipse.debug.core.ILaunchConfiguration configuration) Deprecated.String[][]
getClasspathAndModulepath
(org.eclipse.debug.core.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
(org.eclipse.debug.core.ILaunchConfiguration configuration, String mode, org.eclipse.debug.core.ILaunch launch, org.eclipse.core.runtime.IProgressMonitor monitor) protected void
preLaunchCheck
(org.eclipse.debug.core.ILaunchConfiguration configuration, org.eclipse.debug.core.ILaunch launch, org.eclipse.core.runtime.IProgressMonitor monitor) Performs a check on the launch configuration's attributes.showCommandLine
(org.eclipse.debug.core.ILaunchConfiguration configuration, String mode, org.eclipse.debug.core.ILaunch launch, org.eclipse.core.runtime.IProgressMonitor monitor) verifyMainTypeName
(org.eclipse.debug.core.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, supportsPreviewFeatures, verifyJavaProject, verifyVMInstall, verifyWorkingDirectory
Methods inherited from class org.eclipse.debug.core.model.LaunchConfigurationDelegate
addReferencedProjects, buildForLaunch, buildProjects, computeBuildOrder, computeReferencedBuildOrder, existsProblems, finalLaunchCheck, saveBeforeLaunch
-
Constructor Details
-
JUnitLaunchConfigurationDelegate
public JUnitLaunchConfigurationDelegate()
-
-
Method Details
-
showCommandLine
public String showCommandLine(org.eclipse.debug.core.ILaunchConfiguration configuration, String mode, org.eclipse.debug.core.ILaunch launch, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException - Throws:
org.eclipse.core.runtime.CoreException
-
launch
public void launch(org.eclipse.debug.core.ILaunchConfiguration configuration, String mode, org.eclipse.debug.core.ILaunch launch, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException - Throws:
org.eclipse.core.runtime.CoreException
-
preLaunchCheck
protected void preLaunchCheck(org.eclipse.debug.core.ILaunchConfiguration configuration, org.eclipse.debug.core.ILaunch launch, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException Performs a check on the launch configuration's attributes. If an attribute contains an invalid value, aCoreException
with the error is thrown.- Parameters:
configuration
- the launch configuration to verifylaunch
- the launch to verifymonitor
- the progress monitor to use- Throws:
org.eclipse.core.runtime.CoreException
- an exception is thrown when the verification fails
-
verifyMainTypeName
public String verifyMainTypeName(org.eclipse.debug.core.ILaunchConfiguration configuration) throws org.eclipse.core.runtime.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 classAbstractJavaLaunchConfigurationDelegate
- Parameters:
configuration
- launch configuration- Returns:
- the main type name specified by the given launch configuration
- Throws:
org.eclipse.core.runtime.CoreException
- if unable to retrieve the attribute or the attribute is unspecified
-
evaluateTests
protected IMember[] evaluateTests(org.eclipse.debug.core.ILaunchConfiguration configuration, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException Evaluates all test elements selected by the given launch configuration. The elements are of typeIType
orIMethod
. 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 inspectmonitor
- the progress monitor- Returns:
- returns all types or methods that should be ran
- Throws:
org.eclipse.core.runtime.CoreException
- an exception is thrown when the search for tests failed
-
collectExecutionArguments
protected void collectExecutionArguments(org.eclipse.debug.core.ILaunchConfiguration configuration, List<String> vmArguments, List<String> programArguments) throws org.eclipse.core.runtime.CoreException Collects all VM and program arguments. Implementors can modify and add arguments.- Parameters:
configuration
- the configuration to collect the arguments forvmArguments
- aList
ofString
representing the resulting VM argumentsprogramArguments
- aList
ofString
representing the resulting program arguments- Throws:
org.eclipse.core.runtime.CoreException
- if unable to collect the execution arguments
-
getClasspathAndModulepath
public String[][] getClasspathAndModulepath(org.eclipse.debug.core.ILaunchConfiguration configuration) throws org.eclipse.core.runtime.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 classAbstractJavaLaunchConfigurationDelegate
- Parameters:
configuration
- launch configuration- Returns:
- the classpath and modulepath specified by the given launch configuration, possibly an empty array
- Throws:
org.eclipse.core.runtime.CoreException
- if unable to retrieve the attribute
-
getClasspath
@Deprecated public String[] getClasspath(org.eclipse.debug.core.ILaunchConfiguration configuration) throws org.eclipse.core.runtime.CoreException Deprecated.The call togetClasspath(ILaunchConfiguration)
inlaunch(...)
has been replaced with the call togetClasspathAndModulepath(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 classAbstractJavaLaunchConfigurationDelegate
- Parameters:
configuration
- launch configuration- Returns:
- the classpath specified by the given launch configuration, possibly an empty array
- Throws:
org.eclipse.core.runtime.CoreException
- if unable to retrieve the attribute
-
abort
protected void abort(String message, Throwable exception, int code) throws org.eclipse.core.runtime.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 classAbstractJavaLaunchConfigurationDelegate
- Parameters:
message
- the status messageexception
- lower level exception associated with the error, ornull
if nonecode
- error code- Throws:
org.eclipse.core.runtime.CoreException
- the "abort" core exception
-
getClasspath(ILaunchConfiguration)
inlaunch(...)
has been replaced with the call togetClasspathAndModulepath(ILaunchConfiguration)
.