import akka.actor.Address;
import akka.actor.AddressFromURIString;
import akka.cluster.Cluster;
-import akka.testkit.JavaTestKit;
+import akka.testkit.javadsl.TestKit;
import com.google.common.base.Optional;
import com.google.common.base.Throwables;
import com.google.common.util.concurrent.CheckedFuture;
@AfterClass
public static void tearDownClass() throws IOException {
- JavaTestKit.shutdownActorSystem(system);
+ TestKit.shutdownActorSystem(system);
system = null;
}
ArgumentCaptor<Collection> candidateCapt = ArgumentCaptor.forClass(Collection.class);
IntegrationTestKit kit = new IntegrationTestKit(getSystem(), datastoreContextBuilder);
- try (AbstractDataStore dataStore = kit.setupDistributedDataStore("testSuccessfulCanCommitWithNoopPostStep",
- "test-1")) {
+ try (AbstractDataStore dataStore = kit.setupAbstractDataStore(
+ DistributedDataStore.class, "testSuccessfulCanCommitWithNoopPostStep", "test-1")) {
final ObjectRegistration<DOMDataTreeCommitCohort> cohortReg = dataStore.registerCommitCohort(TEST_ID,
cohort);
assertNotNull(cohortReg);
any(Collection.class), any(SchemaContext.class));
IntegrationTestKit kit = new IntegrationTestKit(getSystem(), datastoreContextBuilder);
- try (AbstractDataStore dataStore = kit.setupDistributedDataStore("testFailedCanCommit", "test-1")) {
+ try (AbstractDataStore dataStore = kit.setupAbstractDataStore(
+ DistributedDataStore.class, "testFailedCanCommit", "test-1")) {
dataStore.registerCommitCohort(TEST_ID, failedCohort);
IntegrationTestKit.verifyShardState(dataStore, "test-1",
any(Collection.class), any(SchemaContext.class));
IntegrationTestKit kit = new IntegrationTestKit(getSystem(), datastoreContextBuilder);
- try (AbstractDataStore dataStore = kit.setupDistributedDataStore("testCanCommitWithMultipleListEntries",
- "cars-1")) {
+ try (AbstractDataStore dataStore = kit.setupAbstractDataStore(
+ DistributedDataStore.class, "testCanCommitWithMultipleListEntries", "cars-1")) {
final ObjectRegistration<DOMDataTreeCommitCohort> cohortReg = dataStore.registerCommitCohort(
new DOMDataTreeIdentifier(LogicalDatastoreType.CONFIGURATION, CarsModel.CAR_LIST_PATH
.node(CarsModel.CAR_QNAME)), cohort);
}
@SuppressWarnings("rawtypes")
- private static DOMDataTreeCandidate findCandidate(ArgumentCaptor<Collection> candidateCapture,
- YangInstanceIdentifier rootPath) {
+ private static DOMDataTreeCandidate findCandidate(final ArgumentCaptor<Collection> candidateCapture,
+ final YangInstanceIdentifier rootPath) {
for (Object obj: candidateCapture.getValue()) {
DOMDataTreeCandidate candidate = (DOMDataTreeCandidate)obj;
if (rootPath.equals(candidate.getRootPath().getRootIdentifier())) {
any(Collection.class), any(SchemaContext.class));
IntegrationTestKit kit = new IntegrationTestKit(getSystem(), datastoreContextBuilder);
- try (AbstractDataStore dataStore = kit.setupDistributedDataStore("testAbortAfterCanCommit",
- "test-1", "cars-1")) {
+ try (AbstractDataStore dataStore = kit.setupAbstractDataStore(
+ DistributedDataStore.class, "testAbortAfterCanCommit", "test-1", "cars-1")) {
dataStore.registerCommitCohort(TEST_ID, cohortToAbort);
IntegrationTestKit.verifyShardState(dataStore, "test-1",
}
}
- private static void assertDataTreeCandidate(DOMDataTreeCandidate candidate, DOMDataTreeIdentifier expTreeId,
- ModificationType expType, Optional<NormalizedNode<?, ?>> expDataAfter,
- Optional<NormalizedNode<?, ?>> expDataBefore) {
+ private static void assertDataTreeCandidate(final DOMDataTreeCandidate candidate,
+ final DOMDataTreeIdentifier expTreeId, final ModificationType expType,
+ final Optional<NormalizedNode<?, ?>> expDataAfter, final Optional<NormalizedNode<?, ?>> expDataBefore) {
assertNotNull("Expected candidate for path " + expTreeId.getRootIdentifier(), candidate);
assertEquals("rootPath", expTreeId, candidate.getRootPath());
assertEquals("modificationType", expType, candidate.getRootNode().getModificationType());