Class AbstractTestHelper
- java.lang.Object
-
- hudson.tasks.BuildStepCompatibilityLayer
-
- hudson.tasks.Builder
-
- de.tracetronic.jenkins.plugins.ecutest.test.AbstractTestHelper
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<Builder>
,BuildStep
- Direct Known Subclasses:
AbstractExportBuilder
,AbstractImportBuilder
,AbstractTestBuilder
public abstract class AbstractTestHelper extends Builder
Helper class providing common used functionalities for all test related task builders.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractTestHelper.GetSettingCallable
Callable
providing remote access to get a ecu.test workspace setting value via COM.-
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
BuildStep.PublisherList
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
-
-
Constructor Summary
Constructors Constructor Description AbstractTestHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
checkETInstance(Launcher launcher, TaskListener listener, boolean kill)
Checks already opened ecu.test instances.protected boolean
checkTSInstance(Launcher launcher, boolean kill)
Checks already opened Tool-Server instances.protected boolean
closeETInstance(Launcher launcher, TaskListener listener)
Tries to close already opened ecu.test instances via COM first.protected String
getConfigDir(Launcher launcher, TaskListener listener)
Gets the configuration directory of the current ecu.test workspace by querying the settings file via COM.protected String
getConfigFilePath(String configFile, String configDir, Launcher launcher, TaskListener listener)
Gets the absolute configuration file path.String
getDefaultConfigDir()
String
getDefaultPackagesDir()
protected String
getPackagesDir(Launcher launcher, TaskListener listener)
Gets the packages directory of the current ecu.test workspace by querying the settings file via COM.protected String
getTestFilePath(String testFile, String pkgDir, Launcher launcher, TaskListener listener)
Gets the absolute test file path.protected int
getTestId(Run<?,?> run)
Gets the test identifier by the size ofTestEnvInvisibleAction
s already added to the build.-
Methods inherited from class hudson.tasks.Builder
all, getDescriptor, getRequiredMonitorService, prebuild
-
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectAction, getProjectActions, perform, perform, prebuild
-
-
-
-
Method Detail
-
getDefaultPackagesDir
public String getDefaultPackagesDir()
-
getDefaultConfigDir
public String getDefaultConfigDir()
-
checkETInstance
protected boolean checkETInstance(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:
true
if processes found,false
otherwise- Throws:
IOException
- signals that an I/O exception has occurredInterruptedException
- if the current thread is interrupted while waiting for the completion
-
closeETInstance
protected boolean closeETInstance(Launcher launcher, TaskListener listener) throws IOException, InterruptedException
Tries to close already opened ecu.test instances via COM first. If this is not successful tries to task-kill the running process.- Parameters:
launcher
- the launcherlistener
- the listener- Returns:
true
if processes found,false
otherwise- Throws:
IOException
- signals that an I/O exception has occurredInterruptedException
- if the current thread is interrupted while waiting for the completion
-
checkTSInstance
protected boolean checkTSInstance(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:
true
if processes found,false
otherwise- Throws:
IOException
- signals that an I/O exception has occurredInterruptedException
- if the current thread is interrupted while waiting for the completion
-
getTestId
protected int getTestId(Run<?,?> run)
Gets the test identifier by the size ofTestEnvInvisibleAction
s already added to the build.- Parameters:
run
- the build- Returns:
- the test id
-
getTestFilePath
protected String getTestFilePath(String testFile, String pkgDir, Launcher launcher, TaskListener listener) throws IOException, InterruptedException
Gets the absolute test file path.- Parameters:
testFile
- the expanded test filepkgDir
- the packages directory containing the test filelauncher
- the launcherlistener
- the listener- Returns:
- the absolute test file path
- Throws:
IOException
- signals that an I/O exception has occurredInterruptedException
- if the build gets interrupted
-
getConfigFilePath
protected String getConfigFilePath(String configFile, String configDir, Launcher launcher, TaskListener listener) throws IOException, InterruptedException
Gets the absolute configuration file path.- Parameters:
configFile
- the expanded configuration fileconfigDir
- the expanded configuration directory containing the configuration filelauncher
- the launcherlistener
- the listener- Returns:
- the absolute configuration file path
- Throws:
IOException
- signals that an I/O exception has occurredInterruptedException
- if the build gets interrupted
-
getConfigDir
protected String getConfigDir(Launcher launcher, TaskListener listener) throws InterruptedException
Gets the configuration directory of the current ecu.test workspace by querying the settings file via COM.- Parameters:
launcher
- the launcherlistener
- the listener- Returns:
- the configuration directory
- Throws:
InterruptedException
- if the current thread is interrupted while waiting for the completion
-
getPackagesDir
protected String getPackagesDir(Launcher launcher, TaskListener listener) throws InterruptedException
Gets the packages directory of the current ecu.test workspace by querying the settings file via COM.- Parameters:
launcher
- the launcherlistener
- the listener- Returns:
- the package directory
- Throws:
InterruptedException
- if the current thread is interrupted while waiting for the completion
-
-