Search in sources :

Example 1 with DeviceManager

use of org.opendaylight.openflowplugin.api.openflow.device.DeviceManager in project openflowplugin by opendaylight.

the class StatisticsContextImpMockInitiation method initialize.

@Before
public void initialize() {
    mockedDeviceContext = mock(DeviceContext.class);
    mockedStatisticsGatheringService = mock(StatisticsGatheringService.class);
    mockedStatisticsOnFlyGatheringService = mock(StatisticsGatheringOnTheFlyService.class);
    mockedConnectionContext = mock(ConnectionContext.class);
    mockedDeviceState = mock(DeviceState.class);
    mockedDeviceInfo = mock(DeviceInfo.class);
    mockedStatisticsManager = mock(StatisticsManager.class);
    mockedMastershipWatcher = mock(ContextChainMastershipWatcher.class);
    final FeaturesReply mockedFeatures = mock(FeaturesReply.class);
    final MessageSpy mockedMessageSpy = mock(MessageSpy.class);
    final OutboundQueue mockedOutboundQueue = mock(OutboundQueue.class);
    final DeviceManager mockedDeviceManager = mock(DeviceManager.class);
    when(mockedDeviceContext.getDeviceState()).thenReturn(mockedDeviceState);
    when(mockedDeviceContext.getDeviceInfo()).thenReturn(mockedDeviceInfo);
    when(mockedDeviceContext.getPrimaryConnectionContext()).thenReturn(mockedConnectionContext);
    when(mockedDeviceContext.getMessageSpy()).thenReturn(mockedMessageSpy);
    when(mockedDeviceState.isTableStatisticsAvailable()).thenReturn(isTable);
    when(mockedDeviceState.isFlowStatisticsAvailable()).thenReturn(isFlow);
    when(mockedDeviceState.isGroupAvailable()).thenReturn(isGroup);
    when(mockedDeviceState.isMetersAvailable()).thenReturn(isMeter);
    when(mockedDeviceState.isPortStatisticsAvailable()).thenReturn(isPort);
    when(mockedDeviceState.isQueueStatisticsAvailable()).thenReturn(isQueue);
    when(mockedDeviceInfo.getNodeInstanceIdentifier()).thenReturn(DUMMY_NODE_ID);
    when(mockedDeviceInfo.getDatapathId()).thenReturn(BigInteger.TEN);
    when(mockedDeviceContext.getDeviceState()).thenReturn(mockedDeviceState);
    when(mockedDeviceContext.getDeviceInfo()).thenReturn(mockedDeviceInfo);
    when(mockedDeviceContext.getPrimaryConnectionContext()).thenReturn(mockedConnectionContext);
    when(mockedDeviceContext.getMessageSpy()).thenReturn(mockedMessageSpy);
    when(mockedDeviceInfo.getNodeId()).thenReturn(DUMMY_NODE_ID.getKey().getId());
    when(mockedConnectionContext.getNodeId()).thenReturn(DUMMY_NODE_ID.getKey().getId());
    when(mockedConnectionContext.getFeatures()).thenReturn(mockedFeatures);
    when(mockedConnectionContext.getConnectionState()).thenReturn(ConnectionContext.CONNECTION_STATE.WORKING);
    when(mockedConnectionContext.getOutboundQueueProvider()).thenReturn(mockedOutboundQueue);
}
Also used : OutboundQueue(org.opendaylight.openflowjava.protocol.api.connection.OutboundQueue) DeviceContext(org.opendaylight.openflowplugin.api.openflow.device.DeviceContext) StatisticsGatheringOnTheFlyService(org.opendaylight.openflowplugin.impl.statistics.services.dedicated.StatisticsGatheringOnTheFlyService) DeviceState(org.opendaylight.openflowplugin.api.openflow.device.DeviceState) StatisticsManager(org.opendaylight.openflowplugin.api.openflow.statistics.StatisticsManager) StatisticsGatheringService(org.opendaylight.openflowplugin.impl.statistics.services.dedicated.StatisticsGatheringService) ContextChainMastershipWatcher(org.opendaylight.openflowplugin.api.openflow.lifecycle.ContextChainMastershipWatcher) FeaturesReply(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FeaturesReply) DeviceInfo(org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo) DeviceManager(org.opendaylight.openflowplugin.api.openflow.device.DeviceManager) ConnectionContext(org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext) MessageSpy(org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageSpy) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 OutboundQueue (org.opendaylight.openflowjava.protocol.api.connection.OutboundQueue)1 ConnectionContext (org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext)1 DeviceContext (org.opendaylight.openflowplugin.api.openflow.device.DeviceContext)1 DeviceInfo (org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo)1 DeviceManager (org.opendaylight.openflowplugin.api.openflow.device.DeviceManager)1 DeviceState (org.opendaylight.openflowplugin.api.openflow.device.DeviceState)1 ContextChainMastershipWatcher (org.opendaylight.openflowplugin.api.openflow.lifecycle.ContextChainMastershipWatcher)1 StatisticsManager (org.opendaylight.openflowplugin.api.openflow.statistics.StatisticsManager)1 MessageSpy (org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageSpy)1 StatisticsGatheringOnTheFlyService (org.opendaylight.openflowplugin.impl.statistics.services.dedicated.StatisticsGatheringOnTheFlyService)1 StatisticsGatheringService (org.opendaylight.openflowplugin.impl.statistics.services.dedicated.StatisticsGatheringService)1 FeaturesReply (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FeaturesReply)1