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 |
deriveTestGridLogFilePath(String productName,
String logFileName)
Returns the path of the log file.
|
static String |
deriveTestPlanDirName(TestPlan testPlan)
Deprecated.
|
static String |
deriveTestPlanId(TestPlan testPlan,
InfrastructureCombination infraCombination,
DeploymentPattern deploymentPattern)
Returns the test-plan id based on the test-plan and the properties relevant to it.
|
static String |
deriveTestRunLogFilePath(TestPlan testPlan,
Boolean truncated)
Returns the path of the test-run log file.
|
static int |
fibonacci(int index)
Returns the number in fibonacci series for a given position.
|
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 |
getDashboardURLFor(TestPlan testPlan)
Generate the Dashboard URL for the given test plan
|
static String |
getDeploymentPatternName(TestPlan testPlan)
Return the deployment pattern name under the DeploymentConfig of a
TestPlan. |
static String |
getHashValue(Path filePath)
Returns the MD5 hash value of a given file.
|
static List<InfrastructureParameter> |
getInfraParamsOfTestPlan(Set<InfrastructureValueSet> valueSets,
TestPlan testPlan)
Read the infra params from the infrastructure_parameter db table, and return
the list of infra params used in the given test plan.
|
static String |
getParameterString(String fileInput,
Properties properties)
Deprecated.
Parameter parsing should only happen via the databuckets
|
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 |
getTestPlanRequestDirectory()
Returns the directory location where the test-plan requests are stored.
|
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 List<InfrastructureParameter> |
parseInfraParameters(Set<InfrastructureValueSet> valueSets,
String infraParameters)
Parse infrastructure parameters to its display values.
|
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.
|
static TestPlan |
updateFinalTestPlanPhase(TestPlan testPlan) |
public static String getTestGridHomePath()
public static Path getTestPlanRequestDirectory() throws IOException
IOException - thrown when error on calculating test plan artifacts directorypublic 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)
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 deriveTestPlanId(TestPlan testPlan, InfrastructureCombination infraCombination, DeploymentPattern deploymentPattern)
testPlan - test-planinfraCombination - infrastructure combination of the test-plandeploymentPattern - deployment-pattern of the test-plan@Deprecated public static String deriveTestPlanDirName(TestPlan testPlan)
testPlan - test-planpublic static boolean isDebugMode(TestPlan testPlan)
testPlan - the test planpublic static String getDashboardURLFor(String productName)
productName - the job namepublic static String getDashboardURLFor(TestPlan testPlan)
testPlan - test planpublic static List<InfrastructureParameter> getInfraParamsOfTestPlan(Set<InfrastructureValueSet> valueSets, TestPlan testPlan)
valueSets - infrastructure parameters value settestPlan - test plan to get infrastructure parameterspublic static List<InfrastructureParameter> parseInfraParameters(Set<InfrastructureValueSet> valueSets, String infraParameters)
valueSets - infrastructure parameter value setinfraParameters - inra parameter string to parsepublic static String getHashValue(Path filePath) throws IOException, NoSuchAlgorithmException
filePath - path to fileIOException - if file reading failsNoSuchAlgorithmException - if hash generation failspublic static int fibonacci(int index)
index - position to get the number from fibinacci seriesCopyright © 2019 WSO2. All rights reserved.