Search in sources :

Example 26 with TestStorageService

use of org.onosproject.store.service.TestStorageService 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)

Example 27 with TestStorageService

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

the class VplsStoreTest method setup.

@Before
public void setup() {
    vplsStore = new DistributedVplsStore();
    vplsStore.coreService = new TestCoreService();
    vplsStore.storageService = new TestStorageService();
    vplsStore.networkConfigService = new TestConfigService();
    vplsStore.active();
}
Also used : TestStorageService(org.onosproject.store.service.TestStorageService) Before(org.junit.Before)

Example 28 with TestStorageService

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

the class NetworkConfigManagerTest method setUp.

@Before
public void setUp() throws Exception {
    configStore = new DistributedNetworkConfigStore();
    TestUtils.setField(configStore, "storageService", new TestStorageService());
    configStore.activate();
    manager = new NetworkConfigManager();
    manager.store = configStore;
    NetTestTools.injectEventDispatcher(manager, new EventDeliveryServiceAdapter());
    manager.clusterService = clusterService;
    manager.activate();
    registry = manager;
    configService = manager;
}
Also used : TestStorageService(org.onosproject.store.service.TestStorageService) EventDeliveryServiceAdapter(org.onosproject.event.EventDeliveryServiceAdapter) DistributedNetworkConfigStore(org.onosproject.store.config.impl.DistributedNetworkConfigStore) Before(org.junit.Before)

Example 29 with TestStorageService

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

the class KubevirtNodeManagerTest method setUp.

@Before
public void setUp() {
    nodeStore = new DistributedKubevirtNodeStore();
    TestUtils.setField(nodeStore, "coreService", new TestCoreService());
    TestUtils.setField(nodeStore, "storageService", new TestStorageService());
    TestUtils.setField(nodeStore, "eventExecutor", MoreExecutors.newDirectExecutorService());
    nodeStore.activate();
    nodeStore.createNode(WORKER_2);
    nodeStore.createNode(WORKER_3);
    target = new KubevirtNodeManager();
    target.storageService = new TestStorageService();
    target.coreService = new TestCoreService();
    target.clusterService = new TestClusterService();
    target.leadershipService = new TestLeadershipService();
    target.nodeStore = nodeStore;
    target.addListener(testListener);
    target.activate();
    testListener.events.clear();
}
Also used : TestStorageService(org.onosproject.store.service.TestStorageService) Before(org.junit.Before)

Example 30 with TestStorageService

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

the class OpenstackSecurityGroupManagerTest method setUp.

/**
 * Initial setup for this unit test.
 */
@Before
public void setUp() throws Exception {
    store = new DistributedSecurityGroupStore();
    TestUtils.setField(store, "coreService", new TestCoreService());
    TestUtils.setField(store, "storageService", new TestStorageService());
    TestUtils.setField(store, "eventExecutor", MoreExecutors.newDirectExecutorService());
    store.activate();
    target = new OpenstackSecurityGroupManager();
    TestUtils.setField(target, "coreService", new TestCoreService());
    target.osSecurityGroupStore = store;
    target.addListener(testOpenstackSecurityGroupListener);
    target.activate();
    securityGroupRule11 = NeutronSecurityGroupRule.builder().id(SECURITY_GROUP_RULE_ID_1_1).securityGroupId(SECURITY_GROUP_ID_1).tenantId(SECURITY_GROUP_TENANT_ID_1).remoteGroupId(SECURITY_GROUP_ID_1).ethertype(SECURITY_GROUP_ETH_TYPE).direction(SECURITY_GROUP_DIRECTION).portRangeMin(SECURITY_GROUP_PORT_RANGE_MIN_1).portRangeMax(SECURITY_GROUP_PORT_RANGE_MAX_1).protocol(SECURITY_GROUP_PROTOCOL_1).remoteIpPrefix(SECURITY_GROUP_REMOTE_IP_PREFIX_1).build();
    securityGroupRule12 = NeutronSecurityGroupRule.builder().id(SECURITY_GROUP_RULE_ID_1_2).securityGroupId(SECURITY_GROUP_ID_1).tenantId(SECURITY_GROUP_TENANT_ID_1).remoteGroupId(SECURITY_GROUP_ID_1).ethertype(SECURITY_GROUP_ETH_TYPE).direction(SECURITY_GROUP_DIRECTION).portRangeMin(SECURITY_GROUP_PORT_RANGE_MIN_1).portRangeMax(SECURITY_GROUP_PORT_RANGE_MAX_1).protocol(SECURITY_GROUP_PROTOCOL_1).remoteIpPrefix(SECURITY_GROUP_REMOTE_IP_PREFIX_1).build();
    securityGroupRule21 = NeutronSecurityGroupRule.builder().id(SECURITY_GROUP_RULE_ID_2_1).securityGroupId(SECURITY_GROUP_ID_2).tenantId(SECURITY_GROUP_TENANT_ID_2).remoteGroupId(SECURITY_GROUP_ID_2).ethertype(SECURITY_GROUP_ETH_TYPE).direction(SECURITY_GROUP_DIRECTION).portRangeMin(SECURITY_GROUP_PORT_RANGE_MIN_2).portRangeMax(SECURITY_GROUP_PORT_RANGE_MAX_2).protocol(SECURITY_GROUP_PROTOCOL_2).remoteIpPrefix(SECURITY_GROUP_REMOTE_IP_PREFIX_2).build();
    securityGroupRule22 = NeutronSecurityGroupRule.builder().id(SECURITY_GROUP_RULE_ID_2_2).securityGroupId(SECURITY_GROUP_ID_2).tenantId(SECURITY_GROUP_TENANT_ID_2).remoteGroupId(SECURITY_GROUP_ID_2).ethertype(SECURITY_GROUP_ETH_TYPE).direction(SECURITY_GROUP_DIRECTION).portRangeMin(SECURITY_GROUP_PORT_RANGE_MIN_2).portRangeMax(SECURITY_GROUP_PORT_RANGE_MAX_2).protocol(SECURITY_GROUP_PROTOCOL_2).remoteIpPrefix(SECURITY_GROUP_REMOTE_IP_PREFIX_2).build();
    securityGroupRules1 = ImmutableList.of(securityGroupRule11, securityGroupRule12);
    securityGroupRules2 = ImmutableList.of(securityGroupRule21, securityGroupRule22);
    securityGroup1 = NeutronSecurityGroup.builder().id(SECURITY_GROUP_ID_1).name(SECURITY_GROUP_NAME_1).tenantId(SECURITY_GROUP_TENANT_ID_1).description(SECURITY_GROUP_DESCRIPTION_1).build();
    securityGroup2 = NeutronSecurityGroup.builder().id(SECURITY_GROUP_ID_2).name(SECURITY_GROUP_NAME_2).tenantId(SECURITY_GROUP_TENANT_ID_2).description(SECURITY_GROUP_DESCRIPTION_2).build();
}
Also used : TestStorageService(org.onosproject.store.service.TestStorageService) 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