Search in sources :

Example 51 with TestStorageService

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

the class KubevirtLoadBalancerManagerTest method setUp.

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

Example 52 with TestStorageService

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

the class KubevirtNetworkManagerTest method setUp.

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

Example 53 with TestStorageService

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

the class KubevirtPodManagerTest method setUp.

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

Example 54 with TestStorageService

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

the class KubevirtSecurityGroupManagerTest method setUp.

/**
 * Initial setup for this unit test.
 */
@Before
public void setUp() throws Exception {
    store = new DistributedKubevirtSecurityGroupStore();
    TestUtils.setField(store, "coreService", new TestCoreService());
    TestUtils.setField(store, "storageService", new TestStorageService());
    TestUtils.setField(store, "eventExecutor", MoreExecutors.newDirectExecutorService());
    store.activate();
    target = new KubevirtSecurityGroupManager();
    TestUtils.setField(target, "coreService", new TestCoreService());
    target.sgStore = store;
    target.addListener(testListener);
    target.activate();
    sgRule11 = DefaultKubevirtSecurityGroupRule.builder().id(SECURITY_GROUP_RULE_ID_1_1).securityGroupId(SECURITY_GROUP_ID_1).remoteGroupId(SECURITY_GROUP_ID_1).direction(SECURITY_GROUP_DIRECTION).etherType(SECURITY_GROUP_ETH_TYPE).portRangeMax(SECURITY_GROUP_PORT_RANGE_MAX_1).portRangeMin(SECURITY_GROUP_PORT_RANGE_MIN_1).protocol(SECURITY_GROUP_PROTOCOL_1).remoteIpPrefix(SECURITY_GROUP_REMOTE_IP_PREFIX_1).build();
    sgRule12 = DefaultKubevirtSecurityGroupRule.builder().id(SECURITY_GROUP_RULE_ID_1_2).securityGroupId(SECURITY_GROUP_ID_1).remoteGroupId(SECURITY_GROUP_ID_2).direction(SECURITY_GROUP_DIRECTION).etherType(SECURITY_GROUP_ETH_TYPE).portRangeMax(SECURITY_GROUP_PORT_RANGE_MAX_2).portRangeMin(SECURITY_GROUP_PORT_RANGE_MIN_2).protocol(SECURITY_GROUP_PROTOCOL_2).remoteIpPrefix(SECURITY_GROUP_REMOTE_IP_PREFIX_2).build();
    sg1 = DefaultKubevirtSecurityGroup.builder().id(SECURITY_GROUP_ID_1).name(SECURITY_GROUP_NAME_1).description(SECURITY_GROUP_DESCRIPTION_1).build();
    sg2 = DefaultKubevirtSecurityGroup.builder().id(SECURITY_GROUP_ID_2).name(SECURITY_GROUP_NAME_2).description(SECURITY_GROUP_DESCRIPTION_2).build();
}
Also used : TestStorageService(org.onosproject.store.service.TestStorageService) Before(org.junit.Before)

Example 55 with TestStorageService

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

the class KubevirtApiConfigManagerTest method setUp.

/**
 * Initial setup for this unit test.
 */
@Before
public void setUp() {
    apiConfig1 = DefaultKubevirtApiConfig.builder().scheme(KubevirtApiConfig.Scheme.HTTP).ipAddress(IpAddress.valueOf("10.10.10.2")).port(6443).state(DISCONNECTED).datacenterId("BD").clusterId("BD-MEH-CT01").build();
    apiConfig2 = DefaultKubevirtApiConfig.builder().scheme(KubevirtApiConfig.Scheme.HTTP).ipAddress(IpAddress.valueOf("10.10.10.3")).port(6443).state(DISCONNECTED).datacenterId("BD").clusterId("BD-MEH-CT01").build();
    configStore = new DistributedKubevirtApiConfigStore();
    TestUtils.setField(configStore, "coreService", new TestCoreService());
    TestUtils.setField(configStore, "storageService", new TestStorageService());
    TestUtils.setField(configStore, "eventExecutor", MoreExecutors.newDirectExecutorService());
    configStore.activate();
    target = new KubevirtApiConfigManager();
    target.storageService = new TestStorageService();
    target.coreService = new TestCoreService();
    target.clusterService = new TestClusterService();
    target.leadershipService = new TestLeadershipService();
    target.configStore = configStore;
    target.addListener(testListener);
    target.activate();
    testListener.events.clear();
}
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