Package com.piketec.jenkins.plugins.tpt
Class TptPlugin
java.lang.Object
hudson.tasks.BuildStepCompatibilityLayer
hudson.tasks.Builder
com.piketec.jenkins.plugins.tpt.TptPlugin
- All Implemented Interfaces:
ExtensionPoint
,Describable<Builder>
,BuildStep
,SimpleBuildStep
This class is just a data container for the TPTPlugin configuration in Jenkins.
If you use this Jenkins plugin you have two Options to run TPT-Test. The first option is just to run TPT via command line and execute the tests. The second option is to execute the tests via API. In this case for every testcase a single worker job will be started. This worker job must have a proper configured
If you use this Jenkins plugin you have two Options to run TPT-Test. The first option is just to run TPT via command line and execute the tests. The second option is to execute the tests via API. In this case for every testcase a single worker job will be started. This worker job must have a proper configured
TptPluginSlave
Build step. distribution job to worker job
execution was introduced in the year 2016.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
The descriptor of TptPluginNested 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
FieldsModifier and TypeFieldDescriptionboolean
Deprecated.static final String
Deprecated.Deprecated.Deprecated.Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
-
Constructor Summary
ConstructorsConstructorDescriptionTptPlugin
(String exePaths, ArrayList<JenkinsConfiguration> executionConfiguration) All the parameter are processed and then they are passed to TptPluginSingleJobExecutor or to TptPluginMasterJobExecutor -
Method Summary
Modifier and TypeMethodDescriptionCommon command line opts.boolean
com.piketec.jenkins.plugins.tpt.TptLog.LogLevel
The severity level of TPT log messages that will be written to failed JUnit tests.Report dir (optional).boolean
void
boolean
performAsDistributingJob
(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener, EnvVars environment, ArrayList<JenkinsConfiguration> configs) Get the required data to create aTptPluginDistributingJobExecutor
and excecutes it.boolean
performWithoutWorkerJobs
(Run<?, ?> run, FilePath workspace, Launcher launcher, TaskListener listener, EnvVars environment, ArrayList<JenkinsConfiguration> configs) Get the required data to create aTptPluginSingleJobExecutor
and excecutes it.protected Object
This method is used to persist the data format when upgrading the plugin.void
setArguments
(String arguments) void
setEnableJunit
(boolean enableJunit) void
Deprecated.void
setIsDistributing
(boolean isDistributing) Should testcase execution be delegated to a sub job or is this run as a single job.void
setIsTptMaster
(boolean isTptMaster) Deprecated.historic problematic name.void
setjUnitLogLevel
(com.piketec.jenkins.plugins.tpt.TptLog.LogLevel jUnitLogLevel) void
setjUnitreport
(String jUnitreport) void
setSlaveJob
(String slaveJob) Deprecated.historic problematic name.void
setSlaveJobCount
(String slaveJobCount) Deprecated.historic problematic name.void
setSlaveJobTries
(String slaveJobTries) Deprecated.historic problematic name.void
setTptBindingName
(String tptBindingName) void
setTptPort
(String tptPort) void
setTptStartUpWaitTime
(String tptStartUpWaitTime) void
setWorkerJob
(String workerJob) void
setWorkerJobCount
(String workerJobCount) void
setWorkerJobTries
(String workerJobTries) Methods inherited from class hudson.tasks.Builder
all, getRequiredMonitorService, prebuild
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, getRequiredMonitorService, perform, prebuild
Methods inherited from interface jenkins.tasks.SimpleBuildStep
perform, perform, requiresWorkspace
-
Field Details
-
RUN_BUILD
- See Also:
-
isTptMaster
Deprecated. -
slaveJobCount
Deprecated. -
slaveJob
Deprecated. -
slaveJobTries
Deprecated.
-
-
Constructor Details
-
TptPlugin
@DataBoundConstructor public TptPlugin(String exePaths, ArrayList<JenkinsConfiguration> executionConfiguration) All the parameter are processed and then they are passed to TptPluginSingleJobExecutor or to TptPluginMasterJobExecutor- Parameters:
exePaths
- paths to tpt executables separated by a comma or a semicolonexecutionConfiguration
- all the jenkins configurations given in the descriptor, used to get the Files,Execution Configuration, test Set, testDataDir, reportDir,etc
-
-
Method Details
-
readResolve
This method is used to persist the data format when upgrading the plugin.- Returns:
- this
-
getExePaths
- Returns:
- The list of paths to possible TPT-installations.
-
setExe
Deprecated.Deprecated, use exePaths instead- Parameters:
exe
- The path to the tpt.exe
-
getIsDistributing
public boolean getIsDistributing()- Returns:
- Should testcase execution be delegated to a sub job
-
setIsDistributing
@DataBoundSetter public void setIsDistributing(boolean isDistributing) Should testcase execution be delegated to a sub job or is this run as a single job.- Parameters:
isDistributing
-true
if the execution should be
-
setIsTptMaster
Deprecated.historic problematic name. UsesetIsDistributing(boolean)
Should testcase execution be delegated to a sub job or is this run as a single job.- Parameters:
isTptMaster
-true
if the execution should be
-
getWorkerJob
- Returns:
- The name of worker job if the plugin runs in distributing mode
-
setWorkerJob
- Parameters:
workerJob
- The name of worker job if the plugin runs in distributing mode
-
setSlaveJob
Deprecated.historic problematic name. UsesetWorkerJob(String)
- Parameters:
slaveJob
- The name of worker job if the plugin runs in distributing mode
-
getWorkerJobCount
- Returns:
- The number of worker jobs the plugin will run in distributing mode. A value below 1 means every test case will be started in its own job.
-
setWorkerJobCount
- Parameters:
workerJobCount
- The number of worker jobs the plugin will run in distributing mode. A value below 1 means every test case will be started in its own job.
-
setSlaveJobCount
Deprecated.historic problematic name. UsesetWorkerJobCount(String)
- Parameters:
slaveJobCount
- The number of worker jobs the plugin will run in distributing mode. A value below 1 means every test case will be started in its own job.
-
getWorkerJobTries
- Returns:
- If the execution of a worker job fails it is possible to reschedule the job for another try. This is the maximal number of tries.
-
setWorkerJobTries
- Parameters:
workerJobTries
- If the execution of a worker job fails it is possible to reschedule the job for another try. This is the maximal number of tries.
-
setSlaveJobTries
Deprecated.historic problematic name. UsesetWorkerJobTries(String)
.- Parameters:
slaveJobTries
- If the execution of a worker job fails it is possible to reschedule the job for another try. This is the maximal number of tries.
-
getTptBindingName
- Returns:
- the RMI binding name for TPT
-
setTptBindingName
- Parameters:
tptBindingName
- The RMI binding name for TPT
-
getTptPort
- Returns:
- The port of the RMI registry
-
setTptPort
- Parameters:
tptPort
- The port of the RMI registry
-
getArguments
Common command line opts. Delimiter between the options is one or more spaces. Inside doublequotes spaces have no special meaning.- Returns:
- 0 or more options for tpt.
-
setArguments
-
getTptStartUpWaitTime
- Returns:
- The time waited before trying to get the API handle after starting TPT
-
setTptStartUpWaitTime
- Parameters:
tptStartUpWaitTime
- the time waited before trying to get the API handle after starting TPT
-
getExecutionConfiguration
- Returns:
- List of all (repeatable) sub-configurations
-
isEnableJunit
public boolean isEnableJunit()- Returns:
- if the TPT test result should be transformed into a JUnit XML (legacy behaviour)
-
setEnableJunit
@DataBoundSetter public void setEnableJunit(boolean enableJunit) - Parameters:
enableJunit
- if the TPT test result should be transformed into a JUnit XML (legacy behaviour)
-
getJUnitreport
Report dir (optional).- Returns:
- The directory, where to store the results, can be
null
.
-
setjUnitreport
- Parameters:
jUnitreport
- The directory, where to store the results, can benull
.
-
getJUnitLogLevel
public com.piketec.jenkins.plugins.tpt.TptLog.LogLevel getJUnitLogLevel()The severity level of TPT log messages that will be written to failed JUnit tests.- Returns:
- The severity level of TPT log messages that will be written to failed JUnit tests.
-
setjUnitLogLevel
@DataBoundSetter public void setjUnitLogLevel(com.piketec.jenkins.plugins.tpt.TptLog.LogLevel jUnitLogLevel) - Parameters:
jUnitLogLevel
- The severity level of TPT log messages that will be written to failed JUnit tests.
-
perform
public void perform(Run<?, ?> run, FilePath workspace, EnvVars env, Launcher launcher, TaskListener listener) throws InterruptedException, IOException- Specified by:
perform
in interfaceSimpleBuildStep
- Throws:
InterruptedException
IOException
-
performWithoutWorkerJobs
public boolean performWithoutWorkerJobs(Run<?, ?> run, FilePath workspace, Launcher launcher, TaskListener listener, EnvVars environment, ArrayList<JenkinsConfiguration> configs) throws InterruptedException, IOExceptionGet the required data to create aTptPluginSingleJobExecutor
and excecutes it. It is called when there are no distributed builds. All the parameters are used to get the data for creating a new TptPluginSingleJobExecutor- Parameters:
run
- The current Jenkins buildlauncher
- The launcherlistener
- The listenerenvironment
- The map of envrionment varibales and their valueconfigs
- The configs with unresolved $-variables- Returns:
- true if it was possible to execute the TptPluginSingleJobExecutor.
- Throws:
InterruptedException
- If thread was interruptedIOException
-
performAsDistributingJob
public boolean performAsDistributingJob(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener, EnvVars environment, ArrayList<JenkinsConfiguration> configs) throws InterruptedExceptionGet the required data to create aTptPluginDistributingJobExecutor
and excecutes it. It is called when there are distributed builds.- Parameters:
build
- The current Jenkins buildlauncher
- The launcherlistener
- The listenerenvironment
- The map of envrionment varibales and their valueconfigs
- The configs with unresolved $-variables- Returns:
- true if the execution from worker jobs and distributing job were successful.
- Throws:
InterruptedException
- If thread was interrupted- See Also:
-
All the parameters are used to get the data for creating a new TptPluginDistributingJobExecutor
-
getDescriptor
- Specified by:
getDescriptor
in interfaceDescribable<Builder>
- Overrides:
getDescriptor
in classBuilder
-