public final class TestGridUtil extends Object
| Constructor and Description |
|---|
TestGridUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
deriveScenarioArtifactPath(TestScenario testScenario,
String fileName)
Derives the relative path of a scenario-artifact.
|
static String |
deriveTestGridLogFilePath(String productName,
String logFileName)
Returns the path of the log file.
|
static String |
deriveTestPlanDirName(TestPlan testPlan)
Returns the test-plan directory name based on the test-plan content.
|
static String |
deriveTestRunLogFilePath(TestPlan testPlan)
Returns the path of the test-run log file.
|
static String |
executeCommand(String command,
File workingDirectory)
Deprecated.
|
static String |
executeCommand(String command,
File workingDirectory,
DeploymentCreationResult deploymentCreationResult)
Deprecated.
|
static Path |
getConfigFilePath()
Returns the path of config.properties.
|
static String |
getDeploymentPatternName(TestPlan testPlan)
Return the deployment pattern name under the DeploymentConfig of a
TestPlan. |
static String |
getParameterString(String fileInput,
Properties properties)
This method builds and returns the parameter string from given properties.
|
static String |
getTestGridHomePath()
Returns the path of the test grid home.
|
static Path |
getTestPlanDirectory()
Returns the directory location where the test-plans are stored.
|
static Path |
getTestRunWorkspace(TestPlan testPlan)
Returns the directory location where the test run artifacts resides relative to testgrid.home.
|
static Path |
getTestRunWorkspace(TestPlan testPlan,
boolean relative)
Returns the directory location where the test run artifacts resides.
|
static TestPlan |
toTestPlanEntity(DeploymentPattern deploymentPattern,
TestPlan testPlan)
This method generates TestPlan object model that from the given input parameters.
|
@Deprecated public static String executeCommand(String command, File workingDirectory) throws CommandExecutionException
ShellExecutor.executeCommand(String) instead.
Executes a command.
Used to executing a script in a given working directory.command - String Command to be executed.workingDirectory - File Directory the command is executed.CommandExecutionException - When there is an error executing the command.@Deprecated public static String executeCommand(String command, File workingDirectory, DeploymentCreationResult deploymentCreationResult) throws CommandExecutionException
ShellExecutor.executeCommand(String) instead.
Executes a command.
Used to execute a script with given deployment details as environment variables.command - Command to execute.workingDirectory - Directory the command is executed.deploymentCreationResult - Deployment creation output.CommandExecutionException - When there is an error executing the command.public static String getTestGridHomePath()
public static Path getTestPlanDirectory() throws IOException
IOException - thrown when error on calculating test plan artifacts directorypublic static Path getTestRunWorkspace(TestPlan testPlan) throws TestGridException
testPlan - test plan for getting the test run artifacts locationTestGridException - thrown when error on calculating test run artifacts directorypublic static Path getTestRunWorkspace(TestPlan testPlan, boolean relative) throws TestGridException
testPlan - test plan for getting the test run artifacts locationrelative - Whether the path need to be returned relative to testgrid.home or not.TestGridException - thrown when error on calculating test run artifacts directorypublic static String getParameterString(String fileInput, Properties properties)
properties - Properties with required paramters as key value pairspublic static TestPlan toTestPlanEntity(DeploymentPattern deploymentPattern, TestPlan testPlan) throws CommandExecutionException
deploymentPattern - deployment patterntestPlan - testPlan objectCommandExecutionExceptionpublic static String getDeploymentPatternName(TestPlan testPlan)
TestPlan.
If not found, return the provisioner name under Infrastructure.testPlan - the test-plan configpublic static Path getConfigFilePath() throws IOException
IOException - for interrupted I/O operationspublic static String deriveTestGridLogFilePath(String productName, String logFileName)
productName - product namepublic static String deriveScenarioArtifactPath(TestScenario testScenario, String fileName) throws TestGridException
testScenario - test-scenario of the artifactfileName - name of the artifactTestGridExceptionpublic static String deriveTestRunLogFilePath(TestPlan testPlan) throws TestGridException
testPlan - test-planTestGridExceptionpublic static String deriveTestPlanDirName(TestPlan testPlan) throws TestGridException
testPlan - test-planTestGridExceptionCopyright © 2018 WSO2. All rights reserved.