Search in sources :

Example 1 with SimpleVirtualMastershipStore

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;
}
Also used : TestEventDispatcher(org.onosproject.common.event.impl.TestEventDispatcher) SimpleVirtualMastershipStore(org.onosproject.incubator.net.virtual.store.impl.SimpleVirtualMastershipStore) DistributedVirtualNetworkStore(org.onosproject.incubator.net.virtual.store.impl.DistributedVirtualNetworkStore) ClusterService(org.onosproject.cluster.ClusterService) TestStorageService(org.onosproject.store.service.TestStorageService) ServiceDirectory(org.onlab.osgi.ServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) CoreService(org.onosproject.core.CoreService) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 ServiceDirectory (org.onlab.osgi.ServiceDirectory)1 TestServiceDirectory (org.onlab.osgi.TestServiceDirectory)1 ClusterService (org.onosproject.cluster.ClusterService)1 TestEventDispatcher (org.onosproject.common.event.impl.TestEventDispatcher)1 CoreService (org.onosproject.core.CoreService)1 DistributedVirtualNetworkStore (org.onosproject.incubator.net.virtual.store.impl.DistributedVirtualNetworkStore)1 SimpleVirtualMastershipStore (org.onosproject.incubator.net.virtual.store.impl.SimpleVirtualMastershipStore)1 TestStorageService (org.onosproject.store.service.TestStorageService)1