Search in sources :

Example 6 with VirtualProviderManager

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());
}
Also used : TestEventDispatcher(org.onosproject.common.event.impl.TestEventDispatcher) SimpleVirtualFlowRuleStore(org.onosproject.incubator.net.virtual.store.impl.SimpleVirtualFlowRuleStore) SimpleVirtualFlowObjectiveStore(org.onosproject.incubator.net.virtual.store.impl.SimpleVirtualFlowObjectiveStore) EventDeliveryService(org.onosproject.event.EventDeliveryService) CoreService(org.onosproject.core.CoreService) VirtualNetworkFlowRuleStore(org.onosproject.incubator.net.virtual.VirtualNetworkFlowRuleStore) DistributedVirtualNetworkStore(org.onosproject.incubator.net.virtual.store.impl.DistributedVirtualNetworkStore) ClusterServiceAdapter(org.onosproject.cluster.ClusterServiceAdapter) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) VirtualProviderManager(org.onosproject.incubator.net.virtual.impl.provider.VirtualProviderManager) VirtualNetworkPacketStore(org.onosproject.incubator.net.virtual.VirtualNetworkPacketStore) Before(org.junit.Before)

Aggregations

TestEventDispatcher (org.onosproject.common.event.impl.TestEventDispatcher)6 VirtualProviderManager (org.onosproject.incubator.net.virtual.impl.provider.VirtualProviderManager)6 Before (org.junit.Before)5 TestServiceDirectory (org.onlab.osgi.TestServiceDirectory)5 CoreService (org.onosproject.core.CoreService)5 DistributedVirtualNetworkStore (org.onosproject.incubator.net.virtual.store.impl.DistributedVirtualNetworkStore)5 TestApplicationId (org.onosproject.TestApplicationId)4 VirtualProviderRegistryService (org.onosproject.incubator.net.virtual.provider.VirtualProviderRegistryService)4 SimpleVirtualFlowRuleStore (org.onosproject.incubator.net.virtual.store.impl.SimpleVirtualFlowRuleStore)4 SimpleVirtualFlowObjectiveStore (org.onosproject.incubator.net.virtual.store.impl.SimpleVirtualFlowObjectiveStore)3 TestStorageService (org.onosproject.store.service.TestStorageService)3 ClusterServiceAdapter (org.onosproject.cluster.ClusterServiceAdapter)2 EventDeliveryService (org.onosproject.event.EventDeliveryService)2 VirtualNetworkFlowRuleStore (org.onosproject.incubator.net.virtual.VirtualNetworkFlowRuleStore)2 VirtualNetworkPacketStore (org.onosproject.incubator.net.virtual.VirtualNetworkPacketStore)2 VirtualNetworkStore (org.onosproject.incubator.net.virtual.VirtualNetworkStore)2 SimpleVirtualGroupStore (org.onosproject.incubator.net.virtual.store.impl.SimpleVirtualGroupStore)2 Test (org.junit.Test)1 ClusterService (org.onosproject.cluster.ClusterService)1 DefaultVirtualNetwork (org.onosproject.incubator.net.virtual.DefaultVirtualNetwork)1