java.lang.Object
de.tracetronic.jenkins.plugins.ecutest.tool.client.AbstractToolClient
de.tracetronic.jenkins.plugins.ecutest.tool.client.TSClient
All Implemented Interfaces:
ToolClient

public class TSClient extends AbstractToolClient
Client to start and stop the Tool-Server via command line execution.
  • Field Details

    • DEFAULT_TCP_PORT

      public static final int DEFAULT_TCP_PORT
      Defines the default port used for TCP communication with the Tool-Server.
      See Also:
  • Constructor Details

    • TSClient

      public TSClient(String toolName, String installPath, int timeout, String toolLibsIniPath, int tcpPort)
      Instantiates a new TSClient.
      Parameters:
      toolName - the tool name identifying the chosen ETInstallation.
      installPath - the Tool-Server install path
      timeout - the timeout
      toolLibsIniPath - the alternative ToolLibs.ini path
      tcpPort - the alternative TCP port
    • TSClient

      public TSClient(String toolName, int timeout)
      Instantiates a new TSClient.
      Parameters:
      toolName - the tool name identifying the chosen ETInstallation.
      timeout - the timeout
  • Method Details

    • checkProcesses

      public static List<String> checkProcesses(Launcher launcher, boolean kill) throws IOException, InterruptedException
      Checks already opened Tool-Server instances.
      Parameters:
      launcher - the launcher
      kill - specifies whether to task-kill the running processes
      Returns:
      list of found processes, can be empty but never null
      Throws:
      IOException - signals that an I/O exception has occurred
      InterruptedException - if the current thread is interrupted while waiting for the completion
    • getToolLibsIniPath

      public String getToolLibsIniPath()
    • getTcpPort

      public int getTcpPort()
    • start

      public boolean start(boolean checkProcesses, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException
      Description copied from interface: ToolClient
      Starts a tool.
      Parameters:
      checkProcesses - specifies whether to check open processes after tear down
      workspace - the workspace
      launcher - the launcher
      listener - the listener
      Returns:
      true if successful, false otherwise
      Throws:
      IOException - signals that an I/O exception has occurred
      InterruptedException - if the build gets interrupted
    • stop

      public boolean stop(boolean checkProcesses, FilePath workspace, Launcher launcher, TaskListener listener) throws InterruptedException, IOException
      Description copied from interface: ToolClient
      Stops a tool.
      Parameters:
      checkProcesses - specifies whether to check open processes after tear down
      workspace - the workspace
      launcher - the launcher
      listener - the listener
      Returns:
      true if successful, false otherwise
      Throws:
      InterruptedException - if the build gets interrupted
      IOException - signals that an I/O exception has occurred
    • restart

      public boolean restart(boolean checkProcesses, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException
      Description copied from interface: ToolClient
      Restarts a tool.
      Parameters:
      checkProcesses - specifies whether to check open processes after tear down
      workspace - the workspace
      launcher - the launcher
      listener - the listener
      Returns:
      true if successful, false otherwise
      Throws:
      IOException - signals that an I/O exception has occurred
      InterruptedException - if the build gets interrupted
    • createCmdLine

      protected ArgumentListBuilder createCmdLine()
      Description copied from class: AbstractToolClient
      Creates the command line string for a process invocation.
      Specified by:
      createCmdLine in class AbstractToolClient
      Returns:
      the ArgumentListBuilder