aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-pmd-plugin
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2010-11-29 17:00:54 +0000
committersimonbrandhof <simon.brandhof@gmail.com>2010-11-29 17:00:54 +0000
commit6ce6cc598fdcd6e3d6eb662b47668b0c6b898f3d (patch)
tree0770d083d359e3e644ff64bf06dc8b9abc3ad04b /plugins/sonar-pmd-plugin
parent0c4893c83a6873b224a50db86311082fd5af555f (diff)
downloadsonarqube-6ce6cc598fdcd6e3d6eb662b47668b0c6b898f3d.tar.gz
sonarqube-6ce6cc598fdcd6e3d6eb662b47668b0c6b898f3d.zip
SONAR-249 improve core components to load rules and metrics
Diffstat (limited to 'plugins/sonar-pmd-plugin')
-rw-r--r--plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/PmdProfileExporterTest.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/PmdProfileExporterTest.java b/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/PmdProfileExporterTest.java
index c35e9440f45..a0a458758bf 100644
--- a/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/PmdProfileExporterTest.java
+++ b/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/PmdProfileExporterTest.java
@@ -35,7 +35,7 @@ public class PmdProfileExporterTest {
PmdRuleRepository repository = new PmdRuleRepository(fileSystem, new XMLRuleParser());
List<Rule> rules = repository.createRules();
- RuleFinder ruleFinder = new PmdRuleFinder(rules);
+ RuleFinder ruleFinder = new FakeRuleFinder(rules);
PmdProfileImporter importer = new PmdProfileImporter(ruleFinder);
Reader reader = new StringReader(TestUtils.getResourceContent("/org/sonar/plugins/pmd/simple.xml"));
RulesProfile rulesProfile = importer.importProfile(reader, ValidationMessages.create());
@@ -103,14 +103,18 @@ public class PmdProfileExporterTest {
assertThat(rule.getProperty(PmdConstants.XPATH_EXPRESSION_PARAM).getValue(), is(xpathExpression));
}
- private static class PmdRuleFinder implements RuleFinder {
+ private static class FakeRuleFinder implements RuleFinder {
private List<Rule> rules;
- public PmdRuleFinder(List<Rule> rules) {
+ public FakeRuleFinder(List<Rule> rules) {
this.rules = rules;
}
+ public Rule findById(int ruleId) {
+ throw new UnsupportedOperationException();
+ }
+
public Rule findByKey(String repositoryKey, String key) {
throw new UnsupportedOperationException();
}