|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.jemmy.Waiter
public class Waiter
Waits for something defined by Waitable interface to be happened.
Timeouts used:
Waiter.TimeDelta - time delta to check actionProduced result.
Waiter.WaitingTime - maximal waiting time
Waiter.AfterWaitingTime - time to sleep after waiting has been finished.
Timeouts
,
Waitable
Constructor Summary | |
---|---|
protected |
Waiter()
Can be used from subclass. |
|
Waiter(Waitable w)
Constructor. |
Method Summary | |
---|---|
Object |
actionProduced(Object obj)
Checks if wait criteria have been met. |
protected String |
getActionProducedMessage(long timeSpent,
Object result)
Returns message to be printed when waiting has been successfully finished. |
String |
getDescription()
Returns description. |
protected String |
getGoldenActionProducedMessage()
Returns message to be printed int golden output when waiting has been successfully finished. |
protected String |
getGoldenTimeoutExpiredMessage()
Returns message to be printed int golden output when waiting timeout has been expired. |
protected String |
getGoldenWaitingStartedMessage()
Returns message to be printed int golden output before waiting start. |
TestOut |
getOutput()
Returns print output streams or writers. |
protected String |
getTimeoutExpiredMessage(long timeSpent)
Returns message to be printed when waiting timeout has been expired. |
Timeouts |
getTimeouts()
Return current timeouts. |
protected 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. |
Timeouts |
setTimeoutsToCloneOf(Timeouts timeouts,
String useAsWaitingTime)
Like setTimeouts(Timeouts) , but clones the timeouts first, then
sets "Waiter.WaitingTime" to the timeout whose name is passed in. |
void |
setWaitingTimeOrigin(String origin)
Sets the origin of the current "Waiter.WaitingTime" to be shown in timeout error messages |
protected long |
timeFromStart()
Returns time from waiting start. |
Object |
waitAction(Object waitableObject)
Waits for not null result of actionProduced method of Waitable implementation passed into constructor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Waiter(Waitable w)
w
- Waitable object defining waiting criteria.protected Waiter()
Method Detail |
---|
public void setTimeouts(Timeouts timeouts)
setTimeouts
in interface Timeoutable
timeouts
- A collection of timeout assignments.Timeoutable
,
Timeouts
,
getTimeouts()
public Timeouts setTimeoutsToCloneOf(Timeouts timeouts, String useAsWaitingTime)
setTimeouts(Timeouts)
, but clones the timeouts first, then
sets "Waiter.WaitingTime" to the timeout whose name is passed in. This
name is remembered for display in timeout error messages so people know
what to adjust.
timeouts
- to be cloned and in which to look up "useAsWaitingTime".useAsWaitingTime
- the name of the timeout to apply to "Waiter.WaitingTime".
public void setWaitingTimeOrigin(String origin)
origin
- is the name of the origin.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 Object waitAction(Object waitableObject) throws InterruptedException
waitableObject
- Object to be passed into actionProduced method.
TimeoutExpiredException
InterruptedException
public Object actionProduced(Object obj)
Waitable
actionProduced
in interface Waitable
obj
-
Waitable
public String getDescription()
Waitable
getDescription
in interface Waitable
Waitable
protected String getWaitingStartedMessage()
protected String getTimeoutExpiredMessage(long timeSpent)
timeSpent
- time from waiting start (milliseconds)
protected String getActionProducedMessage(long timeSpent, Object result)
timeSpent
- time from waiting start (milliseconds)result
- result of Waitable.actionproduced method.
protected String getGoldenWaitingStartedMessage()
protected String getGoldenTimeoutExpiredMessage()
protected String getGoldenActionProducedMessage()
protected long timeFromStart()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |