use of org.onosproject.incubator.net.virtual.impl.provider.VirtualProviderManager in project onos by opennetworkinglab.
the class VirtualNetworkPacketManagerTest method setUp.
@Before
public void setUp() throws TestUtils.TestUtilsException {
virtualNetworkManagerStore = new DistributedVirtualNetworkStore();
TestUtils.setField(virtualNetworkManagerStore, "coreService", coreService);
TestUtils.setField(virtualNetworkManagerStore, "storageService", storageService);
virtualNetworkManagerStore.activate();
manager = new VirtualNetworkManager();
manager.store = virtualNetworkManagerStore;
manager.coreService = coreService;
NetTestTools.injectEventDispatcher(manager, new TestEventDispatcher());
flowObjectiveStore = new SimpleVirtualFlowObjectiveStore();
TestUtils.setField(flowObjectiveStore, "storageService", storageService);
flowObjectiveStore.activate();
flowRuleStore = new SimpleVirtualFlowRuleStore();
flowRuleStore.activate();
providerRegistryService = new VirtualProviderManager();
providerRegistryService.registerProvider(provider);
providerRegistryService.registerProvider(flowRuleProvider);
testDirectory = new TestServiceDirectory().add(VirtualNetworkStore.class, virtualNetworkManagerStore).add(CoreService.class, coreService).add(VirtualProviderRegistryService.class, providerRegistryService).add(EventDeliveryService.class, eventDeliveryService).add(ClusterService.class, new ClusterServiceAdapter()).add(VirtualNetworkFlowRuleStore.class, flowRuleStore).add(VirtualNetworkFlowObjectiveStore.class, flowObjectiveStore).add(VirtualNetworkPacketStore.class, packetStore);
TestUtils.setField(manager, "serviceDirectory", testDirectory);
eventDeliveryService = new TestEventDispatcher();
NetTestTools.injectEventDispatcher(manager, eventDeliveryService);
manager.activate();
vnet1 = VirtualNetworkTestUtil.setupVirtualNetworkTopology(manager, TID1);
vnet2 = VirtualNetworkTestUtil.setupVirtualNetworkTopology(manager, TID2);
packetManager1 = new VirtualNetworkPacketManager(manager, vnet1.id());
packetManager2 = new VirtualNetworkPacketManager(manager, vnet2.id());
}
Aggregations