@Test public void analyse_report_with_multiple_absolute_path() throws Exception { configureReportPaths(new File(baseDir, "coverage.xml").getAbsolutePath() + "," + new File(baseDir, "coverage2.xml").getAbsolutePath()); configureITReportPaths(new File(baseDir, "coverage.xml").getAbsolutePath() + "," + new File(baseDir, "coverage2.xml").getAbsolutePath()); configureOverallReportPaths(new File(baseDir, "coverage.xml").getAbsolutePath() + "," + new File(baseDir, "coverage2.xml").getAbsolutePath()); configureUTReportPaths(new File(baseDir, "unittest.xml").getAbsolutePath() + "," + new File(baseDir, "unittest2.xml").getAbsolutePath()); InputFile resource = addFileToContext("src/foobar.js"); InputFile resource2 = addFileToContext("src/helloworld.js"); InputFile testResource = addFileToContext("test/foobar_test.js"); InputFile testResource2 = addFileToContext("test/helloworld_test.js"); sensor.analyseWithLogger(context, logger); verify(context, times(9)).saveMeasure(eq(resource), any(Measure.class)); verify(context, times(9)).saveMeasure(eq(resource2), any(Measure.class)); verify(context, times(6)).saveMeasure(eq(testResource), 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()).contains("Imported coverage data for 2 file"); assertThat(getLoggingEvents().get(4).getMessage()).contains("Parsing").contains("coverage.xml"); assertThat(getLoggingEvents().get(5).getMessage()).contains("Parsing").contains("coverage2.xml"); assertThat(getLoggingEvents().get(6).getMessage()).contains("Imported IT coverage data for 2 file"); assertThat(getLoggingEvents().get(8).getMessage()).contains("Parsing").contains("coverage.xml"); assertThat(getLoggingEvents().get(9).getMessage()).contains("Parsing").contains("coverage2.xml"); assertThat(getLoggingEvents().get(10).getMessage()).contains("Imported Overall coverage data for 2 file"); assertThat(getLoggingEvents().get(12).getMessage()).contains("Parsing").contains("unittest.xml"); assertThat(getLoggingEvents().get(13).getMessage()).contains("Parsing").contains("unittest2.xml"); assertThat(getLoggingEvents().get(14).getMessage()).contains("Imported unit test data for 2 file"); }
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();  }