import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
import org.opendaylight.controller.md.sal.binding.api.NotificationService;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
import org.opendaylight.controller.md.sal.binding.api.NotificationService;
import org.opendaylight.controller.md.sal.binding.test.AbstractNotificationBrokerTest;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.OpendaylightMdsalListTestListener;
import org.opendaylight.controller.md.sal.binding.test.AbstractNotificationBrokerTest;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.OpendaylightMdsalListTestListener;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.NotificationListener;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.NotificationListener;
public class BackwardsCompatibleNotificationBrokerTest extends AbstractNotificationBrokerTest {
private NotificationProviderService notificationProviderService;
public class BackwardsCompatibleNotificationBrokerTest extends AbstractNotificationBrokerTest {
private NotificationProviderService notificationProviderService;
public void initTest() {
final NotificationService notificationService = getNotificationService();
final NotificationPublishService notificationPublishService = getNotificationPublishService();
public void initTest() {
final NotificationService notificationService = getNotificationService();
final NotificationPublishService notificationPublishService = getNotificationPublishService();
final CountDownLatch latch = new CountDownLatch(1);
final TwoLevelListChanged testData = createTestData();
final CountDownLatch latch = new CountDownLatch(1);
final TwoLevelListChanged testData = createTestData();
final ListenerRegistration<NotificationListener> listenerRegistration =
notificationProviderService.registerNotificationListener(testNotifListener);
notificationProviderService.publish(testData);
final ListenerRegistration<NotificationListener> listenerRegistration =
notificationProviderService.registerNotificationListener(testNotifListener);
notificationProviderService.publish(testData);
assertTrue(testNotifListener.getReceivedNotifications().size() == 1);
assertEquals(testData, testNotifListener.getReceivedNotifications().get(0));
listenerRegistration.close();
}
assertTrue(testNotifListener.getReceivedNotifications().size() == 1);
assertEquals(testData, testNotifListener.getReceivedNotifications().get(0));
listenerRegistration.close();
}
- private List<TwoLevelListChanged> receivedNotifications = new ArrayList<>();
- private CountDownLatch latch;
+ private final List<TwoLevelListChanged> receivedNotifications = new ArrayList<>();
+ private final CountDownLatch latch;