From 867b7e0b56ee784f04c9a02298216a3c8f946005 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 02 Nov 2016 15:53:49 +0000
Subject: [PATCH] TestTimer.java: Added repeatUntilSuccess(CallableVoid callable)
---
opendj-server-legacy/src/test/java/org/opends/server/replication/GenerationIdTest.java | 22 +++++++++-------------
1 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/GenerationIdTest.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/GenerationIdTest.java
index 5b32d27..8c1ed23 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/GenerationIdTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/GenerationIdTest.java
@@ -27,7 +27,6 @@
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.UUID;
-import java.util.concurrent.Callable;
import org.assertj.core.api.Assertions;
import org.assertj.core.api.SoftAssertions;
@@ -61,6 +60,7 @@
import org.opends.server.types.Entry;
import org.opends.server.types.LDIFImportConfig;
import org.opends.server.util.TestTimer;
+import org.opends.server.util.TestTimer.CallableVoid;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@@ -366,16 +366,15 @@
.maxSleep(1, MINUTES)
.sleepTimes(200, MILLISECONDS)
.toTimer();
- timer.repeatUntilSuccess(new Callable<Void>()
+ timer.repeatUntilSuccess(new CallableVoid()
{
@Override
- public Void call() throws Exception
+ public void call() throws Exception
{
LDAPReplicationDomain doToco = LDAPReplicationDomain.retrievesReplicationDomain(baseDN);
assertNotNull(doToco);
assertTrue(doToco.isConnected(), "not connected");
debugInfo("ReplicationDomain: Import/Export is running ? " + doToco.ieRunning());
- return null;
}
});
}
@@ -434,13 +433,12 @@
.maxSleep(10, SECONDS)
.sleepTimes(100, MILLISECONDS)
.toTimer();
- timer.repeatUntilSuccess(new Callable<Void>()
+ timer.repeatUntilSuccess(new CallableVoid()
{
@Override
- public Void call() throws Exception
+ public void call() throws Exception
{
assertNull(LDAPReplicationDomain.retrievesReplicationDomain(baseDN));
- return null;
}
});
}
@@ -858,15 +856,14 @@
.maxSleep(timeout, MILLISECONDS)
.sleepTimes(50, MILLISECONDS)
.toTimer();
- timer.repeatUntilSuccess(new Callable<Void>()
+ timer.repeatUntilSuccess(new CallableVoid()
{
@Override
- public Void call() throws Exception
+ public void call() throws Exception
{
LDAPReplicationDomain domain = MultimasterReplication.findDomain(baseDN, null);
assertNotNull(domain);
assertTrue(domain.isConnected(), "server should have been connected to replication domain" + baseDN);
- return null;
}
});
}
@@ -996,13 +993,12 @@
.maxSleep(10, SECONDS)
.sleepTimes(100, MILLISECONDS)
.toTimer();
- timer.repeatUntilSuccess(new Callable<Void>()
+ timer.repeatUntilSuccess(new CallableVoid()
{
@Override
- public Void call() throws Exception
+ public void call() throws Exception
{
assertGenIdEquals(expectedGenId);
- return null;
}
});
}
--
Gitblit v1.10.0