TPTP 4.3.0 Testing Tools Project
Public API Specification

org.eclipse.hyades.test.core.launch.delegates
Class AbstractLaunchConfigurationDelegate2

java.lang.Object
  extended byorg.eclipse.hyades.test.core.launch.delegates.AbstractLaunchConfigurationDelegate2
All Implemented Interfaces:
org.eclipse.debug.core.model.ILaunchConfigurationDelegate
Direct Known Subclasses:
BasicTestComponentLaunchConfigurationDelegate2, BasicTestLaunchConfigurationDelegate2

public abstract class AbstractLaunchConfigurationDelegate2
extends java.lang.Object
implements org.eclipse.debug.core.model.ILaunchConfigurationDelegate

This class is an abstract LaunchConfigurationDelegate that all TPTP launch configuration delegates extend. It handles the common properties and behaviors for launching a TPTP launch configuration. Sub-classes should implement getLaunchedElement(ILaunchConfiguration), invokeTestExecutionHarness(ILaunchConfiguration, String, StringBuffer). They should usually also override validate(ILaunchConfiguration).

Since:
3.1

Constructor Summary
AbstractLaunchConfigurationDelegate2()
           
 
Method Summary
protected abstract  java.lang.Object getLaunchedElement(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Get the Test Element that the configuration will launch.
protected  org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
          Returns the Delegate's private Resource Set.
protected abstract  org.eclipse.hyades.execution.core.IExecutor invokeTestExecutionHarness(org.eclipse.debug.core.ILaunchConfiguration configuration, java.lang.String mode, java.lang.StringBuffer errorMessages, org.eclipse.core.runtime.IProgressMonitor monitor)
          Invokes the Test Execution Harness with the appropriate information from the given Launch Configuration, in the specified mode.
 void launch(org.eclipse.debug.core.ILaunchConfiguration configuration, java.lang.String mode, org.eclipse.debug.core.ILaunch launch, org.eclipse.core.runtime.IProgressMonitor monitor)
          This method is not meant to be overrided.
protected  void reportProblem(java.lang.String description)
          This method is used when validating a configuration for reporting problems.
protected  void resetFields()
          Allows to reset any private field.
protected  void validate(org.eclipse.debug.core.ILaunchConfiguration configuration, java.lang.String mode)
          Validate a given configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractLaunchConfigurationDelegate2

public AbstractLaunchConfigurationDelegate2()
Method Detail

getLaunchedElement

protected abstract java.lang.Object getLaunchedElement(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                                throws org.eclipse.core.runtime.CoreException
Get the Test Element that the configuration will launch. This Test Element is used to determine which runHandler will be invoked before the Execution Harness is called.

Parameters:
configuration - A Hyades Launch Configuration
Returns:
A typed Test Element (instance of TPFTest or TPFTestComponent)
Throws:
org.eclipse.core.runtime.CoreException

validate

protected void validate(org.eclipse.debug.core.ILaunchConfiguration configuration,
                        java.lang.String mode)
                 throws org.eclipse.core.runtime.CoreException
Validate a given configuration. This method checks that the configuration contains the necessary information for running a test. Sub-classes should add more checks by overriding this method, and invoking the protected method reportProblem(String) (one or more times) for reporting any problems found in the configuration. If this method is not invoked, the configuration is considered as valid. Overriding methods should invoke the parent method using super.validate(configuration, mode).
This implementation checks the following points:

Parameters:
configuration - A Hyades Launch Configuration
mode - The run mode the Launch Configuration should be running in.
Throws:
org.eclipse.core.runtime.CoreException

invokeTestExecutionHarness

protected abstract org.eclipse.hyades.execution.core.IExecutor invokeTestExecutionHarness(org.eclipse.debug.core.ILaunchConfiguration configuration,
                                                                                          java.lang.String mode,
                                                                                          java.lang.StringBuffer errorMessages,
                                                                                          org.eclipse.core.runtime.IProgressMonitor monitor)
                                                                                   throws org.eclipse.core.runtime.CoreException
Invokes the Test Execution Harness with the appropriate information from the given Launch Configuration, in the specified mode.

Parameters:
configuration - A Hyades Launch Configuration
mode - The run mode the Launch Configuration should be running in.
errorMessages - This is initially an empty buffer that this method should fill with the errors reported by the Test Execution Harness. The Test Execution Harness will be considered as failed if this buffer is not empty after the call to this method.
Returns:
An IExecutor instance. This instance represents the executor of the test. Its state will be monitored to display its state in the Debug View. null is accepted: in that case, the Test Execution Progress will not be monitored.
Throws:
org.eclipse.core.runtime.CoreException

reportProblem

protected void reportProblem(java.lang.String description)
This method is used when validating a configuration for reporting problems. This method may be invoked several times by validate for reporting several problems. Invoking this method from another method than validate has no effect.

Parameters:
description - A description of the problem to report.

resetFields

protected void resetFields()
Allows to reset any private field. This method may be overrided, but sub-classes should not omit the call to super.resetFields().


getResourceSet

protected org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
Returns the Delegate's private Resource Set. A delegate instantiates its own ResourceSet at each launch. The Resource Set is unique during the launch process.

Returns:

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
This method is not meant to be overrided. It is invoked by the Debug UI Plugin.

Specified by:
launch in interface org.eclipse.debug.core.model.ILaunchConfigurationDelegate
Throws:
org.eclipse.core.runtime.CoreException

TPTP 4.3.0 Testing Tools Project
Public API Specification