use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.
the class VirtualNetworkLinkManagerTest method setUp.
@Before
public void setUp() throws Exception {
virtualNetworkManagerStore = new DistributedVirtualNetworkStore();
coreService = new VirtualNetworkLinkManagerTest.TestCoreService();
TestUtils.setField(virtualNetworkManagerStore, "coreService", coreService);
TestUtils.setField(virtualNetworkManagerStore, "storageService", new TestStorageService());
virtualNetworkManagerStore.activate();
manager = new VirtualNetworkManager();
manager.store = virtualNetworkManagerStore;
manager.coreService = coreService;
NetTestTools.injectEventDispatcher(manager, new TestEventDispatcher());
testDirectory = new TestServiceDirectory();
TestUtils.setField(manager, "serviceDirectory", testDirectory);
manager.activate();
}
use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.
the class VirtualNetworkManagerTest method setUp.
@Before
public void setUp() throws Exception {
virtualNetworkManagerStore = new DistributedVirtualNetworkStore();
MockIdGenerator.cleanBind();
coreService = new TestCoreService();
TestUtils.setField(virtualNetworkManagerStore, "coreService", coreService);
TestUtils.setField(virtualNetworkManagerStore, "storageService", new TestStorageService());
virtualNetworkManagerStore.activate();
manager = new VirtualNetworkManager();
manager.store = virtualNetworkManagerStore;
manager.addListener(listener);
manager.coreService = coreService;
NetTestTools.injectEventDispatcher(manager, new TestEventDispatcher());
testDirectory = new TestServiceDirectory();
TestUtils.setField(manager, "serviceDirectory", testDirectory);
manager.activate();
}
use of org.onosproject.store.service.TestStorageService 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;
}
use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.
the class VirtualNetworkMeterManagerTest method setUp.
@Before
public void setUp() throws Exception {
virtualNetworkManagerStore = new DistributedVirtualNetworkStore();
CoreService coreService = new TestCoreService();
TestStorageService storageService = new TestStorageService();
TestUtils.setField(virtualNetworkManagerStore, "coreService", coreService);
TestUtils.setField(virtualNetworkManagerStore, "storageService", storageService);
virtualNetworkManagerStore.activate();
meterStore = new SimpleVirtualMeterStore();
providerRegistryService = new VirtualProviderManager();
providerRegistryService.registerProvider(provider);
manager = new VirtualNetworkManager();
manager.store = virtualNetworkManagerStore;
TestUtils.setField(manager, "coreService", coreService);
eventDeliveryService = new TestEventDispatcher();
NetTestTools.injectEventDispatcher(manager, eventDeliveryService);
// eventDeliveryService.addSink(VirtualEvent.class, listenerRegistryManager);
appId = new TestApplicationId("MeterManagerTest");
testDirectory = new TestServiceDirectory().add(VirtualNetworkStore.class, virtualNetworkManagerStore).add(CoreService.class, coreService).add(VirtualProviderRegistryService.class, providerRegistryService).add(EventDeliveryService.class, eventDeliveryService).add(StorageService.class, storageService).add(VirtualNetworkMeterStore.class, meterStore);
TestUtils.setField(manager, "serviceDirectory", testDirectory);
manager.activate();
vnet1 = setupVirtualNetworkTopology(manager, TID1);
vnet2 = setupVirtualNetworkTopology(manager, TID2);
meterManager1 = new VirtualNetworkMeterManager(manager, vnet1.id());
meterManager2 = new VirtualNetworkMeterManager(manager, vnet2.id());
providerService1 = (VirtualMeterProviderService) providerRegistryService.getProviderService(vnet1.id(), VirtualMeterProvider.class);
providerService2 = (VirtualMeterProviderService) providerRegistryService.getProviderService(vnet2.id(), VirtualMeterProvider.class);
assertTrue("provider should be registered", providerRegistryService.getProviders().contains(provider.id()));
setupMeterTestVariables();
}
use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.
the class VirtualNetworkTopologyManagerTest method setUp.
@Before
public void setUp() throws Exception {
virtualNetworkManagerStore = new DistributedVirtualNetworkStore();
coreService = new VirtualNetworkTopologyManagerTest.TestCoreService();
TestUtils.setField(virtualNetworkManagerStore, "coreService", coreService);
TestUtils.setField(virtualNetworkManagerStore, "storageService", new TestStorageService());
virtualNetworkManagerStore.activate();
manager = new VirtualNetworkManager();
manager.store = virtualNetworkManagerStore;
manager.coreService = coreService;
NetTestTools.injectEventDispatcher(manager, new TestEventDispatcher());
testDirectory = new TestServiceDirectory();
TestUtils.setField(manager, "serviceDirectory", testDirectory);
manager.activate();
}
Aggregations