@Test
public void shouldExportProfile() throws Exception {

  Rule rule = Rule.create(CodeNarcRulesDefinition.REPOSITORY_KEY, "org.codenarc.rule.basic.AddEmptyStringRule", "Add Empty String");
  profile.activateRule(rule, RulePriority.MAJOR);
  rule = Rule.create(CodeNarcRulesDefinition.REPOSITORY_KEY, "org.codenarc.rule.size.ClassSizeRule", "Class Size");
  profile.activateRule(rule, RulePriority.MAJOR);
  exporter.exportProfile(profile);
  assertSimilarXml(
    TestUtils.getResource("/org/sonar/plugins/groovy/codenarc/exportProfile/exportProfile.xml"),
    writer.toString());
}