### Question:
GenericCoverageSensor implements Sensor { @Override public void analyse(Project project, SensorContext context) { analyseWithLogger(context, LoggerFactory.getLogger(GenericCoverageSensor.class)); } GenericCoverageSensor(Settings settings, FileSystem fs, ResourcePerspectives perspectives); @Override boolean shouldExecuteOnProject(Project project); @Override void analyse(Project project, SensorContext context); void analyseWithLogger(SensorContext context, Logger logger); @Override String toString();  }### Answer:
@Test(expected = IllegalStateException.class) public void analyse_txt_report() throws Exception { configureReportPaths("not-xml.txt"); sensor.analyse(project, context); }
@Test(expected = IllegalStateException.class) public void it_analyse_txt_report() throws Exception { configureITReportPaths("not-xml.txt"); sensor.analyse(project, context); }
@Test(expected = IllegalStateException.class) public void overall_analyse_txt_report() throws Exception { configureOverallReportPaths("not-xml.txt"); sensor.analyse(project, context); }
@Test(expected = IllegalStateException.class) public void ut_analyse_txt_report() throws Exception { configureUTReportPaths("not-xml.txt"); sensor.analyse(project, context); }
@Test(expected = IllegalStateException.class) public void analyse_invalid_report() throws Exception { configureReportPaths("invalid-coverage.xml"); sensor.analyse(project, context); }
@Test(expected = IllegalStateException.class) public void it_analyse_invalid_report() throws Exception { configureITReportPaths("invalid-coverage.xml"); sensor.analyse(project, context); }
@Test(expected = IllegalStateException.class) public void overall_analyse_invalid_report() throws Exception { configureOverallReportPaths("invalid-coverage.xml"); sensor.analyse(project, context); }
@Test(expected = IllegalStateException.class) public void ut_analyse_invalid_report() throws Exception { configureUTReportPaths("invalid-unittest.xml"); sensor.analyse(project, context); }
@Test public void analyse_report_with_absolute_path() throws Exception { File reportFile = new File(baseDir, "coverage.xml"); configureReportPaths(reportFile.getAbsolutePath()); InputFile resource = addFileToContext("src/foobar.js"); sensor.analyse(project, context); verify(context, times(3)).saveMeasure(eq(resource), any(Measure.class)); }