Search in sources :

Example 51 with ServerConfig

use of org.eclipse.che.api.core.model.workspace.config.ServerConfig in project che-server by eclipse-che.

the class ServerConfigImplTest method testCreateFromEndpointDevfileEndpointAttributeNotSetWhenDefault.

@Test
public void testCreateFromEndpointDevfileEndpointAttributeNotSetWhenDefault() {
    ServerConfig serverConfig = ServerConfigImpl.createFromEndpoint(new EndpointImpl("name", 123, new HashMap<>()));
    assertFalse(serverConfig.getAttributes().containsKey(REQUIRE_SUBDOMAIN));
}
Also used : ServerConfig(org.eclipse.che.api.core.model.workspace.config.ServerConfig) HashMap(java.util.HashMap) EndpointImpl(org.eclipse.che.api.workspace.server.model.impl.devfile.EndpointImpl) Test(org.testng.annotations.Test)

Example 52 with ServerConfig

use of org.eclipse.che.api.core.model.workspace.config.ServerConfig in project che-server by eclipse-che.

the class ServerConfigImplTest method testStoreEndpointNameIntoAttributes.

@Test
public void testStoreEndpointNameIntoAttributes() {
    ServerConfig serverConfig = ServerConfigImpl.createFromEndpoint(new EndpointImpl("blabol", 123, emptyMap()));
    assertEquals(serverConfig.getAttributes().get(SERVER_NAME_ATTRIBUTE), "blabol");
}
Also used : ServerConfig(org.eclipse.che.api.core.model.workspace.config.ServerConfig) EndpointImpl(org.eclipse.che.api.workspace.server.model.impl.devfile.EndpointImpl) Test(org.testng.annotations.Test)

Example 53 with ServerConfig

use of org.eclipse.che.api.core.model.workspace.config.ServerConfig in project che-server by eclipse-che.

the class ServerConfigImplTest method testCreateFromEndpointTranslateProtocol.

@Test
public void testCreateFromEndpointTranslateProtocol() {
    ServerConfig serverConfig = ServerConfigImpl.createFromEndpoint(new EndpointImpl("name", 123, singletonMap("protocol", "hello")));
    assertEquals(serverConfig.getProtocol(), "hello");
}
Also used : ServerConfig(org.eclipse.che.api.core.model.workspace.config.ServerConfig) EndpointImpl(org.eclipse.che.api.workspace.server.model.impl.devfile.EndpointImpl) Test(org.testng.annotations.Test)

Example 54 with ServerConfig

use of org.eclipse.che.api.core.model.workspace.config.ServerConfig in project che-server by eclipse-che.

the class ServerConfigImplTest method testCreateFromEndpointTranslatePublicFalse.

@Test
public void testCreateFromEndpointTranslatePublicFalse() {
    ServerConfig serverConfig = ServerConfigImpl.createFromEndpoint(new EndpointImpl("name", 123, singletonMap("public", "false")));
    assertFalse(serverConfig.getAttributes().isEmpty());
    assertEquals(serverConfig.getAttributes().get(INTERNAL_SERVER_ATTRIBUTE), Boolean.TRUE.toString());
}
Also used : ServerConfig(org.eclipse.che.api.core.model.workspace.config.ServerConfig) EndpointImpl(org.eclipse.che.api.workspace.server.model.impl.devfile.EndpointImpl) Test(org.testng.annotations.Test)

Example 55 with ServerConfig

use of org.eclipse.che.api.core.model.workspace.config.ServerConfig in project che-server by eclipse-che.

the class ServerConfigImplTest method testCreateFromEndpointTranslatePublicTrue.

@Test
public void testCreateFromEndpointTranslatePublicTrue() {
    ServerConfig serverConfig = ServerConfigImpl.createFromEndpoint(new EndpointImpl("name", 123, singletonMap("public", "true")));
    assertFalse(serverConfig.isInternal());
}
Also used : ServerConfig(org.eclipse.che.api.core.model.workspace.config.ServerConfig) EndpointImpl(org.eclipse.che.api.workspace.server.model.impl.devfile.EndpointImpl) Test(org.testng.annotations.Test)

Aggregations

ServerConfig (org.eclipse.che.api.core.model.workspace.config.ServerConfig)74 Test (org.testng.annotations.Test)54 ServerConfigImpl (org.eclipse.che.api.workspace.server.model.impl.ServerConfigImpl)42 ServicePort (io.fabric8.kubernetes.api.model.ServicePort)30 IntOrString (io.fabric8.kubernetes.api.model.IntOrString)28 EndpointImpl (org.eclipse.che.api.workspace.server.model.impl.devfile.EndpointImpl)20 ServicePortBuilder (io.fabric8.kubernetes.api.model.ServicePortBuilder)18 HashMap (java.util.HashMap)16 Annotations (org.eclipse.che.workspace.infrastructure.kubernetes.Annotations)16 Service (io.fabric8.kubernetes.api.model.Service)14 KubernetesEnvironment (org.eclipse.che.workspace.infrastructure.kubernetes.environment.KubernetesEnvironment)12 Map (java.util.Map)10 ImmutableMap (com.google.common.collect.ImmutableMap)8 InfrastructureException (org.eclipse.che.api.workspace.server.spi.InfrastructureException)8 Container (io.fabric8.kubernetes.api.model.Container)6 ContainerPortBuilder (io.fabric8.kubernetes.api.model.ContainerPortBuilder)6 Ingress (io.fabric8.kubernetes.api.model.networking.v1.Ingress)6 ArrayList (java.util.ArrayList)6 Collections.singletonMap (java.util.Collections.singletonMap)6 Optional (java.util.Optional)6