aboutsummaryrefslogtreecommitdiff
path: root/bigtop-test-framework
diff options
context:
space:
mode:
authorDasha Boudnik <dasha@wandisco.com>2015-01-07 18:24:08 -0800
committerKonstantin Boudnik <cos@apache.org>2015-01-08 23:39:52 -0800
commit940b6fda26ad655d1f3972ff0b28d2d031a7ce44 (patch)
tree0cf570bba866d1d6ba9ed09b8fbfdbd8252fd45c /bigtop-test-framework
parent4a7b61b9ce4b17ce46429505d8328f82a3a65042 (diff)
BIGTOP-1526. Property file for FailureVars can not be placed to {{/}}
Signed-off-by: Konstantin Boudnik <cos@apache.org>
Diffstat (limited to 'bigtop-test-framework')
-rw-r--r--bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/failures/FailureVars.groovy24
1 files changed, 19 insertions, 5 deletions
diff --git a/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/failures/FailureVars.groovy b/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/failures/FailureVars.groovy
index 3d11507f..d1cb045d 100644
--- a/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/failures/FailureVars.groovy
+++ b/bigtop-test-framework/src/main/groovy/org/apache/bigtop/itest/failures/FailureVars.groovy
@@ -8,14 +8,26 @@ import java.io.IOException;
/**
* This class manages objects, variables, and command line parameter values for cluster failure testing.
* By default, all parameters are off or set to false.
+ *
+ * The system property "failurePropertiesFile" represents the path to the file containing test parameters
+ * and must be set in order to parametrize a test. Failure scenario parameters are:
+ * testhost
+ * testremotehost
+ * runall
+ * servicerestart
+ * servicekill
+ * networkshutdown
+ * service
+ * failuredelay
+ * startdelay
+ * killduration
*/
public class FailureVars {
private final String CRON_SERVICE;
private final int SLEEP_TIME = 100;
private static FailureVars instance = null;
- private String propertyFile = "/failureVars.properties"
- private Boolean useProperties = Boolean.parseBoolean(System.getProperty("useFailureProperties", "false"));
+ private String propertyFile = System.getProperty("failurePropertiesFile");
private String testHost;
private String testRemoteHost;
private String runFailures;
@@ -38,7 +50,7 @@ public class FailureVars {
}
protected FailureVars() {
- if(useProperties) {
+ if(propertyFile != null) {
loadProps();
}
}
@@ -52,7 +64,9 @@ public class FailureVars {
private void loadProps() {
try {
- BufferedReader is = new BufferedReader (new InputStreamReader(getClass().getResourceAsStream(propertyFile)));
+ File pFile = new File(propertyFile);
+ assert(pFile.exists()) : "Failure properties file cannot be read";
+ BufferedReader is = new BufferedReader (new InputStreamReader(getClass(pFile)));
System.out.println("Input Stream Location: " + is);
Properties props = new Properties();
props.load(is);
@@ -69,7 +83,7 @@ public class FailureVars {
killDuration = props.getProperty("killduration", Integer.toString(0));
}
catch(IOException ioe) {
- System.out.println(ioe);
+ System.out.println(ioe.getMessage());
}
}