diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2010-09-10 13:04:24 +0000 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2010-09-10 13:04:24 +0000 |
commit | 23830d07ed51853724dc660fff187c9e5aa4b36a (patch) | |
tree | 6873e45ea9642bf45d91c4058dc1a5e54b8416c9 /plugins | |
parent | 5cd839bbecd061d9463694d025788754bfca0f08 (diff) | |
download | sonarqube-23830d07ed51853724dc660fff187c9e5aa4b36a.tar.gz sonarqube-23830d07ed51853724dc660fff187c9e5aa4b36a.zip |
* rename RuleProvider to RuleFinder
* deprecate some classes in the rule API
* add the parameter ValidationMessages to ProfileDefinition.createPrototype()
Diffstat (limited to 'plugins')
3 files changed, 14 insertions, 4 deletions
diff --git a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/SonarWayProfileTest.java b/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/SonarWayProfileTest.java index 4bce25c4af8..697a9c6685c 100644 --- a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/SonarWayProfileTest.java +++ b/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/SonarWayProfileTest.java @@ -22,7 +22,9 @@ package org.sonar.plugins.checkstyle; import org.junit.Test; import org.sonar.api.profiles.ProfileDefinition; import org.sonar.api.profiles.ProfilePrototype; +import org.sonar.api.utils.ValidationMessages; +import static org.hamcrest.core.Is.is; import static org.hamcrest.number.OrderingComparisons.greaterThan; import static org.junit.Assert.assertThat; @@ -31,8 +33,10 @@ public class SonarWayProfileTest { @Test public void create() { ProfileDefinition sonarWay = new SonarWayProfile(); - ProfilePrototype prototype = sonarWay.createPrototype(); + ValidationMessages validation = ValidationMessages.create(); + ProfilePrototype prototype = sonarWay.createPrototype(validation); assertThat(prototype.getRulesByRepositoryKey(CheckstyleConstants.REPOSITORY_KEY).size(), greaterThan(1)); + assertThat(validation.hasErrors(), is(false)); } } diff --git a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/SonarWayWithFindbugsProfileTest.java b/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/SonarWayWithFindbugsProfileTest.java index 98d2b7a996e..ae6513bbfa2 100644 --- a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/SonarWayWithFindbugsProfileTest.java +++ b/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/SonarWayWithFindbugsProfileTest.java @@ -19,8 +19,10 @@ */ package org.sonar.plugins.checkstyle; +import org.hamcrest.core.Is; import org.junit.Test; import org.sonar.api.profiles.ProfilePrototype; +import org.sonar.api.utils.ValidationMessages; import static org.junit.Assert.assertThat; import static org.hamcrest.CoreMatchers.is; @@ -29,8 +31,8 @@ public class SonarWayWithFindbugsProfileTest { @Test public void sameAsSonarWay() { - ProfilePrototype withFindbugs = new SonarWayWithFindbugsProfile().createPrototype(); - ProfilePrototype withoutFindbugs = new SonarWayProfile().createPrototype(); + ProfilePrototype withFindbugs = new SonarWayWithFindbugsProfile().createPrototype(ValidationMessages.create()); + ProfilePrototype withoutFindbugs = new SonarWayProfile().createPrototype(ValidationMessages.create()); assertThat(withFindbugs.getRules().size(), is(withoutFindbugs.getRules().size())); } } diff --git a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/SunConventionsProfileTest.java b/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/SunConventionsProfileTest.java index 28c82ac350e..73eaa38e8e8 100644 --- a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/SunConventionsProfileTest.java +++ b/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/SunConventionsProfileTest.java @@ -19,9 +19,11 @@ */ package org.sonar.plugins.checkstyle; +import org.hamcrest.core.Is; import org.junit.Test; import org.sonar.api.profiles.ProfileDefinition; import org.sonar.api.profiles.ProfilePrototype; +import org.sonar.api.utils.ValidationMessages; import static org.hamcrest.Matchers.is; import static org.hamcrest.number.OrderingComparisons.greaterThan; @@ -31,10 +33,12 @@ public class SunConventionsProfileTest { @Test public void create() { ProfileDefinition sunConventionsProfile = new SunConventionsProfile(); - ProfilePrototype prototype = sunConventionsProfile.createPrototype(); + ValidationMessages validation = ValidationMessages.create(); + ProfilePrototype prototype = sunConventionsProfile.createPrototype(validation); assertThat(prototype.getRulesByRepositoryKey(CheckstyleConstants.REPOSITORY_KEY).size(), greaterThan(1)); assertThat( prototype.getRule(CheckstyleConstants.REPOSITORY_KEY, "com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck").getParameter("lineSeparator"), is("system")); + assertThat(validation.hasErrors(), Is.is(false)); } } |