X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=dom%2Fmdsal-dom-inmemory-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fmdsal%2Fdom%2Fstore%2Finmemory%2FInMemoryDOMDataTreeShardTest.java;h=f9b4d4ee0482a80b5f58233e219d886ee1c6737a;hb=refs%2Fchanges%2F30%2F45830%2F1;hp=add31fec0892226e980305aa0f5cc9780d8658a1;hpb=395348596fcc6296e1a9ed0d9899b5aa16f08625;p=mdsal.git diff --git a/dom/mdsal-dom-inmemory-datastore/src/test/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataTreeShardTest.java b/dom/mdsal-dom-inmemory-datastore/src/test/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataTreeShardTest.java index add31fec08..f9b4d4ee04 100644 --- a/dom/mdsal-dom-inmemory-datastore/src/test/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataTreeShardTest.java +++ b/dom/mdsal-dom-inmemory-datastore/src/test/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataTreeShardTest.java @@ -32,6 +32,8 @@ import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier; import org.opendaylight.yangtools.concepts.ListenerRegistration; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.schema.tree.CursorAwareDataTreeModification; +import org.opendaylight.yangtools.yang.data.api.schema.tree.CursorAwareDataTreeSnapshot; public class InMemoryDOMDataTreeShardTest { @@ -57,8 +59,10 @@ public class InMemoryDOMDataTreeShardTest { final Collection prefixes = ImmutableList.of(DOM_DATA_TREE_IDENTIFIER); assertEquals(prefixes.toString(), inMemoryDOMDataTreeShard.createProducer(prefixes).getPrefixes().toString()); + final InMemoryDOMDataTreeShardProducer mockProducer = mock(InMemoryDOMDataTreeShardProducer.class); + inMemoryDOMDataTreeShard.onGlobalContextUpdated(createTestContext()); - inMemoryDOMDataTreeShard.createTransaction(prefixes); + inMemoryDOMDataTreeShard.createTransaction("", mockProducer, prefixes, mock(CursorAwareDataTreeSnapshot.class)); final DOMDataTreeChangeListener domDataTreeChangeListener = mock(DOMDataTreeChangeListener.class); final ListenerRegistration listenerRegistration = mock(ListenerRegistration.class); @@ -71,7 +75,7 @@ public class InMemoryDOMDataTreeShardTest { assertFalse(inMemoryDOMDataTreeShard.getChildShards().containsKey(DOM_DATA_TREE_IDENTIFIER)); } - @Test(expected = UnsupportedOperationException.class) + @Test public void createTransactionWithException() throws Exception { final DOMDataTreeIdentifier domDataTreeIdentifier = new DOMDataTreeIdentifier(LogicalDatastoreType.CONFIGURATION, YangInstanceIdentifier.EMPTY); @@ -79,11 +83,15 @@ public class InMemoryDOMDataTreeShardTest { final InMemoryDOMDataTreeShard inMemoryDOMDataTreeShard = InMemoryDOMDataTreeShard.create(domDataTreeIdentifier, MoreExecutors.newDirectExecutorService(), 1); + final CursorAwareDataTreeModification dataTreeModification = mock(CursorAwareDataTreeModification.class); final InmemoryDOMDataTreeShardWriteTransaction inmemoryDOMDataTreeShardWriteTransaction = mock(InmemoryDOMDataTreeShardWriteTransaction.class); + doReturn(dataTreeModification).when(inmemoryDOMDataTreeShardWriteTransaction).getRootModification(); + final InMemoryDOMDataTreeShardProducer mockProducer = mock(InMemoryDOMDataTreeShardProducer.class); + final Collection prefixes = ImmutableList.of(DOM_DATA_TREE_IDENTIFIER); - inMemoryDOMDataTreeShard.createTransaction(inmemoryDOMDataTreeShardWriteTransaction); + inMemoryDOMDataTreeShard.createTransaction("", mockProducer, prefixes, mock(CursorAwareDataTreeSnapshot.class)); } @After