Class TptApiCallable<S>

  • Type Parameters:
    S - is the return type of the call method, i.e. the type of whatever you want to get from the TPT API. NOTE: This type must be Serializable
    All Implemented Interfaces:
    hudson.remoting.Callable<S,​java.lang.InterruptedException>, java.io.Serializable, org.jenkinsci.remoting.RoleSensitive
    Direct Known Subclasses:
    CleanUpCallable, ExecuteTestsSlaveCallable, GetTestCasesCallable, RunOverviewReportCallable

    public abstract class TptApiCallable<S>
    extends java.lang.Object
    implements hudson.remoting.Callable<S,​java.lang.InterruptedException>
    This class can open a TPT API connection. It is a Callable, which means it will be executed on a Jenkins Agent. This is necessary, because we want to use the TPT API only via localhost and not via another remote connection. Every request that is made to the TPT API extends this class.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      TptApiCallable​(TaskListener listener, int tptPort, java.lang.String tptBindingName, FilePath[] exePaths, java.util.List<java.lang.String> arguments, long startUpWaitTime)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected com.piketec.tpt.api.TptApi getApi()
      Starts TPT if necessary and returns a TPT API connection for the settings given in the constructor
      protected com.piketec.tpt.api.TptApi getApiIfTptIsOpen()
      Only returns the TPT API if TPT is already running.
      TptLogger getLogger()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface hudson.remoting.Callable

        call, getChannelOrFail, getOpenChannelOrFail
      • Methods inherited from interface org.jenkinsci.remoting.RoleSensitive

        checkRoles
    • Constructor Detail

      • TptApiCallable

        public TptApiCallable​(TaskListener listener,
                              int tptPort,
                              java.lang.String tptBindingName,
                              FilePath[] exePaths,
                              java.util.List<java.lang.String> arguments,
                              long startUpWaitTime)
    • Method Detail

      • getLogger

        public TptLogger getLogger()
        Returns:
        a logger that prints its log messages live on the Jenkins Agent
      • getApi

        @Nullable
        protected com.piketec.tpt.api.TptApi getApi()
                                             throws java.lang.InterruptedException
        Starts TPT if necessary and returns a TPT API connection for the settings given in the constructor
        Returns:
        the handle to the api
        Throws:
        java.lang.InterruptedException - If thread was interrupted
      • getApiIfTptIsOpen

        @Nullable
        protected com.piketec.tpt.api.TptApi getApiIfTptIsOpen()
        Only returns the TPT API if TPT is already running. Otherwise it returns null.
        Returns:
        the handle to the api