Class TSClient
java.lang.Object
de.tracetronic.jenkins.plugins.ecutest.tool.client.AbstractToolClient
de.tracetronic.jenkins.plugins.ecutest.tool.client.TSClient
- All Implemented Interfaces:
ToolClient
Client to start and stop the Tool-Server via command line execution.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Defines the default port used for TCP communication with the Tool-Server. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckProcesses
(Launcher launcher, boolean kill) Checks already opened Tool-Server instances.protected ArgumentListBuilder
Creates the command line string for a process invocation.int
boolean
restart
(boolean checkProcesses, FilePath workspace, Launcher launcher, TaskListener listener) Restarts a tool.boolean
start
(boolean checkProcesses, FilePath workspace, Launcher launcher, TaskListener listener) Starts a tool.boolean
stop
(boolean checkProcesses, FilePath workspace, Launcher launcher, TaskListener listener) Stops a tool.Methods inherited from class de.tracetronic.jenkins.plugins.ecutest.tool.client.AbstractToolClient
getInstallPath, getTimeout, getToolName, launchProcess
-
Field Details
-
DEFAULT_TCP_PORT
public static final int DEFAULT_TCP_PORTDefines 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 newTSClient
.- Parameters:
toolName
- the tool name identifying the chosenETInstallation
.installPath
- the Tool-Server install pathtimeout
- the timeouttoolLibsIniPath
- the alternative ToolLibs.ini pathtcpPort
- the alternative TCP port
-
TSClient
Instantiates a newTSClient
.- Parameters:
toolName
- the tool name identifying the chosenETInstallation
.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 launcherkill
- 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 occurredInterruptedException
- if the current thread is interrupted while waiting for the completion
-
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 downworkspace
- the workspacelauncher
- the launcherlistener
- the listener- Returns:
true
if successful,false
otherwise- Throws:
IOException
- signals that an I/O exception has occurredInterruptedException
- 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 downworkspace
- the workspacelauncher
- the launcherlistener
- the listener- Returns:
true
if successful,false
otherwise- Throws:
InterruptedException
- if the build gets interruptedIOException
- 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 downworkspace
- the workspacelauncher
- the launcherlistener
- the listener- Returns:
true
if successful,false
otherwise- Throws:
IOException
- signals that an I/O exception has occurredInterruptedException
- if the build gets interrupted
-
createCmdLine
Description copied from class:AbstractToolClient
Creates the command line string for a process invocation.- Specified by:
createCmdLine
in classAbstractToolClient
- Returns:
- the
ArgumentListBuilder
-