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

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
  • 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, 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:
      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 class AbstractJavaLaunchConfigurationDelegate
      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 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:
      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 for
      vmArguments - a List of String representing the resulting VM arguments
      programArguments - a List of String 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 class AbstractJavaLaunchConfigurationDelegate
      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.
      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:
      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 class AbstractJavaLaunchConfigurationDelegate
      Parameters:
      message - the status message
      exception - lower level exception associated with the error, or null if none
      code - error code
      Throws:
      org.eclipse.core.runtime.CoreException - the "abort" core exception