Search in sources :

Example 56 with EndpointImpl

use of org.eclipse.che.api.workspace.server.model.impl.devfile.EndpointImpl in project devspaces-images by redhat-developer.

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)

Example 57 with EndpointImpl

use of org.eclipse.che.api.workspace.server.model.impl.devfile.EndpointImpl in project devspaces-images by redhat-developer.

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 58 with EndpointImpl

use of org.eclipse.che.api.workspace.server.model.impl.devfile.EndpointImpl in project devspaces-images by redhat-developer.

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 59 with EndpointImpl

use of org.eclipse.che.api.workspace.server.model.impl.devfile.EndpointImpl in project devspaces-images by redhat-developer.

the class ServerConfigImplTest method testCreateFromEndpointTranslatePath.

@Test
public void testCreateFromEndpointTranslatePath() {
    ServerConfig serverConfig = ServerConfigImpl.createFromEndpoint(new EndpointImpl("name", 123, singletonMap("path", "hello")));
    assertEquals(serverConfig.getPath(), "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 60 with EndpointImpl

use of org.eclipse.che.api.workspace.server.model.impl.devfile.EndpointImpl in project devspaces-images by redhat-developer.

the class DevfileParserTest method testInitializingDevfileMapsAfterParsing.

@Test
public void testInitializingDevfileMapsAfterParsing() throws Exception {
    // given
    CommandImpl command = new CommandImpl();
    command.getActions().add(new ActionImpl());
    devfile.getCommands().add(command);
    ComponentImpl component = new ComponentImpl();
    component.getEndpoints().add(new EndpointImpl());
    devfile.getComponents().add(component);
    // when
    DevfileImpl parsed = devfileParser.parseYaml(DEVFILE_YAML_CONTENT);
    // then
    assertNotNull(parsed.getCommands().get(0).getAttributes());
    assertNotNull(parsed.getComponents().get(0).getSelector());
    assertNotNull(parsed.getComponents().get(0).getEndpoints().get(0).getAttributes());
}
Also used : CommandImpl(org.eclipse.che.api.workspace.server.model.impl.devfile.CommandImpl) DevfileImpl(org.eclipse.che.api.workspace.server.model.impl.devfile.DevfileImpl) EndpointImpl(org.eclipse.che.api.workspace.server.model.impl.devfile.EndpointImpl) ActionImpl(org.eclipse.che.api.workspace.server.model.impl.devfile.ActionImpl) ComponentImpl(org.eclipse.che.api.workspace.server.model.impl.devfile.ComponentImpl) Test(org.testng.annotations.Test)

Aggregations

EndpointImpl (org.eclipse.che.api.workspace.server.model.impl.devfile.EndpointImpl)60 Test (org.testng.annotations.Test)52 ComponentImpl (org.eclipse.che.api.workspace.server.model.impl.devfile.ComponentImpl)36 ServerConfig (org.eclipse.che.api.core.model.workspace.config.ServerConfig)20 MachineConfigImpl (org.eclipse.che.api.workspace.server.model.impl.MachineConfigImpl)20 Collections.emptyMap (java.util.Collections.emptyMap)12 Map (java.util.Map)12 ActionImpl (org.eclipse.che.api.workspace.server.model.impl.devfile.ActionImpl)12 DevfileImpl (org.eclipse.che.api.workspace.server.model.impl.devfile.DevfileImpl)12 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)12 EntrypointImpl (org.eclipse.che.api.workspace.server.model.impl.devfile.EntrypointImpl)10 EnvImpl (org.eclipse.che.api.workspace.server.model.impl.devfile.EnvImpl)10 ProjectImpl (org.eclipse.che.api.workspace.server.model.impl.devfile.ProjectImpl)10 SourceImpl (org.eclipse.che.api.workspace.server.model.impl.devfile.SourceImpl)10 ImmutableMap (com.google.common.collect.ImmutableMap)8 Collections.singletonMap (java.util.Collections.singletonMap)8 ServerConfigImpl (org.eclipse.che.api.workspace.server.model.impl.ServerConfigImpl)8 CommandImpl (org.eclipse.che.api.workspace.server.model.impl.devfile.CommandImpl)8 MetadataImpl (org.eclipse.che.api.workspace.server.model.impl.devfile.MetadataImpl)8 ArgumentMatchers.anyMap (org.mockito.ArgumentMatchers.anyMap)8