TPTP 4.5.0 Testing Tools Project
Internal API Specification

org.eclipse.tptp.test.tools.junit.plugin.internal.harness
Class WorkbenchExecutionDeploymentAdapter

java.lang.Object
  extended by org.eclipse.hyades.execution.harness.JavaExecutionDeploymentAdapter
      extended by org.eclipse.hyades.test.tools.core.internal.java.harness.JUnitExecutionDeploymentAdapter
          extended by org.eclipse.tptp.test.tools.junit.plugin.internal.harness.WorkbenchExecutionDeploymentAdapter
All Implemented Interfaces:
org.eclipse.hyades.execution.harness.IExecutionDeploymentAdapter

public class WorkbenchExecutionDeploymentAdapter
extends JUnitExecutionDeploymentAdapter

This deployment adapter performs the deployment of all necessary files for executing a JUnit plugin test suite on a workbench location. The implementation reuses regular JUnit test suite deployment, and in addition, also deploys plugin-related files. It also prepares a temporary configuration area on the remote host that will be used for running the remote workbench.


Nested Class Summary
protected static class WorkbenchExecutionDeploymentAdapter.LocationPair
           
 
Field Summary
 
Fields inherited from class org.eclipse.hyades.execution.harness.JavaExecutionDeploymentAdapter
PATH_NAME_SEPARATOR, ROOTDIR_ENV_VARIABLE1, ROOTDIR_ENV_VARIABLE2, ROOTDIR_ENV_VARIABLE3
 
Constructor Summary
WorkbenchExecutionDeploymentAdapter()
           
 
Method Summary
protected  void addForeignFile(boolean isStandalone, org.eclipse.core.resources.IProject project, java.io.File file, java.lang.String relativeDeployPath, java.util.HashMap deployableFiles, java.lang.String deployRootDir)
          Utility method to add a file that is not in the workspace to the deployable files.
protected  void cleanUpConfigurationArea(org.eclipse.hyades.execution.core.INode node, org.eclipse.hyades.models.common.configuration.CFGLocation location)
           
 void cleanUpTestAssets(org.eclipse.hyades.execution.core.INode node, org.eclipse.hyades.models.common.testprofile.TPFDeployment deployment, boolean isStandalone, java.lang.StringBuffer bufError, org.eclipse.hyades.execution.core.IExecutionEnvironment exeEnvironment)
           
protected  void cleanUpWorkspace(org.eclipse.hyades.execution.core.INode node, org.eclipse.hyades.models.common.configuration.CFGLocation location)
           
protected  java.util.HashMap collectDeployableFiles(org.eclipse.hyades.models.common.configuration.CFGArtifactLocationPair[] pairs, boolean isStandalone, org.eclipse.hyades.execution.core.IExecutionEnvironment exeEnvironment)
           
protected  void collectPluginFiles(boolean isStandalone, org.eclipse.core.resources.IProject project, java.util.HashMap deployableFiles, java.lang.String deployRootDir, java.util.Set deployedBundleDirs, java.util.Collection externalPlugins)
          Collect the plugin files (MANIFEST.MF, plugin.xml...) that must be deployed to the target.
protected  void collectTestSuiteFiles(boolean isStandalone, java.util.HashMap deployableFiles, org.eclipse.hyades.models.common.testprofile.TPFTestSuite testSuite, org.eclipse.hyades.models.common.configuration.CFGLocation location, java.lang.String deployRootDir)
          This implementation collects all files referenced in the junit source file project, if this project is a plug-in project.
protected  java.util.Properties createConfigIniFile(java.util.HashMap deployableFiles, org.eclipse.hyades.models.common.configuration.CFGPropertyGroup group, java.lang.String brandingID, java.util.TreeMap pluginMap, java.lang.String configDir)
           
protected  java.lang.String createTemporaryDirectoryName(java.lang.String type, org.eclipse.hyades.models.common.configuration.CFGLocation location, java.lang.String deployRootDir)
           
 void deployTestAssets(org.eclipse.hyades.execution.core.INode node, org.eclipse.hyades.models.common.testprofile.TPFDeployment deployment, boolean isStandalone, java.lang.StringBuffer bufError, org.eclipse.hyades.execution.core.IExecutionEnvironment exeEnvironment)
           
protected  boolean excludeFromClasspath(java.lang.String localAbsolutePath, org.eclipse.hyades.models.common.configuration.CFGArtifact artifact, org.eclipse.hyades.models.common.configuration.CFGLocation location)
           
protected  java.lang.String getBrandingPlugin(org.eclipse.hyades.models.common.configuration.CFGPropertyGroup group)
           
protected static java.lang.String getBundleURL(java.lang.String id, java.util.Map pluginMap)
           
protected  java.lang.String getConfigDir(org.eclipse.hyades.models.common.configuration.CFGPropertyGroup workbenchGroup, java.lang.String deployRootDir)
           
protected static java.lang.String getContributingPlugin(java.lang.String productID)
           
protected static java.io.File getManifestFile(org.eclipse.core.resources.IProject project)
          Generates a manifest file for the specified plugin project.
protected static java.util.Collection getOutputDirectories(org.eclipse.core.resources.IProject project)
          Returns the output directories of a java project.
protected static java.io.File getPluginFile(org.eclipse.core.resources.IProject project)
          Generates a plugin.xml file for the specified plugin project.
protected static java.util.TreeMap getPluginsToRun(org.eclipse.hyades.models.common.configuration.CFGPropertyGroup group)
           
protected static java.lang.String getRemoteBundleURL(org.eclipse.hyades.models.common.configuration.CFGPropertyGroup group, java.lang.String bundleID, java.util.Map map)
           
protected static org.eclipse.pde.core.plugin.IPluginModelBase[] getSelectedPlugins(org.eclipse.hyades.models.common.configuration.CFGPropertyGroup group)
           
protected  boolean isEclipsRunning(org.eclipse.hyades.execution.core.INode node, org.eclipse.hyades.models.common.configuration.CFGLocation location)
           
protected  void makeConfigurationArea(java.util.HashMap deployableFiles, org.eclipse.hyades.models.common.configuration.CFGLocation location, org.eclipse.hyades.execution.core.IExecutionEnvironment exeEnvironment)
           
protected  void makeConfigurationAreas(java.util.HashMap deployableFiles, org.eclipse.hyades.models.common.configuration.CFGArtifactLocationPair[] pairs, org.eclipse.hyades.execution.core.IExecutionEnvironment exeEnvironment)
           
protected  void prepareWorkspace(java.util.HashMap deployableFiles, org.eclipse.hyades.models.common.configuration.CFGLocation location, org.eclipse.hyades.execution.core.IExecutionEnvironment exeEnvironment)
           
protected static void save(java.io.File file, java.util.Properties properties)
           
protected static void setBundleLocations(org.eclipse.hyades.models.common.configuration.CFGPropertyGroup group, java.util.Map map, java.util.Properties properties)
           
protected static org.eclipse.core.runtime.IStatus validateModel(org.eclipse.pde.core.plugin.IPluginModelBase model)
           
protected static java.util.TreeMap validatePlugins(org.eclipse.pde.core.plugin.IPluginModelBase[] models, java.util.ArrayList statusEntries)
           
 
Methods inherited from class org.eclipse.hyades.test.tools.core.internal.java.harness.JUnitExecutionDeploymentAdapter
addIfExist, addPluginFile, getPluginFiles
 
Methods inherited from class org.eclipse.hyades.execution.harness.JavaExecutionDeploymentAdapter
cleanFromNode, collectClassFiles, collectClasspathFiles, collectDeployableArtifacts, collectPairsByNode, deployFile, deployFile, deployToNode, getClasspathFiles, getDefaultRootDir, getDefaultUsername, getDeployableFilePath, getDeployFilePath, getDeployRootDir, getSourceRootDir, getWorkspaceRoot, isRootEnvironmentVariable, isSourceDestinationSame, isValidPair, removeDirectory, setLocationClasspath, uniformPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkbenchExecutionDeploymentAdapter

public WorkbenchExecutionDeploymentAdapter()
Method Detail

deployTestAssets

public void deployTestAssets(org.eclipse.hyades.execution.core.INode node,
                             org.eclipse.hyades.models.common.testprofile.TPFDeployment deployment,
                             boolean isStandalone,
                             java.lang.StringBuffer bufError,
                             org.eclipse.hyades.execution.core.IExecutionEnvironment exeEnvironment)
Specified by:
deployTestAssets in interface org.eclipse.hyades.execution.harness.IExecutionDeploymentAdapter
Overrides:
deployTestAssets in class org.eclipse.hyades.execution.harness.JavaExecutionDeploymentAdapter

collectDeployableFiles

protected java.util.HashMap collectDeployableFiles(org.eclipse.hyades.models.common.configuration.CFGArtifactLocationPair[] pairs,
                                                   boolean isStandalone,
                                                   org.eclipse.hyades.execution.core.IExecutionEnvironment exeEnvironment)
Overrides:
collectDeployableFiles in class org.eclipse.hyades.execution.harness.JavaExecutionDeploymentAdapter

cleanUpTestAssets

public void cleanUpTestAssets(org.eclipse.hyades.execution.core.INode node,
                              org.eclipse.hyades.models.common.testprofile.TPFDeployment deployment,
                              boolean isStandalone,
                              java.lang.StringBuffer bufError,
                              org.eclipse.hyades.execution.core.IExecutionEnvironment exeEnvironment)
Specified by:
cleanUpTestAssets in interface org.eclipse.hyades.execution.harness.IExecutionDeploymentAdapter
Overrides:
cleanUpTestAssets in class org.eclipse.hyades.execution.harness.JavaExecutionDeploymentAdapter

excludeFromClasspath

protected boolean excludeFromClasspath(java.lang.String localAbsolutePath,
                                       org.eclipse.hyades.models.common.configuration.CFGArtifact artifact,
                                       org.eclipse.hyades.models.common.configuration.CFGLocation location)
Overrides:
excludeFromClasspath in class org.eclipse.hyades.execution.harness.JavaExecutionDeploymentAdapter

collectTestSuiteFiles

protected void collectTestSuiteFiles(boolean isStandalone,
                                     java.util.HashMap deployableFiles,
                                     org.eclipse.hyades.models.common.testprofile.TPFTestSuite testSuite,
                                     org.eclipse.hyades.models.common.configuration.CFGLocation location,
                                     java.lang.String deployRootDir)
Description copied from class: JUnitExecutionDeploymentAdapter
This implementation collects all files referenced in the junit source file project, if this project is a plug-in project. Otherwise, it does nothing. See bugzilla_140715 for details.

Overrides:
collectTestSuiteFiles in class JUnitExecutionDeploymentAdapter

collectPluginFiles

protected void collectPluginFiles(boolean isStandalone,
                                  org.eclipse.core.resources.IProject project,
                                  java.util.HashMap deployableFiles,
                                  java.lang.String deployRootDir,
                                  java.util.Set deployedBundleDirs,
                                  java.util.Collection externalPlugins)
Collect the plugin files (MANIFEST.MF, plugin.xml...) that must be deployed to the target. This does not include class files, which are deployed by JavaExecutionDeploymentAdapter.collectClasspathFiles(boolean, HashMap, CFGArtifact, CFGLocation, String). This method also computes the locations of remote bundles copied from local workspace plugins.

Parameters:
project - The project that contains the test and its plugin
deployableFiles - This map is populated with the plugin files that must be deployed to the remote host.
deployedBundleDirs - This set is populated with the remote directories of bundles that should be installed on the remote workbench.
externalPlugins - The list of external plugins that are enabled on the remote workbench. This list is used to avoid deploying workspace plugins that already exist on the remote workbench as enabled platform plugins.

addForeignFile

protected void addForeignFile(boolean isStandalone,
                              org.eclipse.core.resources.IProject project,
                              java.io.File file,
                              java.lang.String relativeDeployPath,
                              java.util.HashMap deployableFiles,
                              java.lang.String deployRootDir)
Utility method to add a file that is not in the workspace to the deployable files.


getManifestFile

protected static java.io.File getManifestFile(org.eclipse.core.resources.IProject project)
Generates a manifest file for the specified plugin project.

Parameters:
project - A plugin project.
Returns:
The generated file.

getPluginFile

protected static java.io.File getPluginFile(org.eclipse.core.resources.IProject project)
Generates a plugin.xml file for the specified plugin project.

Parameters:
project - A plugin project.
Returns:
The generated file.

getOutputDirectories

protected static java.util.Collection getOutputDirectories(org.eclipse.core.resources.IProject project)
Returns the output directories of a java project.

Parameters:
project - A java project
Returns:
A collection of String (denoting a path relative to the project).

makeConfigurationAreas

protected void makeConfigurationAreas(java.util.HashMap deployableFiles,
                                      org.eclipse.hyades.models.common.configuration.CFGArtifactLocationPair[] pairs,
                                      org.eclipse.hyades.execution.core.IExecutionEnvironment exeEnvironment)
                               throws java.lang.Exception
Throws:
java.lang.Exception

createTemporaryDirectoryName

protected java.lang.String createTemporaryDirectoryName(java.lang.String type,
                                                        org.eclipse.hyades.models.common.configuration.CFGLocation location,
                                                        java.lang.String deployRootDir)

cleanUpConfigurationArea

protected void cleanUpConfigurationArea(org.eclipse.hyades.execution.core.INode node,
                                        org.eclipse.hyades.models.common.configuration.CFGLocation location)

makeConfigurationArea

protected void makeConfigurationArea(java.util.HashMap deployableFiles,
                                     org.eclipse.hyades.models.common.configuration.CFGLocation location,
                                     org.eclipse.hyades.execution.core.IExecutionEnvironment exeEnvironment)
                              throws java.lang.Exception
Throws:
java.lang.Exception

getConfigDir

protected java.lang.String getConfigDir(org.eclipse.hyades.models.common.configuration.CFGPropertyGroup workbenchGroup,
                                        java.lang.String deployRootDir)
                                 throws java.io.IOException
Throws:
java.io.IOException

getBrandingPlugin

protected java.lang.String getBrandingPlugin(org.eclipse.hyades.models.common.configuration.CFGPropertyGroup group)

getPluginsToRun

protected static java.util.TreeMap getPluginsToRun(org.eclipse.hyades.models.common.configuration.CFGPropertyGroup group)

getSelectedPlugins

protected static org.eclipse.pde.core.plugin.IPluginModelBase[] getSelectedPlugins(org.eclipse.hyades.models.common.configuration.CFGPropertyGroup group)

validatePlugins

protected static java.util.TreeMap validatePlugins(org.eclipse.pde.core.plugin.IPluginModelBase[] models,
                                                   java.util.ArrayList statusEntries)

validateModel

protected static org.eclipse.core.runtime.IStatus validateModel(org.eclipse.pde.core.plugin.IPluginModelBase model)

createConfigIniFile

protected java.util.Properties createConfigIniFile(java.util.HashMap deployableFiles,
                                                   org.eclipse.hyades.models.common.configuration.CFGPropertyGroup group,
                                                   java.lang.String brandingID,
                                                   java.util.TreeMap pluginMap,
                                                   java.lang.String configDir)
                                            throws org.eclipse.core.runtime.CoreException,
                                                   java.io.IOException
Throws:
org.eclipse.core.runtime.CoreException
java.io.IOException

getContributingPlugin

protected static java.lang.String getContributingPlugin(java.lang.String productID)

getBundleURL

protected static java.lang.String getBundleURL(java.lang.String id,
                                               java.util.Map pluginMap)

save

protected static void save(java.io.File file,
                           java.util.Properties properties)

setBundleLocations

protected static void setBundleLocations(org.eclipse.hyades.models.common.configuration.CFGPropertyGroup group,
                                         java.util.Map map,
                                         java.util.Properties properties)

getRemoteBundleURL

protected static java.lang.String getRemoteBundleURL(org.eclipse.hyades.models.common.configuration.CFGPropertyGroup group,
                                                     java.lang.String bundleID,
                                                     java.util.Map map)

prepareWorkspace

protected void prepareWorkspace(java.util.HashMap deployableFiles,
                                org.eclipse.hyades.models.common.configuration.CFGLocation location,
                                org.eclipse.hyades.execution.core.IExecutionEnvironment exeEnvironment)

cleanUpWorkspace

protected void cleanUpWorkspace(org.eclipse.hyades.execution.core.INode node,
                                org.eclipse.hyades.models.common.configuration.CFGLocation location)

isEclipsRunning

protected boolean isEclipsRunning(org.eclipse.hyades.execution.core.INode node,
                                  org.eclipse.hyades.models.common.configuration.CFGLocation location)

TPTP 4.5.0 Testing Tools Project
Internal API Specification