Search in sources :

Example 21 with ComponentConfigAdapter

use of org.onosproject.cfg.ComponentConfigAdapter in project onos by opennetworkinglab.

the class IntentCleanupTestMock method setUp.

@Before
public void setUp() {
    service = createMock(IntentService.class);
    store = new SimpleIntentStore();
    cleanup = new IntentCleanup();
    cleanup.cfgService = new ComponentConfigAdapter();
    cleanup.service = service;
    cleanup.store = store;
    cleanup.period = 1000;
    cleanup.retryThreshold = 3;
    assertTrue("store should be empty", Sets.newHashSet(cleanup.store.getIntents()).isEmpty());
    super.setUp();
}
Also used : ComponentConfigAdapter(org.onosproject.cfg.ComponentConfigAdapter) IntentService(org.onosproject.net.intent.IntentService) SimpleIntentStore(org.onosproject.store.trivial.SimpleIntentStore) Before(org.junit.Before)

Example 22 with ComponentConfigAdapter

use of org.onosproject.cfg.ComponentConfigAdapter in project onos by opennetworkinglab.

the class FlowRuleManagerTest method setUp.

@Before
public void setUp() {
    mgr = new FlowRuleManager();
    mgr.store = new SimpleFlowRuleStore();
    injectEventDispatcher(mgr, new TestEventDispatcher());
    mgr.deviceService = new TestDeviceService();
    mgr.mastershipService = new TestMastershipService();
    mgr.coreService = new TestCoreService();
    mgr.operationsService = MoreExecutors.newDirectExecutorService();
    mgr.deviceInstallers = MoreExecutors.newDirectExecutorService();
    mgr.cfgService = new ComponentConfigAdapter();
    ClusterService mockClusterService = createMock(ClusterService.class);
    NodeId nodeId = new NodeId(NODE_ID);
    MockControllerNode mockControllerNode = new MockControllerNode(nodeId);
    expect(mockClusterService.getLocalNode()).andReturn(mockControllerNode).anyTimes();
    replay(mockClusterService);
    mgr.clusterService = mockClusterService;
    service = mgr;
    registry = mgr;
    DriverRegistryManager driverRegistry = new DriverRegistryManager();
    driverService = new TestDriverManager(driverRegistry);
    driverRegistry.addDriver(new DefaultDriver("foo", ImmutableList.of(), "", "", "", ImmutableMap.of(FlowRuleProgrammable.class, TestFlowRuleProgrammable.class), ImmutableMap.of()));
    mgr.activate(null);
    mgr.addListener(listener);
    provider = new TestProvider(PID);
    providerService = this.registry.register(provider);
    appId = new TestApplicationId(0, "FlowRuleManagerTest");
    assertTrue("provider should be registered", this.registry.getProviders().contains(provider.id()));
}
Also used : TestEventDispatcher(org.onosproject.common.event.impl.TestEventDispatcher) ComponentConfigAdapter(org.onosproject.cfg.ComponentConfigAdapter) ClusterService(org.onosproject.cluster.ClusterService) SimpleFlowRuleStore(org.onosproject.store.trivial.SimpleFlowRuleStore) NodeId(org.onosproject.cluster.NodeId) DefaultDriver(org.onosproject.net.driver.DefaultDriver) DriverRegistryManager(org.onosproject.net.driver.impl.DriverRegistryManager) Before(org.junit.Before)

Example 23 with ComponentConfigAdapter

use of org.onosproject.cfg.ComponentConfigAdapter in project onos by opennetworkinglab.

the class DefaultTopologyProviderTest method setUp.

@Before
public void setUp() {
    provider.deviceService = deviceService;
    provider.linkService = linkService;
    provider.providerRegistry = topologyService;
    provider.cfgService = new ComponentConfigAdapter();
    provider.activate(null);
}
Also used : ComponentConfigAdapter(org.onosproject.cfg.ComponentConfigAdapter) Before(org.junit.Before)

Example 24 with ComponentConfigAdapter

use of org.onosproject.cfg.ComponentConfigAdapter 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 25 with ComponentConfigAdapter

use of org.onosproject.cfg.ComponentConfigAdapter in project onos by opennetworkinglab.

the class LldpLinkProviderTest method setUp.

@Before
public void setUp() {
    deviceBlacklist = new HashSet<>();
    portBlacklist = new HashSet<>();
    cfg = new TestSuppressionConfig();
    coreService = createMock(CoreService.class);
    expect(coreService.registerApplication(appId.name())).andReturn(appId).anyTimes();
    replay(coreService);
    provider.cfgService = new ComponentConfigAdapter();
    provider.enabled = false;
    provider.coreService = coreService;
    provider.cfgRegistry = configRegistry;
    provider.deviceService = deviceService;
    provider.linkService = linkService;
    provider.packetService = packetService;
    provider.providerRegistry = linkRegistry;
    provider.masterService = masterService;
    provider.clusterMetadataService = new ClusterMetadataServiceAdapter();
    provider.activate(null);
    provider.eventExecutor = MoreExecutors.newDirectExecutorService();
    providerService = linkRegistry.registeredProvider();
}
Also used : ComponentConfigAdapter(org.onosproject.cfg.ComponentConfigAdapter) CoreService(org.onosproject.core.CoreService) ClusterMetadataServiceAdapter(org.onosproject.cluster.ClusterMetadataServiceAdapter) Before(org.junit.Before)

Aggregations

ComponentConfigAdapter (org.onosproject.cfg.ComponentConfigAdapter)30 Before (org.junit.Before)27 CoreService (org.onosproject.core.CoreService)12 IntentExtensionService (org.onosproject.net.intent.IntentExtensionService)7 MockResourceService (org.onosproject.net.resource.MockResourceService)7 TestEventDispatcher (org.onosproject.common.event.impl.TestEventDispatcher)6 DomainService (org.onosproject.net.domain.DomainService)6 ClusterService (org.onosproject.cluster.ClusterService)4 NodeId (org.onosproject.cluster.NodeId)4 DeviceServiceAdapter (org.onosproject.net.device.DeviceServiceAdapter)4 DriverServiceAdapter (org.onosproject.net.driver.DriverServiceAdapter)4 CoreServiceAdapter (org.onosproject.core.CoreServiceAdapter)3 DefaultDriver (org.onosproject.net.driver.DefaultDriver)3 DriverRegistryManager (org.onosproject.net.driver.impl.DriverRegistryManager)3 ClusterCommunicationServiceAdapter (org.onosproject.store.cluster.messaging.ClusterCommunicationServiceAdapter)3 TestStorageService (org.onosproject.store.service.TestStorageService)3 Test (org.junit.Test)2 ComponentContextAdapter (org.onlab.osgi.ComponentContextAdapter)2 FlowRuleIntent (org.onosproject.net.intent.FlowRuleIntent)2 Intent (org.onosproject.net.intent.Intent)2