Search in sources :

Example 1 with TestCoreManager

use of org.onosproject.core.impl.TestCoreManager in project onos by opennetworkinglab.

the class IntentManagerTest method setUp.

@Before
public void setUp() {
    manager = new IntentManager();
    flowRuleService = new MockFlowRuleService();
    manager.store = new SimpleIntentStore();
    injectEventDispatcher(manager, new TestEventDispatcher());
    manager.trackerService = trackerService;
    manager.flowRuleService = flowRuleService;
    manager.coreService = new TestCoreManager();
    manager.configService = mock(ComponentConfigService.class);
    service = manager;
    extensionService = manager;
    intentInstallCoordinator = manager;
    manager.activate();
    service.addListener(listener);
    extensionService.registerCompiler(MockIntent.class, compiler);
    installer = new TestIntentInstaller(extensionService, trackerService, intentInstallCoordinator, flowRuleService);
    extensionService.registerInstaller(MockInstallableIntent.class, installer);
    assertTrue("store should be empty", Sets.newHashSet(service.getIntents()).isEmpty());
    assertEquals(0L, flowRuleService.getFlowRuleCount());
}
Also used : TestEventDispatcher(org.onosproject.common.event.impl.TestEventDispatcher) ComponentConfigService(org.onosproject.cfg.ComponentConfigService) TestCoreManager(org.onosproject.core.impl.TestCoreManager) SimpleIntentStore(org.onosproject.store.trivial.SimpleIntentStore) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 ComponentConfigService (org.onosproject.cfg.ComponentConfigService)1 TestEventDispatcher (org.onosproject.common.event.impl.TestEventDispatcher)1 TestCoreManager (org.onosproject.core.impl.TestCoreManager)1 SimpleIntentStore (org.onosproject.store.trivial.SimpleIntentStore)1