Outputable
, Timeoutable
, Waitable
WindowWaiter
public class Waiter extends java.lang.Object implements Waitable, Timeoutable, Outputable
Modifier | Constructor | Description |
---|---|---|
protected |
Waiter() |
Can be used from subclass.
|
|
Waiter(Waitable w) |
Constructor.
|
Modifier and Type | Method | Description |
---|---|---|
java.lang.Object |
actionProduced(java.lang.Object obj) |
Checks if wait criteria have been met.
|
protected java.lang.String |
getActionProducedMessage(long timeSpent,
java.lang.Object result) |
Returns message to be printed when waiting has been successfully finished.
|
java.lang.String |
getDescription() |
Returns description.
|
protected java.lang.String |
getGoldenActionProducedMessage() |
Returns message to be printed int golden output when waiting has been successfully finished.
|
protected java.lang.String |
getGoldenTimeoutExpiredMessage() |
Returns message to be printed int golden output when waiting timeout has been expired.
|
protected java.lang.String |
getGoldenWaitingStartedMessage() |
Returns message to be printed int golden output before waiting start.
|
TestOut |
getOutput() |
Returns print output streams or writers.
|
protected java.lang.String |
getTimeoutExpiredMessage(long timeSpent) |
Returns message to be printed when waiting timeout has been expired.
|
Timeouts |
getTimeouts() |
Return current timeouts.
|
protected java.lang.String |
getWaitingStartedMessage() |
Returns message to be printed before waiting start.
|
void |
setOutput(TestOut out) |
Defines print output streams or writers.
|
void |
setTimeouts(Timeouts timeouts) |
Defines current timeouts.
|
protected long |
timeFromStart() |
Returns time from waiting start.
|
java.lang.Object |
waitAction(java.lang.Object waitableObject) |
Waits for not null result of actionProduced method of Waitable implementation passed into constructor.
|
public Waiter(Waitable w)
w
- Waitable object defining waiting criteria.protected Waiter()
public void setTimeouts(Timeouts timeouts)
setTimeouts
in interface Timeoutable
timeouts
- A collection of timeout assignments.Timeoutable
,
Timeouts
,
getTimeouts()
public Timeouts getTimeouts()
getTimeouts
in interface Timeoutable
Timeoutable
,
Timeouts
,
setTimeouts(org.netbeans.jemmy.Timeouts)
public void setOutput(TestOut out)
setOutput
in interface Outputable
out
- Identify the streams or writers used for print output.Outputable
,
TestOut
,
getOutput()
public TestOut getOutput()
getOutput
in interface Outputable
Outputable
,
TestOut
,
setOutput(org.netbeans.jemmy.TestOut)
public java.lang.Object waitAction(java.lang.Object waitableObject) throws java.lang.InterruptedException
waitableObject
- Object to be passed into actionProduced method.TimeoutExpiredException
java.lang.InterruptedException
public java.lang.Object actionProduced(java.lang.Object obj)
Waitable
actionProduced
in interface Waitable
obj
- Waitable
public java.lang.String getDescription()
Waitable
getDescription
in interface Waitable
Waitable
protected java.lang.String getWaitingStartedMessage()
protected java.lang.String getTimeoutExpiredMessage(long timeSpent)
timeSpent
- time from waiting start (milliseconds)protected java.lang.String getActionProducedMessage(long timeSpent, java.lang.Object result)
timeSpent
- time from waiting start (milliseconds)result
- result of Waitable.actionproduced method.protected java.lang.String getGoldenWaitingStartedMessage()
protected java.lang.String getGoldenTimeoutExpiredMessage()
protected java.lang.String getGoldenActionProducedMessage()
protected long timeFromStart()