org.apache.tools.ant.taskdefs
public class WaitFor extends ConditionBase
parallel
task to
synchronize the execution of tests with server startup.
The following attributes can be specified on a waitfor task:
processSuccess
and processTimeout
Since: Ant 1.5
UNKNOWN: category="control"
Nested Class Summary | |
---|---|
static class | WaitFor.Unit
The enumeration of units:
millisecond, second, minute, hour, day, week |
Field Summary | |
---|---|
static long | DEFAULT_CHECK_MILLIS default check time |
static long | DEFAULT_MAX_WAIT_MILLIS default wait time |
static long | ONE_DAY a day in milliseconds |
static long | ONE_HOUR an hour in milliseconds |
static long | ONE_MILLISECOND a millisecond |
static long | ONE_MINUTE a minute in milliseconds |
static long | ONE_SECOND a second in milliseconds |
static long | ONE_WEEK a week in milliseconds |
Constructor Summary | |
---|---|
WaitFor()
Constructor, names this task "waitfor". | |
WaitFor(String taskName)
Constructor that takes the name of the task in the task name.
|
Method Summary | |
---|---|
long | calculateCheckEveryMillis()
Get the check wait time, in milliseconds. |
long | calculateMaxWaitMillis()
Get the maxiumum wait time, in milliseconds. |
void | execute()
Check repeatedly for the specified conditions until they become
true or the timeout expires. |
protected void | processSuccess()
Actions to be taken on a successful waitfor.
|
protected void | processTimeout()
Actions to be taken on an unsuccessful wait.
|
void | setCheckEvery(long time)
Set the time between each check |
void | setCheckEveryUnit(WaitFor.Unit unit)
Set the check every time unit |
void | setMaxWait(long time)
Set the maximum length of time to wait. |
void | setMaxWaitUnit(WaitFor.Unit unit)
Set the max wait time unit |
void | setTimeoutProperty(String p)
Name the property to set after a timeout. |
Parameters: taskName the name of the task.
Since: Ant 1.8
Returns: how long to wait between checks
Since: Ant 1.8
Returns: how long to wait before timing out
Since: Ant 1.8
Throws: BuildException on error
Since: Ant1.7
Since: Ant1.7
Parameters: time a long
value
Parameters: unit an enumerated Unit
value
Parameters: time a long
value
Parameters: unit an enumerated Unit
value
Parameters: p the property name