X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2FFollowerLogInformationImplTest.java;h=84d1545a65e3302462b69f9ee96f8dd982955654;hp=7df9f3713ffc302dcf100c45a93b8fd034b0fffa;hb=3927509ec3ecfa32a51b725d2b7155d425f5b877;hpb=e316a0ef36279a72767703d190f38a39d7d49395 diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/FollowerLogInformationImplTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/FollowerLogInformationImplTest.java index 7df9f3713f..84d1545a65 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/FollowerLogInformationImplTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/FollowerLogInformationImplTest.java @@ -7,14 +7,12 @@ */ package org.opendaylight.controller.cluster.raft; - import com.google.common.base.Stopwatch; import com.google.common.util.concurrent.Uninterruptibles; import org.junit.Test; import scala.concurrent.duration.FiniteDuration; import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicLong; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -29,7 +27,7 @@ public class FollowerLogInformationImplTest { FollowerLogInformation followerLogInformation = new FollowerLogInformationImpl( - "follower1", new AtomicLong(10), new AtomicLong(9), timeoutDuration); + "follower1", 10, 9, timeoutDuration); @@ -57,8 +55,7 @@ public class FollowerLogInformationImplTest { // hence getting the actual elapsed time and do a match. // if the sleep has spilled over, then return the test gracefully private long sleepWithElaspsedTimeReturned(long millis) { - Stopwatch stopwatch = new Stopwatch(); - stopwatch.start(); + Stopwatch stopwatch = Stopwatch.createStarted(); Uninterruptibles.sleepUninterruptibly(millis, TimeUnit.MILLISECONDS); stopwatch.stop(); return stopwatch.elapsed(TimeUnit.MILLISECONDS);