import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import java.util.concurrent.TimeUnit;
-import org.opendaylight.controller.md.sal.binding.compat.HeliumNotificationProviderServiceAdapter;
-
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
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.compat.HeliumNotificationProviderServiceAdapter;
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;
+@Deprecated
public class BackwardsCompatibleNotificationBrokerTest extends AbstractNotificationBrokerTest {
private NotificationProviderService notificationProviderService;
public void initTest() {
final NotificationService notificationService = getNotificationService();
final NotificationPublishService notificationPublishService = getNotificationPublishService();
- notificationProviderService = new HeliumNotificationProviderServiceAdapter(notificationPublishService, notificationService);
+ notificationProviderService = new HeliumNotificationProviderServiceAdapter(notificationPublishService,
+ notificationService);
}
- private TwoLevelListChanged createTestData() {
+ private static TwoLevelListChanged createTestData() {
final TwoLevelListChangedBuilder tb = new TwoLevelListChangedBuilder();
- tb.setTopLevelList(ImmutableList.of(new TopLevelListBuilder().setKey(new TopLevelListKey("test")).build()));
+ tb.setTopLevelList(ImmutableList.of(new TopLevelListBuilder().withKey(new TopLevelListKey("test")).build()));
return tb.build();
}
private static class NotifTestListenerChild extends NotifTestListener {
- public NotifTestListenerChild(final CountDownLatch latch) {
+ NotifTestListenerChild(final CountDownLatch latch) {
super(latch);
}
}
+
private static class NotifTestListener implements OpendaylightMdsalListTestListener {
- private List<TwoLevelListChanged> receivedNotifications = new ArrayList<>();
- private CountDownLatch latch;
+ private final List<TwoLevelListChanged> receivedNotifications = new ArrayList<>();
+ private final CountDownLatch latch;
- public NotifTestListener(CountDownLatch latch) {
+ NotifTestListener(final CountDownLatch latch) {
this.latch = latch;
}
@Override
- public void onTwoLevelListChanged(TwoLevelListChanged notification) {
+ public void onTwoLevelListChanged(final TwoLevelListChanged notification) {
receivedNotifications.add(notification);
latch.countDown();
}
return receivedNotifications;
}
}
-
}