X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fmodification%2FAbstractModificationTest.java;h=9daa3429fd32096d5d840068ece2e8089761005b;hp=efaca5d4f6f3d583aec500b683909b8c28d245b8;hb=7e62b4a59f9e43bcd0585845f1aeb55c44199f27;hpb=7d753ff9887cb803bdcd222aec2ab2a0a9c87906 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/modification/AbstractModificationTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/modification/AbstractModificationTest.java index efaca5d4f6..9daa3429fd 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/modification/AbstractModificationTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/modification/AbstractModificationTest.java @@ -8,37 +8,37 @@ package org.opendaylight.controller.cluster.datastore.modification; -import com.google.common.base.Optional; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; +import java.util.Optional; import org.junit.Before; import org.opendaylight.controller.md.cluster.datastore.model.TestModel; -import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore; -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.DOMStoreWriteTransaction; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadTransaction; +import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort; +import org.opendaylight.mdsal.dom.spi.store.DOMStoreWriteTransaction; +import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; public abstract class AbstractModificationTest { - protected InMemoryDOMDataStore store; + protected InMemoryDOMDataStore store; - @Before - public void setUp(){ - store = new InMemoryDOMDataStore("test", MoreExecutors.sameThreadExecutor()); - store.onGlobalContextUpdated(TestModel.createTestContext()); - } + @Before + public void setUp() { + store = new InMemoryDOMDataStore("test", MoreExecutors.newDirectExecutorService()); + store.onGlobalContextUpdated(TestModel.createTestContext()); + } - protected void commitTransaction(DOMStoreWriteTransaction transaction){ - DOMStoreThreePhaseCommitCohort cohort = transaction.ready(); - cohort.preCommit(); - cohort.commit(); - } + protected void commitTransaction(final DOMStoreWriteTransaction transaction) { + DOMStoreThreePhaseCommitCohort cohort = transaction.ready(); + cohort.preCommit(); + cohort.commit(); + } - protected Optional> readData(InstanceIdentifier path) throws Exception{ - DOMStoreReadTransaction transaction = store.newReadOnlyTransaction(); - ListenableFuture>> future = transaction.read(path); - return future.get(); - } + protected Optional> readData(final YangInstanceIdentifier path) throws Exception { + DOMStoreReadTransaction transaction = store.newReadOnlyTransaction(); + ListenableFuture>> future = transaction.read(path); + return future.get(); + } }