Search in sources :

Example 6 with CoreServiceAdapter

use of org.onosproject.core.CoreServiceAdapter in project onos by opennetworkinglab.

the class NetworkConfigLinksProviderTest method setUp.

/**
 * Sets up a network config links provider under test and the services
 * required to run it.
 */
@Before
public void setUp() {
    provider = new NetworkConfigLinksProvider();
    provider.coreService = new CoreServiceAdapter();
    provider.packetService = new PacketServiceAdapter();
    LinkProviderRegistryAdapter linkRegistry = new LinkProviderRegistryAdapter();
    provider.providerRegistry = linkRegistry;
    provider.deviceService = new TestDeviceManager();
    provider.masterService = new TestMastershipService();
    provider.packetService = new TestPacketService();
    provider.clusterMetadataService = new ClusterMetadataServiceAdapter();
    provider.netCfgService = configRegistry;
    provider.activate();
    providerService = linkRegistry.registeredProvider();
}
Also used : CoreServiceAdapter(org.onosproject.core.CoreServiceAdapter) PacketServiceAdapter(org.onosproject.net.packet.PacketServiceAdapter) ClusterMetadataServiceAdapter(org.onosproject.cluster.ClusterMetadataServiceAdapter) LinkProviderRegistryAdapter(org.onosproject.net.link.LinkProviderRegistryAdapter) Before(org.junit.Before)

Example 7 with CoreServiceAdapter

use of org.onosproject.core.CoreServiceAdapter in project up4 by omec-project.

the class Up4DeviceManagerTest method setUp.

@Before
public void setUp() {
    component = new Up4DeviceManager();
    component.coreService = new CoreServiceAdapter();
    component.flowRuleService = new FlowRuleServiceAdapter();
    component.meterService = new MeterServiceAdapter();
    component.deviceService = new DeviceServiceAdapter();
    component.piPipeconfService = new PiPipeconfServiceAdapter();
    component.netCfgService = new NetworkConfigRegistryAdapter();
    component.componentConfigService = new ComponentConfigAdapter();
    component.up4Store = TestDistributedUp4Store.build();
    injectEventDispatcher(component, new TestEventDispatcher());
    component.activate();
}
Also used : ComponentConfigAdapter(org.onosproject.cfg.ComponentConfigAdapter) TestEventDispatcher(org.onosproject.common.event.impl.TestEventDispatcher) CoreServiceAdapter(org.onosproject.core.CoreServiceAdapter) FlowRuleServiceAdapter(org.onosproject.net.flow.FlowRuleServiceAdapter) NetworkConfigRegistryAdapter(org.onosproject.net.config.NetworkConfigRegistryAdapter) MeterServiceAdapter(org.onosproject.net.meter.MeterServiceAdapter) PiPipeconfServiceAdapter(org.onosproject.net.pi.PiPipeconfServiceAdapter) DeviceServiceAdapter(org.onosproject.net.device.DeviceServiceAdapter) Before(org.junit.Before)

Example 8 with CoreServiceAdapter

use of org.onosproject.core.CoreServiceAdapter in project onos by opennetworkinglab.

the class ECFlowRuleStoreTest method setUp.

@Before
public void setUp() throws Exception {
    flowStoreImpl = new ECFlowRuleStore();
    flowStoreImpl.storageService = new TestStorageService() {

        @Override
        public <K, V> ConsistentMapBuilder<K, V> consistentMapBuilder() {
            return new ConsistentMapBuilder<K, V>() {

                @Override
                public AsyncConsistentMap<K, V> buildAsyncMap() {
                    return new AsyncConsistentMapAdapter<K, V>();
                }

                @Override
                public ConsistentMap<K, V> build() {
                    return null;
                }
            };
        }
    };
    ReplicaInfoManager replicaInfoManager = new ReplicaInfoManager();
    replicaInfoManager.mastershipService = new MasterOfAll();
    flowStoreImpl.replicaInfoManager = replicaInfoManager;
    mockClusterService = createMock(ClusterService.class);
    flowStoreImpl.clusterService = mockClusterService;
    nodeId = new NodeId("1");
    mockControllerNode = new MockControllerNode(nodeId);
    expect(mockClusterService.getLocalNode()).andReturn(mockControllerNode).anyTimes();
    replay(mockClusterService);
    flowStoreImpl.clusterCommunicator = new ClusterCommunicationServiceAdapter();
    flowStoreImpl.mastershipService = new MasterOfAll();
    flowStoreImpl.deviceService = new DeviceServiceAdapter();
    flowStoreImpl.coreService = new CoreServiceAdapter();
    flowStoreImpl.configService = new ComponentConfigAdapter();
    flowStoreImpl.persistenceService = new PersistenceServiceAdapter();
    flowStoreImpl.activate(context);
}
Also used : PersistenceServiceAdapter(org.onosproject.store.persistence.PersistenceServiceAdapter) TestStorageService(org.onosproject.store.service.TestStorageService) ClusterCommunicationServiceAdapter(org.onosproject.store.cluster.messaging.ClusterCommunicationServiceAdapter) ComponentConfigAdapter(org.onosproject.cfg.ComponentConfigAdapter) ClusterService(org.onosproject.cluster.ClusterService) CoreServiceAdapter(org.onosproject.core.CoreServiceAdapter) ConsistentMap(org.onosproject.store.service.ConsistentMap) AsyncConsistentMap(org.onosproject.store.service.AsyncConsistentMap) NodeId(org.onosproject.cluster.NodeId) AsyncConsistentMap(org.onosproject.store.service.AsyncConsistentMap) ConsistentMapBuilder(org.onosproject.store.service.ConsistentMapBuilder) DeviceServiceAdapter(org.onosproject.net.device.DeviceServiceAdapter) Before(org.junit.Before)

Example 9 with CoreServiceAdapter

use of org.onosproject.core.CoreServiceAdapter in project onos by opennetworkinglab.

the class InfluxDbMetricsReporterTest method setUp.

/**
 * Sets up the services required by influxDB metrics reporter.
 */
@Before
public void setUp() {
    influxReporter = new DefaultInfluxDbMetricsReporter();
    influxReporter.coreService = new CoreServiceAdapter();
    influxReporter.cfgService = new ComponentConfigAdapter();
    influxReporter.clusterService = new ClusterServiceAdapter();
    influxReporter.metricsService = new TestMetricsService();
    influxReporter.activate();
}
Also used : ComponentConfigAdapter(org.onosproject.cfg.ComponentConfigAdapter) CoreServiceAdapter(org.onosproject.core.CoreServiceAdapter) ClusterServiceAdapter(org.onosproject.cluster.ClusterServiceAdapter) Before(org.junit.Before)

Example 10 with CoreServiceAdapter

use of org.onosproject.core.CoreServiceAdapter in project aaa by opencord.

the class AaaIntegrationTest method setUp.

/**
 * Sets up the services required by the AAA application.
 */
@Before
public void setUp() {
    aaa = new AaaManager();
    aaa.netCfgService = new TestNetworkConfigRegistry();
    aaa.coreService = new CoreServiceAdapter();
    aaa.packetService = new MockPacketService();
    aaa.cfgService = new MockCfgService();
    aaa.activate(new AaaTestBase.MockComponentContext());
}
Also used : CoreServiceAdapter(org.onosproject.core.CoreServiceAdapter) MockCfgService(org.opencord.aaa.impl.AaaTestBase.MockCfgService) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)10 CoreServiceAdapter (org.onosproject.core.CoreServiceAdapter)10 ComponentConfigAdapter (org.onosproject.cfg.ComponentConfigAdapter)3 ClusterServiceAdapter (org.onosproject.cluster.ClusterServiceAdapter)3 ClusterCommunicationServiceAdapter (org.onosproject.store.cluster.messaging.ClusterCommunicationServiceAdapter)3 TestStorageService (org.onosproject.store.service.TestStorageService)3 DeviceServiceAdapter (org.onosproject.net.device.DeviceServiceAdapter)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ClusterMetadataServiceAdapter (org.onosproject.cluster.ClusterMetadataServiceAdapter)1 ClusterService (org.onosproject.cluster.ClusterService)1 NodeId (org.onosproject.cluster.NodeId)1 TestEventDispatcher (org.onosproject.common.event.impl.TestEventDispatcher)1 ApplicationId (org.onosproject.core.ApplicationId)1 DefaultApplicationId (org.onosproject.core.DefaultApplicationId)1 ControlMessageServiceAdaptor (org.onosproject.cpman.impl.message.ControlMessageServiceAdaptor)1 ControlPlaneMonitorServiceAdaptor (org.onosproject.cpman.impl.message.ControlPlaneMonitorServiceAdaptor)1 NetworkConfigRegistryAdapter (org.onosproject.net.config.NetworkConfigRegistryAdapter)1 DefaultTrafficSelector (org.onosproject.net.flow.DefaultTrafficSelector)1 FlowRuleServiceAdapter (org.onosproject.net.flow.FlowRuleServiceAdapter)1 TrafficSelector (org.onosproject.net.flow.TrafficSelector)1