Merge "BUG-4117: notification supplier - rename"
authorAbhijit Kumbhare <abhijit.kumbhare@ericsson.com>
Mon, 23 May 2016 22:06:02 +0000 (22:06 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 23 May 2016 22:06:02 +0000 (22:06 +0000)
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/DeviceContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/direct/AbstractDirectStatisticsService.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/device/DeviceContextImplTest.java

index 1d82ea0f2f89d7e7784f5e12fc33088842ca7718..441725723740f439ac10f78b1f03bc1e5d2c5028 100644 (file)
@@ -412,6 +412,8 @@ public class DeviceContextImpl implements DeviceContext, ExtensionConverterProvi
                         .child(Flow.class, new FlowKey(flowDescriptor.getFlowId()));
                 // b) notify listener
                 itemLifecycleListener.onRemoved(flowPath);
+                // c) trigger off a notification
+                notificationPublishService.offerNotification(flowRemovedNotification);
             } else {
                 LOG.debug("flow id not found: nodeId={} tableId={}, priority={}",
                         getDeviceState().getNodeId(), flowRegKey.getTableId(), flowRemovedNotification.getPriority());
index efc9eb379fc8845193424430214924cd57b457c7..e809ebf9a05b759d250fafcfddbeba1533893124 100644 (file)
@@ -92,7 +92,7 @@ public abstract class AbstractDirectStatisticsService<I extends StoreStatsGroupi
         final ListenableFuture<RpcResult<List<MultipartReply>>> rpcReply = handleServiceCall(input);
         ListenableFuture<RpcResult<O>> rpcResult = Futures.transform(rpcReply, resultTransformFunction);
 
-        if (input.isStoreStats()) {
+        if (Boolean.TRUE.equals(input.isStoreStats())) {
             rpcResult = Futures.transform(rpcResult, resultStoreFunction);
         }
 
index 6c18618612521c412f1903d6f5ecc7e6a32a8da3..07e345168a52e4d77b538a2b47bf6a9f0e84cdda 100644 (file)
@@ -494,6 +494,7 @@ public class DeviceContextImplTest {
                 .setPriority(42)
                 .setCookie(new FlowCookie(BigInteger.ONE))
                 .setMatch(new MatchBuilder().build());
+        final NotificationPublishService mockedNotificationPublishService = mock(NotificationPublishService.class);
 
         Mockito.when(messageTranslatorFlowRemoved.translate(any(Object.class), any(DeviceState.class), any(Object.class)))
                 .thenReturn(flowRemovedMdsalBld.build());
@@ -518,6 +519,7 @@ public class DeviceContextImplTest {
                 .child(Table.class, new TableKey((short) 0))
                 .child(Flow.class, new FlowKey(new FlowId("ut-ofp:f456")));
 
+        deviceContext.setNotificationPublishService(mockedNotificationPublishService);
         deviceContext.processFlowRemovedMessage(flowRemovedBld.build());
         Mockito.verify(itemLifecycleListener).onRemoved(flowToBeRemovedPath);
     }