add binding for controller NotificationService
authorMichael Vorburger <mike@vorburger.ch>
Fri, 21 Dec 2018 14:10:16 +0000 (15:10 +0100)
committerMichael Vorburger <mike@vorburger.ch>
Wed, 1 Jul 2020 23:38:08 +0000 (01:38 +0200)
Signed-off-by: Michael Vorburger <mike@vorburger.ch>
src/main/java/org/opendaylight/controller/simple/InMemoryControllerModule.java
src/test/java/org/opendaylight/controller/simple/test/InMemoryControllerModuleTest.java

index dec0a4655712f1d810ea42100f0c3392e9238bc2..8f7ef98b0880dad5ad5b9f06212c69a8879e35a6 100644 (file)
@@ -10,9 +10,11 @@ package org.opendaylight.controller.simple;
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 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.HeliumRpcProviderRegistry;
 import org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataBrokerAdapter;
 import org.opendaylight.controller.md.sal.binding.impl.BindingDOMNotificationPublishServiceAdapter;
+import org.opendaylight.controller.md.sal.binding.impl.BindingDOMNotificationServiceAdapter;
 import org.opendaylight.controller.md.sal.binding.impl.BindingDOMRpcProviderServiceAdapter;
 import org.opendaylight.controller.md.sal.binding.impl.BindingDOMRpcServiceAdapter;
 import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
@@ -66,6 +68,8 @@ public class InMemoryControllerModule extends AbstractCloseableModule {
 
         domNotificationPublishService = dataBrokerTestModule.getDOMNotificationRouter();
         bind(DOMNotificationService.class).toInstance(domNotificationPublishService);
+        bind(NotificationService.class).toInstance(
+                new BindingDOMNotificationServiceAdapter(bindingToNormalizedNodeCodec, domNotificationPublishService));
 
         bindingDOMNotificationPublishServiceAdapter = new BindingDOMNotificationPublishServiceAdapter(
                 bindingToNormalizedNodeCodec, domNotificationPublishService);
index 5f1f666b73dc9e5ef5ac118193ba583246cab7a3..ab942ba6d40f3151bf3ae0fd1b5e7f8fef1320b8 100644 (file)
@@ -12,6 +12,7 @@ import javax.inject.Inject;
 import org.junit.Rule;
 import org.junit.Test;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.controller.simple.InMemoryControllerModule;
 import org.opendaylight.infrautils.inject.guice.testutils.AnnotationsModule;
 import org.opendaylight.infrautils.inject.guice.testutils.GuiceRule2;
@@ -22,6 +23,7 @@ public class InMemoryControllerModuleTest extends AbstractSimpleDistributionTest
     public @Rule GuiceRule2 guice = new GuiceRule2(InMemoryControllerModule.class, AnnotationsModule.class);
 
     @Inject DataBroker dataBroker;
+    @Inject NotificationService notificationService;
 
     @Test public void testDataBroker() throws InterruptedException, ExecutionException {
         dataBroker.newReadWriteTransaction().commit().get();