org.eclipse.mylar.internal.java.ui.junit
Class JUnitLaunchConfigurationDelegateCOPY

java.lang.Object
  extended by org.eclipse.debug.core.model.LaunchConfigurationDelegate
      extended by org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate
          extended by org.eclipse.jdt.internal.junit.launcher.JUnitBaseLaunchConfiguration
              extended by org.eclipse.mylar.internal.java.ui.junit.JUnitLaunchConfigurationDelegateCOPY
All Implemented Interfaces:
org.eclipse.debug.core.IDebugEventSetListener, org.eclipse.debug.core.model.ILaunchConfigurationDelegate, org.eclipse.debug.core.model.ILaunchConfigurationDelegate2
Direct Known Subclasses:
MylarPdeJUnitLaunchConfiguration

public abstract class JUnitLaunchConfigurationDelegateCOPY
extends org.eclipse.jdt.internal.junit.launcher.JUnitBaseLaunchConfiguration

A launch delegate for launching JUnit Plug-in tests.

Note: This class may still undergo significant changes in 3.3 before it stabilizes

Since:
3.3

Field Summary
static java.lang.String CORE_APPLICATION
           
protected  java.io.File fConfigDir
           
private  java.util.Map fPluginMap
           
static java.lang.String[] REQUIRED_PLUGINS
           
static java.lang.String UI_APPLICATION
           
 
Fields inherited from class org.eclipse.jdt.internal.junit.launcher.JUnitBaseLaunchConfiguration
ATTR_KEEPRUNNING, FAILURES_FILENAME_ATTR, LAUNCH_CONTAINER_ATTR, NO_DISPLAY_ATTR, PORT_ATTR, RUN_QUIETLY_MODE, TEST_KIND_ATTR, TESTNAME_ATTR, TESTTYPE_ATTR
 
Fields inherited from class org.eclipse.debug.core.model.LaunchConfigurationDelegate
complileErrorProjectPromptStatus, complileErrorPromptStatus, promptStatus, saveScopedDirtyEditors, switchToDebugPromptStatus
 
Constructor Summary
JUnitLaunchConfigurationDelegateCOPY()
           
 
Method Summary
protected  void abort(java.lang.String message, java.lang.Throwable exception, int code)
           
protected  void clear(org.eclipse.debug.core.ILaunchConfiguration configuration, org.eclipse.core.runtime.IProgressMonitor monitor)
          Clears the workspace prior to launching if the workspace exists and the option to clear it is turned on.
protected  org.eclipse.jdt.launching.VMRunnerConfiguration createVMRunner(org.eclipse.debug.core.ILaunchConfiguration configuration, org.eclipse.jdt.internal.junit.launcher.TestSearchResult testTypes, int port, java.lang.String runMode)
           
protected abstract  org.eclipse.jdt.internal.junit.launcher.TestSearchResult customFindTestTypes(org.eclipse.debug.core.ILaunchConfiguration configuration, org.eclipse.core.runtime.IProgressMonitor pm)
           
private  org.eclipse.pde.core.plugin.IPluginModelBase findPlugin(java.lang.String id)
           
protected  org.eclipse.core.resources.IProject[] getBuildOrder(org.eclipse.debug.core.ILaunchConfiguration configuration, java.lang.String mode)
           
 java.lang.String[] getClasspath(org.eclipse.debug.core.ILaunchConfiguration configuration)
           
protected  java.io.File getConfigurationDirectory(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Returns the location of the configuration area
 java.lang.String[] getEnvironment(org.eclipse.debug.core.ILaunchConfiguration configuration)
           
 java.lang.String getProgramArguments(org.eclipse.debug.core.ILaunchConfiguration configuration)
           
private  java.lang.String[] getProgramArgumentsArray(org.eclipse.debug.core.ILaunchConfiguration configuration, org.eclipse.jdt.internal.junit.launcher.TestSearchResult testSearchResult, int port, java.lang.String runMode)
          Returns the program arguments to launch with.
protected  org.eclipse.core.resources.IProject[] getProjectsForProblemSearch(org.eclipse.debug.core.ILaunchConfiguration configuration, java.lang.String mode)
           
private  java.lang.String getTestPluginId(org.eclipse.debug.core.ILaunchConfiguration configuration)
           
 java.lang.String getVMArguments(org.eclipse.debug.core.ILaunchConfiguration configuration)
           
 org.eclipse.jdt.launching.IVMRunner getVMRunner(org.eclipse.debug.core.ILaunchConfiguration configuration, java.lang.String mode)
           
 java.util.Map getVMSpecificAttributesMap(org.eclipse.debug.core.ILaunchConfiguration configuration)
           
 java.io.File getWorkingDirectory(org.eclipse.debug.core.ILaunchConfiguration configuration)
           
 void launch(org.eclipse.debug.core.ILaunchConfiguration configuration, java.lang.String mode, org.eclipse.debug.core.ILaunch launch, org.eclipse.core.runtime.IProgressMonitor monitor)
           
protected  void manageLaunch(org.eclipse.debug.core.ILaunch launch)
          Adds a listener to the launch to be notified at interesting launch lifecycle events such as when the launch terminates.
protected  void preLaunchCheck(org.eclipse.debug.core.ILaunchConfiguration configuration, org.eclipse.debug.core.ILaunch launch, org.eclipse.core.runtime.IProgressMonitor monitor)
          Does sanity checking before launching.
protected  void setDefaultSourceLocator(org.eclipse.debug.core.ILaunch launch, org.eclipse.debug.core.ILaunchConfiguration configuration)
           
protected  void synchronizeManifests(org.eclipse.debug.core.ILaunchConfiguration configuration, org.eclipse.core.runtime.IProgressMonitor monitor)
          Checks for old-style plugin.xml files that have become stale since the last launch.
protected  void validatePluginDependencies(org.eclipse.debug.core.ILaunchConfiguration configuration, org.eclipse.core.runtime.IProgressMonitor monitor)
          Validates inter-bundle dependencies automatically prior to launching if that option is turned on.
protected  void validateProjectDependencies(org.eclipse.debug.core.ILaunchConfiguration configuration, org.eclipse.core.runtime.IProgressMonitor monitor)
          Checks if the Automated Management of Dependencies option is turned on.
 
Methods inherited from class org.eclipse.jdt.internal.junit.launcher.JUnitBaseLaunchConfiguration
containerTestTarget, defaultTestLoaderClass, findTestTypes, getBasicArguments, informAndAbort, keepAlive, launchTypes, performStringSubstitution, singleTypeTarget, testSearchTarget
 
Methods inherited from class org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate
getBootpath, getBootpathExt, getBreakpoints, getDefaultWorkingDirectory, getJavaLibraryPath, getJavaProject, getJavaProjectName, getLaunchManager, getMainTypeName, getVMConnectorId, getVMInstall, getVMInstallName, getVMInstallType, getVMInstallTypeId, getWorkingDirectoryPath, handleDebugEvents, isAllowTerminate, isLaunchProblem, isStopInMain, preLaunchCheck, prepareStopInMain, verifyJavaProject, verifyMainTypeName, verifyVMInstall, verifyWorkingDirectory
 
Methods inherited from class org.eclipse.debug.core.model.LaunchConfigurationDelegate
addReferencedProjects, buildForLaunch, buildProjects, computeBuildOrder, computeReferencedBuildOrder, existsProblems, finalLaunchCheck, getLaunch, saveBeforeLaunch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CORE_APPLICATION

public static final java.lang.String CORE_APPLICATION
See Also:
Constant Field Values

UI_APPLICATION

public static final java.lang.String UI_APPLICATION
See Also:
Constant Field Values

REQUIRED_PLUGINS

public static java.lang.String[] REQUIRED_PLUGINS

fConfigDir

protected java.io.File fConfigDir

fPluginMap

private java.util.Map fPluginMap
Constructor Detail

JUnitLaunchConfigurationDelegateCOPY

public JUnitLaunchConfigurationDelegateCOPY()
Method Detail

customFindTestTypes

protected abstract org.eclipse.jdt.internal.junit.launcher.TestSearchResult customFindTestTypes(org.eclipse.debug.core.ILaunchConfiguration configuration,
                                                                                                org.eclipse.core.runtime.IProgressMonitor pm)
                                                                                         throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

getTestPluginId

private java.lang.String getTestPluginId(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                  throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

launch

public void launch(org.eclipse.debug.core.ILaunchConfiguration configuration,
                   java.lang.String mode,
                   org.eclipse.debug.core.ILaunch launch,
                   org.eclipse.core.runtime.IProgressMonitor monitor)
            throws org.eclipse.core.runtime.CoreException
Specified by:
launch in interface org.eclipse.debug.core.model.ILaunchConfigurationDelegate
Overrides:
launch in class org.eclipse.jdt.internal.junit.launcher.JUnitBaseLaunchConfiguration
Throws:
org.eclipse.core.runtime.CoreException

getVMRunner

public org.eclipse.jdt.launching.IVMRunner getVMRunner(org.eclipse.debug.core.ILaunchConfiguration configuration,
                                                       java.lang.String mode)
                                                throws org.eclipse.core.runtime.CoreException
Overrides:
getVMRunner in class org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate
Throws:
org.eclipse.core.runtime.CoreException

createVMRunner

protected org.eclipse.jdt.launching.VMRunnerConfiguration createVMRunner(org.eclipse.debug.core.ILaunchConfiguration configuration,
                                                                         org.eclipse.jdt.internal.junit.launcher.TestSearchResult testTypes,
                                                                         int port,
                                                                         java.lang.String runMode)
                                                                  throws org.eclipse.core.runtime.CoreException
Specified by:
createVMRunner in class org.eclipse.jdt.internal.junit.launcher.JUnitBaseLaunchConfiguration
Throws:
org.eclipse.core.runtime.CoreException

abort

protected void abort(java.lang.String message,
                     java.lang.Throwable exception,
                     int code)
              throws org.eclipse.core.runtime.CoreException
Overrides:
abort in class org.eclipse.jdt.internal.junit.launcher.JUnitBaseLaunchConfiguration
Throws:
org.eclipse.core.runtime.CoreException

getProgramArgumentsArray

private java.lang.String[] getProgramArgumentsArray(org.eclipse.debug.core.ILaunchConfiguration configuration,
                                                    org.eclipse.jdt.internal.junit.launcher.TestSearchResult testSearchResult,
                                                    int port,
                                                    java.lang.String runMode)
                                             throws org.eclipse.core.runtime.CoreException
Returns the program arguments to launch with. This list is a combination of arguments computed by PDE based on attributes specified in the given launch configuration, followed by the program arguments that the entered directly into the launch configuration.

Parameters:
configuration - launch configuration
Returns:
the program arguments necessary for launching
Throws:
org.eclipse.core.runtime.CoreException - if unable to retrieve the attribute or create the necessary configuration files

findPlugin

private org.eclipse.pde.core.plugin.IPluginModelBase findPlugin(java.lang.String id)
                                                         throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

getProgramArguments

public java.lang.String getProgramArguments(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                     throws org.eclipse.core.runtime.CoreException
Overrides:
getProgramArguments in class org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate
Throws:
org.eclipse.core.runtime.CoreException

getVMArguments

public java.lang.String getVMArguments(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                throws org.eclipse.core.runtime.CoreException
Overrides:
getVMArguments in class org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate
Throws:
org.eclipse.core.runtime.CoreException

getEnvironment

public java.lang.String[] getEnvironment(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                  throws org.eclipse.core.runtime.CoreException
Overrides:
getEnvironment in class org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate
Throws:
org.eclipse.core.runtime.CoreException

getClasspath

public java.lang.String[] getClasspath(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                throws org.eclipse.core.runtime.CoreException
Overrides:
getClasspath in class org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate
Throws:
org.eclipse.core.runtime.CoreException

getWorkingDirectory

public java.io.File getWorkingDirectory(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                 throws org.eclipse.core.runtime.CoreException
Overrides:
getWorkingDirectory in class org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate
Throws:
org.eclipse.core.runtime.CoreException

getVMSpecificAttributesMap

public java.util.Map getVMSpecificAttributesMap(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                         throws org.eclipse.core.runtime.CoreException
Overrides:
getVMSpecificAttributesMap in class org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate
Throws:
org.eclipse.core.runtime.CoreException

setDefaultSourceLocator

protected void setDefaultSourceLocator(org.eclipse.debug.core.ILaunch launch,
                                       org.eclipse.debug.core.ILaunchConfiguration configuration)
                                throws org.eclipse.core.runtime.CoreException
Overrides:
setDefaultSourceLocator in class org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate
Throws:
org.eclipse.core.runtime.CoreException

getConfigurationDirectory

protected java.io.File getConfigurationDirectory(org.eclipse.debug.core.ILaunchConfiguration configuration)
Returns the location of the configuration area

Parameters:
configuration - the launch configuration
Returns:
a directory where the configuration area is located

getBuildOrder

protected org.eclipse.core.resources.IProject[] getBuildOrder(org.eclipse.debug.core.ILaunchConfiguration configuration,
                                                              java.lang.String mode)
                                                       throws org.eclipse.core.runtime.CoreException
Overrides:
getBuildOrder in class org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate
Throws:
org.eclipse.core.runtime.CoreException

getProjectsForProblemSearch

protected org.eclipse.core.resources.IProject[] getProjectsForProblemSearch(org.eclipse.debug.core.ILaunchConfiguration configuration,
                                                                            java.lang.String mode)
                                                                     throws org.eclipse.core.runtime.CoreException
Overrides:
getProjectsForProblemSearch in class org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate
Throws:
org.eclipse.core.runtime.CoreException

manageLaunch

protected void manageLaunch(org.eclipse.debug.core.ILaunch launch)
Adds a listener to the launch to be notified at interesting launch lifecycle events such as when the launch terminates.

Parameters:
launch - the launch

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
Does sanity checking before launching. The criteria whether the launch should proceed or not is specific to the launch configuration type.

Parameters:
configuration - launch configuration
launch - the launch object to contribute processes and debug targets to
monitor - a progress monitor
Throws:
org.eclipse.core.runtime.CoreException - exception thrown if launch fails or canceled or if unable to retrieve attributes from the launch configuration

synchronizeManifests

protected void synchronizeManifests(org.eclipse.debug.core.ILaunchConfiguration configuration,
                                    org.eclipse.core.runtime.IProgressMonitor monitor)
Checks for old-style plugin.xml files that have become stale since the last launch. For any stale plugin.xml files found, the corresponding MANIFEST.MF is deleted from the runtime configuration area so that it gets regenerated upon startup.

Parameters:
configuration - the launch configuration
monitor - the progress monitor

clear

protected void clear(org.eclipse.debug.core.ILaunchConfiguration configuration,
                     org.eclipse.core.runtime.IProgressMonitor monitor)
              throws org.eclipse.core.runtime.CoreException
Clears the workspace prior to launching if the workspace exists and the option to clear it is turned on. Also clears the configuration area if that option is chosen.

Parameters:
configuration - the launch configuration
monitor - the progress monitor
Throws:
org.eclipse.core.runtime.CoreException - if unable to retrieve launch attribute values
Since:
3.3

validateProjectDependencies

protected void validateProjectDependencies(org.eclipse.debug.core.ILaunchConfiguration configuration,
                                           org.eclipse.core.runtime.IProgressMonitor monitor)
Checks if the Automated Management of Dependencies option is turned on. If so, it makes aure all manifests are updated with the correct dependencies.

Parameters:
configuration - the launch configuration
monitor - a progress monitor

validatePluginDependencies

protected void validatePluginDependencies(org.eclipse.debug.core.ILaunchConfiguration configuration,
                                          org.eclipse.core.runtime.IProgressMonitor monitor)
                                   throws org.eclipse.core.runtime.CoreException
Validates inter-bundle dependencies automatically prior to launching if that option is turned on.

Parameters:
configuration - the launch configuration
monitor - a progress monitor
Throws:
org.eclipse.core.runtime.CoreException