|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.thoughtworks.selenium.condition.DefaultConditionRunner
public class DefaultConditionRunner
This implementation throws a simple RuntimeException
when the
condition is not met in the waitFor(Condition)
method. More specific
runners are preferred for different testing frameworks. E.g. JUnit tests
would prefer to use JUnitConditionRunner
.
Nested Class Summary | |
---|---|
static class |
DefaultConditionRunner.Log4jMonitor
A Log4j implementation of DefaultConditionRunner.Monitor . |
static interface |
DefaultConditionRunner.Monitor
A DefaultConditionRunner.Monitor can be installed in DefaultConditionRunner as an
open ended way of being notified of certain events. |
static class |
DefaultConditionRunner.NoOpMonitor
A no-op implementation of DefaultConditionRunner.Monitor . |
Nested classes/interfaces inherited from interface com.thoughtworks.selenium.condition.ConditionRunner |
---|
ConditionRunner.Context |
Constructor Summary | |
---|---|
DefaultConditionRunner(DefaultConditionRunner.Monitor monitor,
Selenium selenium,
int interval,
int timeout)
|
|
DefaultConditionRunner(DefaultConditionRunner.Monitor monitor,
Selenium selenium,
int initialDelay,
int interval,
int timeout)
|
|
DefaultConditionRunner(Selenium selenium)
Constructs an instance of this class with reasonable defaults. |
|
DefaultConditionRunner(Selenium selenium,
int interval,
int timeout)
Constructs an instance of this class with a DefaultConditionRunner.NoOpMonitor . |
|
DefaultConditionRunner(Selenium selenium,
int initialDelay,
int interval,
int timeout)
Constructs an instance of this class with a DefaultConditionRunner.NoOpMonitor . |
Method Summary | |
---|---|
protected void |
throwAssertionException(java.lang.String message)
|
protected void |
throwAssertionException(java.lang.String message,
java.lang.Throwable throwable)
|
void |
waitFor(Condition condition)
This method will, every so often, evaluate the given condition 's
Condition.isTrue(ConditionRunner.Context) method, until:
it becomes true, in which case it simply returns
a certain amount of time is passed, in which case it fails by throwing
an failure exception tailored to a given test framework -- e.g. |
void |
waitFor(java.lang.String narrative,
Condition condition)
As above but with an additonal 'should' phrase narrative used in the event of the condition failing to become true |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultConditionRunner(DefaultConditionRunner.Monitor monitor, Selenium selenium, int initialDelay, int interval, int timeout)
selenium
- the selenium to be passed to the Conditions run from within
this runner.initialDelay
- (in millis) how long to wait before the initial test of the conditioninterval
- (in millis) when waiting for a condition, how long to wait
between calls to
Condition.isTrue(com.thoughtworks.selenium.condition.ConditionRunner.Context)
timeout
- (in millis) when waiting for a condition, how long to wait
until we give up.public DefaultConditionRunner(DefaultConditionRunner.Monitor monitor, Selenium selenium, int interval, int timeout)
selenium
- the selenium to be passed to the Conditions run from within
this runner.interval
- (in millis) when waiting for a condition, how long to wait
between calls to
Condition.isTrue(com.thoughtworks.selenium.condition.ConditionRunner.Context)
timeout
- (in millis) when waiting for a condition, how long to wait
until we give up.public DefaultConditionRunner(Selenium selenium, int initialDelay, int interval, int timeout)
DefaultConditionRunner.NoOpMonitor
.
DefaultConditionRunner(Monitor, Selenium, int, int)
public DefaultConditionRunner(Selenium selenium, int interval, int timeout)
DefaultConditionRunner.NoOpMonitor
.
DefaultConditionRunner(Monitor, Selenium, int, int)
public DefaultConditionRunner(Selenium selenium)
DefaultConditionRunner(Monitor, Selenium, int, int)
Method Detail |
---|
public void waitFor(Condition condition)
ConditionRunner
condition
's
Condition.isTrue(ConditionRunner.Context)
method, until:
AssertionFailedError
in the case of JUnit
RuntimeException
and rethrown
waitFor
in interface ConditionRunner
public void waitFor(java.lang.String narrative, Condition condition)
ConditionRunner
waitFor
in interface ConditionRunner
protected void throwAssertionException(java.lang.String message)
protected void throwAssertionException(java.lang.String message, java.lang.Throwable throwable)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |