Search in sources :

Example 1 with ComponentConfigAdapter

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

the class DriverRegistryManagerTest method setUp.

@Before
public void setUp() {
    mgr = new DriverRegistryManager();
    mgr.deviceService = new DeviceServiceAdapter();
    mgr.componentConfigService = new ComponentConfigAdapter();
    mgr.eventDispatcher = new TestEventDispatcher();
    mgr.componentService = componentService;
    mgr.activate(null);
}
Also used : ComponentConfigAdapter(org.onosproject.cfg.ComponentConfigAdapter) TestEventDispatcher(org.onosproject.common.event.impl.TestEventDispatcher) DeviceServiceAdapter(org.onosproject.net.device.DeviceServiceAdapter) Before(org.junit.Before)

Example 2 with ComponentConfigAdapter

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

the class GroupManagerTest method setUp.

@Before
public void setUp() {
    mgr = new GroupManager();
    groupService = mgr;
    // mgr.deviceService = new DeviceManager();
    mgr.deviceService = new TestDeviceService();
    mgr.cfgService = new ComponentConfigAdapter();
    mgr.store = new SimpleGroupStore();
    mgr.mastershipService = new TestMastershipService();
    injectEventDispatcher(mgr, new TestEventDispatcher());
    providerRegistry = mgr;
    mgr.activate(null);
    mgr.addListener(listener);
    DriverRegistryManager driverRegistry = new DriverRegistryManager();
    driverService = new TestDriverManager(driverRegistry);
    driverRegistry.addDriver(new DefaultDriver("foo", ImmutableList.of(), "", "", "", ImmutableMap.of(GroupProgrammable.class, TestGroupProgrammable.class), ImmutableMap.of()));
    internalProvider = new TestGroupProvider(PID);
    provider = internalProvider;
    providerService = providerRegistry.register(provider);
    appId = new DefaultApplicationId(2, "org.groupmanager.test");
    assertTrue("provider should be registered", providerRegistry.getProviders().contains(provider.id()));
}
Also used : ComponentConfigAdapter(org.onosproject.cfg.ComponentConfigAdapter) TestEventDispatcher(org.onosproject.common.event.impl.TestEventDispatcher) SimpleGroupStore(org.onosproject.store.trivial.SimpleGroupStore) DefaultDriver(org.onosproject.net.driver.DefaultDriver) DriverRegistryManager(org.onosproject.net.driver.impl.DriverRegistryManager) DefaultApplicationId(org.onosproject.core.DefaultApplicationId) Before(org.junit.Before)

Example 3 with ComponentConfigAdapter

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

the class HostManagerTest method setUp.

@Before
public void setUp() {
    mgr = new HostManager();
    mgr.store = new SimpleHostStore();
    injectEventDispatcher(mgr, new TestEventDispatcher());
    registry = mgr;
    mgr.networkConfigService = new TestNetworkConfigService();
    mgr.cfgService = new ComponentConfigAdapter();
    mgr.activate(REMOVE_DUPS_MONITOR);
    mgr.addListener(listener);
    provider = new TestHostProvider(PID);
    provider2 = new TestHostProvider(PID2);
    providerService = registry.register(provider);
    providerService2 = registry.register(provider2);
    assertTrue("provider should be registered", registry.getProviders().contains(provider.id()));
    assertTrue("provider2 should be registered", registry.getProviders().contains(provider2.id()));
}
Also used : TestEventDispatcher(org.onosproject.common.event.impl.TestEventDispatcher) ComponentConfigAdapter(org.onosproject.cfg.ComponentConfigAdapter) SimpleHostStore(org.onosproject.store.trivial.SimpleHostStore) Before(org.junit.Before)

Example 4 with ComponentConfigAdapter

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

the class LinkCollectionEncapIntentCompilerTest method setUp.

@Before
public void setUp() {
    sut = new LinkCollectionIntentCompiler();
    coreService = createMock(CoreService.class);
    expect(coreService.registerApplication("org.onosproject.net.intent")).andReturn(appId);
    sut.coreService = coreService;
    domainService = createMock(DomainService.class);
    expect(domainService.getDomain(anyObject(DeviceId.class))).andReturn(LOCAL).anyTimes();
    sut.domainService = domainService;
    super.setUp();
    intentExtensionService = createMock(IntentExtensionService.class);
    intentExtensionService.registerCompiler(LinkCollectionIntent.class, sut);
    intentExtensionService.unregisterCompiler(LinkCollectionIntent.class);
    registrator = new IntentConfigurableRegistrator();
    registrator.extensionService = intentExtensionService;
    registrator.cfgService = new ComponentConfigAdapter();
    registrator.activate();
    sut.registrator = registrator;
    sut.resourceService = new MockResourceService();
    LinkCollectionCompiler.optimizeInstructions = false;
    LinkCollectionCompiler.copyTtl = false;
    replay(coreService, domainService, intentExtensionService);
}
Also used : ComponentConfigAdapter(org.onosproject.cfg.ComponentConfigAdapter) IntentExtensionService(org.onosproject.net.intent.IntentExtensionService) MockResourceService(org.onosproject.net.resource.MockResourceService) DomainService(org.onosproject.net.domain.DomainService) CoreService(org.onosproject.core.CoreService) Before(org.junit.Before)

Example 5 with ComponentConfigAdapter

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

the class LinkCollectionIntentFlowObjectiveCompilerTest method setUp.

@Before
public void setUp() {
    compiler = new LinkCollectionIntentFlowObjectiveCompiler();
    coreService = createMock(CoreService.class);
    expect(coreService.registerApplication("org.onosproject.net.intent")).andReturn(appId);
    flowObjectiveService = new FlowObjectiveServiceAdapter();
    resourceService = new MockResourceService();
    compiler.coreService = coreService;
    compiler.flowObjectiveService = flowObjectiveService;
    domainService = createMock(DomainService.class);
    expect(domainService.getDomain(anyObject(DeviceId.class))).andReturn(LOCAL).anyTimes();
    compiler.domainService = domainService;
    super.setUp();
    intentExtensionService = createMock(IntentExtensionService.class);
    intentExtensionService.registerCompiler(LinkCollectionIntent.class, compiler);
    intentExtensionService.unregisterCompiler(LinkCollectionIntent.class);
    registrator = new IntentConfigurableRegistrator();
    registrator.extensionService = intentExtensionService;
    registrator.cfgService = new ComponentConfigAdapter();
    registrator.activate();
    compiler.registrator = registrator;
    compiler.resourceService = resourceService;
    LinkCollectionCompiler.optimizeInstructions = false;
    LinkCollectionCompiler.copyTtl = false;
    replay(coreService, domainService, intentExtensionService);
    compiler.activate();
}
Also used : ComponentConfigAdapter(org.onosproject.cfg.ComponentConfigAdapter) MockResourceService(org.onosproject.net.resource.MockResourceService) IntentExtensionService(org.onosproject.net.intent.IntentExtensionService) DomainService(org.onosproject.net.domain.DomainService) FlowObjectiveServiceAdapter(org.onosproject.net.flowobjective.FlowObjectiveServiceAdapter) CoreService(org.onosproject.core.CoreService) 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