Search in sources :

Example 1 with MachineConfigDto

use of org.eclipse.che.api.machine.shared.dto.MachineConfigDto in project che by eclipse.

the class CheEnvironmentValidatorTest method shouldFailValidationIfServerConfProtocolIsInvalid.

@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Machine .* contains server conf with invalid protocol .*", dataProvider = "invalidProtocolProvider")
public void shouldFailValidationIfServerConfProtocolIsInvalid(String invalidProtocol) throws Exception {
    MachineConfigDto config = createMachineConfig();
    config.getServers().add(newDto(ServerConfDto.class).withPort("8080/tcp").withProtocol(invalidProtocol));
    environmentValidator.validateMachine(config);
}
Also used : ServerConfDto(org.eclipse.che.api.machine.shared.dto.ServerConfDto) MachineConfigDto(org.eclipse.che.api.machine.shared.dto.MachineConfigDto) Test(org.testng.annotations.Test)

Example 2 with MachineConfigDto

use of org.eclipse.che.api.machine.shared.dto.MachineConfigDto in project che by eclipse.

the class CheEnvironmentValidatorTest method shouldFailValidationIfMachineTypeIsNull.

@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Type 'null' of machine '.*' is not supported. Supported values are: docker, ssh.")
public void shouldFailValidationIfMachineTypeIsNull() throws Exception {
    MachineConfigDto config = createMachineConfig();
    config.withType(null);
    environmentValidator.validateMachine(config);
}
Also used : MachineConfigDto(org.eclipse.che.api.machine.shared.dto.MachineConfigDto) Test(org.testng.annotations.Test)

Example 3 with MachineConfigDto

use of org.eclipse.che.api.machine.shared.dto.MachineConfigDto in project che by eclipse.

the class CheEnvironmentValidatorTest method shouldFailValidationIfServerConfPortIsInvalid.

@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Machine .* contains server conf with invalid port .*", dataProvider = "invalidPortProvider")
public void shouldFailValidationIfServerConfPortIsInvalid(String invalidPort) throws Exception {
    MachineConfigDto config = createMachineConfig();
    config.getServers().add(newDto(ServerConfDto.class).withPort(invalidPort));
    environmentValidator.validateMachine(config);
}
Also used : MachineConfigDto(org.eclipse.che.api.machine.shared.dto.MachineConfigDto) Test(org.testng.annotations.Test)

Example 4 with MachineConfigDto

use of org.eclipse.che.api.machine.shared.dto.MachineConfigDto in project che by eclipse.

the class CheEnvironmentValidatorTest method shouldFailValidationIfLocationHasInvalidProtocol.

@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Machine '.*' has invalid source location protocol: ftp://localhost")
public void shouldFailValidationIfLocationHasInvalidProtocol() throws Exception {
    MachineConfigDto config = createMachineConfig();
    config.withSource(newDto(MachineSourceDto.class).withType("dockerfile").withLocation("ftp://localhost"));
    environmentValidator.validateMachine(config);
}
Also used : MachineConfigDto(org.eclipse.che.api.machine.shared.dto.MachineConfigDto) MachineSourceDto(org.eclipse.che.api.machine.shared.dto.MachineSourceDto) Test(org.testng.annotations.Test)

Example 5 with MachineConfigDto

use of org.eclipse.che.api.machine.shared.dto.MachineConfigDto in project che by eclipse.

the class CheEnvironmentValidatorTest method shouldFailValidationIfMissingSourceLocationAndContent.

@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Source of machine '.*' must contain location or content")
public void shouldFailValidationIfMissingSourceLocationAndContent() throws Exception {
    MachineConfigDto config = createMachineConfig();
    config.withSource(newDto(MachineSourceDto.class).withType("dockerfile"));
    environmentValidator.validateMachine(config);
}
Also used : MachineConfigDto(org.eclipse.che.api.machine.shared.dto.MachineConfigDto) Test(org.testng.annotations.Test)

Aggregations

MachineConfigDto (org.eclipse.che.api.machine.shared.dto.MachineConfigDto)23 Test (org.testng.annotations.Test)13 Test (org.junit.Test)7 MachineDto (org.eclipse.che.api.machine.shared.dto.MachineDto)5 MachineEntity (org.eclipse.che.ide.api.machine.MachineEntity)5 IsWidget (com.google.gwt.user.client.ui.IsWidget)4 ArrayList (java.util.ArrayList)4 Matchers.anyString (org.mockito.Matchers.anyString)4 HashMap (java.util.HashMap)3 MachineSourceDto (org.eclipse.che.api.machine.shared.dto.MachineSourceDto)3 EnvironmentDto (org.eclipse.che.api.workspace.shared.dto.EnvironmentDto)3 WorkspaceConfigDto (org.eclipse.che.api.workspace.shared.dto.WorkspaceConfigDto)3 WorkspaceRuntimeDto (org.eclipse.che.api.workspace.shared.dto.WorkspaceRuntimeDto)3 ProcessTreeNode (org.eclipse.che.ide.extension.machine.client.processes.ProcessTreeNode)3 CommandOutputConsole (org.eclipse.che.ide.extension.machine.client.outputspanel.console.CommandOutputConsole)2 TerminalPresenter (org.eclipse.che.ide.extension.machine.client.perspective.terminal.TerminalPresenter)2 List (java.util.List)1 MachineLimitsDto (org.eclipse.che.api.machine.shared.dto.MachineLimitsDto)1 MachineProcessDto (org.eclipse.che.api.machine.shared.dto.MachineProcessDto)1 ServerConfDto (org.eclipse.che.api.machine.shared.dto.ServerConfDto)1