Class AbstractTestBuilder
- java.lang.Object
-
- hudson.tasks.BuildStepCompatibilityLayer
-
- hudson.tasks.Builder
-
- de.tracetronic.jenkins.plugins.ecutest.test.AbstractTestHelper
-
- de.tracetronic.jenkins.plugins.ecutest.test.AbstractTestBuilder
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<Builder>
,BuildStep
,SimpleBuildStep
- Direct Known Subclasses:
TestFolderBuilder
,TestPackageBuilder
,TestProjectBuilder
public abstract class AbstractTestBuilder extends AbstractTestHelper implements SimpleBuildStep
Common base class for all test related task builders implemented in this plugin.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.tracetronic.jenkins.plugins.ecutest.test.AbstractTestHelper
AbstractTestHelper.GetSettingCallable
-
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 AbstractTestBuilder(String testFile)
Instantiates a newAbstractTestBuilder
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addBuildAction(Run<?,?> run, AbstractTestClient testClient)
Adds the build action holding test information by injecting environment variables.AbstractTestDescriptor
getDescriptor()
ExecutionConfig
getExecutionConfig()
BuildStepMonitor
getRequiredMonitorService()
TestConfig
getTestConfig()
String
getTestFile()
void
perform(Run<?,?> run, FilePath workspace, Launcher launcher, TaskListener listener)
protected abstract boolean
runTest(String testFile, TestConfig testConfig, ExecutionConfig executionConfig, Run<?,?> run, FilePath workspace, Launcher launcher, TaskListener listener)
Run the test with given configurations within a defined timeout.void
setExecutionConfig(ExecutionConfig executionConfig)
void
setTestConfig(TestConfig testConfig)
-
Methods inherited from class de.tracetronic.jenkins.plugins.ecutest.test.AbstractTestHelper
checkETInstance, checkTSInstance, closeETInstance, getConfigDir, getConfigFilePath, getDefaultConfigDir, getDefaultPackagesDir, getPackagesDir, getTestFilePath, getTestId
-
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
-
AbstractTestBuilder
public AbstractTestBuilder(String testFile)
Instantiates a newAbstractTestBuilder
.- Parameters:
testFile
- the test file path
-
-
Method Detail
-
getTestConfig
@Nonnull public TestConfig getTestConfig()
-
setTestConfig
@DataBoundSetter public void setTestConfig(@CheckForNull TestConfig testConfig)
-
getExecutionConfig
@Nonnull public ExecutionConfig getExecutionConfig()
-
setExecutionConfig
@DataBoundSetter public void setExecutionConfig(@CheckForNull ExecutionConfig executionConfig)
-
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
-
addBuildAction
protected void addBuildAction(Run<?,?> run, AbstractTestClient testClient)
Adds the build action holding test information by injecting environment variables.- Parameters:
run
- the runtestClient
- the test client
-
runTest
protected abstract boolean runTest(String testFile, TestConfig testConfig, ExecutionConfig executionConfig, Run<?,?> run, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException
Run the test with given configurations within a defined timeout.- Parameters:
testFile
- the full test file pathtestConfig
- the expanded test configurationexecutionConfig
- the expanded execution configurationrun
- the buildworkspace
- the workspacelauncher
- the launcherlistener
- the listener- Returns:
true
if running the test passed,false
otherwise- Throws:
IOException
- signals that an I/O exception has occurredInterruptedException
- if the build gets interrupted
-
getRequiredMonitorService
public BuildStepMonitor getRequiredMonitorService()
- Specified by:
getRequiredMonitorService
in interfaceBuildStep
- Overrides:
getRequiredMonitorService
in classBuilder
-
getDescriptor
public AbstractTestDescriptor getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<Builder>
- Overrides:
getDescriptor
in classBuilder
-
-