X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FAbstractShardManagerTest.java;h=9e05b7fbd32800b9aeda2ea1fb58bca9b7dee39d;hb=abaef4a5ae37f27542155457fe7306a4662b1eeb;hp=f6f45b0b2ff682da91fdaa0e29f065592ce733b1;hpb=c32a09739f0f7a008fe203b7b4ca172755136307;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardManagerTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardManagerTest.java index f6f45b0b2f..9e05b7fbd3 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardManagerTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardManagerTest.java @@ -14,11 +14,10 @@ import static org.mockito.MockitoAnnotations.initMocks; import akka.actor.ActorRef; import akka.actor.PoisonPill; import akka.actor.Props; -import java.util.concurrent.CountDownLatch; +import com.google.common.util.concurrent.SettableFuture; import java.util.concurrent.TimeUnit; import org.junit.After; import org.junit.Before; -import org.mockito.Mock; import org.opendaylight.controller.cluster.access.concepts.MemberName; import org.opendaylight.controller.cluster.datastore.config.Configuration; import org.opendaylight.controller.cluster.datastore.identifiers.ShardIdentifier; @@ -42,8 +41,7 @@ public class AbstractShardManagerTest extends AbstractClusterRefActorTest { .dataStoreName(shardMrgIDSuffix).shardInitializationTimeout(600, TimeUnit.MILLISECONDS) .shardHeartbeatIntervalInMillis(100).shardElectionTimeoutFactor(6); - @Mock - protected static CountDownLatch ready; + protected static SettableFuture ready; protected TestShardManager.Builder newTestShardMgrBuilder() { return TestShardManager.builder(datastoreContextBuilder).distributedDataStore(mock(DistributedDataStore.class)); @@ -55,12 +53,13 @@ public class AbstractShardManagerTest extends AbstractClusterRefActorTest { } protected Props newShardMgrProps(final Configuration config) { - return newTestShardMgrBuilder(config).waitTillReadyCountDownLatch(ready).props(); + return newTestShardMgrBuilder(config).readinessFuture(ready).props(); } @Before - public void setUp() throws Exception { + public void setUp() { initMocks(this); + ready = SettableFuture.create(); InMemoryJournal.clear(); InMemorySnapshotStore.clear();