Search in sources :

Example 1 with CoreServiceAdapter

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

the class ControlPlaneManagerTest method setUp.

/**
 * Sets up the services required by the CPMan application.
 */
@Before
public void setUp() {
    cpMan = new ControlPlaneManager();
    cpMan.coreService = new CoreServiceAdapter();
    cpMan.messageService = new ControlMessageServiceAdaptor();
    cpMan.monitorService = new ControlPlaneMonitorServiceAdaptor();
    cpMan.activate();
}
Also used : ControlPlaneMonitorServiceAdaptor(org.onosproject.cpman.impl.message.ControlPlaneMonitorServiceAdaptor) CoreServiceAdapter(org.onosproject.core.CoreServiceAdapter) ControlMessageServiceAdaptor(org.onosproject.cpman.impl.message.ControlMessageServiceAdaptor) Before(org.junit.Before)

Example 2 with CoreServiceAdapter

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

the class DefaultVirtualPacketProviderTest method setUp.

@Before
public void setUp() {
    virtualProvider = new DefaultVirtualPacketProvider();
    virtualProvider.coreService = new CoreServiceAdapter();
    virtualProvider.vnaService = new TestVirtualNetworkAdminService();
    providerService = new TestVirtualPacketProviderService();
    testPacketService = new TestPacketService();
    virtualProvider.packetService = testPacketService;
    providerManager = new VirtualProviderManager();
    virtualProvider.providerRegistryService = providerManager;
    providerManager.registerProviderService(VNET_ID, providerService);
    virtualProvider.activate();
    vAppId = new TestApplicationId(0, "Virtual App");
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    selector.matchEthType(Ethernet.TYPE_IPV4);
    virtualProvider.startPacketHandling();
}
Also used : CoreServiceAdapter(org.onosproject.core.CoreServiceAdapter) TrafficSelector(org.onosproject.net.flow.TrafficSelector) DefaultTrafficSelector(org.onosproject.net.flow.DefaultTrafficSelector) Before(org.junit.Before)

Example 3 with CoreServiceAdapter

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

the class FlowTableConfigTest method setUp.

@Before
public void setUp() throws Exception {
    directory.add(CoreService.class, new CoreServiceAdapter() {

        @Override
        public ApplicationId getAppId(Short id) {
            return APP_ID;
        }

        @Override
        public ApplicationId registerApplication(String name) {
            return APP_ID;
        }
    });
    mapper = testFriendlyMapper();
    JsonNode sample = loadJsonFromResource(SAMPLE, mapper);
    cfgnode = sample.path("devices").path(DID.toString()).path(FlowTableConfig.CONFIG_KEY);
}
Also used : CoreServiceAdapter(org.onosproject.core.CoreServiceAdapter) JsonNode(com.fasterxml.jackson.databind.JsonNode) DefaultApplicationId(org.onosproject.core.DefaultApplicationId) ApplicationId(org.onosproject.core.ApplicationId) Before(org.junit.Before)

Example 4 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 5 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)

Aggregations

Before (org.junit.Before)7 CoreServiceAdapter (org.onosproject.core.CoreServiceAdapter)7 ComponentConfigAdapter (org.onosproject.cfg.ComponentConfigAdapter)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 ClusterServiceAdapter (org.onosproject.cluster.ClusterServiceAdapter)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 LinkProviderRegistryAdapter (org.onosproject.net.link.LinkProviderRegistryAdapter)1 MeterServiceAdapter (org.onosproject.net.meter.MeterServiceAdapter)1