X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fmodification%2FAbstractModificationTest.java;h=ac06dc2b32e9c7b7a77c90a6025aa6e4f1340c6a;hb=461173ce10acbd8597b8f4c6ccb6c98c7a99447c;hp=efaca5d4f6f3d583aec500b683909b8c28d245b8;hpb=b2e6c299fad844633c8b40a2e180780f5774a4ae;p=controller.git 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..ac06dc2b32 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 @@ -13,32 +13,32 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; 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(); + } }