Search in sources :

Example 11 with MockDataTreeChangeListener

use of org.opendaylight.controller.cluster.datastore.utils.MockDataTreeChangeListener in project controller by opendaylight.

the class DataTreeChangeListenerSupportTest method testInitialChangeListenerEventWithListPath.

@Test
public void testInitialChangeListenerEventWithListPath() throws DataValidationFailedException {
    mergeToStore(shard.getDataStore(), TEST_PATH, testNodeWithOuter(1, 2));
    MockDataTreeChangeListener listener = registerChangeListener(OUTER_LIST_PATH, 1).getKey();
    listener.waitForChangeEvents();
    listener.verifyNotifiedData(OUTER_LIST_PATH);
}
Also used : MockDataTreeChangeListener(org.opendaylight.controller.cluster.datastore.utils.MockDataTreeChangeListener) Test(org.junit.Test)

Example 12 with MockDataTreeChangeListener

use of org.opendaylight.controller.cluster.datastore.utils.MockDataTreeChangeListener in project controller by opendaylight.

the class DataTreeChangeListenerSupportTest method testChangeListenerWithNoInitialData.

@Test
public void testChangeListenerWithNoInitialData() {
    MockDataTreeChangeListener listener = registerChangeListener(TEST_PATH, 0).getKey();
    listener.expectNoMoreChanges("Unexpected initial change event");
}
Also used : MockDataTreeChangeListener(org.opendaylight.controller.cluster.datastore.utils.MockDataTreeChangeListener) Test(org.junit.Test)

Aggregations

MockDataTreeChangeListener (org.opendaylight.controller.cluster.datastore.utils.MockDataTreeChangeListener)12 Test (org.junit.Test)11 ActorRef (akka.actor.ActorRef)6 TestActorRef (akka.testkit.TestActorRef)6 RegisterDataTreeChangeListener (org.opendaylight.controller.cluster.datastore.messages.RegisterDataTreeChangeListener)6 RegisterDataTreeNotificationListenerReply (org.opendaylight.controller.cluster.datastore.messages.RegisterDataTreeNotificationListenerReply)6 YangInstanceIdentifier (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)4 ActorSelection (akka.actor.ActorSelection)2 DisableElectionsRaftPolicy (org.opendaylight.controller.cluster.raft.policy.DisableElectionsRaftPolicy)2 Creator (akka.japi.Creator)1 TestKit (akka.testkit.javadsl.TestKit)1 Timeout (akka.util.Timeout)1 SimpleEntry (java.util.AbstractMap.SimpleEntry)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 ShardIdentifier (org.opendaylight.controller.cluster.datastore.identifiers.ShardIdentifier)1 UpdateSchemaContext (org.opendaylight.controller.cluster.datastore.messages.UpdateSchemaContext)1 ElectionTimeout (org.opendaylight.controller.cluster.raft.base.messages.ElectionTimeout)1 FindLeaderReply (org.opendaylight.controller.cluster.raft.client.messages.FindLeaderReply)1 DataValidationFailedException (org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException)1