}
@Test
public void TestExpBackoffPolicy() throws IvoryException {
AbstractRerunPolicy backoff = new ExpBackoffPolicy();
long delay = backoff.getDelay(new Frequency("minutes(2)"), 2);
Assert.assertEquals(delay, 480000);
long currentTime = System.currentTimeMillis();
delay = backoff.getDelay(new Frequency("minutes(2)"), new Date(
currentTime - 1 * 4 * 60 * 1000), new Date(currentTime + 1 * 60
* 60 * 1000));
Assert.assertEquals(delay, 1 * 6 * 60 * 1000);
currentTime = System.currentTimeMillis();
delay = backoff.getDelay(new Frequency("minutes(1)"), new Date(
currentTime - 1 * 9 * 60 * 1000), new Date(currentTime + 1 * 60
* 60 * 1000));
Assert.assertEquals(delay, 900000);
}