Package com.piketec.jenkins.plugins.tpt
Class TptApiAccess
- java.lang.Object
-
- com.piketec.jenkins.plugins.tpt.TptApiAccess
-
public class TptApiAccess extends Object
Since the TPT API should be used only on the localshost and not via a remote connection, all API calls are done within Callables. This class provides utility methods to start the Callables.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Boolean
executeTestsOnWorker(FilePath tptFilePath, String executionConfigName, String testSetName, FilePath workerJobReportPath, FilePath workerJobDataPath, List<String> testSetList)
Executes all test cases named intestSetList
as a sub set of the given test set.GetTestCasesCallableResult
getTestCases(FilePath tptFilePath, String executionConfigName, String testSet)
Get all test cases for the given test set.Boolean
runOverviewReport(FilePath tptFilePath, String executionConfigName, String testSet, FilePath reportPath, FilePath testDataPath)
Creates an overview report for already available test data.
-
-
-
Constructor Detail
-
TptApiAccess
public TptApiAccess(Launcher launcher, TptLogger logger, FilePath[] exePaths, List<String> arguments, int tptPort, String tptBindingName, long tptStartupWaitTime)
Provide all information that is needed to establish an TPT API connection. This information is needed for any Callable that is called in later methods, so to reduce parameters in these methods, get them here already.- Parameters:
launcher
- The launcherlogger
- for dumping messagesexePaths
- paths to the tpt.exe files, usually set in the Jenkins UItptPort
- port that the TPT API should use to connect.tptBindingName
- binding name that the TPT API should use to connect.tptStartupWaitTime
- time that Jenkins waits for TPT to start up if it is not running already
-
-
Method Detail
-
getTestCases
@CheckForNull public GetTestCasesCallableResult getTestCases(FilePath tptFilePath, String executionConfigName, String testSet) throws InterruptedException
Get all test cases for the given test set. If the test set isnull
or empty, the test sets of the execution configuration are evaluated.- Parameters:
tptFilePath
- tpt file from which to get the test casesexecutionConfigName
- execution configurationtestSet
- test set from which to get the test cases- Returns:
- a list of test case names for the given settings and the total test case count
- Throws:
InterruptedException
- If thread was interrupted
-
runOverviewReport
public Boolean runOverviewReport(FilePath tptFilePath, String executionConfigName, String testSet, FilePath reportPath, FilePath testDataPath) throws InterruptedException
Creates an overview report for already available test data.- Parameters:
tptFilePath
- - tpt file for which the overview report should be builtexecutionConfigName
- - execution configuration that was executedtestSet
- - test set that was executedreportPath
- - path to the folder where the test case reports can be found and the overview report should be puttestDataPath
- - path to the test data that is needed to build the overview report- Returns:
- true if the report generation was successful, false otherwise.
- Throws:
InterruptedException
- If thread was interrupted
-
executeTestsOnWorker
public Boolean executeTestsOnWorker(FilePath tptFilePath, String executionConfigName, String testSetName, FilePath workerJobReportPath, FilePath workerJobDataPath, List<String> testSetList) throws InterruptedException
Executes all test cases named intestSetList
as a sub set of the given test set.- Parameters:
tptFilePath
- - tpt file that should be executedexecutionConfigName
- - execution configuration that should be executedtestSetName
- - test set that should be executedworkerJobReportPath
- - path to where the report shall be putworkerJobDataPath
- - path to where the test data shall be puttestSetList
- The list of test cases to execute- Returns:
- true if the execution was successful, false otherwise.
- Throws:
InterruptedException
- If thread was interrupted
-
-