Class ETClient
java.lang.Object
de.tracetronic.jenkins.plugins.ecutest.tool.client.AbstractToolClient
de.tracetronic.jenkins.plugins.ecutest.tool.client.ETClient
- All Implemented Interfaces:
ToolClient
Client to start and stop ecu.test by either COM or XML-RPC communication.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkConfigStatus
(Launcher launcher, TaskListener listener) Checks whether the currently selected configurations are started.boolean
checkLicense
(Launcher launcher, TaskListener listener) Check license of ecu.test.boolean
checkProcessArchitecture
(String processPath, boolean is64BitJVM, Launcher launcher) Checks the process architecture compatibility between ecu.test and underlying JVM that runs the agent.checkProcesses
(Launcher launcher, TaskListener listener, boolean kill) Checks already opened ecu.test instances.protected ArgumentListBuilder
Creates the command line string for a process invocation.static ToolVersion
getComVersion
(Launcher launcher, TaskListener listener) Gets the COM version of currently running ecu.test instance.boolean
boolean
boolean
restart
(boolean checkProcesses, FilePath workspace, Launcher launcher, TaskListener listener) Restarts a tool.void
setLicenseCheck
(boolean licenseCheck) 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.static boolean
stopProcesses
(Launcher launcher, TaskListener listener, boolean kill) Closes already opened ecu.test instances.boolean
updateUserLibs
(Launcher launcher, TaskListener listener) Updates all user libraries.Methods inherited from class de.tracetronic.jenkins.plugins.ecutest.tool.client.AbstractToolClient
getInstallPath, getTimeout, getToolName, launchProcess
-
Constructor Details
-
ETClient
public ETClient(String toolName, String installPath, String workspaceDir, String settingsDir, int timeout, boolean debugMode) Instantiates a newETClient
.- Parameters:
toolName
- the tool name identifying the chosenETInstallation
.installPath
- the ecu.test install pathworkspaceDir
- the ecu.test workspace directorysettingsDir
- the ecu.test settings directorytimeout
- the timeout to start ecu.testdebugMode
- specifies whether to enable debug mode
-
ETClient
Instantiates a newETClient
.- Parameters:
toolName
- the tool name identifying the chosenETInstallation
.timeout
- the timeout to start ecu.test
-
-
Method Details
-
checkProcesses
public static List<String> checkProcesses(Launcher launcher, TaskListener listener, boolean kill) throws IOException, InterruptedException Checks already opened ecu.test instances.- Parameters:
launcher
- the launcherlistener
- the listenerkill
- 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
-
stopProcesses
public static boolean stopProcesses(Launcher launcher, TaskListener listener, boolean kill) throws IOException, InterruptedException Closes already opened ecu.test instances.- Parameters:
launcher
- the launcherlistener
- the listenerkill
- specifies whether to task-kill the running processes- Returns:
true
if ecu.test instance has been stopped successfully- Throws:
IOException
- signals that an I/O exception has occurredInterruptedException
- if the current thread is interrupted while waiting for the completion
-
getComVersion
public static ToolVersion getComVersion(Launcher launcher, TaskListener listener) throws IOException, InterruptedException Gets the COM version of currently running ecu.test instance.- Parameters:
launcher
- the launcherlistener
- the listener- Returns:
- the COM version
- Throws:
IOException
- signals that an I/O exception has occurredInterruptedException
- if the current thread is interrupted while waiting for the completion
-
checkLicense
public boolean checkLicense(Launcher launcher, TaskListener listener) throws IOException, InterruptedException Check license of ecu.test.- Parameters:
launcher
- the launcherlistener
- the listener- Returns:
true
if ecu.test instance has been stopped successfully- Throws:
IOException
- the io exceptionInterruptedException
- the interrupted exception
-
getWorkspaceDir
-
getSettingsDir
-
isDebugMode
public boolean isDebugMode() -
getVersion
-
getLastTbc
-
getLastTcf
-
isLicenseCheck
public boolean isLicenseCheck() -
setLicenseCheck
public void setLicenseCheck(boolean licenseCheck) -
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
-
checkProcessArchitecture
public boolean checkProcessArchitecture(String processPath, boolean is64BitJVM, Launcher launcher) throws IOException, InterruptedException Checks the process architecture compatibility between ecu.test and underlying JVM that runs the agent. A 64-bit JVM supports both 32-bit and 64-bit ecu.test, while 32-bit JVM is only compatible with 32-bit ecu.test.- Parameters:
processPath
- the full process pathis64BitJVM
- specifies whether the JVM supports 64-bit architecturelauncher
- the launcher- Returns:
true
if architectures are compatible,false
otherwise- Throws:
IOException
- signals that an I/O exception has occurredInterruptedException
- if the current thread is interrupted while waiting for the completion
-
updateUserLibs
public boolean updateUserLibs(Launcher launcher, TaskListener listener) throws IOException, InterruptedException Updates all user libraries.- Parameters:
launcher
- the launcherlistener
- the listener- Returns:
true
if update is successful,false
otherwise- Throws:
IOException
- signals that an I/O exception has occurredInterruptedException
- if the current thread is interrupted while waiting for the completion
-
checkConfigStatus
public boolean checkConfigStatus(Launcher launcher, TaskListener listener) throws IOException, InterruptedException Checks whether the currently selected configurations are started.- Parameters:
launcher
- the launcherlistener
- the listener- Returns:
true
if configurations are started,false
otherwise- Throws:
IOException
- the io exceptionInterruptedException
- the interrupted exception
-