@Test void should_skip_all_empty_params() { String importedXml = PmdTestUtils.getResourceContent("/org/sonar/plugins/pmd/export_rule_with_all_params_empty.xml"); String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<ruleset name=\"pmd\">\n" + " <description>Sonar Profile: pmd</description>\n" + " <rule ref=\"category/java/codestyle.xml/CommentDefaultAccessModifier\">\n" + " <priority>2</priority>\n" + " </rule>\n" + "</ruleset>"; final StringWriter writer = new StringWriter(); exporter.exportProfile(importProfile(importedXml), writer); assertThat(writer.toString()).satisfies(equalsIgnoreEOL(expected)); }
@Override public void exportProfile(RulesProfile profile, Writer writer) { final PmdRuleSet tree = PmdRuleSets.from(profile, PmdConstants.REPOSITORY_KEY); try { tree.writeTo(writer); } catch (IllegalStateException e) { throw new IllegalStateException("An exception occurred while generating the PMD configuration file from profile: " + profile.getName(), e); } }
PmdProfileExporter extends ProfileExporter { @Override public void exportProfile(RulesProfile profile, Writer writer) { final PmdRuleSet tree = PmdRuleSets.from(profile, PmdConstants.REPOSITORY_KEY); try { tree.writeTo(writer); } catch (IllegalStateException e) { throw new IllegalStateException("An exception occurred while generating the PMD configuration file from profile: " + profile.getName(), e); } } }
PmdProfileExporter extends ProfileExporter { @Override public void exportProfile(RulesProfile profile, Writer writer) { final PmdRuleSet tree = PmdRuleSets.from(profile, PmdConstants.REPOSITORY_KEY); try { tree.writeTo(writer); } catch (IllegalStateException e) { throw new IllegalStateException("An exception occurred while generating the PMD configuration file from profile: " + profile.getName(), e); } } PmdProfileExporter(); }
PmdProfileExporter extends ProfileExporter { @Override public void exportProfile(RulesProfile profile, Writer writer) { final PmdRuleSet tree = PmdRuleSets.from(profile, PmdConstants.REPOSITORY_KEY); try { tree.writeTo(writer); } catch (IllegalStateException e) { throw new IllegalStateException("An exception occurred while generating the PMD configuration file from profile: " + profile.getName(), e); } } PmdProfileExporter(); @Override void exportProfile(RulesProfile profile, Writer writer); }
PmdProfileExporter extends ProfileExporter { @Override public void exportProfile(RulesProfile profile, Writer writer) { final PmdRuleSet tree = PmdRuleSets.from(profile, PmdConstants.REPOSITORY_KEY); try { tree.writeTo(writer); } catch (IllegalStateException e) { throw new IllegalStateException("An exception occurred while generating the PMD configuration file from profile: " + profile.getName(), e); } } PmdProfileExporter(); @Override void exportProfile(RulesProfile profile, Writer writer);  }