com.atlassian.confluence.cluster
Class RepeatableTaskRunner

java.lang.Object
  extended by com.atlassian.confluence.cluster.RepeatableTaskRunner

Deprecated. Since 5.5 Use PollingChangeTracker

@Deprecated
public class RepeatableTaskRunner
extends 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.


Constructor Summary
RepeatableTaskRunner(long intervalMillis, long timeoutMillis)
          Deprecated.  
 
Method Summary
 void assertFalse(String message, RepeatableTask task)
          Deprecated. since 5.6 use assertThat(String, java.util.concurrent.Callable, org.hamcrest.Matcher) instead
<V> void
assertThat(Callable<V> task, org.hamcrest.Matcher<V> matcher)
          Deprecated.  
<V> void
assertThat(String message, Callable<V> task, org.hamcrest.Matcher<V> matcher)
          Deprecated.  
 void assertTrue(String message, RepeatableTask task)
          Deprecated. since 5.6 use assertThat(String, java.util.concurrent.Callable, org.hamcrest.Matcher) instead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepeatableTaskRunner

public RepeatableTaskRunner(long intervalMillis,
                            long timeoutMillis)
Deprecated. 
Parameters:
intervalMillis - the interval between successive runs of the task
timeoutMillis - the total amount of time from the start of running a task until the AssertionFailedError is thrown.
Method Detail

assertTrue

@Deprecated
public void assertTrue(String message,
                                  RepeatableTask task)
                throws Exception
Deprecated. since 5.6 use assertThat(String, java.util.concurrent.Callable, org.hamcrest.Matcher) instead

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 timeout
task - a Callable which returns a Boolean
Throws:
junit.framework.AssertionFailedError - if the task does not return true before the timeout expires
Exception - if the task itself throws an exception

assertFalse

@Deprecated
public void assertFalse(String message,
                                   RepeatableTask task)
                 throws Exception
Deprecated. since 5.6 use assertThat(String, java.util.concurrent.Callable, org.hamcrest.Matcher) instead

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 timeout
task - a Callable which returns a Boolean
Throws:
junit.framework.AssertionFailedError - if the task does not return false before the timeout expires
Exception - if the task itself throws an exception

assertThat

public <V> void assertThat(Callable<V> task,
                           org.hamcrest.Matcher<V> matcher)
                throws Exception
Deprecated. 
Throws:
Exception

assertThat

public <V> void assertThat(String message,
                           Callable<V> task,
                           org.hamcrest.Matcher<V> matcher)
                throws Exception
Deprecated. 
Throws:
Exception


Copyright © 2003–2015 Atlassian. All rights reserved.