X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FShardTest.java;h=46fdfacbe956497db88acba4e9d2de831aa6991e;hb=baf24349053f1097e311de0b6632a7463bff7b1b;hp=bdae31c96fbc54fada222f51d3cf6aea9b61562c;hpb=a4fcc7debbd036c6e1df8c88df1c0268c62e76e4;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java index bdae31c96f..46fdfacbe9 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java @@ -13,7 +13,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import static org.mockito.Matchers.any; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.inOrder; import static org.mockito.Mockito.mock; @@ -150,6 +150,18 @@ public class ShardTest extends AbstractShardTest { writeToStore(shard, path, ImmutableNodes.containerNode(TestModel.TEST_QNAME)); listener.waitForChangeEvents(); + listener.verifyOnInitialDataEvent(); + + final MockDataTreeChangeListener listener2 = new MockDataTreeChangeListener(1); + final ActorRef dclActor2 = actorFactory.createActor(DataTreeChangeListenerActor.props(listener2, + TestModel.TEST_PATH), "testRegisterDataTreeChangeListener-DataTreeChangeListener2"); + + shard.tell(new RegisterDataTreeChangeListener(TestModel.TEST_PATH, dclActor2, false), testKit.getRef()); + + testKit.expectMsgClass(Duration.ofSeconds(3), RegisterDataTreeNotificationListenerReply.class); + + listener2.waitForChangeEvents(); + listener2.verifyNoOnInitialDataEvent(); } @SuppressWarnings("serial") @@ -539,7 +551,7 @@ public class ShardTest extends AbstractShardTest { verifyOuterListEntry(shard, 1); - verifyLastApplied(shard, 5); + verifyLastApplied(shard, 3); } @Test @@ -1014,8 +1026,7 @@ public class ShardTest extends AbstractShardTest { // Committed transaction count should increase as usual assertEquals(1, shardStats.getCommittedTransactionsCount()); - // Commit index should advance as we do not have an empty - // modification + // Commit index should advance 1 to account for disabling metadata assertEquals(1, shardStats.getCommitIndex()); }