Search in sources :

Example 1 with DistributedRegionStore

use of org.onosproject.store.region.impl.DistributedRegionStore in project onos by opennetworkinglab.

the class MastershipManagerTest method setUp.

@Before
public void setUp() throws Exception {
    mgr = new MastershipManager();
    service = mgr;
    injectEventDispatcher(mgr, new TestEventDispatcher());
    testClusterService = new TestClusterService();
    mgr.clusterService = testClusterService;
    mgr.upgradeService = new UpgradeServiceAdapter();
    mgr.store = new TestSimpleMastershipStore(mgr.clusterService);
    regionStore = new DistributedRegionStore();
    TestUtils.setField(regionStore, "storageService", new TestStorageService());
    TestUtils.callMethod(regionStore, "activate", new Class<?>[] {});
    regionManager = new TestRegionManager();
    TestUtils.setField(regionManager, "store", regionStore);
    regionManager.activate();
    mgr.regionService = regionManager;
    ComponentConfigService mockConfigService = EasyMock.createMock(ComponentConfigService.class);
    expect(mockConfigService.getProperties(anyObject())).andReturn(ImmutableSet.of());
    mockConfigService.registerProperties(mgr.getClass());
    expectLastCall();
    mockConfigService.unregisterProperties(mgr.getClass(), false);
    expectLastCall();
    expect(mockConfigService.getProperties(anyObject())).andReturn(ImmutableSet.of());
    mgr.cfgService = mockConfigService;
    replay(mockConfigService);
    mgr.activate();
}
Also used : TestEventDispatcher(org.onosproject.common.event.impl.TestEventDispatcher) UpgradeServiceAdapter(org.onosproject.upgrade.impl.UpgradeServiceAdapter) ComponentConfigService(org.onosproject.cfg.ComponentConfigService) TestStorageService(org.onosproject.store.service.TestStorageService) DistributedRegionStore(org.onosproject.store.region.impl.DistributedRegionStore) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 ComponentConfigService (org.onosproject.cfg.ComponentConfigService)1 TestEventDispatcher (org.onosproject.common.event.impl.TestEventDispatcher)1 DistributedRegionStore (org.onosproject.store.region.impl.DistributedRegionStore)1 TestStorageService (org.onosproject.store.service.TestStorageService)1 UpgradeServiceAdapter (org.onosproject.upgrade.impl.UpgradeServiceAdapter)1