@Test public void analyse_report_with_language_unknown_files() throws Exception { configureReportPaths("coverage.xml"); String path = "src/foobar.js"; DefaultInputFile inputFile = new DefaultInputFile(path).setAbsolutePath(path); fs.add(inputFile); when(context.getResource(inputFile)).thenReturn(mock(Resource.class)); thrown.expectMessage("Line 2 of report coverage.xml refers to a file with an unknown language: src/foobar.js"); thrown.expect(IllegalStateException.class); sensor.analyseWithLogger(context, logger); }
public void analyseWithLogger(SensorContext context, Logger logger) { boolean ok = loadReport(context, logger, ReportParser.Mode.COVERAGE, coverageReportPath(logger)); if (ok) { ok = loadReport(context, logger, ReportParser.Mode.IT_COVERAGE, itReportPath()); } if (ok) { ok = loadReport(context, logger, ReportParser.Mode.OVERALL_COVERAGE, overallReportPath()); } if (ok) { loadReport(context, logger, ReportParser.Mode.UNITTEST, unitTestReportPath()); } }
GenericCoverageSensor implements Sensor { public void analyseWithLogger(SensorContext context, Logger logger) { boolean ok = loadReport(context, logger, ReportParser.Mode.COVERAGE, coverageReportPath(logger)); if (ok) { ok = loadReport(context, logger, ReportParser.Mode.IT_COVERAGE, itReportPath()); } if (ok) { ok = loadReport(context, logger, ReportParser.Mode.OVERALL_COVERAGE, overallReportPath()); } if (ok) { loadReport(context, logger, ReportParser.Mode.UNITTEST, unitTestReportPath()); } } }
GenericCoverageSensor implements Sensor { public void analyseWithLogger(SensorContext context, Logger logger) { boolean ok = loadReport(context, logger, ReportParser.Mode.COVERAGE, coverageReportPath(logger)); if (ok) { ok = loadReport(context, logger, ReportParser.Mode.IT_COVERAGE, itReportPath()); } if (ok) { ok = loadReport(context, logger, ReportParser.Mode.OVERALL_COVERAGE, overallReportPath()); } if (ok) { loadReport(context, logger, ReportParser.Mode.UNITTEST, unitTestReportPath()); } } GenericCoverageSensor(Settings settings, FileSystem fs, ResourcePerspectives perspectives); }
GenericCoverageSensor implements Sensor { public void analyseWithLogger(SensorContext context, Logger logger) { boolean ok = loadReport(context, logger, ReportParser.Mode.COVERAGE, coverageReportPath(logger)); if (ok) { ok = loadReport(context, logger, ReportParser.Mode.IT_COVERAGE, itReportPath()); } if (ok) { ok = loadReport(context, logger, ReportParser.Mode.OVERALL_COVERAGE, overallReportPath()); } if (ok) { loadReport(context, logger, ReportParser.Mode.UNITTEST, unitTestReportPath()); } } 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(); }
GenericCoverageSensor implements Sensor { public void analyseWithLogger(SensorContext context, Logger logger) { boolean ok = loadReport(context, logger, ReportParser.Mode.COVERAGE, coverageReportPath(logger)); if (ok) { ok = loadReport(context, logger, ReportParser.Mode.IT_COVERAGE, itReportPath()); } if (ok) { ok = loadReport(context, logger, ReportParser.Mode.OVERALL_COVERAGE, overallReportPath()); } if (ok) { loadReport(context, logger, ReportParser.Mode.UNITTEST, unitTestReportPath()); } } 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();  }