import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
+import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
import org.opendaylight.openflowjava.protocol.api.connection.OutboundQueue;
import org.opendaylight.openflowjava.protocol.api.connection.OutboundQueueHandler;
import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceInitializationPhaseHandler;
import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceTerminationPhaseHandler;
import org.opendaylight.openflowplugin.api.openflow.lifecycle.LifecycleConductor;
+import org.opendaylight.openflowplugin.api.openflow.lifecycle.LifecycleService;
import org.opendaylight.openflowplugin.api.openflow.md.core.TranslatorKey;
import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageIntelligenceAgency;
+import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorExecutor;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager;
import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManagerFactory;
import org.opendaylight.openflowplugin.openflow.md.util.OpenflowPortsUtil;
private MessageIntelligenceAgency messageIntelligenceAgency;
@Mock
private DeviceInfo deviceInfo;
+ @Mock
+ private LifecycleService lifecycleService;
+ @Mock
+ private ClusterSingletonServiceProvider clusterSingletonServiceProvider;
+ @Mock
+ private ConvertorExecutor convertorExecutor;
@Before
public void setUp() throws Exception {
when(mockedWriteTransaction.submit()).thenReturn(mockedFuture);
- final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
- final DeviceManagerImpl deviceManager = new DeviceManagerImpl(mockedDataBroker,
- TEST_VALUE_GLOBAL_NOTIFICATION_QUOTA, false, barrierIntervalNanos, barrierCountLimit, lifecycleConductor, true, convertorManager);
+ final DeviceManagerImpl deviceManager = new DeviceManagerImpl(
+ mockedDataBroker,
+ TEST_VALUE_GLOBAL_NOTIFICATION_QUOTA,
+ false,
+ barrierIntervalNanos,
+ barrierCountLimit,
+ lifecycleConductor,
+ true,
+ convertorExecutor,
+ clusterSingletonServiceProvider);
deviceManager.setDeviceInitializationPhaseHandler(deviceInitPhaseHandler);
deviceManager.setDeviceTerminationPhaseHandler(deviceTerminationPhaseHandler);
doThrow(new IllegalStateException("dummy")).when(mockedDeviceContext).initialSubmitTransaction();
}
deviceManager.addDeviceContextToMap(deviceInfo, mockedDeviceContext);
- deviceManager.onDeviceContextLevelUp(deviceInfo);
+ deviceManager.onDeviceContextLevelUp(deviceInfo, lifecycleService);
if (withException) {
verify(mockedDeviceContext).close();
} else {
order.verify(mockConnectionContext).setOutboundQueueProvider(any(OutboundQueueProvider.class));
order.verify(mockConnectionContext).setOutboundQueueHandleRegistration(
Mockito.<OutboundQueueHandlerRegistration<OutboundQueueProvider>>any());
- verify(deviceInitPhaseHandler).onDeviceContextLevelUp(Matchers.<DeviceInfo>any());
+ verify(deviceInitPhaseHandler).onDeviceContextLevelUp(Matchers.<DeviceInfo>any(), Mockito.<LifecycleService>any());
}
@Test
order.verify(mockConnectionContext).setOutboundQueueProvider(any(OutboundQueueProvider.class));
order.verify(mockConnectionContext).setOutboundQueueHandleRegistration(
Mockito.<OutboundQueueHandlerRegistration<OutboundQueueProvider>>any());
- verify(deviceInitPhaseHandler).onDeviceContextLevelUp(Matchers.<DeviceInfo>any());
+ verify(deviceInitPhaseHandler).onDeviceContextLevelUp(Matchers.<DeviceInfo>any(), Mockito.<LifecycleService>any());
}
@Test