Search in sources :

Example 71 with TestServiceDirectory

use of org.onlab.osgi.TestServiceDirectory in project onos by opennetworkinglab.

the class K8sNodeWebResourceTest method setUpTest.

/**
 * Sets up the global values for all the tests.
 */
@Before
public void setUpTest() {
    final CodecManager codecService = new CodecManager();
    codecService.activate();
    codecService.registerCodec(K8sNode.class, new K8sNodeCodec());
    codecService.registerCodec(K8sApiConfig.class, new K8sApiConfigCodec());
    codecService.registerCodec(HostNodesInfo.class, new HostNodesInfoCodec());
    ServiceDirectory testDirectory = new TestServiceDirectory().add(K8sNodeAdminService.class, mockK8sNodeAdminService).add(K8sApiConfigAdminService.class, mockK8sApiConfigAdminService).add(CodecService.class, codecService);
    setServiceDirectory(testDirectory);
    k8sNode = DefaultK8sNode.builder().clusterName("kubernetes").hostname("minion-node").type(K8sNode.Type.MINION).dataIp(IpAddress.valueOf("10.134.34.222")).managementIp(IpAddress.valueOf("10.134.231.30")).nodeInfo(new K8sNodeInfo(IpAddress.valueOf("30.30.30.3"), null)).intgBridge(DeviceId.deviceId("of:00000000000000a1")).extBridge(DeviceId.deviceId("of:00000000000000b1")).state(K8sNodeState.INIT).build();
    k8sApiConfig = DefaultK8sApiConfig.builder().clusterName("kubernetes").segmentId(1).mode(K8sApiConfig.Mode.NORMAL).scheme(K8sApiConfig.Scheme.HTTPS).ipAddress(IpAddress.valueOf("10.134.34.223")).port(6443).state(DISCONNECTED).token("tokenMod").caCertData("caCertData").clientCertData("clientCertData").clientKeyData("clientKeyData").build();
}
Also used : K8sNodeInfo(org.onosproject.k8snode.api.K8sNodeInfo) K8sApiConfigCodec(org.onosproject.k8snode.codec.K8sApiConfigCodec) ServiceDirectory(org.onlab.osgi.ServiceDirectory) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) K8sNodeCodec(org.onosproject.k8snode.codec.K8sNodeCodec) K8sApiConfigAdminService(org.onosproject.k8snode.api.K8sApiConfigAdminService) TestServiceDirectory(org.onlab.osgi.TestServiceDirectory) CodecManager(org.onosproject.codec.impl.CodecManager) HostNodesInfoCodec(org.onosproject.k8snode.codec.HostNodesInfoCodec) Before(org.junit.Before)

Aggregations

TestServiceDirectory (org.onlab.osgi.TestServiceDirectory)71 Before (org.junit.Before)66 ServiceDirectory (org.onlab.osgi.ServiceDirectory)53 CodecManager (org.onosproject.codec.impl.CodecManager)37 DistributedVirtualNetworkStore (org.onosproject.incubator.net.virtual.store.impl.DistributedVirtualNetworkStore)14 TestEventDispatcher (org.onosproject.common.event.impl.TestEventDispatcher)13 TestStorageService (org.onosproject.store.service.TestStorageService)12 CoreService (org.onosproject.core.CoreService)10 BeforeClass (org.junit.BeforeClass)5 CfmCodecContext (org.onosproject.cfm.CfmCodecContext)5 CodecService (org.onosproject.codec.CodecService)5 VirtualProviderManager (org.onosproject.incubator.net.virtual.impl.provider.VirtualProviderManager)5 BaseConfig (org.onosproject.net.config.BaseConfig)5 DeviceService (org.onosproject.net.device.DeviceService)5 TestApplicationId (org.onosproject.TestApplicationId)4 CfmMdService (org.onosproject.incubator.net.l2monitoring.cfm.service.CfmMdService)3 VirtualNetworkStore (org.onosproject.incubator.net.virtual.VirtualNetworkStore)3 VirtualProviderRegistryService (org.onosproject.incubator.net.virtual.provider.VirtualProviderRegistryService)3 SimpleVirtualFlowRuleStore (org.onosproject.incubator.net.virtual.store.impl.SimpleVirtualFlowRuleStore)3 Semaphore (java.util.concurrent.Semaphore)2