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);
}
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()));
}
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()));
}
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);
}
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();
}
Aggregations