use of org.onosproject.net.domain.DomainService in project onos by opennetworkinglab.
the class LinkCollectionIntentCompilerTest 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();
intent = LinkCollectionIntent.builder().appId(APP_ID).selector(selector).treatment(treatment).links(links).filteredIngressPoints(ImmutableSet.of(new FilteredConnectPoint(d1p1))).filteredEgressPoints(ImmutableSet.of(new FilteredConnectPoint(d3p1))).build();
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.net.domain.DomainService in project onos by opennetworkinglab.
the class LinkCollectionOptimizationTest 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();
/*
* We activate the optimizations.
*/
LinkCollectionCompiler.optimizeInstructions = true;
LinkCollectionCompiler.copyTtl = true;
replay(coreService, domainService, intentExtensionService);
}
use of org.onosproject.net.domain.DomainService in project onos by opennetworkinglab.
the class GetDomainsCommand method doExecute.
@Override
public void doExecute() {
DomainService domainService = AbstractShellCommand.get(DomainService.class);
Set<DomainId> domainIds = domainService.getDomainIds();
domainIds.forEach(domainId -> print("%s", domainId.id()));
}
Aggregations