public final class TestGridUtil extends Object
| Constructor and Description |
|---|
TestGridUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
convertToJsonString(Properties properties)
transform the properties object into a json string.
|
static String |
deriveLogDownloadLocation(TestPlan testPlan)
Returns the path of the directory where log files will be downloaded.
|
static String |
deriveScenarioArtifactPath(TestScenario testScenario,
String fileName)
Derives the relative path of a scenario-artifact.
|
static String |
deriveScenarioOutputPropertyFilePath(TestPlan testPlan)
Returns the path of the scenario outputs property file.
|
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,
Boolean truncated)
Returns the path of the test-run log file.
|
static Path |
getConfigFilePath()
Returns the path of config.properties.
|
static String |
getDashboardURLFor(String productName)
Generate the Dashboard URL for the given product/job name.
|
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 Path |
getSurefireReportsDir(TestPlan testPlan)
Returns the absolute path of the integration test log file.
|
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 Path |
getTestScenarioArtifactPath(TestScenario testScenario) |
static boolean |
isDebugMode(TestPlan testPlan)
Checks whether debug mode is enabled for this test plan or not.
|
static TestPlan |
mergeTestPlans(TestPlan testPlanConfig,
TestPlan testPlanPersisted,
boolean addToConfigYaml)
Copies non existing properties from a persisted test plan to a test plan object generated from the config.
|
static Map<String,String> |
parseInfraParametersString(String infraParams)
Parse the infra param string of
TestPlan.getInfraParameters() into a map of key-value pairs. |
static TestPlan |
toTestPlanEntity(DeploymentPattern deploymentPattern,
TestPlan testPlan)
This method generates TestPlan object model that from the given input parameters.
|
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)
testPlan - test plan for getting the test run artifacts locationrelative - Whether the path need to be returned relative to testgrid.home or not.public static Map<String,String> parseInfraParametersString(String infraParams)
TestPlan.getInfraParameters() into a map of key-value pairs.infraParams - the TestPlan.getInfraParameters()public static String convertToJsonString(Properties properties)
public 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 TestPlan mergeTestPlans(TestPlan testPlanConfig, TestPlan testPlanPersisted, boolean addToConfigYaml)
testPlanConfig - an instance of test plan which is generated from the configtestPlanPersisted - an instance of test plan which is persisted in the dbTestPlan with merged propertiespublic static String getDeploymentPatternName(TestPlan testPlan)
TestPlan.
If not found, return the provisioner name under Infrastructure.testPlan - the test-plan configpublic static Path getConfigFilePath()
public static String deriveTestGridLogFilePath(String productName, String logFileName)
productName - product namepublic static String deriveScenarioArtifactPath(TestScenario testScenario, String fileName)
TESTGRID_HOME/jobs/#name#/builds/#depl_name#_#infra-uuid#_#test-run-num#/#scenario_dir#/#file_name#
testScenario - test-scenario of the artifactfileName - name of the artifactpublic static Path getTestScenarioArtifactPath(TestScenario testScenario)
public static String deriveTestRunLogFilePath(TestPlan testPlan, Boolean truncated)
TESTGRID_HOME/jobs/#name#/builds/#depl_name#_#infra-uuid#_#test-run-num#/test-run.log
testPlan - test-plantruncated - whether the truncated log or the raw log filepublic static Path getSurefireReportsDir(TestPlan testPlan)
DataBucketsHelper.getOutputLocation(TestPlan).testPlan - test-planpublic static String deriveLogDownloadLocation(TestPlan testPlan)
testPlan - TestPlan objectpublic static String deriveScenarioOutputPropertyFilePath(TestPlan testPlan)
testPlan - test-planpublic static String deriveTestPlanDirName(TestPlan testPlan)
testPlan - test-planpublic static boolean isDebugMode(TestPlan testPlan)
testPlan - the test planCopyright © 2018 WSO2. All rights reserved.