Search in sources :

Example 1 with TestStorageService

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

the class K8sNetworkManagerTest method setUp.

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

Example 2 with TestStorageService

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

the class K8sIngressManagerTest method setUp.

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

Example 3 with TestStorageService

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

the class K8sServiceManagerTest method setUp.

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

Example 4 with TestStorageService

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

the class K8sApiConfigManagerTest method setUp.

/**
 * Initial setup for this unit test.
 */
@Before
public void setUp() {
    apiConfig1 = DefaultK8sApiConfig.builder().clusterName("kubernetes1").segmentId(1).mode(K8sApiConfig.Mode.NORMAL).scheme(K8sApiConfig.Scheme.HTTP).ipAddress(IpAddress.valueOf("10.10.10.2")).port(6443).state(DISCONNECTED).build();
    apiConfig2 = DefaultK8sApiConfig.builder().clusterName("kubernetes2").segmentId(2).mode(K8sApiConfig.Mode.NORMAL).scheme(K8sApiConfig.Scheme.HTTPS).ipAddress(IpAddress.valueOf("10.10.10.3")).port(6443).state(DISCONNECTED).token("token").caCertData("caCertData").clientCertData("clientCertData").clientKeyData("clientKeyData").build();
    apiConfig3 = DefaultK8sApiConfig.builder().clusterName("kubernetes3").segmentId(3).mode(K8sApiConfig.Mode.PASSTHROUGH).scheme(K8sApiConfig.Scheme.HTTP).ipAddress(IpAddress.valueOf("10.10.10.4")).port(8080).state(DISCONNECTED).build();
    configStore = new DistributedK8sApiConfigStore();
    TestUtils.setField(configStore, "coreService", new TestCoreService());
    TestUtils.setField(configStore, "storageService", new TestStorageService());
    TestUtils.setField(configStore, "eventExecutor", MoreExecutors.newDirectExecutorService());
    configStore.activate();
    configStore.createApiConfig(apiConfig2);
    configStore.createApiConfig(apiConfig3);
    target = new K8sApiConfigManager();
    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)

Example 5 with TestStorageService

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

the class K8sNodeManagerTest method setUp.

/**
 * Initial setup for this unit test.
 */
@Before
public void setUp() {
    nodeStore = new DistributedK8sNodeStore();
    TestUtils.setField(nodeStore, "coreService", new TestCoreService());
    TestUtils.setField(nodeStore, "storageService", new TestStorageService());
    TestUtils.setField(nodeStore, "eventExecutor", MoreExecutors.newDirectExecutorService());
    nodeStore.activate();
    nodeStore.createNode(MINION_2);
    nodeStore.createNode(MINION_3);
    target = new K8sNodeManager();
    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)

Aggregations

Before (org.junit.Before)70 TestStorageService (org.onosproject.store.service.TestStorageService)70 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 TestApplicationId (org.onosproject.TestApplicationId)3 ComponentConfigAdapter (org.onosproject.cfg.ComponentConfigAdapter)3 ClusterService (org.onosproject.cluster.ClusterService)3 VirtualNetworkStore (org.onosproject.incubator.net.virtual.VirtualNetworkStore)3 VirtualProviderManager (org.onosproject.incubator.net.virtual.impl.provider.VirtualProviderManager)3 Semaphore (java.util.concurrent.Semaphore)2 KryoNamespace (org.onlab.util.KryoNamespace)2 ClusterServiceAdapter (org.onosproject.cluster.ClusterServiceAdapter)2 NodeId (org.onosproject.cluster.NodeId)2 VirtualProviderRegistryService (org.onosproject.incubator.net.virtual.provider.VirtualProviderRegistryService)2 DeviceService (org.onosproject.net.device.DeviceService)2 DeviceServiceAdapter (org.onosproject.net.device.DeviceServiceAdapter)2 WorkPartitionServiceAdapter (org.onosproject.net.intent.WorkPartitionServiceAdapter)2 Serializer (org.onosproject.store.service.Serializer)2