Code Review
/
mdsal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix InMemory shard transaction chaining.
[mdsal.git]
/
dom
/
mdsal-dom-inmemory-datastore
/
src
/
test
/
java
/
org
/
opendaylight
/
mdsal
/
dom
/
store
/
inmemory
/
InMemoryDOMDataTreeShardProducerTest.java
diff --git
a/dom/mdsal-dom-inmemory-datastore/src/test/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataTreeShardProducerTest.java
b/dom/mdsal-dom-inmemory-datastore/src/test/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataTreeShardProducerTest.java
index 729211641270355fdfb4554578e5bad1fb0576a7..0115866eb4f422033d5115ac5550c39ad9695dbd 100644
(file)
--- a/
dom/mdsal-dom-inmemory-datastore/src/test/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataTreeShardProducerTest.java
+++ b/
dom/mdsal-dom-inmemory-datastore/src/test/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataTreeShardProducerTest.java
@@
-8,6
+8,7
@@
package org.opendaylight.mdsal.dom.store.inmemory;
import static org.junit.Assert.assertNotNull;
package org.opendaylight.mdsal.dom.store.inmemory;
import static org.junit.Assert.assertNotNull;
+import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyCollectionOf;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Matchers.anyCollectionOf;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
@@
-18,6
+19,7
@@
import static org.opendaylight.mdsal.dom.store.inmemory.TestUtils.resetMocks;
import com.google.common.collect.ImmutableSet;
import org.junit.Test;
import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
import com.google.common.collect.ImmutableSet;
import org.junit.Test;
import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
+import org.opendaylight.yangtools.yang.data.api.schema.tree.CursorAwareDataTreeSnapshot;
public class InMemoryDOMDataTreeShardProducerTest {
public class InMemoryDOMDataTreeShardProducerTest {
@@
-26,15
+28,23
@@
public class InMemoryDOMDataTreeShardProducerTest {
final InMemoryDOMDataTreeShard inMemoryDOMDataTreeShard = mock(InMemoryDOMDataTreeShard.class);
final InmemoryDOMDataTreeShardWriteTransaction inmemoryDOMDataTreeShardWriteTransaction =
mock(InmemoryDOMDataTreeShardWriteTransaction.class);
final InMemoryDOMDataTreeShard inMemoryDOMDataTreeShard = mock(InMemoryDOMDataTreeShard.class);
final InmemoryDOMDataTreeShardWriteTransaction inmemoryDOMDataTreeShardWriteTransaction =
mock(InmemoryDOMDataTreeShardWriteTransaction.class);
+ final CursorAwareDataTreeSnapshot snapshot = mock(CursorAwareDataTreeSnapshot.class);
+ doReturn(snapshot).when(inMemoryDOMDataTreeShard).takeSnapshot();
+
doReturn(inmemoryDOMDataTreeShardWriteTransaction).when(inMemoryDOMDataTreeShard)
doReturn(inmemoryDOMDataTreeShardWriteTransaction).when(inMemoryDOMDataTreeShard)
- .createTransaction(anyCollectionOf((DOMDataTreeIdentifier.class)));
+ .createTransaction(any(String.class), any(InMemoryDOMDataTreeShardProducer.class),
+ anyCollectionOf((DOMDataTreeIdentifier.class)), any(CursorAwareDataTreeSnapshot.class));
final InMemoryDOMDataTreeShardProducer inMemoryDOMDataTreeShardProducer =
new InMemoryDOMDataTreeShardProducer(inMemoryDOMDataTreeShard,
ImmutableSet.of(DOM_DATA_TREE_IDENTIFIER));
assertNotNull(inMemoryDOMDataTreeShardProducer.createTransaction());
final InMemoryDOMDataTreeShardProducer inMemoryDOMDataTreeShardProducer =
new InMemoryDOMDataTreeShardProducer(inMemoryDOMDataTreeShard,
ImmutableSet.of(DOM_DATA_TREE_IDENTIFIER));
assertNotNull(inMemoryDOMDataTreeShardProducer.createTransaction());
- verify(inMemoryDOMDataTreeShard).createTransaction(anyCollectionOf(DOMDataTreeIdentifier.class));
+ verify(inMemoryDOMDataTreeShard).createTransaction(
+ any(String.class),
+ any(InMemoryDOMDataTreeShardProducer.class),
+ anyCollectionOf(DOMDataTreeIdentifier.class),
+ any(CursorAwareDataTreeSnapshot.class));
resetMocks();
}
}
\ No newline at end of file
resetMocks();
}
}
\ No newline at end of file