use of org.onosproject.net.intent.IntentExtensionService 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.intent.IntentExtensionService in project onos by opennetworkinglab.
the class OpticalCircuitIntentCompilerTest method setUp.
@Before
public void setUp() {
sut = new OpticalCircuitIntentCompiler();
coreService = createMock(CoreService.class);
expect(coreService.registerApplication("org.onosproject.net.intent")).andReturn(appId);
sut.coreService = coreService;
sut.deviceService = new MockDeviceService();
sut.resourceService = new MockResourceService();
sut.intentService = new TestIntentService();
sut.intentSetMultimap = new MockIntentSetMultimap();
super.setUp();
intentExtensionService = createMock(IntentExtensionService.class);
intentExtensionService.registerCompiler(OpticalCircuitIntent.class, sut);
intentExtensionService.unregisterCompiler(OpticalCircuitIntent.class);
sut.intentManager = intentExtensionService;
replay(coreService, intentExtensionService);
// mocking ComponentConfigService
ComponentConfigService mockConfigService = EasyMock.createMock(ComponentConfigService.class);
expect(mockConfigService.getProperties(anyObject())).andReturn(ImmutableSet.of());
mockConfigService.registerProperties(sut.getClass());
expectLastCall();
mockConfigService.unregisterProperties(sut.getClass(), false);
expectLastCall();
expect(mockConfigService.getProperties(anyObject())).andReturn(ImmutableSet.of());
sut.cfgService = mockConfigService;
replay(mockConfigService);
}
Aggregations