Search in sources :

Example 1 with DriverServiceAdapter

use of org.onosproject.net.driver.DriverServiceAdapter in project onos by opennetworkinglab.

the class OpenFlowGroupProviderTest method setUp.

@Before
public void setUp() {
    provider.controller = controller;
    provider.providerRegistry = providerRegistry;
    provider.cfgService = new ComponentConfigAdapter();
    provider.driverService = new DriverServiceAdapter();
    provider.activate(null);
}
Also used : ComponentConfigAdapter(org.onosproject.cfg.ComponentConfigAdapter) DriverServiceAdapter(org.onosproject.net.driver.DriverServiceAdapter) Before(org.junit.Before)

Example 2 with DriverServiceAdapter

use of org.onosproject.net.driver.DriverServiceAdapter in project onos by opennetworkinglab.

the class PollingAlarmProviderTest method setUp.

@Before
public void setUp() {
    provider.providerRegistry = providerRegistry;
    provider.deviceService = deviceService;
    provider.mastershipService = mastershipService;
    provider.cfgService = cfgService;
    AbstractProjectableModel.setDriverService(null, new DriverServiceAdapter());
    provider.activate(context);
}
Also used : DriverServiceAdapter(org.onosproject.net.driver.DriverServiceAdapter) Before(org.junit.Before)

Example 3 with DriverServiceAdapter

use of org.onosproject.net.driver.DriverServiceAdapter in project onos by opennetworkinglab.

the class LinkDiscoveryProviderTest method setUp.

@Before
public void setUp() {
    coreService = createMock(CoreService.class);
    expect(coreService.registerApplication(appId.name())).andReturn(appId).anyTimes();
    replay(coreService);
    provider.coreService = coreService;
    provider.providerRegistry = linkRegistry;
    provider.deviceService = deviceService;
    provider.mastershipService = mastershipService;
    provider.linkService = linkService;
    provider.cfgService = new ComponentConfigAdapter();
    AbstractProjectableModel.setDriverService(null, new DriverServiceAdapter());
    provider.activate(null);
    providerService = linkRegistry.registeredProvider();
}
Also used : ComponentConfigAdapter(org.onosproject.cfg.ComponentConfigAdapter) DriverServiceAdapter(org.onosproject.net.driver.DriverServiceAdapter) CoreService(org.onosproject.core.CoreService) Before(org.junit.Before)

Example 4 with DriverServiceAdapter

use of org.onosproject.net.driver.DriverServiceAdapter in project onos by opennetworkinglab.

the class NetconfDeviceProviderTest method setUp.

@Before
public void setUp() throws IOException {
    coreService = createMock(CoreService.class);
    expect(coreService.registerApplication(APP_NAME)).andReturn(appId).anyTimes();
    replay(coreService);
    provider.coreService = coreService;
    provider.providerRegistry = deviceRegistry;
    provider.mastershipService = mastershipService;
    provider.deviceService = deviceService;
    provider.providerService = providerService;
    provider.cfgService = cfgService;
    provider.controller = controller;
    provider.deviceKeyAdminService = deviceKeyAdminService;
    provider.componentConfigService = new ComponentConfigAdapter();
    AbstractProjectableModel.setDriverService(null, new DriverServiceAdapter());
    provider.activate(null);
    devices.clear();
    available = false;
    firstRequest = true;
    DeviceId subject = DeviceId.deviceId(NETCONF_DEVICE_ID_STRING);
    DeviceId subjectIpv6 = DeviceId.deviceId(NETCONF_DEVICE_ID_STRING_IPV6);
    String key = "netconf";
    ObjectMapper mapper = new ObjectMapper();
    JsonNode jsonNode = mapper.readTree(jsonStream);
    ConfigApplyDelegate delegate = new MockDelegate();
    netconfDeviceConfig.init(subject, key, jsonNode, mapper, delegate);
    JsonNode jsonNodesshKey = mapper.readTree(jsonStreamSshKey);
    netconfDeviceConfigSshKey.init(subject, key, jsonNodesshKey, mapper, delegate);
    JsonNode jsonNodeEmpty = mapper.createObjectNode();
    netconfDeviceConfigEmptyIpv4.init(subject, key, jsonNodeEmpty, mapper, delegate);
    netconfDeviceConfigEmptyIpv6.init(subjectIpv6, key, jsonNodeEmpty, mapper, delegate);
    deviceAdded = new CountDownLatch(0);
}
Also used : ComponentConfigAdapter(org.onosproject.cfg.ComponentConfigAdapter) DriverServiceAdapter(org.onosproject.net.driver.DriverServiceAdapter) DeviceId(org.onosproject.net.DeviceId) CoreService(org.onosproject.core.CoreService) JsonNode(com.fasterxml.jackson.databind.JsonNode) CountDownLatch(java.util.concurrent.CountDownLatch) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) ConfigApplyDelegate(org.onosproject.net.config.ConfigApplyDelegate) Before(org.junit.Before)

Example 5 with DriverServiceAdapter

use of org.onosproject.net.driver.DriverServiceAdapter in project onos by opennetworkinglab.

the class OpenFlowDeviceProviderTest method startUp.

@Before
public void startUp() {
    provider.providerRegistry = registry;
    provider.controller = controller;
    provider.cfgService = new ComponentConfigAdapter();
    provider.driverService = new DriverServiceAdapter();
    provider.deviceService = new DeviceServiceAdapter();
    controller.switchMap.put(DPID1, SW1);
    provider.activate(null);
    assertNotNull("provider should be registered", registry.provider);
    assertNotNull("listener should be registered", controller.listener);
    assertEquals("devices not added", 1, registry.connected.size());
    assertEquals("ports not added", 2, registry.ports.get(DID1).size());
}
Also used : ComponentConfigAdapter(org.onosproject.cfg.ComponentConfigAdapter) DriverServiceAdapter(org.onosproject.net.driver.DriverServiceAdapter) DeviceServiceAdapter(org.onosproject.net.device.DeviceServiceAdapter) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)5 DriverServiceAdapter (org.onosproject.net.driver.DriverServiceAdapter)5 ComponentConfigAdapter (org.onosproject.cfg.ComponentConfigAdapter)4 CoreService (org.onosproject.core.CoreService)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 DeviceId (org.onosproject.net.DeviceId)1 ConfigApplyDelegate (org.onosproject.net.config.ConfigApplyDelegate)1 DeviceServiceAdapter (org.onosproject.net.device.DeviceServiceAdapter)1