Search in sources :

Example 1 with NonZeroUint32Type

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());
}
Also used : OpenflowProviderConfigBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.OpenflowProviderConfigBuilder) InetSocketAddress(java.net.InetSocketAddress) NonZeroUint32Type(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.NonZeroUint32Type) ThreadPoolLoggingExecutor(org.opendaylight.openflowplugin.impl.util.ThreadPoolLoggingExecutor) BarrierOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutputBuilder) Before(org.junit.Before)

Example 2 with NonZeroUint32Type

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();
}
Also used : NonZeroUint32Type(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.NonZeroUint32Type) Before(org.junit.Before)

Example 3 with NonZeroUint32Type

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);
}
Also used : NonZeroUint16Type(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.NonZeroUint16Type) Hashtable(java.util.Hashtable) NonZeroUint32Type(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.NonZeroUint32Type) Before(org.junit.Before)

Example 4 with NonZeroUint32Type

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();
}
Also used : NonZeroUint16Type(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.NonZeroUint16Type) OpenflowProviderConfigBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.OpenflowProviderConfigBuilder) TransactionChainListener(org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener) NonZeroUint32Type(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.NonZeroUint32Type) HashedWheelTimer(io.netty.util.HashedWheelTimer) Before(org.junit.Before)

Example 5 with NonZeroUint32Type

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();
}
Also used : NonZeroUint32Type(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.lldp.discovery.config.rev160511.NonZeroUint32Type) TopologyLldpDiscoveryConfigBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.lldp.discovery.config.rev160511.TopologyLldpDiscoveryConfigBuilder)

Aggregations

Before (org.junit.Before)6 NonZeroUint32Type (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.NonZeroUint32Type)6 OpenflowProviderConfigBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.OpenflowProviderConfigBuilder)3 NonZeroUint16Type (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.NonZeroUint16Type)2 HashedWheelTimer (io.netty.util.HashedWheelTimer)1 InetSocketAddress (java.net.InetSocketAddress)1 Hashtable (java.util.Hashtable)1 List (java.util.List)1 TransactionChainListener (org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener)1 DeviceFlowRegistryImpl (org.opendaylight.openflowplugin.impl.registry.flow.DeviceFlowRegistryImpl)1 ThreadPoolLoggingExecutor (org.opendaylight.openflowplugin.impl.util.ThreadPoolLoggingExecutor)1 ConvertorManager (org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorManager)1 NodeId (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId)1 Nodes (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes)1 Node (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node)1 NodeKey (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey)1 BarrierOutputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutputBuilder)1 StatisticsManagerControlService (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.sm.control.rev150812.StatisticsManagerControlService)1 NonZeroUint32Type (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.lldp.discovery.config.rev160511.NonZeroUint32Type)1 TopologyLldpDiscoveryConfigBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.lldp.discovery.config.rev160511.TopologyLldpDiscoveryConfigBuilder)1