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