Class TptPlugin

All Implemented Interfaces:
ExtensionPoint, Describable<Builder>, BuildStep, SimpleBuildStep

public class TptPlugin extends Builder implements 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 TptPluginSlave Build step. distribution job to worker job execution was introduced in the year 2016.
  • Field Details

  • 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 semicolon
      executionConfiguration - all the jenkins configurations given in the descriptor, used to get the Files,Execution Configuration, test Set, testDataDir, reportDir,etc
  • Method Details

    • readResolve

      protected Object readResolve()
      This method is used to persist the data format when upgrading the plugin.
      Returns:
      this
    • getExePaths

      public String getExePaths()
      Returns:
      The list of paths to possible TPT-installations.
    • setExe

      @Deprecated public void setExe(String exe)
      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

      @DataBoundSetter @Deprecated public void setIsTptMaster(boolean isTptMaster)
      Deprecated.
      historic problematic name. Use setIsDistributing(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

      public String getWorkerJob()
      Returns:
      The name of worker job if the plugin runs in distributing mode
    • setWorkerJob

      @DataBoundSetter public void setWorkerJob(String workerJob)
      Parameters:
      workerJob - The name of worker job if the plugin runs in distributing mode
    • setSlaveJob

      @DataBoundSetter @Deprecated public void setSlaveJob(String slaveJob)
      Deprecated.
      historic problematic name. Use setWorkerJob(String)
      Parameters:
      slaveJob - The name of worker job if the plugin runs in distributing mode
    • getWorkerJobCount

      public String 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

      @DataBoundSetter public void setWorkerJobCount(String workerJobCount)
      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

      @DataBoundSetter @Deprecated public void setSlaveJobCount(String slaveJobCount)
      Deprecated.
      historic problematic name. Use setWorkerJobCount(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

      public String 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

      @DataBoundSetter public void setWorkerJobTries(String workerJobTries)
      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

      @DataBoundSetter @Deprecated public void setSlaveJobTries(String slaveJobTries)
      Deprecated.
      historic problematic name. Use setWorkerJobTries(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

      public String getTptBindingName()
      Returns:
      the RMI binding name for TPT
    • setTptBindingName

      @DataBoundSetter public void setTptBindingName(String tptBindingName)
      Parameters:
      tptBindingName - The RMI binding name for TPT
    • getTptPort

      public String getTptPort()
      Returns:
      The port of the RMI registry
    • setTptPort

      @DataBoundSetter public void setTptPort(String tptPort)
      Parameters:
      tptPort - The port of the RMI registry
    • getArguments

      public String 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

      @DataBoundSetter public void setArguments(String arguments)
    • getTptStartUpWaitTime

      public String getTptStartUpWaitTime()
      Returns:
      The time waited before trying to get the API handle after starting TPT
    • setTptStartUpWaitTime

      @DataBoundSetter public void setTptStartUpWaitTime(String tptStartUpWaitTime)
      Parameters:
      tptStartUpWaitTime - the time waited before trying to get the API handle after starting TPT
    • getExecutionConfiguration

      public List<JenkinsConfiguration> 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

      public String getJUnitreport()
      Report dir (optional).
      Returns:
      The directory, where to store the results, can be null.
    • setjUnitreport

      @DataBoundSetter public void setjUnitreport(String jUnitreport)
      Parameters:
      jUnitreport - The directory, where to store the results, can be null.
    • 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 interface SimpleBuildStep
      Throws:
      InterruptedException
      IOException
    • performWithoutWorkerJobs

      public boolean performWithoutWorkerJobs(Run<?,?> run, FilePath workspace, Launcher launcher, TaskListener listener, EnvVars environment, ArrayList<JenkinsConfiguration> configs) throws InterruptedException, IOException
      Get the required data to create a TptPluginSingleJobExecutor 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 build
      launcher - The launcher
      listener - The listener
      environment - The map of envrionment varibales and their value
      configs - The configs with unresolved $-variables
      Returns:
      true if it was possible to execute the TptPluginSingleJobExecutor.
      Throws:
      InterruptedException - If thread was interrupted
      IOException
    • performAsDistributingJob

      public boolean performAsDistributingJob(Run<?,?> build, FilePath workspace, Launcher launcher, TaskListener listener, EnvVars environment, ArrayList<JenkinsConfiguration> configs) throws InterruptedException
      Get the required data to create a TptPluginDistributingJobExecutor and excecutes it. It is called when there are distributed builds.
      Parameters:
      build - The current Jenkins build
      launcher - The launcher
      listener - The listener
      environment - The map of envrionment varibales and their value
      configs - 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

      public TptPlugin.DescriptorImpl getDescriptor()
      Specified by:
      getDescriptor in interface Describable<Builder>
      Overrides:
      getDescriptor in class Builder