@Test public void should_report_analyse_failure() { when(executor.execute()).thenThrow(new RuntimeException()); exception.expect(XmlParserException.class); pmdSensor.analyse(project, sensorContext); }
@Override public void analyse(Project project, SensorContext context) { try { Report report = executor.execute(); for (RuleViolation violation : report) { pmdViolationRecorder.saveViolation(violation); } } catch (Exception e) { throw new XmlParserException(e); } }
PmdSensor implements Sensor { @Override public void analyse(Project project, SensorContext context) { try { Report report = executor.execute(); for (RuleViolation violation : report) { pmdViolationRecorder.saveViolation(violation); } } catch (Exception e) { throw new XmlParserException(e); } } }
PmdSensor implements Sensor { @Override public void analyse(Project project, SensorContext context) { try { Report report = executor.execute(); for (RuleViolation violation : report) { pmdViolationRecorder.saveViolation(violation); } } catch (Exception e) { throw new XmlParserException(e); } } PmdSensor(RulesProfile profile, PmdExecutor executor, PmdViolationRecorder pmdViolationRecorder, FileSystem fs); }
PmdSensor implements Sensor { @Override public void analyse(Project project, SensorContext context) { try { Report report = executor.execute(); for (RuleViolation violation : report) { pmdViolationRecorder.saveViolation(violation); } } catch (Exception e) { throw new XmlParserException(e); } } PmdSensor(RulesProfile profile, PmdExecutor executor, PmdViolationRecorder pmdViolationRecorder, FileSystem fs); @Override boolean shouldExecuteOnProject(Project project); @Override void analyse(Project project, SensorContext context); @Override String toString(); }
PmdSensor implements Sensor { @Override public void analyse(Project project, SensorContext context) { try { Report report = executor.execute(); for (RuleViolation violation : report) { pmdViolationRecorder.saveViolation(violation); } } catch (Exception e) { throw new XmlParserException(e); } } PmdSensor(RulesProfile profile, PmdExecutor executor, PmdViolationRecorder pmdViolationRecorder, FileSystem fs); @Override boolean shouldExecuteOnProject(Project project); @Override void analyse(Project project, SensorContext context); @Override String toString();  }