com.atlassian.confluence.cluster
Class RepeatableTaskRunner
java.lang.Object
com.atlassian.confluence.cluster.RepeatableTaskRunner
public class RepeatableTaskRunner
- extends java.lang.Object
Runs a task at set intervals. Throws an AssertionFailedError
if the
task does not return the desired result within the timeout period.
This is designed for testing asynchronous events on the server.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RepeatableTaskRunner
public RepeatableTaskRunner(long intervalMillis,
long timeoutMillis)
- Parameters:
intervalMillis
- the interval between successive runs of the tasktimeoutMillis
- the total amount of time from the start of running a task until the
AssertionFailedError
is thrown.
assertTrue
public void assertTrue(java.lang.String message,
RepeatableTask task)
throws java.lang.Exception
- Runs the provided task at intervals. Throws an
AssertionFailedError
if the task doesn't
return true within the timeout provided.
- Parameters:
message
- the failure message used if the task doesn't return true within the timeouttask
- a Callable which returns a Boolean
- Throws:
junit.framework.AssertionFailedError
- if the task does not return true before the timeout expires
java.lang.Exception
- if the task itself throws an exception
assertFalse
public void assertFalse(java.lang.String message,
RepeatableTask task)
throws java.lang.Exception
- Runs the provided task at intervals. Throws an
AssertionFailedError
if the task doesn't
return false within the timeout provided.
- Parameters:
message
- the failure message used if the task doesn't return false within the timeouttask
- a Callable which returns a Boolean
- Throws:
junit.framework.AssertionFailedError
- if the task does not return false before the timeout expires
java.lang.Exception
- if the task itself throws an exception
Copyright © 2003-2013 Atlassian. All Rights Reserved.