use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.lldp.discovery.config.rev160511.NonZeroUint32Type in project openflowplugin by opendaylight.
the class ConnectionManagerImplTest method setUp.
@Before
public void setUp() {
final ThreadPoolLoggingExecutor threadPool = new ThreadPoolLoggingExecutor(0, Integer.MAX_VALUE, 60L, TimeUnit.SECONDS, new SynchronousQueue<>(), "ofppool");
connectionManagerImpl = new ConnectionManagerImpl(new OpenflowProviderConfigBuilder().setEchoReplyTimeout(new NonZeroUint32Type(ECHO_REPLY_TIMEOUT)).build(), threadPool);
connectionManagerImpl.setDeviceConnectedHandler(deviceConnectedHandler);
final InetSocketAddress deviceAddress = InetSocketAddress.createUnresolved("yahoo", 42);
Mockito.when(connection.getRemoteAddress()).thenReturn(deviceAddress);
Mockito.when(connection.isAlive()).thenReturn(true);
Mockito.when(connection.barrier(Matchers.<BarrierInput>any())).thenReturn(RpcResultBuilder.success(new BarrierOutputBuilder().build()).buildFuture());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.lldp.discovery.config.rev160511.NonZeroUint32Type in project openflowplugin by opendaylight.
the class StatisticsContextImplTest method setUp.
@Before
public void setUp() throws Exception {
convertorManager = ConvertorManagerFactory.createDefaultManager();
when(mockedDeviceInfo.reserveXidForDeviceMessage()).thenReturn(TEST_XID);
Mockito.when(mockedDeviceContext.getDeviceState()).thenReturn(mockedDeviceState);
Mockito.when(config.isIsTableStatisticsPollingOn()).thenReturn(true);
Mockito.when(config.isIsFlowStatisticsPollingOn()).thenReturn(true);
Mockito.when(config.isIsGroupStatisticsPollingOn()).thenReturn(true);
Mockito.when(config.isIsMeterStatisticsPollingOn()).thenReturn(true);
Mockito.when(config.isIsPortStatisticsPollingOn()).thenReturn(true);
Mockito.when(config.isIsQueueStatisticsPollingOn()).thenReturn(true);
Mockito.when(config.getBasicTimerDelay()).thenReturn(new NonZeroUint32Type(3000L));
Mockito.when(config.getMaximumTimerDelay()).thenReturn(new NonZeroUint32Type(50000L));
initStatisticsContext();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.lldp.discovery.config.rev160511.NonZeroUint32Type in project openflowplugin by opendaylight.
the class ConfigurationServiceFactoryImplTest method setUp.
@Before
public void setUp() throws Exception {
when(config.isIsStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
when(config.isIsFlowStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
when(config.isIsTableStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
when(config.isIsFlowStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
when(config.isIsGroupStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
when(config.isIsMeterStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
when(config.isIsQueueStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
when(config.isIsPortStatisticsPollingOn()).thenReturn(IS_STATISTICS_POLLING_ON);
when(config.getBarrierCountLimit()).thenReturn(new NonZeroUint16Type(BARRIER_COUNT_LIMIT));
when(config.getBarrierIntervalTimeoutLimit()).thenReturn(new NonZeroUint32Type(BARRIER_INTERVAL_TIMEOUT_LIMIT));
when(config.getEchoReplyTimeout()).thenReturn(new NonZeroUint32Type(ECHO_REPLY_TIMEOUT));
when(config.isEnableFlowRemovedNotification()).thenReturn(ENABLE_FLOW_REMOVED_NOTIFICATION);
when(config.isSkipTableFeatures()).thenReturn(SKIP_TABLE_FEATURES);
when(config.getBasicTimerDelay()).thenReturn(new NonZeroUint32Type(BASIC_TIMER_DELAY));
when(config.getMaximumTimerDelay()).thenReturn(new NonZeroUint32Type(MAXIMUM_TIMER_DELAY));
when(config.isSwitchFeaturesMandatory()).thenReturn(SWITCH_FEATURES_MANDATORY);
when(config.isIsStatisticsRpcEnabled()).thenReturn(IS_STATISTICS_RPC_ENABLED);
when(config.isUseSingleLayerSerialization()).thenReturn(USE_SINGLE_LAYER_SERIALIZATION);
when(config.getRpcRequestsQuota()).thenReturn(new NonZeroUint16Type(RPC_REQUESTS_QUOTA));
when(config.getGlobalNotificationQuota()).thenReturn(GLOBAL_NOTIFICATION_QUOTA);
when(config.getThreadPoolMinThreads()).thenReturn(THREAD_POOL_MIN_THREADS);
when(config.getThreadPoolMaxThreads()).thenReturn(new NonZeroUint16Type(THREAD_POOL_MAX_THREADS));
when(config.getThreadPoolTimeout()).thenReturn(THREAD_POOL_TIMEOUT);
final Dictionary<String, Object> properties = new Hashtable<>();
properties.put(ConfigurationProperty.IS_STATISTICS_POLLING_ON.toString(), IS_STATISTICS_POLLING_ON);
when(configuration.getProperties()).thenReturn(properties);
when(configurationAdmin.getConfiguration(OFConstants.CONFIG_FILE_ID)).thenReturn(configuration);
when(bundleContext.getService(serviceReference)).thenReturn(configurationAdmin);
when(bundleContext.getServiceReference(ConfigurationAdmin.class)).thenReturn(serviceReference);
configurationService = new ConfigurationServiceFactoryImpl().newInstance(config, bundleContext);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.lldp.discovery.config.rev160511.NonZeroUint32Type in project openflowplugin by opendaylight.
the class DeviceManagerImplTest method setUp.
@Before
public void setUp() throws Exception {
when(mockConnectionContext.getNodeId()).thenReturn(DUMMY_NODE_ID);
when(mockConnectionContext.getFeatures()).thenReturn(mockFeatures);
when(mockConnectionContext.getConnectionAdapter()).thenReturn(mockedConnectionAdapter);
when(mockConnectionContext.getDeviceInfo()).thenReturn(deviceInfo);
when(mockedDeviceContext.getPrimaryConnectionContext()).thenReturn(mockConnectionContext);
when(deviceInfo.getNodeInstanceIdentifier()).thenReturn(DUMMY_IDENTIFIER);
when(deviceInfo.getNodeId()).thenReturn(DUMMY_NODE_ID);
when(mockFeatures.getCapabilities()).thenReturn(capabilities);
when(mockFeatures.getCapabilitiesV10()).thenReturn(capabilitiesV10);
when(mockFeatures.getDatapathId()).thenReturn(BigInteger.valueOf(21L));
when(mockedFuture.isDone()).thenReturn(true);
when(writeTransaction.submit()).thenReturn(mockedFuture);
when(transactionChain.newWriteOnlyTransaction()).thenReturn(writeTransaction);
when(dataBroker.createTransactionChain(any(TransactionChainListener.class))).thenReturn(transactionChain);
when(dataBroker.newWriteOnlyTransaction()).thenReturn(writeTransaction);
deviceManager = new DeviceManagerImpl(new OpenflowProviderConfigBuilder().setBarrierCountLimit(new NonZeroUint16Type(BARRIER_COUNT_LIMIT)).setBarrierIntervalTimeoutLimit(new NonZeroUint32Type(BARRIER_INTERVAL_NANOS)).setGlobalNotificationQuota(TEST_VALUE_GLOBAL_NOTIFICATION_QUOTA).setSwitchFeaturesMandatory(false).setEnableFlowRemovedNotification(true).setSkipTableFeatures(false).setUseSingleLayerSerialization(true).build(), dataBroker, messageIntelligenceAgency, notificationPublishService, new HashedWheelTimer(), convertorExecutor, DeviceInitializerProviderFactory.createDefaultProvider());
deviceManager.setTranslatorLibrary(translatorLibrary);
verify(dataBroker).newWriteOnlyTransaction();
verify(writeTransaction).merge(eq(LogicalDatastoreType.OPERATIONAL), any(), any());
verify(writeTransaction).submit();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.lldp.discovery.config.rev160511.NonZeroUint32Type in project openflowplugin by opendaylight.
the class LLDPLinkAgerTest method getConfig.
private TopologyLldpDiscoveryConfig getConfig() {
TopologyLldpDiscoveryConfigBuilder cfgBuilder = new TopologyLldpDiscoveryConfigBuilder();
cfgBuilder.setTopologyLldpInterval(new NonZeroUint32Type(LLDP_INTERVAL));
cfgBuilder.setTopologyLldpExpirationInterval(new NonZeroUint32Type(LINK_EXPIRATION_TIME));
return cfgBuilder.build();
}
Aggregations