Modified:
trunk/smart-load-test/smart-load-test-engine-impl/src/test/java/com/smartitengineering/loadtest/engine/impl/DummyTestCase.java
Log:
Add support for configurable sleep duration in dummy test case
Previously sleep duration wasn't configurable but for loadtest engine test
configurable would be required and thus this change is introduced.
Signed-off-by: Imran M Yousuf <imyo...@smartitengineering.com>
Modified:
trunk/smart-load-test/smart-load-test-engine-impl/src/test/java/com/smartitengineering/loadtest/engine/impl/DummyTestCase.java
==============================================================================
---
trunk/smart-load-test/smart-load-test-engine-impl/src/test/java/com/smartitengineering/loadtest/engine/impl/DummyTestCase.java
(original)
+++
trunk/smart-load-test/smart-load-test-engine-impl/src/test/java/com/smartitengineering/loadtest/engine/impl/DummyTestCase.java
Wed Oct 29 03:58:44 2008
@@ -18,6 +18,7 @@
package com.smartitengineering.loadtest.engine.impl;
import java.util.Map;
+import java.util.Properties;
/**
*
@@ -27,12 +28,26 @@
extends AbstractTestCase {
private int sleepTime = 10;
+
+ public static final String SLEEP_TIME_PROP
= "com.smartitengineering.loadtest.dummyTestCase.sleep";
public DummyTestCase() {
}
public DummyTestCase(int sleepTime) {
this.sleepTime = sleepTime;
+ }
+
+ public DummyTestCase(Properties properties) {
+ if(properties != null && properties.contains(SLEEP_TIME_PROP)) {
+ String time = properties.getProperty(SLEEP_TIME_PROP);
+ try {
+ sleepTime = Integer.parseInt(time);
+ }
+ catch(Exception ex) {
+ sleepTime = 10;
+ }
+ }
}
@Override