public class TotalTestRunnerUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TotalTestRunnerUtils.GetRemoteUTF8FileContents
Returns a UTF8 string of the remote file.
|
Modifier and Type | Field and Description |
---|---|
static String |
TTT_CLI_200401 |
static String |
TTT_CLI_200501 |
static String |
TTT_MINIMUM_CLI_VERSION |
static String |
TTT_NEW_EXTENSIONS_CLI_VERSION |
static String |
TTT_OUTPUTFOLDER_CLI_VERSION |
Constructor and Description |
---|
TotalTestRunnerUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
escapeForScript(String input)
Returns an escaped version of the given input String for a Batch or Shell script.
|
static hudson.FilePath |
getCLIScriptPath(hudson.Launcher launcher,
hudson.model.TaskListener listener,
String fileSeparator,
String osScriptFile)
Returns the path to the script to execute Total Test CLI
|
static hudson.FilePath |
getCLIScriptPath(hudson.Launcher launcher,
hudson.model.TaskListener listener,
String fileSeparator,
String osScriptFile,
String minCLIRelease)
Returns the path to the script to execute Total Test CLI
|
static String |
getCLIVersion(hudson.Launcher launcher,
String remoteFileSeparator)
Returns the version of the Total Test CLI
|
static String |
getHost(String hostPort)
Gets the host name;
|
static com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials |
getLoginInformation(hudson.model.Item project,
String credentialsId)
Retrieves login information given a credential ID
|
static String |
getPort(String hostPort)
Gets the port for the host connection.
|
static String |
getTopaWorkbenchCLIPath(hudson.Launcher launcher)
Returns the path of the Topaz Workbench CLI, as defined in the global
Jenkins' System settings.
|
static boolean |
isMinimumRelease(hudson.Launcher launcher,
hudson.model.TaskListener listener,
String remoteFileSeparator,
String versionNumber)
Returns if the Total Test CLI is greater or equal to the passed version.
|
static boolean |
isSpecicalTestName(String testName)
Checks if the specified test name is ALL_SCENARIOS or ALL_SUITES
|
static boolean |
isTestNameList(String testSuiteEntry)
Checks if the test suite entry is a list of test scenario/suite names.
|
static void |
logJenkinsAndPluginVersion(hudson.model.TaskListener listener)
Logs the Jenkins and Total Test Plugin versions
|
static boolean |
usesDefaultOutputFolder(hudson.Launcher launcher,
hudson.model.TaskListener listener,
String remoteFileSeparator)
Returns if the Total Test CLI will use the default Output folder
|
static boolean |
usesNewFileExtensions(hudson.Launcher launcher,
hudson.model.TaskListener listener,
String remoteFileSeparator)
Returns if the Total Test CLI will use the defulat Output folder
|
static void |
validateHostPort(hudson.model.TaskListener listener,
String hostPortValue)
Validate that there is a host and port defined.
|
public static final String TTT_MINIMUM_CLI_VERSION
public static final String TTT_NEW_EXTENSIONS_CLI_VERSION
public static final String TTT_OUTPUTFOLDER_CLI_VERSION
public static final String TTT_CLI_200401
public static final String TTT_CLI_200501
public static String getHost(String hostPort)
hostPort
- A string containing host:port.String
the host namepublic static String getPort(String hostPort)
hostPort
- A string containing host:port.String
the portpublic static com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials getLoginInformation(hudson.model.Item project, String credentialsId)
project
- the Jenkins projectcredentialsId
- The credendtial id for the user.public static void validateHostPort(hudson.model.TaskListener listener, String hostPortValue)
listener
- Task listenerhostPortValue
- The host and port. Format(host:port)public static String escapeForScript(String input)
input
- the String
to escapeString
public static boolean isSpecicalTestName(String testName)
The check is case insensitive.
testName
- The test name to check.true
if either ALL_SCENARIOS or ALL_SUITES was specified, otherwise false
.public static boolean isTestNameList(String testSuiteEntry)
testSuiteEntry
- The test suite entry to check.true
if the entry is a list, otherwise false
public static void logJenkinsAndPluginVersion(hudson.model.TaskListener listener)
listener
- An instance of TaskListener
for the task.public static String getTopaWorkbenchCLIPath(hudson.Launcher launcher)
launcher
- An instance Launcher
for launching the script.public static hudson.FilePath getCLIScriptPath(hudson.Launcher launcher, hudson.model.TaskListener listener, String fileSeparator, String osScriptFile) throws IOException, InterruptedException
launcher
- An instance Launcher
for launching the script.listener
- An instance of TaskListener
for the task.fileSeparator
- The file separator for the system on which the script will run.osScriptFile
- The name of the operating system dependent script file to run.FilePath
for the CLI directoryIOException
- If the CLI directory does not exist.InterruptedException
- If unable to get CLI directory.public static hudson.FilePath getCLIScriptPath(hudson.Launcher launcher, hudson.model.TaskListener listener, String fileSeparator, String osScriptFile, String minCLIRelease) throws IOException, InterruptedException
launcher
- An instance Launcher
for launching the script.listener
- An instance of TaskListener
for the task.fileSeparator
- The file separator for the system on which the script will run.osScriptFile
- The name of the operating system dependent script file to run.minCLIRelease
- The minimum CLI release required to run the script.FilePath
for the CLI directoryIOException
- If the CLI directory does not exist.InterruptedException
- If unable to get CLI directory.public static String getCLIVersion(hudson.Launcher launcher, String remoteFileSeparator) throws IOException, InterruptedException
launcher
- The machine that the files will be checked out.remoteFileSeparator
- The remote file separatorFilePath
for the CLI directoryIOException
- If the CLI directory does not exist.InterruptedException
- If unable to get CLI directory.public static boolean usesDefaultOutputFolder(hudson.Launcher launcher, hudson.model.TaskListener listener, String remoteFileSeparator)
launcher
- The machine that the files will be checked out.listener
- An instance of TaskListener
for the task.remoteFileSeparator
- The remote file separatorpublic static boolean usesNewFileExtensions(hudson.Launcher launcher, hudson.model.TaskListener listener, String remoteFileSeparator)
launcher
- The machine that the files will be checked out.listener
- An instance of TaskListener
for the task.remoteFileSeparator
- The remote file separatorpublic static boolean isMinimumRelease(hudson.Launcher launcher, hudson.model.TaskListener listener, String remoteFileSeparator, String versionNumber)
launcher
- The machine that the files will be checked out.listener
- An instance of TaskListener
for the task.remoteFileSeparator
- The remote file separatorversionNumber
- The minimum Total Test CLI version number to check against.true
if this node supports using the local configuration directory, otherwise false
.Copyright © 2016–2023. All rights reserved.