import org.slf4j.LoggerFactory;
import scala.concurrent.Await;
import scala.concurrent.Future;
-import scala.concurrent.duration.Duration;
+import scala.concurrent.duration.FiniteDuration;
/**
* Class that represents a cluster member node for unit tests. It encapsulates an actor system with
ActorContext actorContext = datastore.getActorContext();
Future<ActorRef> future = actorContext.findLocalShardAsync(shardName);
- ActorRef shardActor = Await.result(future, Duration.create(10, TimeUnit.SECONDS));
+ ActorRef shardActor = Await.result(future, FiniteDuration.create(10, TimeUnit.SECONDS));
AssertionError lastError = null;
Stopwatch sw = Stopwatch.createStarted();
return this;
}
- public MemberNode build() {
+ public MemberNode build() throws Exception {
Preconditions.checkNotNull(moduleShardsConfig, "moduleShardsConfig must be specified");
Preconditions.checkNotNull(akkaConfig, "akkaConfig must be specified");
Preconditions.checkNotNull(testName, "testName must be specified");
String memberName = new ClusterWrapperImpl(system).getCurrentMemberName().getName();
node.kit.getDatastoreContextBuilder().shardManagerPersistenceId("shard-manager-config-" + memberName);
- node.configDataStore = node.kit.setupDistributedDataStore("config_" + testName, moduleShardsConfig,
- true, schemaContext, waitForshardLeader);
+ node.configDataStore = node.kit.setupAbstractDataStore(DistributedDataStore.class,
+ "config_" + testName, moduleShardsConfig, true, schemaContext, waitForshardLeader);
if (createOperDatastore) {
node.kit.getDatastoreContextBuilder().shardManagerPersistenceId("shard-manager-oper-" + memberName);
- node.operDataStore = node.kit.setupDistributedDataStore("oper_" + testName, moduleShardsConfig,
- true, schemaContext, waitForshardLeader);
+ node.operDataStore = node.kit.setupAbstractDataStore(DistributedDataStore.class,
+ "oper_" + testName, moduleShardsConfig, true, schemaContext, waitForshardLeader);
}
members.add(node);