@Test public void should_fail_to_dump_xml_rule_set() throws IOException { when(fs.workDir()).thenReturn(new File("xxx")); expectedException.expect(IllegalStateException.class); expectedException.expectMessage("Fail to save the PMD configuration"); configuration.dumpXmlRuleSet("pmd", "<xml>"); }
public File dumpXmlRuleSet(String repositoryKey, String rulesXml) { try { File configurationFile = writeToWorkingDirectory(rulesXml, repositoryKey + ".xml"); LOG.info("PMD configuration: " + configurationFile.getAbsolutePath()); return configurationFile; } catch (IOException e) { throw new IllegalStateException("Fail to save the PMD configuration", e); } }
PmdConfiguration implements BatchExtension { public File dumpXmlRuleSet(String repositoryKey, String rulesXml) { try { File configurationFile = writeToWorkingDirectory(rulesXml, repositoryKey + ".xml"); LOG.info("PMD configuration: " + configurationFile.getAbsolutePath()); return configurationFile; } catch (IOException e) { throw new IllegalStateException("Fail to save the PMD configuration", e); } } }
PmdConfiguration implements BatchExtension { public File dumpXmlRuleSet(String repositoryKey, String rulesXml) { try { File configurationFile = writeToWorkingDirectory(rulesXml, repositoryKey + ".xml"); LOG.info("PMD configuration: " + configurationFile.getAbsolutePath()); return configurationFile; } catch (IOException e) { throw new IllegalStateException("Fail to save the PMD configuration", e); } } PmdConfiguration(FileSystem fileSystem, Settings settings); }
PmdConfiguration implements BatchExtension { public File dumpXmlRuleSet(String repositoryKey, String rulesXml) { try { File configurationFile = writeToWorkingDirectory(rulesXml, repositoryKey + ".xml"); LOG.info("PMD configuration: " + configurationFile.getAbsolutePath()); return configurationFile; } catch (IOException e) { throw new IllegalStateException("Fail to save the PMD configuration", e); } } PmdConfiguration(FileSystem fileSystem, Settings settings); File dumpXmlRuleSet(String repositoryKey, String rulesXml); File dumpXmlReport(Report report); }
PmdConfiguration implements BatchExtension { public File dumpXmlRuleSet(String repositoryKey, String rulesXml) { try { File configurationFile = writeToWorkingDirectory(rulesXml, repositoryKey + ".xml"); LOG.info("PMD configuration: " + configurationFile.getAbsolutePath()); return configurationFile; } catch (IOException e) { throw new IllegalStateException("Fail to save the PMD configuration", e); } } PmdConfiguration(FileSystem fileSystem, Settings settings); File dumpXmlRuleSet(String repositoryKey, String rulesXml); File dumpXmlReport(Report report); static final String PROPERTY_GENERATE_XML; static final String PMD_RESULT_XML; }