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%2FIntegrationTestKit.java;h=5ddd8271ea381f21f083ea72986463acba924e8b;hb=a6af137c30470b86d4bc624d4c48cb686495a182;hp=1c4bfcfbb23dcf2d23faccdb6492d7f328656bf3;hpb=64b9093c2c9ce670b92f2d0ea44c76dc9a385b5a;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/IntegrationTestKit.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/IntegrationTestKit.java index 1c4bfcfbb2..5ddd8271ea 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/IntegrationTestKit.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/IntegrationTestKit.java @@ -17,12 +17,12 @@ import akka.cluster.Cluster; import akka.cluster.ClusterEvent.CurrentClusterState; import akka.cluster.Member; import akka.cluster.MemberStatus; -import com.google.common.base.Optional; import com.google.common.base.Stopwatch; import com.google.common.collect.Sets; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.Uninterruptibles; import java.lang.reflect.Constructor; +import java.util.Optional; import java.util.Set; import java.util.concurrent.Callable; import java.util.concurrent.TimeUnit; @@ -38,11 +38,11 @@ import org.opendaylight.controller.cluster.datastore.persisted.DatastoreSnapshot import org.opendaylight.controller.cluster.datastore.utils.ActorContext; import org.opendaylight.controller.cluster.raft.client.messages.GetOnDemandRaftState; import org.opendaylight.controller.md.cluster.datastore.model.SchemaContextHelper; -import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; -import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction; -import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort; -import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain; -import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction; +import org.opendaylight.mdsal.common.api.LogicalDatastoreType; +import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadTransaction; +import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort; +import org.opendaylight.mdsal.dom.spi.store.DOMStoreTransactionChain; +import org.opendaylight.mdsal.dom.spi.store.DOMStoreWriteTransaction; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.opendaylight.yangtools.yang.model.api.SchemaContext; @@ -64,7 +64,8 @@ public class IntegrationTestKit extends ShardTestKit { this(actorSystem, datastoreContextBuilder, 7); } - public IntegrationTestKit(final ActorSystem actorSystem, final Builder datastoreContextBuilder, int commitTimeout) { + public IntegrationTestKit(final ActorSystem actorSystem, final Builder datastoreContextBuilder, + final int commitTimeout) { super(actorSystem); this.datastoreContextBuilder = datastoreContextBuilder; this.commitTimeout = commitTimeout; @@ -139,8 +140,8 @@ public class IntegrationTestKit extends ShardTestKit { ActorSystem.class, ClusterWrapper.class, Configuration.class, DatastoreContextFactory.class, DatastoreSnapshot.class); - final AbstractDataStore dataStore = constructor.newInstance( - getSystem(), cluster, config, mockContextFactory, restoreFromSnapshot); + final AbstractDataStore dataStore = constructor.newInstance(getSystem(), cluster, config, mockContextFactory, + restoreFromSnapshot); dataStore.onGlobalContextUpdated(schemaContext); @@ -152,7 +153,7 @@ public class IntegrationTestKit extends ShardTestKit { return dataStore; } - private void setDataStoreName(String typeName) { + private void setDataStoreName(final String typeName) { if ("config".equals(typeName)) { datastoreContextBuilder.logicalStoreType(LogicalDatastoreType.CONFIGURATION); } else if ("operational".equals(typeName)) { @@ -249,7 +250,7 @@ public class IntegrationTestKit extends ShardTestKit { ActorRef shard = null; for (int i = 0; i < 20 * 5 && shard == null; i++) { Uninterruptibles.sleepUninterruptibly(50, TimeUnit.MILLISECONDS); - Optional shardReply = actorContext.findLocalShard(shardName); + com.google.common.base.Optional shardReply = actorContext.findLocalShard(shardName); if (shardReply.isPresent()) { shard = shardReply.get(); } @@ -261,7 +262,7 @@ public class IntegrationTestKit extends ShardTestKit { for (int i = 0; i < 20 * 5 ; i++) { LOG.debug("Waiting for shard down {}", shardName); Uninterruptibles.sleepUninterruptibly(50, TimeUnit.MILLISECONDS); - Optional shardReply = actorContext.findLocalShard(shardName); + com.google.common.base.Optional shardReply = actorContext.findLocalShard(shardName); if (!shardReply.isPresent()) { return; } @@ -365,8 +366,7 @@ public class IntegrationTestKit extends ShardTestKit { } @SuppressWarnings("checkstyle:IllegalCatch") - void assertExceptionOnCall(final Callable callable, final Class expType) - throws Exception { + void assertExceptionOnCall(final Callable callable, final Class expType) { try { callable.call(); fail("Expected " + expType.getSimpleName()); @@ -376,7 +376,7 @@ public class IntegrationTestKit extends ShardTestKit { } void assertExceptionOnTxChainCreates(final DOMStoreTransactionChain txChain, - final Class expType) throws Exception { + final Class expType) { assertExceptionOnCall(() -> { txChain.newWriteOnlyTransaction(); return null;