Search in sources :

Example 1 with FlowObjectiveServiceAdapter

use of org.onosproject.net.flowobjective.FlowObjectiveServiceAdapter 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

Before (org.junit.Before)1 ComponentConfigAdapter (org.onosproject.cfg.ComponentConfigAdapter)1 CoreService (org.onosproject.core.CoreService)1 DomainService (org.onosproject.net.domain.DomainService)1 FlowObjectiveServiceAdapter (org.onosproject.net.flowobjective.FlowObjectiveServiceAdapter)1 IntentExtensionService (org.onosproject.net.intent.IntentExtensionService)1 MockResourceService (org.onosproject.net.resource.MockResourceService)1