@Test
public void shouldSaveErrorsAndFailuresInXML() throws URISyntaxException {

  SensorContextTester context = SensorContextTester.create(new File(""));
  context.fileSystem()
    .add(inputFile("org.sonar.core.ExtensionsFinderTest"))
    .add(inputFile("org.sonar.core.ExtensionsFinderTest2"))
    .add(inputFile("org.sonar.core.ExtensionsFinderTest3"));
  surefireSensor.collect(context, new File(getClass().getResource(
    "/org/sonar/plugins/groovy/surefire/SurefireSensorTest/shouldSaveErrorsAndFailuresInXML/").toURI()));
  // 1 classes, 6 measures by class
  assertThat(context.measure(":org.sonar.core.ExtensionsFinderTest", CoreMetrics.SKIPPED_TESTS).value()).isEqualTo(1);
  assertThat(context.measure(":org.sonar.core.ExtensionsFinderTest", CoreMetrics.TESTS).value()).isEqualTo(7);
  assertThat(context.measures(":org.sonar.core.ExtensionsFinderTest")).hasSize(6);
}