Search in sources :

Example 21 with TestStorageService

use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.

the class KubevirtRouterManagerTest method setUp.

@Before
public void setUp() throws Exception {
    kubevirtRouterStore = new DistributedKubevirtRouterStore();
    TestUtils.setField(kubevirtRouterStore, "coreService", new TestCoreService());
    TestUtils.setField(kubevirtRouterStore, "storageService", new TestStorageService());
    TestUtils.setField(kubevirtRouterStore, "eventExecutor", MoreExecutors.newDirectExecutorService());
    TestUtils.setField(kubevirtRouterStore, "loadBalancerService", new TestLoadBalancerService());
    kubevirtRouterStore.activate();
    target = new KubevirtRouterManager();
    TestUtils.setField(target, "coreService", new TestCoreService());
    target.kubevirtRouterStore = kubevirtRouterStore;
    target.addListener(testListener);
    target.activate();
}
Also used : TestStorageService(org.onosproject.store.service.TestStorageService) Before(org.junit.Before)

Example 22 with TestStorageService

use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.

the class VirtualNetworkFlowRuleManagerTest 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();
    flowRuleStore = new SimpleVirtualFlowRuleStore();
    providerRegistryService = new VirtualProviderManager();
    providerRegistryService.registerProvider(provider);
    manager = new VirtualNetworkManager();
    manager.store = virtualNetworkManagerStore;
    TestUtils.setField(manager, "coreService", coreService);
    eventDeliveryService = new TestEventDispatcher();
    NetTestTools.injectEventDispatcher(manager, eventDeliveryService);
    appId = new TestApplicationId("FlowRuleManagerTest");
    testDirectory = new TestServiceDirectory().add(VirtualNetworkStore.class, virtualNetworkManagerStore).add(CoreService.class, coreService).add(VirtualProviderRegistryService.class, providerRegistryService).add(EventDeliveryService.class, eventDeliveryService).add(VirtualNetworkFlowRuleStore.class, flowRuleStore);
    TestUtils.setField(manager, "serviceDirectory", testDirectory);
    manager.activate();
    vnet1 = setupVirtualNetworkTopology(manager, TID1);
    vnet2 = setupVirtualNetworkTopology(manager, TID2);
    vnetFlowRuleService1 = new VirtualNetworkFlowRuleManager(manager, vnet1.id());
    vnetFlowRuleService2 = new VirtualNetworkFlowRuleManager(manager, vnet2.id());
    vnetFlowRuleService1.addListener(listener1);
    vnetFlowRuleService2.addListener(listener2);
    vnetFlowRuleService1.operationsService = MoreExecutors.newDirectExecutorService();
    vnetFlowRuleService2.operationsService = MoreExecutors.newDirectExecutorService();
    vnetFlowRuleService1.deviceInstallers = MoreExecutors.newDirectExecutorService();
    vnetFlowRuleService2.deviceInstallers = MoreExecutors.newDirectExecutorService();
    providerService1 = (VirtualFlowRuleProviderService) providerRegistryService.getProviderService(vnet1.id(), VirtualFlowRuleProvider.class);
    providerService2 = (VirtualFlowRuleProviderService) providerRegistryService.getProviderService(vnet2.id(), VirtualFlowRuleProvider.class);
}
Also used : SimpleVirtualFlowRuleStore(org.onosproject.incubator.net.virtual.store.impl.SimpleVirtualFlowRuleStore) TestEventDispatcher(org.onosproject.common.event.impl.TestEventDispatcher) TestStorageService(org.onosproject.store.service.TestStorageService) VirtualProviderRegistryService(org.onosproject.incubator.net.virtual.provider.VirtualProviderRegistryService) CoreService(org.onosproject.core.CoreService) TestApplicationId(org.onosproject.TestApplicationId) VirtualNetworkFlowRuleStore(org.onosproject.incubator.net.virtual.VirtualNetworkFlowRuleStore) DistributedVirtualNetworkStore(org.onosproject.incubator.net.virtual.store.impl.DistributedVirtualNetworkStore) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) VirtualNetworkStore(org.onosproject.incubator.net.virtual.VirtualNetworkStore) DistributedVirtualNetworkStore(org.onosproject.incubator.net.virtual.store.impl.DistributedVirtualNetworkStore) VirtualProviderManager(org.onosproject.incubator.net.virtual.impl.provider.VirtualProviderManager) Before(org.junit.Before)

Example 23 with TestStorageService

use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.

the class VirtualNetworkGroupManagerTest 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();
    groupStore = new SimpleVirtualGroupStore();
    providerRegistryService = new VirtualProviderManager();
    providerRegistryService.registerProvider(provider);
    manager = new VirtualNetworkManager();
    manager.store = virtualNetworkManagerStore;
    TestUtils.setField(manager, "coreService", coreService);
    eventDeliveryService = new TestEventDispatcher();
    injectEventDispatcher(manager, eventDeliveryService);
    appId = new TestApplicationId("VirtualGroupManagerTest");
    testDirectory = new TestServiceDirectory().add(VirtualNetworkStore.class, virtualNetworkManagerStore).add(CoreService.class, coreService).add(VirtualProviderRegistryService.class, providerRegistryService).add(EventDeliveryService.class, eventDeliveryService).add(VirtualNetworkGroupStore.class, groupStore);
    TestUtils.setField(manager, "serviceDirectory", testDirectory);
    manager.activate();
    vnet1 = setupVirtualNetworkTopology(manager, TID1);
    vnet2 = setupVirtualNetworkTopology(manager, TID2);
    groupManager1 = new VirtualNetworkGroupManager(manager, vnet1.id());
    groupManager2 = new VirtualNetworkGroupManager(manager, vnet2.id());
    groupManager1.addListener(listener1);
    groupManager2.addListener(listener2);
    providerService1 = (VirtualGroupProviderService) providerRegistryService.getProviderService(vnet1.id(), VirtualGroupProvider.class);
    providerService2 = (VirtualGroupProviderService) providerRegistryService.getProviderService(vnet2.id(), VirtualGroupProvider.class);
}
Also used : TestEventDispatcher(org.onosproject.common.event.impl.TestEventDispatcher) TestStorageService(org.onosproject.store.service.TestStorageService) VirtualProviderRegistryService(org.onosproject.incubator.net.virtual.provider.VirtualProviderRegistryService) CoreService(org.onosproject.core.CoreService) TestApplicationId(org.onosproject.TestApplicationId) DistributedVirtualNetworkStore(org.onosproject.incubator.net.virtual.store.impl.DistributedVirtualNetworkStore) SimpleVirtualGroupStore(org.onosproject.incubator.net.virtual.store.impl.SimpleVirtualGroupStore) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) VirtualNetworkStore(org.onosproject.incubator.net.virtual.VirtualNetworkStore) DistributedVirtualNetworkStore(org.onosproject.incubator.net.virtual.store.impl.DistributedVirtualNetworkStore) VirtualProviderManager(org.onosproject.incubator.net.virtual.impl.provider.VirtualProviderManager) VirtualNetworkGroupStore(org.onosproject.incubator.net.virtual.VirtualNetworkGroupStore) Before(org.junit.Before)

Example 24 with TestStorageService

use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.

the class VirtualNetworkHostManagerTest 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;
    manager.coreService = coreService;
    NetTestTools.injectEventDispatcher(manager, new TestEventDispatcher());
    testDirectory = new TestServiceDirectory();
    TestUtils.setField(manager, "serviceDirectory", testDirectory);
    manager.activate();
}
Also used : TestEventDispatcher(org.onosproject.common.event.impl.TestEventDispatcher) DistributedVirtualNetworkStore(org.onosproject.incubator.net.virtual.store.impl.DistributedVirtualNetworkStore) TestStorageService(org.onosproject.store.service.TestStorageService) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) CoreService(org.onosproject.core.CoreService) Before(org.junit.Before)

Example 25 with TestStorageService

use of org.onosproject.store.service.TestStorageService in project onos by opennetworkinglab.

the class VirtualNetworkPathManagerTest 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;
    manager.coreService = coreService;
    NetTestTools.injectEventDispatcher(manager, new TestEventDispatcher());
    testDirectory = new TestServiceDirectory();
    TestUtils.setField(manager, "serviceDirectory", testDirectory);
    manager.activate();
}
Also used : TestEventDispatcher(org.onosproject.common.event.impl.TestEventDispatcher) DistributedVirtualNetworkStore(org.onosproject.incubator.net.virtual.store.impl.DistributedVirtualNetworkStore) TestStorageService(org.onosproject.store.service.TestStorageService) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) CoreService(org.onosproject.core.CoreService) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)75 TestStorageService (org.onosproject.store.service.TestStorageService)75 TestEventDispatcher (org.onosproject.common.event.impl.TestEventDispatcher)18 TestServiceDirectory (org.onlab.osgi.TestServiceDirectory)12 DistributedVirtualNetworkStore (org.onosproject.incubator.net.virtual.store.impl.DistributedVirtualNetworkStore)12 CoreService (org.onosproject.core.CoreService)8 ClusterServiceAdapter (org.onosproject.cluster.ClusterServiceAdapter)6 ClusterCommunicationServiceAdapter (org.onosproject.store.cluster.messaging.ClusterCommunicationServiceAdapter)5 TestApplicationId (org.onosproject.TestApplicationId)3 ComponentConfigAdapter (org.onosproject.cfg.ComponentConfigAdapter)3 ClusterService (org.onosproject.cluster.ClusterService)3 LeadershipServiceAdapter (org.onosproject.cluster.LeadershipServiceAdapter)3 CoreServiceAdapter (org.onosproject.core.CoreServiceAdapter)3 VirtualNetworkStore (org.onosproject.incubator.net.virtual.VirtualNetworkStore)3 VirtualProviderManager (org.onosproject.incubator.net.virtual.impl.provider.VirtualProviderManager)3 FlowObjectiveServiceAdapter (org.onosproject.net.flowobjective.FlowObjectiveServiceAdapter)3 Semaphore (java.util.concurrent.Semaphore)2 ComponentContextAdapter (org.onlab.osgi.ComponentContextAdapter)2 KryoNamespace (org.onlab.util.KryoNamespace)2 NodeId (org.onosproject.cluster.NodeId)2