Ejemplo n.º 1
0
  @Test
  public void ensureHealthy_happyDay_whenGMExceptionWasThrown() throws Exception {
    when(reader.readLine()).thenReturn("NG");
    try {
      sut.execute(gmCommand);
      // SUPPRESS CHECKSTYLE EmptyBlock BECAUSE test
    } catch (GMException e) {
    }

    sut.ensureHealthy();
  }
Ejemplo n.º 2
0
  @Test
  public void ensureHealthy_happyDay_whenErrorWasThrown() throws Exception {
    when(reader.readLine()).thenThrow(new Error());
    try {
      sut.execute(gmCommand);
      // SUPPRESS CHECKSTYLE EmptyBlock BECAUSE test
    } catch (Error e) {
    }

    exception.expect(GMServiceException.class);
    sut.ensureHealthy();
  }
Ejemplo n.º 3
0
  private void ensureHealthy_happyDay(int count) throws Exception {
    when(reader.readLine()).thenReturn("OK");
    for (int i = 0; i < count; i++) sut.execute(gmCommand);

    sut.ensureHealthy();
  }