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();
}
Aggregations