@Test
public void successRatioIsZeroWhenAllTestsFail() throws URISyntaxException {

  SensorContextTester context = SensorContextTester.create(new File(""));
  context.fileSystem().add(inputFile("org.sonar.Foo"));
  surefireSensor.collect(context, new File(getClass().getResource(
    "/org/sonar/plugins/groovy/surefire/SurefireSensorTest/successRatioIsZeroWhenAllTestsFail/").toURI()));
  assertThat(context.measure(":org.sonar.Foo", CoreMetrics.TESTS).value()).isEqualTo(2);
  assertThat(context.measure(":org.sonar.Foo", CoreMetrics.TEST_FAILURES).value()).isEqualTo(1);
  assertThat(context.measure(":org.sonar.Foo", CoreMetrics.TEST_ERRORS).value()).isEqualTo(1);
  assertThat(context.measure(":org.sonar.Foo", CoreMetrics.TEST_SUCCESS_DENSITY).value()).isEqualTo(0);
}