Class AbstractToolBuilder
- java.lang.Object
-
- hudson.tasks.BuildStepCompatibilityLayer
-
- hudson.tasks.Builder
-
- de.tracetronic.jenkins.plugins.ecutest.tool.AbstractToolBuilder
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<Builder>
,BuildStep
,SimpleBuildStep
- Direct Known Subclasses:
LicenseETBuilder
,StartETBuilder
,StartTSBuilder
,StopETBuilder
,StopTSBuilder
public abstract class AbstractToolBuilder extends Builder implements SimpleBuildStep
Common base class for all tool related task builders implemented in this plugin.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractToolBuilder.SetComPropertyCallable
Callable
providing remote access to set the current COM properties.-
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
BuildStep.PublisherList
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Nested classes/interfaces inherited from interface jenkins.tasks.SimpleBuildStep
SimpleBuildStep.LastBuildAction, SimpleBuildStep.LastBuildActionFactory
-
-
Field Summary
-
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
-
-
Constructor Summary
Constructors Constructor Description AbstractToolBuilder(String toolName)
Instantiates aAbstractToolBuilder
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ETInstallation
configureToolInstallation(Computer computer, TaskListener listener, EnvVars envVars)
Configures the tool installation for functioning in the node and the environment.abstract int
getDefaultTimeout()
Gets the default timeout.AbstractToolDescriptor
getDescriptor()
ETInstallation
getInstallation()
BuildStepMonitor
getRequiredMonitorService()
String
getTimeout()
protected int
getToolId(Run<?,?> run)
Gets the test identifier by the size ofToolEnvInvisibleAction
s already added to the build.ETInstallation
getToolInstallation(EnvVars envVars)
Gets the tool installation by descriptor and tool name.String
getToolName()
protected boolean
isInstallationVerified(EnvVars envVars)
Verify the installation object and updates properties if needed.void
perform(Run<?,?> run, FilePath workspace, Launcher launcher, TaskListener listener)
protected abstract void
performTool(Run<?,?> run, FilePath workspace, Launcher launcher, TaskListener listener)
Performs the tool-specific build step operations.void
setInstallation(ETInstallation installation)
Sets the ecu.test installation and the derived name.void
setTimeout(int timeout)
void
setTimeout(String timeout)
-
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectAction, getProjectActions, perform, perform, prebuild
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface hudson.tasks.BuildStep
getProjectAction, getProjectActions, perform, prebuild
-
Methods inherited from interface jenkins.tasks.SimpleBuildStep
perform, perform, requiresWorkspace
-
-
-
-
Constructor Detail
-
AbstractToolBuilder
public AbstractToolBuilder(@Nonnull String toolName)
Instantiates aAbstractToolBuilder
.- Parameters:
toolName
- the tool name
-
-
Method Detail
-
setTimeout
@DataBoundSetter public void setTimeout(@CheckForNull String timeout)
-
setTimeout
public void setTimeout(int timeout)
-
getDefaultTimeout
public abstract int getDefaultTimeout()
Gets the default timeout.- Returns:
- the default timeout
-
getInstallation
public ETInstallation getInstallation()
-
setInstallation
@DataBoundSetter public void setInstallation(ETInstallation installation)
Sets the ecu.test installation and the derived name.- Parameters:
installation
- the ecu.test installation
-
perform
public void perform(@Nonnull Run<?,?> run, @Nonnull FilePath workspace, @Nonnull Launcher launcher, @Nonnull TaskListener listener) throws InterruptedException, IOException
- Specified by:
perform
in interfaceSimpleBuildStep
- Throws:
InterruptedException
IOException
-
performTool
protected abstract void performTool(Run<?,?> run, FilePath workspace, Launcher launcher, TaskListener listener) throws InterruptedException, IOException, ETPluginException
Performs the tool-specific build step operations.- Parameters:
run
- the runworkspace
- the workspacelauncher
- the launcherlistener
- the listener- Throws:
InterruptedException
- the interrupted exceptionIOException
- signals that an I/O exception has occurredETPluginException
- in case of tool operation errors
-
getToolId
protected int getToolId(Run<?,?> run)
Gets the test identifier by the size ofToolEnvInvisibleAction
s already added to the build.- Parameters:
run
- the run- Returns:
- the tool id
-
isInstallationVerified
protected boolean isInstallationVerified(EnvVars envVars)
Verify the installation object and updates properties if needed.- Parameters:
envVars
- the environment variables of the run- Returns:
true
if installation for given tool name exists,false
otherwise
-
getToolInstallation
@CheckForNull public ETInstallation getToolInstallation(EnvVars envVars)
Gets the tool installation by descriptor and tool name.- Parameters:
envVars
- the environment variables- Returns:
- the tool installation
-
getRequiredMonitorService
public BuildStepMonitor getRequiredMonitorService()
- Specified by:
getRequiredMonitorService
in interfaceBuildStep
- Overrides:
getRequiredMonitorService
in classBuilder
-
getDescriptor
public AbstractToolDescriptor getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<Builder>
- Overrides:
getDescriptor
in classBuilder
-
configureToolInstallation
public ETInstallation configureToolInstallation(Computer computer, TaskListener listener, EnvVars envVars) throws IOException, InterruptedException, ETPluginException
Configures the tool installation for functioning in the node and the environment.- Parameters:
computer
- the nodelistener
- the listenerenvVars
- the environment variables- Returns:
- the tool installation
- Throws:
IOException
- signals that an I/O exception has occurredInterruptedException
- if the build gets interruptedETPluginException
- if the selected tool installation is not configured
-
-