@Test public void analyse_report_with_multiple_relative_path() throws Exception { configureReportPaths("coverage.xml,coverage2.xml"); configureITReportPaths("coverage.xml,coverage2.xml"); configureOverallReportPaths("coverage.xml,coverage2.xml"); configureUTReportPaths("unittest.xml,unittest2.xml"); InputFile resource1 = addFileToContext("src/foobar.js"); InputFile resource2 = addFileToContext("src/helloworld.js"); InputFile resource3 = addFileToContext("src/third.js"); InputFile testResource1 = addFileToContext("test/foobar_test.js"); InputFile testResource2 = addFileToContext("test/helloworld_test.js"); sensor.analyseWithLogger(context, logger); verify(context, times(9)).saveMeasure(eq(resource1), any(Measure.class)); verify(context, times(9)).saveMeasure(eq(resource2), any(Measure.class)); verify(context, times(9)).saveMeasure(eq(resource3), any(Measure.class)); verify(context, times(6)).saveMeasure(eq(testResource1), any(Measure.class)); verify(context, times(6)).saveMeasure(eq(testResource2), any(Measure.class)); assertThat(getLoggingEvents().get(0).getMessage()).contains("Parsing").contains("coverage.xml"); assertThat(getLoggingEvents().get(1).getMessage()).contains("Parsing").contains("coverage2.xml"); assertThat(getLoggingEvents().get(2).getMessage()).isEqualTo("Imported coverage data for 3 files"); assertThat(getLoggingEvents().get(3).getMessage()).contains("Parsing").contains("coverage.xml"); assertThat(getLoggingEvents().get(4).getMessage()).contains("Parsing").contains("coverage2.xml"); assertThat(getLoggingEvents().get(5).getMessage()).isEqualTo("Imported IT coverage data for 3 files"); assertThat(getLoggingEvents().get(6).getMessage()).contains("Parsing").contains("coverage.xml"); assertThat(getLoggingEvents().get(7).getMessage()).contains("Parsing").contains("coverage2.xml"); assertThat(getLoggingEvents().get(8).getMessage()).isEqualTo("Imported Overall coverage data for 3 files"); assertThat(getLoggingEvents().get(9).getMessage()).contains("Parsing").contains("unittest.xml"); assertThat(getLoggingEvents().get(10).getMessage()).contains("Parsing").contains("unittest2.xml"); assertThat(getLoggingEvents().get(11).getMessage()).isEqualTo("Imported unit test data for 2 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();  }