Search in sources :

Example 6 with TwoLevelListChanged

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.TwoLevelListChanged in project controller by opendaylight.

the class ForwardedNotificationAdapterTest method testNotifSubscription.

@Test
public void testNotifSubscription() throws InterruptedException {
    final CountDownLatch latch = new CountDownLatch(1);
    final TwoLevelListChanged testData = createTestData();
    final TestNotifListener testNotifListener = new TestNotifListener(latch);
    final ListenerRegistration<TestNotifListener> listenerRegistration = getNotificationService().registerNotificationListener(testNotifListener);
    getNotificationPublishService().putNotification(testData);
    latch.await();
    assertTrue(testNotifListener.getReceivedNotifications().size() == 1);
    assertEquals(testData, testNotifListener.getReceivedNotifications().get(0));
    listenerRegistration.close();
}
Also used : TwoLevelListChanged(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.TwoLevelListChanged) CountDownLatch(java.util.concurrent.CountDownLatch) AbstractNotificationBrokerTest(org.opendaylight.controller.md.sal.binding.test.AbstractNotificationBrokerTest) Test(org.junit.Test)

Aggregations

CountDownLatch (java.util.concurrent.CountDownLatch)4 Test (org.junit.Test)4 AbstractNotificationBrokerTest (org.opendaylight.controller.md.sal.binding.test.AbstractNotificationBrokerTest)4 TwoLevelListChanged (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.TwoLevelListChanged)4 TwoLevelListChangedBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.TwoLevelListChangedBuilder)2 TopLevelListBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListBuilder)2 TopLevelListKey (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListKey)2 ExecutionException (java.util.concurrent.ExecutionException)1 TimeoutException (java.util.concurrent.TimeoutException)1 NotificationListener (org.opendaylight.yangtools.yang.binding.NotificationListener)1