Require FiniteDuration in waitOnAsyncTask() 52/78452/2
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 5 Dec 2018 10:20:21 +0000 (11:20 +0100)
committerTom Pantelis <tompantelis@gmail.com>
Wed, 5 Dec 2018 15:13:57 +0000 (15:13 +0000)
We do not want tests to ever specify an infite duration, make sure
we express that in the contract.

Change-Id: If0202e6b81761461e0d34ad6a00ea207f8a28e50
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractTest.java

index 80c8398..a3726e2 100644 (file)
@@ -23,7 +23,7 @@ import org.opendaylight.controller.cluster.access.concepts.MemberName;
 import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
 import scala.compat.java8.FutureConverters;
 import scala.concurrent.Await;
-import scala.concurrent.duration.Duration;
+import scala.concurrent.duration.FiniteDuration;
 
 public abstract class AbstractTest {
     protected static final MemberName MEMBER_NAME = MemberName.forName("member-1");
@@ -53,7 +53,7 @@ public abstract class AbstractTest {
         return new LocalHistoryIdentifier(CLIENT_ID, HISTORY_COUNTER.incrementAndGet());
     }
 
-    protected static <T> T waitOnAsyncTask(final CompletionStage<T> completionStage, final Duration timeout)
+    protected static <T> T waitOnAsyncTask(final CompletionStage<T> completionStage, final FiniteDuration timeout)
             throws Exception {
         return Await.result(FutureConverters.toScala(completionStage), timeout);
     }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.