Search in sources :

Example 1 with ServerPortValidator

use of com.thoughtworks.go.util.validators.ServerPortValidator in project gocd by gocd.

the class GoServerValidatorTest method shouldValidatorServerBeforeStart.

@Test
public void shouldValidatorServerBeforeStart() throws IOException, InterruptedException {
    try {
        startServerOnPort(PORT_TO_TRY);
        serverPortValidator = new ServerPortValidator(PORT_TO_TRY);
        Validation validation = serverPortValidator.validate(new Validation());
        assertThat(validation.isSuccessful(), is(false));
    } finally {
        shutDownServer();
    }
}
Also used : Validation(com.thoughtworks.go.util.validators.Validation) ServerPortValidator(com.thoughtworks.go.util.validators.ServerPortValidator) Test(org.junit.Test)

Example 2 with ServerPortValidator

use of com.thoughtworks.go.util.validators.ServerPortValidator in project gocd by gocd.

the class GoServerValidatorTest method shouldNotFailIfPortIsAvailable.

@Test
public void shouldNotFailIfPortIsAvailable() throws IOException, InterruptedException {
    serverPortValidator = new ServerPortValidator(PORT_TO_TRY);
    Validation validation = serverPortValidator.validate(new Validation());
    assertThat(validation.isSuccessful(), is(true));
}
Also used : Validation(com.thoughtworks.go.util.validators.Validation) ServerPortValidator(com.thoughtworks.go.util.validators.ServerPortValidator) Test(org.junit.Test)

Aggregations

ServerPortValidator (com.thoughtworks.go.util.validators.ServerPortValidator)2 Validation (com.thoughtworks.go.util.validators.Validation)2 Test (org.junit.Test)2