Search in sources :

Example 1 with SimpleIntentStore

use of org.onosproject.store.trivial.SimpleIntentStore in project onos by opennetworkinglab.

the class FlowRuleIntentInstallerTest method setup.

@Before
public void setup() {
    super.setup();
    flowRuleService = new TestFlowRuleService();
    installer = new FlowRuleIntentInstaller();
    installer.flowRuleService = flowRuleService;
    installer.store = new SimpleIntentStore();
    installer.intentExtensionService = intentExtensionService;
    installer.intentInstallCoordinator = intentInstallCoordinator;
    installer.trackerService = trackerService;
    installer.configService = mock(ComponentConfigService.class);
    installer.activate();
}
Also used : ComponentConfigService(org.onosproject.cfg.ComponentConfigService) SimpleIntentStore(org.onosproject.store.trivial.SimpleIntentStore) Before(org.junit.Before)

Example 2 with SimpleIntentStore

use of org.onosproject.store.trivial.SimpleIntentStore in project onos by opennetworkinglab.

the class IntentCleanupTest method setUp.

@Before
public void setUp() {
    service = new MockIntentService();
    store = new SimpleIntentStore();
    cleanup = new IntentCleanup();
    super.setUp();
    cleanup.cfgService = new ComponentConfigAdapter();
    cleanup.service = service;
    cleanup.store = store;
    cleanup.period = 10;
    cleanup.retryThreshold = 3;
    cleanup.activate();
    assertTrue("store should be empty", Sets.newHashSet(cleanup.store.getIntents()).isEmpty());
}
Also used : ComponentConfigAdapter(org.onosproject.cfg.ComponentConfigAdapter) SimpleIntentStore(org.onosproject.store.trivial.SimpleIntentStore) Before(org.junit.Before)

Example 3 with SimpleIntentStore

use of org.onosproject.store.trivial.SimpleIntentStore 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)

Example 4 with SimpleIntentStore

use of org.onosproject.store.trivial.SimpleIntentStore in project onos by opennetworkinglab.

the class IntentCleanupTestMock method setUp.

@Before
public void setUp() {
    service = createMock(IntentService.class);
    store = new SimpleIntentStore();
    cleanup = new IntentCleanup();
    cleanup.cfgService = new ComponentConfigAdapter();
    cleanup.service = service;
    cleanup.store = store;
    cleanup.period = 1000;
    cleanup.retryThreshold = 3;
    assertTrue("store should be empty", Sets.newHashSet(cleanup.store.getIntents()).isEmpty());
    super.setUp();
}
Also used : ComponentConfigAdapter(org.onosproject.cfg.ComponentConfigAdapter) IntentService(org.onosproject.net.intent.IntentService) SimpleIntentStore(org.onosproject.store.trivial.SimpleIntentStore) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)4 SimpleIntentStore (org.onosproject.store.trivial.SimpleIntentStore)4 ComponentConfigAdapter (org.onosproject.cfg.ComponentConfigAdapter)2 ComponentConfigService (org.onosproject.cfg.ComponentConfigService)2 TestEventDispatcher (org.onosproject.common.event.impl.TestEventDispatcher)1 TestCoreManager (org.onosproject.core.impl.TestCoreManager)1 IntentService (org.onosproject.net.intent.IntentService)1