Author: lzoubek(a)redhat.com
Date: 2011-08-22 08:54:15 -0400 (Mon, 22 Aug 2011)
New Revision: 34138
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/Timing.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java
Log:
botext: delay multiplier can be now defined via sys property
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/Timing.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/Timing.java 2011-08-22
12:53:31 UTC (rev 34137)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/Timing.java 2011-08-22
12:54:15 UTC (rev 34138)
@@ -1,16 +1,30 @@
package org.jboss.tools.ui.bot.ext;
+import org.apache.log4j.Logger;
+import org.jboss.tools.ui.bot.ext.config.TestConfigurator;
+
/**
- *
+ * This class abstracts waiting time for bot. These methods should be used everywhere,
where we
+ * are waiting for something. Time can be then globally adjusted
+ * using @link {@link TestConfigurator#SWTBOTEXT_DELAY_MULTIPLIER} system property
* @author lzoubek
*
*/
public class Timing {
+ private static final Logger log = Logger.getLogger(Timing.class);
+
public static double multiplier=1.0;
static {
- // TODO determine or auto set multiplier
+ try {
+ multiplier =
Double.parseDouble(System.getProperty(TestConfigurator.SWTBOTEXT_DELAY_MULTIPLIER,
"1.0"));
+ if (multiplier<0) {
+ multiplier=1.0;
+ }
+ } catch (Exception ex) {
+ log.error("Unable to parse TestConfigurator.SWTBOTEXT_DELAY_MULTIPLIER",
ex);
+ }
}
public static int time3S() {
return (int) Math.round(3000*multiplier);
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java 2011-08-22
12:53:31 UTC (rev 34137)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java 2011-08-22
12:54:15 UTC (rev 34138)
@@ -13,6 +13,7 @@
import java.util.regex.Pattern;
import org.apache.log4j.Logger;
+import org.jboss.tools.ui.bot.ext.Timing;
import org.jboss.tools.ui.bot.ext.config.Annotations.DB;
import org.jboss.tools.ui.bot.ext.config.Annotations.ESB;
import org.jboss.tools.ui.bot.ext.config.Annotations.JBPM;
@@ -74,6 +75,10 @@
* path to property file which contains either 1 configuration or properties [config
name]=[abs path to config property file]
*/
public static final String SWTBOT_TEST_PROPERTIES_FILE =
"swtbot.test.properties.file";
+ /**
+ * a double number for multiply waiting see @link {@link Timing}
+ */
+ public static final String
SWTBOTEXT_DELAY_MULTIPLIER="swtbotext.delay.multiplier";
public static Properties multiProperties = new Properties();
public static TestConfiguration currentConfig;
static {
@@ -158,6 +163,7 @@
log.info(" * Defaults loaded");
}
}
+ log.info("Default Timing mulitiplier is set to "+Timing.multiplier);
}
/**
Show replies by date