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%2Fbehaviors%2FAbstractLeaderElectionScenarioTest.java;h=8f0cc998030b66b2d19157da6df197812f240a3f;hp=27fc7c09741bd790d5410d73af3fc4599642b098;hb=35235f427f3a056f85fe83ddd1133e67540328f7;hpb=c32a09739f0f7a008fe203b7b4ca172755136307 diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeaderElectionScenarioTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeaderElectionScenarioTest.java index 27fc7c0974..8f0cc99803 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeaderElectionScenarioTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeaderElectionScenarioTest.java @@ -19,8 +19,8 @@ import akka.dispatch.ControlMessage; import akka.dispatch.Dispatchers; import akka.dispatch.Mailboxes; import akka.pattern.Patterns; -import akka.testkit.JavaTestKit; import akka.testkit.TestActorRef; +import akka.testkit.javadsl.TestKit; import akka.util.Timeout; import com.google.common.util.concurrent.Uninterruptibles; import java.util.Map; @@ -40,7 +40,6 @@ import org.opendaylight.controller.cluster.raft.utils.MessageCollectorActor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import scala.concurrent.Await; -import scala.concurrent.duration.Duration; import scala.concurrent.duration.FiniteDuration; /** @@ -177,15 +176,15 @@ public class AbstractLeaderElectionScenarioTest { } } - static class SendImmediateHeartBeat implements ControlMessage { - public static final SendImmediateHeartBeat INSTANCE = new SendImmediateHeartBeat(); + static final class SendImmediateHeartBeat implements ControlMessage { + static final SendImmediateHeartBeat INSTANCE = new SendImmediateHeartBeat(); private SendImmediateHeartBeat() { } } - static class GetBehaviorState implements ControlMessage { - public static final GetBehaviorState INSTANCE = new GetBehaviorState(); + static final class GetBehaviorState implements ControlMessage { + static final GetBehaviorState INSTANCE = new GetBehaviorState(); private GetBehaviorState() { } @@ -226,8 +225,8 @@ public class AbstractLeaderElectionScenarioTest { } @After - public void tearDown() throws Exception { - JavaTestKit.shutdownActorSystem(system); + public void tearDown() { + TestKit.shutdownActorSystem(system); } DefaultConfigParamsImpl newConfigParams() { @@ -251,7 +250,7 @@ public class AbstractLeaderElectionScenarioTest { RaftState actualState; try { actualState = (RaftState) Await.result(Patterns.ask(actor.self(), GetBehaviorState.INSTANCE, - Timeout.apply(5, TimeUnit.SECONDS)), Duration.apply(5, TimeUnit.SECONDS)); + Timeout.apply(5, TimeUnit.SECONDS)), FiniteDuration.create(5, TimeUnit.SECONDS)); } catch (RuntimeException e) { throw e; } catch (Exception e) {