@Test public void analyse_report_not_found() throws Exception { configureReportPaths("xxx"); configureITReportPaths(""); configureOverallReportPaths(""); sensor.analyseWithLogger(context, logger); verifyZeroInteractions(context); assertThat(getLoggingEvents().get(1).getLevel()).isEqualTo("warn"); assertThat(getLoggingEvents().get(1).getMessage()).contains("Cannot find coverage"); configureReportPaths(""); configureITReportPaths("xxx"); configureOverallReportPaths(""); sensor.analyseWithLogger(context, logger); verifyZeroInteractions(context); assertThat(getLoggingEvents().get(4).getLevel()).isEqualTo("warn"); assertThat(getLoggingEvents().get(4).getMessage()).contains("Cannot find IT coverage"); configureReportPaths(""); configureITReportPaths(""); configureUTReportPaths("xxx"); configureOverallReportPaths("xxx"); sensor.analyseWithLogger(context, logger); verifyZeroInteractions(context); assertThat(getLoggingEvents().get(8).getLevel()).isEqualTo("warn"); assertThat(getLoggingEvents().get(8).getMessage()).contains("Cannot find Overall coverage"); configureReportPaths(""); configureOverallReportPaths(""); configureUTReportPaths("xxx"); sensor.analyseWithLogger(context, logger); verifyZeroInteractions(context); assertThat(getLoggingEvents().get(13).getMessage()).contains("Cannot find unit test"); assertThat(getLoggingEvents().get(13).getLevel()).isEqualTo("warn"); }
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();  }