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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations