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%2FDataTreeCohortIntegrationTest.java;h=7068d75a70800a79a95c92ee436fdbf6c6562af7;hb=f9ee2cce797cf12402dd55c406f3e270d7d2e20d;hp=ce02d6ccab4745693ac374ef8190e1b1b9ecc38c;hpb=466078ab1dc8a8cc2981b161051f6edecd6af85a;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataTreeCohortIntegrationTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataTreeCohortIntegrationTest.java index ce02d6ccab..7068d75a70 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataTreeCohortIntegrationTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataTreeCohortIntegrationTest.java @@ -5,7 +5,6 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.controller.cluster.datastore; import static org.junit.Assert.assertEquals; @@ -24,12 +23,11 @@ import akka.actor.Address; import akka.actor.AddressFromURIString; import akka.cluster.Cluster; import akka.testkit.javadsl.TestKit; -import com.google.common.base.Optional; import com.google.common.base.Throwables; import com.google.common.util.concurrent.FluentFuture; import com.typesafe.config.ConfigFactory; -import java.math.BigInteger; import java.util.Collection; +import java.util.Optional; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import org.junit.AfterClass; @@ -51,6 +49,7 @@ import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort; import org.opendaylight.mdsal.dom.spi.store.DOMStoreWriteTransaction; import org.opendaylight.yangtools.concepts.ObjectRegistration; import org.opendaylight.yangtools.util.concurrent.FluentFutures; +import org.opendaylight.yangtools.yang.common.Uint64; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; @@ -113,7 +112,7 @@ public class DataTreeCohortIntegrationTest { kit.testWriteTransaction(dataStore, TestModel.TEST_PATH, node); verify(cohort).canCommit(any(Object.class), any(SchemaContext.class), candidateCapt.capture()); assertDataTreeCandidate((DOMDataTreeCandidate) candidateCapt.getValue().iterator().next(), TEST_ID, - ModificationType.WRITE, Optional.of(node), Optional.absent()); + ModificationType.WRITE, Optional.of(node), Optional.empty()); reset(cohort); doReturn(PostCanCommitStep.NOOP_SUCCESSFUL_FUTURE).when(cohort).canCommit(any(Object.class), @@ -193,7 +192,7 @@ public class DataTreeCohortIntegrationTest { writeTx = dataStore.newWriteOnlyTransaction(); final YangInstanceIdentifier optimaPath = CarsModel.newCarPath("optima"); - final MapEntryNode optimaNode = CarsModel.newCarEntry("optima", BigInteger.valueOf(20000)); + final MapEntryNode optimaNode = CarsModel.newCarEntry("optima", Uint64.valueOf(20000)); writeTx.write(optimaPath, optimaNode); kit.doCommit(writeTx.ready()); @@ -201,7 +200,7 @@ public class DataTreeCohortIntegrationTest { verify(cohort).canCommit(any(Object.class), any(SchemaContext.class), candidateCapture.capture()); assertDataTreeCandidate((DOMDataTreeCandidate) candidateCapture.getValue().iterator().next(), new DOMDataTreeIdentifier(LogicalDatastoreType.CONFIGURATION, optimaPath), ModificationType.WRITE, - Optional.of(optimaNode), Optional.absent()); + Optional.of(optimaNode), Optional.empty()); // Write replace the cars container with 2 new car entries. The cohort should get invoked with 3 // DOMDataTreeCandidates: once for each of the 2 new car entries (WRITE mod) and once for the deleted prior @@ -213,9 +212,9 @@ public class DataTreeCohortIntegrationTest { writeTx = dataStore.newWriteOnlyTransaction(); final YangInstanceIdentifier sportagePath = CarsModel.newCarPath("sportage"); - final MapEntryNode sportageNode = CarsModel.newCarEntry("sportage", BigInteger.valueOf(20000)); + final MapEntryNode sportageNode = CarsModel.newCarEntry("sportage", Uint64.valueOf(20000)); final YangInstanceIdentifier soulPath = CarsModel.newCarPath("soul"); - final MapEntryNode soulNode = CarsModel.newCarEntry("soul", BigInteger.valueOf(20000)); + final MapEntryNode soulNode = CarsModel.newCarEntry("soul", Uint64.valueOf(20000)); writeTx.write(CarsModel.BASE_PATH, CarsModel.newCarsNode(CarsModel.newCarsMapNode(sportageNode,soulNode))); kit.doCommit(writeTx.ready()); @@ -224,15 +223,15 @@ public class DataTreeCohortIntegrationTest { assertDataTreeCandidate(findCandidate(candidateCapture, sportagePath), new DOMDataTreeIdentifier( LogicalDatastoreType.CONFIGURATION, sportagePath), ModificationType.WRITE, - Optional.of(sportageNode), Optional.absent()); + Optional.of(sportageNode), Optional.empty()); assertDataTreeCandidate(findCandidate(candidateCapture, soulPath), new DOMDataTreeIdentifier( LogicalDatastoreType.CONFIGURATION, soulPath), ModificationType.WRITE, - Optional.of(soulNode), Optional.absent()); + Optional.of(soulNode), Optional.empty()); assertDataTreeCandidate(findCandidate(candidateCapture, optimaPath), new DOMDataTreeIdentifier( LogicalDatastoreType.CONFIGURATION, optimaPath), ModificationType.DELETE, - Optional.absent(), Optional.of(optimaNode)); + Optional.empty(), Optional.of(optimaNode)); // Delete the cars container - cohort should be invoked for the 2 deleted car entries. @@ -249,11 +248,11 @@ public class DataTreeCohortIntegrationTest { assertDataTreeCandidate(findCandidate(candidateCapture, sportagePath), new DOMDataTreeIdentifier( LogicalDatastoreType.CONFIGURATION, sportagePath), ModificationType.DELETE, - Optional.absent(), Optional.of(sportageNode)); + Optional.empty(), Optional.of(sportageNode)); assertDataTreeCandidate(findCandidate(candidateCapture, soulPath), new DOMDataTreeIdentifier( LogicalDatastoreType.CONFIGURATION, soulPath), ModificationType.DELETE, - Optional.absent(), Optional.of(soulNode)); + Optional.empty(), Optional.of(soulNode)); } }