From b36bc464f98e0136d41e60774093aa946b207999 Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Mon, 27 Jul 2015 16:25:31 +0200 Subject: SONAR-6713 Load rules in global container --- plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java | 1 + .../src/main/java/org/sonar/xoo/rule/XooRulesDefinition.java | 6 ++++++ .../src/test/java/org/sonar/xoo/rule/XooRulesDefinitionTest.java | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java index a0f9cfdb4e8..fdd9505fac0 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java @@ -105,4 +105,5 @@ public class XooPlugin extends SonarPlugin { XooProjectBuilder.class, XooPostJob.class); } + } diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/XooRulesDefinition.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/XooRulesDefinition.java index b7d826a03a8..74f4e2a7fee 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/XooRulesDefinition.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/XooRulesDefinition.java @@ -76,7 +76,13 @@ public class XooRulesDefinition implements RulesDefinition { repo.createRule(CustomMessageSensor.RULE_KEY).setName("Issue With Custom Message") .setHtmlDescription("Generate an issue on each file with a custom message"); + + repo.createRule(RandomAccessSensor.RULE_KEY).setName("One Issue Per File with Random Access") + .setHtmlDescription("This issue is generated on each file"); + repo.createRule(DeprecatedResourceApiSensor.RULE_KEY).setName("Issue created using deprecated API") + .setHtmlDescription("Issue created using deprecated API"); + repo.done(); } diff --git a/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/rule/XooRulesDefinitionTest.java b/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/rule/XooRulesDefinitionTest.java index 556ce27aa88..30e8a45261d 100644 --- a/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/rule/XooRulesDefinitionTest.java +++ b/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/rule/XooRulesDefinitionTest.java @@ -37,7 +37,7 @@ public class XooRulesDefinitionTest { assertThat(repo).isNotNull(); assertThat(repo.name()).isEqualTo("Xoo"); assertThat(repo.language()).isEqualTo("xoo"); - assertThat(repo.rules()).hasSize(8); + assertThat(repo.rules()).hasSize(10); RulesDefinition.Rule rule = repo.rule(OneIssuePerLineSensor.RULE_KEY); assertThat(rule.name()).isNotEmpty(); -- cgit v1.2.3