@Test void should_export_empty_configuration_as_xml() { final StringWriter writer = new StringWriter(); exporter.exportProfile(RulesProfile.create(), writer); assertThat(writer.toString()).satisfies(equalsIgnoreEOL("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<ruleset name=\"pmd\"> <description>Sonar Profile: pmd</description></ruleset>")); }
@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);  }