X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-inmemory-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fstore%2Fimpl%2FInMemoryDataStoreTest.java;h=4720f4b4b9f4fcc0c04cad1b2470f2fb15097006;hp=c609e13e791c375979ad99bce62ed27df9d321f8;hb=ed6019236d78a69577888f60064c3714eaa80f6a;hpb=54916d10764a5234881040e9a68ae35d63b3dac9 diff --git a/opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDataStoreTest.java b/opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDataStoreTest.java index c609e13e79..4720f4b4b9 100644 --- a/opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDataStoreTest.java +++ b/opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDataStoreTest.java @@ -7,10 +7,15 @@ */ package org.opendaylight.controller.md.sal.dom.store.impl; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import com.google.common.base.Optional; import com.google.common.util.concurrent.CheckedFuture; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; +import java.util.concurrent.ExecutionException; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; @@ -32,13 +37,6 @@ import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes; import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder; import org.opendaylight.yangtools.yang.model.api.SchemaContext; -import java.util.concurrent.ExecutionException; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - public class InMemoryDataStoreTest { @@ -47,8 +45,7 @@ public class InMemoryDataStoreTest { @Before public void setupStore() { - domStore = new InMemoryDOMDataStore("TEST", MoreExecutors.sameThreadExecutor(), - MoreExecutors.sameThreadExecutor()); + domStore = new InMemoryDOMDataStore("TEST", MoreExecutors.sameThreadExecutor()); schemaContext = TestModel.createTestContext(); domStore.onGlobalContextUpdated(schemaContext); } @@ -271,7 +268,7 @@ public class InMemoryDataStoreTest { Mockito.doThrow( new RuntimeException( "mock ex" ) ).when( mockSnapshot ) .readNode( Mockito.any( YangInstanceIdentifier.class ) ); - DOMStoreReadTransaction readTx = new SnapshotBackedReadTransaction( "1", mockSnapshot ); + DOMStoreReadTransaction readTx = new SnapshotBackedReadTransaction("1", true, mockSnapshot); doReadAndThrowEx( readTx ); } @@ -296,12 +293,12 @@ public class InMemoryDataStoreTest { .readNode( Mockito.any( YangInstanceIdentifier.class ) ); Mockito.doReturn( mockModification ).when( mockSnapshot ).newModification(); TransactionReadyPrototype mockReady = Mockito.mock( TransactionReadyPrototype.class ); - DOMStoreReadTransaction readTx = new SnapshotBackedReadWriteTransaction( "1", mockSnapshot, mockReady ); + DOMStoreReadTransaction readTx = new SnapshotBackedReadWriteTransaction("1", false, mockSnapshot, mockReady); doReadAndThrowEx( readTx ); } - private void doReadAndThrowEx( DOMStoreReadTransaction readTx ) throws Throwable { + private void doReadAndThrowEx( final DOMStoreReadTransaction readTx ) throws Throwable { try { readTx.read(TestModel.TEST_PATH).get();