Class TestFolderBuilder
- java.lang.Object
-
- hudson.tasks.BuildStepCompatibilityLayer
-
- hudson.tasks.Builder
-
- de.tracetronic.jenkins.plugins.ecutest.test.AbstractTestHelper
-
- de.tracetronic.jenkins.plugins.ecutest.test.AbstractTestBuilder
-
- de.tracetronic.jenkins.plugins.ecutest.test.TestFolderBuilder
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<Builder>
,BuildStep
,SimpleBuildStep
public class TestFolderBuilder extends AbstractTestBuilder
Builder providing the execution of ecu.test packages and projects inside of a test folder.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TestFolderBuilder.DescriptorImpl
DescriptorImpl forTestFolderBuilder
.static class
TestFolderBuilder.ScanMode
Defines the modes to scan the test folder.-
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 Modifier and Type Field Description protected static TestFolderBuilder.ScanMode
DEFAULT_SCANMODE
Defines the defaultTestFolderBuilder.ScanMode
.-
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
-
-
Constructor Summary
Constructors Constructor Description TestFolderBuilder(String testFile)
Instantiates a newTestFolderBuilder
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PackageConfig
getPackageConfig()
ProjectConfig
getProjectConfig()
TestFolderBuilder.ScanMode
getScanMode()
protected String
getTestFilePath(String testFile, String pkgDir, Launcher launcher, TaskListener listener)
Gets the absolute test file path.boolean
isFailFast()
boolean
isRecursiveScan()
protected boolean
runTest(String testFolder, TestConfig testConfig, ExecutionConfig executionConfig, Run<?,?> run, FilePath workspace, Launcher launcher, TaskListener listener)
Run the test with given configurations within a defined timeout.void
setFailFast(boolean failFast)
void
setPackageConfig(PackageConfig packageConfig)
void
setProjectConfig(ProjectConfig projectConfig)
void
setRecursiveScan(boolean recursiveScan)
void
setScanMode(TestFolderBuilder.ScanMode scanMode)
-
Methods inherited from class de.tracetronic.jenkins.plugins.ecutest.test.AbstractTestBuilder
addBuildAction, getDescriptor, getExecutionConfig, getRequiredMonitorService, getTestConfig, getTestFile, perform, setExecutionConfig, setTestConfig
-
Methods inherited from class de.tracetronic.jenkins.plugins.ecutest.test.AbstractTestHelper
checkETInstance, checkTSInstance, closeETInstance, getConfigDir, getConfigFilePath, getDefaultConfigDir, getDefaultPackagesDir, getPackagesDir, 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
-
-
-
-
Field Detail
-
DEFAULT_SCANMODE
protected static final TestFolderBuilder.ScanMode DEFAULT_SCANMODE
Defines the defaultTestFolderBuilder.ScanMode
.
-
-
Constructor Detail
-
TestFolderBuilder
@DataBoundConstructor public TestFolderBuilder(@Nonnull String testFile)
Instantiates a newTestFolderBuilder
.- Parameters:
testFile
- the test folder
-
-
Method Detail
-
getScanMode
@Nonnull public TestFolderBuilder.ScanMode getScanMode()
-
setScanMode
@DataBoundSetter public void setScanMode(@Nonnull TestFolderBuilder.ScanMode scanMode)
-
isRecursiveScan
public boolean isRecursiveScan()
-
setRecursiveScan
@DataBoundSetter public void setRecursiveScan(boolean recursiveScan)
-
isFailFast
public boolean isFailFast()
-
setFailFast
@DataBoundSetter public void setFailFast(boolean failFast)
-
getPackageConfig
@Nonnull public PackageConfig getPackageConfig()
-
setPackageConfig
@DataBoundSetter public void setPackageConfig(@CheckForNull PackageConfig packageConfig)
-
getProjectConfig
@Nonnull public ProjectConfig getProjectConfig()
-
setProjectConfig
@DataBoundSetter public void setProjectConfig(@CheckForNull ProjectConfig projectConfig)
-
getTestFilePath
protected String getTestFilePath(String testFile, String pkgDir, Launcher launcher, TaskListener listener) throws IOException, InterruptedException
Description copied from class:AbstractTestHelper
Gets the absolute test file path.- Overrides:
getTestFilePath
in classAbstractTestHelper
- Parameters:
testFile
- the expanded test filepkgDir
- the packages directory containing the test filelauncher
- the launcherlistener
- the listener- Returns:
- the absolute test file path
- Throws:
IOException
- signals that an I/O exception has occurredInterruptedException
- if the build gets interrupted
-
runTest
protected boolean runTest(String testFolder, TestConfig testConfig, ExecutionConfig executionConfig, Run<?,?> run, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException
Description copied from class:AbstractTestBuilder
Run the test with given configurations within a defined timeout.- Specified by:
runTest
in classAbstractTestBuilder
- Parameters:
testFolder
- 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
-
-