com.atlassian.jira.webtest.framework.gadget
Class GadgetTimedQuery<T>

java.lang.Object
  extended by com.atlassian.jira.webtest.framework.core.context.AbstractWebTestContextAware
      extended by com.atlassian.jira.webtest.framework.gadget.GadgetTimedQuery<T>
All Implemented Interfaces:
WebTestContextAware, PollingQuery, TimedQuery<T>

public class GadgetTimedQuery<T>
extends AbstractWebTestContextAware
implements TimedQuery<T>

TimedQuery switching focus into gadget frame for the time of invocation.

Since:
v4.3

Field Summary
 
Fields inherited from class com.atlassian.jira.webtest.framework.core.context.AbstractWebTestContextAware
context
 
Constructor Summary
GadgetTimedQuery(WebTestContext context, TimedQuery<T> query, Gadget gadget)
           
 
Method Summary
 T by(long timeoutInMillis)
          Evaluate this query by given timeout.
 T by(long timeout, TimeUnit unit)
          Evaluate this query by given timeout.
 T byDefaultTimeout()
          Evaluate this query by a timeout deemed default in the given test context.
 long defaultTimeout()
          Default timeout of this query in the current test context.
 long interval()
          An interval (in milliseconds) that will be used to periodically evaluate the query.
 T now()
          Evaluate this query immediately.
 String toString()
           
 
Methods inherited from class com.atlassian.jira.webtest.framework.core.context.AbstractWebTestContextAware
context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GadgetTimedQuery

public GadgetTimedQuery(WebTestContext context,
                        TimedQuery<T> query,
                        Gadget gadget)
Method Detail

by

public T by(long timeoutInMillis)
Description copied from interface: TimedQuery
Evaluate this query by given timeout. That is, return the expected T as soon as the query evaluates to the expected value, otherwise perform any appropriate operation when the timeout expires (e.g. return real value, null, or throw exception

Specified by:
by in interface TimedQuery<T>
Parameters:
timeoutInMillis - timeout in milliseconds (must be greater than 0)
Returns:
expected value of T, or any suitable value, if the expected value was not returned before timeout expired

by

public T by(long timeout,
            TimeUnit unit)
Description copied from interface: TimedQuery
Evaluate this query by given timeout. That is, return the expected T as soon as the query evaluates to the expected value, otherwise perform any appropriate operation when the timeout expires (e.g. return real value, null, or throw exception

Specified by:
by in interface TimedQuery<T>
Parameters:
timeout - timeout (must be greater than 0)
unit - the unit that the timeout is in
Returns:
expected value of T, or any suitable value, if the expected value was not returned before timeout expired

byDefaultTimeout

public T byDefaultTimeout()
Description copied from interface: TimedQuery
Evaluate this query by a timeout deemed default in the given test context.

Specified by:
byDefaultTimeout in interface TimedQuery<T>
Returns:
expected value of T, or any suitable value, if the expected value was not returned before the default timeout expired
See Also:
PollingQuery.defaultTimeout()

now

public T now()
Description copied from interface: TimedQuery
Evaluate this query immediately.

Specified by:
now in interface TimedQuery<T>
Returns:
current evaluation of the underlying query.

interval

public long interval()
Description copied from interface: PollingQuery
An interval (in milliseconds) that will be used to periodically evaluate the query.

Specified by:
interval in interface PollingQuery
Returns:
evaluation interval of this query.

defaultTimeout

public long defaultTimeout()
Description copied from interface: PollingQuery
Default timeout of this query in the current test context.

Specified by:
defaultTimeout in interface PollingQuery
Returns:
default timeout of this query

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2013 Atlassian. All Rights Reserved.