TPTP 4.4.0 Testing Tools Project
Public API Specification

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

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

public class BasicTestLaunchConfigurationDelegate2
extends AbstractLaunchConfigurationDelegate2

This class is the delegate for the Test launch configuration. It handles the launching of a TPTP Test according to a Test Launch Configuration.

See Also:
ILaunchConfigurationDelegate

Constructor Summary
BasicTestLaunchConfigurationDelegate2()
          Create a Test launch configuration delegate.
 
Method Summary
protected  org.eclipse.hyades.models.common.testprofile.TPFDeployment getDeployment(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Returns the deployment used for launching the test.
protected  java.lang.Object getLaunchedElement(org.eclipse.debug.core.ILaunchConfiguration configuration)
          This implementation returns the test launched by the specified launch configuration.
protected  org.eclipse.hyades.models.common.testprofile.TPFTest getLaunchedTest(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Returns the test launched by the Test launch configuration.
protected  org.eclipse.core.resources.IContainer getTestExecutionHistoryLocation(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Returns the Test Log file location.
protected  java.lang.String getTestExecutionHistoryName(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Returns the Test Log name.
 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)
          This implementation invokes the Test Execution Harness to launch the test specified by a Test launch configuration, using the Test launch configuration properties.
protected  boolean isTestExecutionHistoryDatabase(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Returns the Test Log "database" property.
protected  boolean isTestExecutionHistoryTestLogFile(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Returns the "Test Log File" property.
protected  boolean overrideExistingTestExecutionHistory(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Returns the Test Log "overwrite" property.
protected  void validate(org.eclipse.debug.core.ILaunchConfiguration configuration, java.lang.String mode)
          In addition to the points checked by the super class, this implementation checks the following points: The deployment is not null The Test Log name is neither empty nor null The Test Log file location is not null
 
Methods inherited from class org.eclipse.hyades.test.core.launch.delegates.AbstractLaunchConfigurationDelegate2
getResourceSet, launch, reportProblem, resetFields
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicTestLaunchConfigurationDelegate2

public BasicTestLaunchConfigurationDelegate2()
Create a Test launch configuration delegate.

Method Detail

getLaunchedTest

protected org.eclipse.hyades.models.common.testprofile.TPFTest getLaunchedTest(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                                                        throws org.eclipse.core.runtime.CoreException
Returns the test launched by the Test launch configuration. This is a conveniency method for sub-classes.

Throws:
org.eclipse.core.runtime.CoreException
See Also:
TestLaunchConfigurationFacade.getTest(ILaunchConfiguration, org.eclipse.emf.ecore.resource.ResourceSet)

getDeployment

protected org.eclipse.hyades.models.common.testprofile.TPFDeployment getDeployment(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                                                            throws org.eclipse.core.runtime.CoreException
Returns the deployment used for launching the test. This is a conveniency method for sub-classes.

Throws:
org.eclipse.core.runtime.CoreException
See Also:
DeploymentLaunchConfigurationFacade.getDeployment(ILaunchConfiguration, org.eclipse.emf.ecore.resource.ResourceSet)

getTestExecutionHistoryName

protected java.lang.String getTestExecutionHistoryName(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                                throws org.eclipse.core.runtime.CoreException
Returns the Test Log name. This is a conveniency method for sub-classes.

Throws:
org.eclipse.core.runtime.CoreException
See Also:
ExecutionHistoryLaunchConfigurationFacade.getExecutionHistoryName(ILaunchConfiguration)

getTestExecutionHistoryLocation

protected org.eclipse.core.resources.IContainer getTestExecutionHistoryLocation(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                                                         throws org.eclipse.core.runtime.CoreException
Returns the Test Log file location. This is a conveniency method for sub-classes.

Throws:
org.eclipse.core.runtime.CoreException
See Also:
ExecutionHistoryLaunchConfigurationFacade.getExecutionHistoryLocation(ILaunchConfiguration)

overrideExistingTestExecutionHistory

protected boolean overrideExistingTestExecutionHistory(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                                throws org.eclipse.core.runtime.CoreException
Returns the Test Log "overwrite" property. This is a convenience method for sub-classes.

Throws:
org.eclipse.core.runtime.CoreException
See Also:
ExecutionHistoryLaunchConfigurationFacade.isExecutionHistoryOverriden(ILaunchConfiguration)

isTestExecutionHistoryDatabase

protected boolean isTestExecutionHistoryDatabase(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                          throws org.eclipse.core.runtime.CoreException
Returns the Test Log "database" property. This is a convenience method for sub-classes.

Throws:
org.eclipse.core.runtime.CoreException
See Also:
ExecutionHistoryLaunchConfigurationFacade.isExecutionHistoryDatabase(ILaunchConfiguration)
Provisional API: This API is subject to change in the next release.
As of TPTP V4.4.0, this is stable provisional API (see http://www.eclipse.org/tptp/home/documents/process/development/api_contract.html).

isTestExecutionHistoryTestLogFile

protected boolean isTestExecutionHistoryTestLogFile(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                             throws org.eclipse.core.runtime.CoreException
Returns the "Test Log File" property. This is a convenience method for sub-classes.

Throws:
org.eclipse.core.runtime.CoreException
See Also:
ExecutionHistoryLaunchConfigurationFacade.isExecutionHistoryTestLogFile(ILaunchConfiguration)
Provisional API: This API is subject to change in the next release.
As of TPTP V4.4.0, this is stable provisional API (see http://www.eclipse.org/tptp/home/documents/process/development/api_contract.html).

getLaunchedElement

protected java.lang.Object getLaunchedElement(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                       throws org.eclipse.core.runtime.CoreException
This implementation returns the test launched by the specified launch configuration.

Specified by:
getLaunchedElement in class AbstractLaunchConfigurationDelegate2
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
In addition to the points checked by the super class, this implementation checks the following points:

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

invokeTestExecutionHarness

public 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

This implementation invokes the Test Execution Harness to launch the test specified by a Test launch configuration, using the Test launch configuration properties.

In run mode, the type of test passed to the Execution Harness is the type of test test. In debug or profile mode, the type passed to the Execution Harness is the type of the, appended with ".debug" or ".profile" respectively.
For instance, if the type of the test "org.myorg.mytest" and the delegate is invoked in debug mode, the type passed to the execution harness is "org.myorg.mytest.debug".

Specified by:
invokeTestExecutionHarness in class AbstractLaunchConfigurationDelegate2
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
See Also:
ILaunchConfigurationDelegate.launch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, org.eclipse.debug.core.ILaunch, org.eclipse.core.runtime.IProgressMonitor)

TPTP 4.4.0 Testing Tools Project
Public API Specification