use of org.onosproject.incubator.net.virtual.store.impl.SimpleVirtualMastershipStore in project onos by opennetworkinglab.
the class VirtualNetworkMastershipManagerTest method setUp.
@Before
public void setUp() throws Exception {
virtualNetworkManagerStore = new DistributedVirtualNetworkStore();
CoreService coreService = new TestCoreService();
TestUtils.setField(virtualNetworkManagerStore, "coreService", coreService);
TestUtils.setField(virtualNetworkManagerStore, "storageService", new TestStorageService());
virtualNetworkManagerStore.activate();
manager = new VirtualNetworkManager();
manager.store = virtualNetworkManagerStore;
TestUtils.setField(manager, "coreService", coreService);
eventDeliveryService = new TestEventDispatcher();
NetTestTools.injectEventDispatcher(manager, eventDeliveryService);
SimpleVirtualMastershipStore store = new SimpleVirtualMastershipStore();
TestUtils.setField(store, "coreService", coreService);
store.activate();
testClusterService = new TestClusterService();
ServiceDirectory testDirectory = new TestServiceDirectory().add(VirtualNetworkStore.class, virtualNetworkManagerStore).add(CoreService.class, coreService).add(EventDeliveryService.class, eventDeliveryService).add(ClusterService.class, testClusterService).add(VirtualNetworkMastershipStore.class, store);
TestUtils.setField(manager, "serviceDirectory", testDirectory);
manager.activate();
createVnets();
mastershipMgr1 = new VirtualNetworkMastershipManager(manager, vnet1.id());
mastershipMgr2 = new VirtualNetworkMastershipManager(manager, vnet2.id());
service = mastershipMgr1;
}
Aggregations