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/ReplicationTestCase.java |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java
index 8472094..f8579e8 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/replication/ReplicationTestCase.java
@@ -75,6 +75,7 @@
 import org.opends.server.types.Modification;
 import org.opends.server.types.SearchResultEntry;
 import org.opends.server.util.TestTimer;
+import org.opends.server.util.TestTimer.CallableVoid;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
@@ -244,20 +245,19 @@
       .maxSleep(secTimeout, SECONDS)
       .sleepTimes(1, SECONDS)
       .toTimer();
-    timer.repeatUntilSuccess(new Callable<Void>()
+    timer.repeatUntilSuccess(new CallableVoid()
     {
       @Override
-      public Void call() throws Exception
+      public void call() throws Exception
       {
         if (rb.isConnected())
         {
           logger.trace("checkConnection: connection of broker " + rb.getServerId()
               + " to RS " + rb.getRsGroupId() + " obtained.");
-          return null;
+          return;
         }
 
         rb.start();
-        return null;
       }
     });
   }
@@ -517,10 +517,10 @@
       .maxSleep(timeoutInSecs, 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
       {
         final Entry newEntry = DirectoryServer.getEntry(dn);
         assertNotNull(newEntry);
@@ -529,7 +529,6 @@
         Attribute attr = attrs.iterator().next();
         boolean foundAttributeValue = attr.contains(ByteString.valueOfUtf8(valueString));
         assertEquals(foundAttributeValue, expectedAttributeValueFound, foundMsg);
-        return null;
       }
     });
   }
@@ -544,13 +543,12 @@
       .maxSleep(timeoutInMillis, MILLISECONDS)
       .sleepTimes(200, MILLISECONDS)
       .toTimer();
-    timer.repeatUntilSuccess(new Callable<Void>()
+    timer.repeatUntilSuccess(new CallableVoid()
     {
       @Override
-      public Void call() throws Exception
+      public void call() throws Exception
       {
         assertEquals(DirectoryServer.entryExists(dn), exist, "Expected entry with dn \"" + dn + "\" would exist");
-        return null;
       }
     });
 

--
Gitblit v1.10.0