com.atlassian.jira.webtest.framework.core.condition
Class AbstractTimedCondition

java.lang.Object
  extended by com.atlassian.jira.webtest.framework.core.AbstractPollingQuery
      extended by com.atlassian.jira.webtest.framework.core.condition.AbstractTimedCondition
All Implemented Interfaces:
ClockAware, TimedCondition, PollingQuery
Direct Known Subclasses:
AbstractSeleniumTimedCondition

@NotThreadSafe
public abstract class AbstractTimedCondition
extends AbstractPollingQuery
implements TimedCondition, ClockAware

Abstract condition that implements by(long) in terms of TimedCondition.now() (to implement by derived classes) and a configured interval between attempts to evaluate TimedCondition.now().

Since:
v4.3

Field Summary
 
Fields inherited from class com.atlassian.jira.webtest.framework.core.AbstractPollingQuery
defaultTimeout, interval
 
Constructor Summary
protected AbstractTimedCondition(com.atlassian.core.util.Clock clock, long defTimeout, long interval)
           
protected AbstractTimedCondition(long defTimeout, long interval)
           
protected AbstractTimedCondition(PollingQuery other)
           
 
Method Summary
 boolean by(long timeout)
          Evaluate the condition by given timeout.
 boolean byDefaultTimeout()
          Evaluate the condition by a timeout deemed default by the condition in the given test context.
 com.atlassian.core.util.Clock clock()
          Clock used by this instance.
 
Methods inherited from class com.atlassian.jira.webtest.framework.core.AbstractPollingQuery
defaultTimeout, interval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.webtest.framework.core.condition.TimedCondition
now
 
Methods inherited from interface com.atlassian.jira.webtest.framework.core.PollingQuery
defaultTimeout, interval
 

Constructor Detail

AbstractTimedCondition

protected AbstractTimedCondition(com.atlassian.core.util.Clock clock,
                                 long defTimeout,
                                 long interval)

AbstractTimedCondition

protected AbstractTimedCondition(long defTimeout,
                                 long interval)

AbstractTimedCondition

protected AbstractTimedCondition(PollingQuery other)
Method Detail

by

public final boolean by(long timeout)
Description copied from interface: TimedCondition
Evaluate the condition by given timeout. That is, return true as soon as the condition is true, otherwise return false when the given timeout expires.

Specified by:
by in interface TimedCondition
Parameters:
timeout - timeout in milliseconds (must be greater than 0)
Returns:
true, if the underlying condition evaluates to true before the timeout expires

byDefaultTimeout

public final boolean byDefaultTimeout()
Description copied from interface: TimedCondition
Evaluate the condition by a timeout deemed default by the condition in the given test context.

Specified by:
byDefaultTimeout in interface TimedCondition
Returns:
true, if the underlying condition evaluates to true before the default timeout expires

clock

public com.atlassian.core.util.Clock clock()
Description copied from interface: ClockAware
Clock used by this instance.

Specified by:
clock in interface ClockAware
Returns:
clock


Copyright © 2002-2012 Atlassian. All Rights Reserved.