@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>\n" + " <rule ref=\"rulesets/java/comments.xml/CommentDefaultAccessModifier\">\n" + " <priority>2</priority>\n" + " </rule>\n" + "</ruleset>"; String actual = exporter.exportProfile(PmdConstants.REPOSITORY_KEY, importProfile(importedXml)); assertThat(actual).satisfies(equalsIgnoreEOL(expected)); }
@Override public void exportProfile(RulesProfile profile, Writer writer) { String profileName = profile.getName(); PmdRuleSet tree = createPmdRuleset(PmdConstants.REPOSITORY_KEY, profile.getActiveRulesByRepository(PmdConstants.REPOSITORY_KEY)); exportPmdRulesetToXml(tree, writer, profileName); }
PmdProfileExporter extends ProfileExporter { @Override public void exportProfile(RulesProfile profile, Writer writer) { String profileName = profile.getName(); PmdRuleSet tree = createPmdRuleset(PmdConstants.REPOSITORY_KEY, profile.getActiveRulesByRepository(PmdConstants.REPOSITORY_KEY)); exportPmdRulesetToXml(tree, writer, profileName); } }
PmdProfileExporter extends ProfileExporter { @Override public void exportProfile(RulesProfile profile, Writer writer) { String profileName = profile.getName(); PmdRuleSet tree = createPmdRuleset(PmdConstants.REPOSITORY_KEY, profile.getActiveRulesByRepository(PmdConstants.REPOSITORY_KEY)); exportPmdRulesetToXml(tree, writer, profileName); } PmdProfileExporter(); }
PmdProfileExporter extends ProfileExporter { @Override public void exportProfile(RulesProfile profile, Writer writer) { String profileName = profile.getName(); PmdRuleSet tree = createPmdRuleset(PmdConstants.REPOSITORY_KEY, profile.getActiveRulesByRepository(PmdConstants.REPOSITORY_KEY)); exportPmdRulesetToXml(tree, writer, profileName); } PmdProfileExporter(); @Override void exportProfile(RulesProfile profile, Writer writer); String exportProfile(String repositoryKey, RulesProfile profile); }
PmdProfileExporter extends ProfileExporter { @Override public void exportProfile(RulesProfile profile, Writer writer) { String profileName = profile.getName(); PmdRuleSet tree = createPmdRuleset(PmdConstants.REPOSITORY_KEY, profile.getActiveRulesByRepository(PmdConstants.REPOSITORY_KEY)); exportPmdRulesetToXml(tree, writer, profileName); } PmdProfileExporter(); @Override void exportProfile(RulesProfile profile, Writer writer); String exportProfile(String repositoryKey, RulesProfile profile);  }