@Test public void analyse_report_with_deprecated_key() throws Exception { configureOldReportPath("coverage.xml"); InputFile resource = addFileToContext("src/foobar.js"); sensor.analyseWithLogger(context, logger); verify(context, times(3)).saveMeasure(eq(resource), any(Measure.class)); assertThat(getLoggingEvents().get(0).getMessage()) .isEqualTo("Use the new property \"sonar.genericcoverage.reportPaths\" instead of the deprecated \"sonar.genericcoverage.reportPath\""); assertThat(getLoggingEvents().get(1).getMessage()).contains("Parsing").contains("coverage.xml"); assertThat(getLoggingEvents().get(2).getMessage()).contains("Imported coverage data for 1 file"); assertThat(getLoggingEvents().get(4).getMessage()).contains("Imported IT coverage data for 0 files"); assertThat(getLoggingEvents().get(5).getMessage()).contains("Imported Overall coverage data for 0 files"); assertThat(getLoggingEvents().get(6).getMessage()).contains("Imported unit test data for 0 files"); }
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();  }