Search in sources :

Example 1 with VirtualNetworkManager

use of org.onosproject.incubator.net.virtual.impl.VirtualNetworkManager in project onos by opennetworkinglab.

the class VirtualNetworkTopologyProviderTest method setUp.

@Before
public void setUp() throws Exception {
    virtualNetworkManagerStore = new DistributedVirtualNetworkStore();
    coreService = new VirtualNetworkTopologyProviderTest.TestCoreService();
    TestUtils.setField(virtualNetworkManagerStore, "coreService", coreService);
    TestUtils.setField(virtualNetworkManagerStore, "storageService", new TestStorageService());
    virtualNetworkManagerStore.activate();
    manager = new VirtualNetworkManager();
    TestUtils.setField(manager, "coreService", coreService);
    TestUtils.setField(manager, "store", virtualNetworkManagerStore);
    TestUtils.setField(manager, "intentService", intentService);
    NetTestTools.injectEventDispatcher(manager, new TestEventDispatcher());
    testDirectory = new TestServiceDirectory();
    TestUtils.setField(manager, "serviceDirectory", testDirectory);
    manager.activate();
    manager.registerTenantId(TenantId.tenantId(tenantIdValue1));
    virtualNetwork = manager.createVirtualNetwork(TenantId.tenantId(tenantIdValue1));
    topologyService = manager.get(virtualNetwork.id(), TopologyService.class);
    topologyProvider = new DefaultVirtualNetworkProvider();
    topologyProvider.topologyService = topologyService;
    topologyProvider.providerRegistry = virtualNetworkRegistry;
    topologyProvider.activate();
    setupVirtualNetworkTopology();
    changed = new Semaphore(0, true);
}
Also used : TestEventDispatcher(org.onosproject.common.event.impl.TestEventDispatcher) DistributedVirtualNetworkStore(org.onosproject.incubator.net.virtual.store.impl.DistributedVirtualNetworkStore) VirtualNetworkManager(org.onosproject.incubator.net.virtual.impl.VirtualNetworkManager) TestStorageService(org.onosproject.store.service.TestStorageService) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) Semaphore(java.util.concurrent.Semaphore) TopologyService(org.onosproject.net.topology.TopologyService) Before(org.junit.Before)

Aggregations

Semaphore (java.util.concurrent.Semaphore)1 Before (org.junit.Before)1 TestServiceDirectory (org.onlab.osgi.TestServiceDirectory)1 TestEventDispatcher (org.onosproject.common.event.impl.TestEventDispatcher)1 VirtualNetworkManager (org.onosproject.incubator.net.virtual.impl.VirtualNetworkManager)1 DistributedVirtualNetworkStore (org.onosproject.incubator.net.virtual.store.impl.DistributedVirtualNetworkStore)1 TopologyService (org.onosproject.net.topology.TopologyService)1 TestStorageService (org.onosproject.store.service.TestStorageService)1