aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-pmd-plugin
diff options
context:
space:
mode:
authorGodin <mandrikov@gmail.com>2010-12-07 16:02:48 +0000
committerGodin <mandrikov@gmail.com>2010-12-07 16:02:48 +0000
commitb09f170fa5cd8980019d6cf91251ab11970b1cc6 (patch)
tree4fbf596dfeb13b56fec587d49c404de977264642 /plugins/sonar-pmd-plugin
parent8e9d7ff89a66bf987d7fcb7c298a53a992625375 (diff)
downloadsonarqube-b09f170fa5cd8980019d6cf91251ab11970b1cc6.tar.gz
sonarqube-b09f170fa5cd8980019d6cf91251ab11970b1cc6.zip
SONAR-1829: Use severity instead of priority
Diffstat (limited to 'plugins/sonar-pmd-plugin')
-rw-r--r--plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/PmdProfileImporterTest.java30
-rw-r--r--plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/SonarWayProfileTest.java16
-rw-r--r--plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/SonarWayWithFindbugsProfileTest.java16
-rw-r--r--plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/SunConventionsProfileTest.java16
4 files changed, 37 insertions, 41 deletions
diff --git a/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/PmdProfileImporterTest.java b/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/PmdProfileImporterTest.java
index fd386c398ab..41064bec012 100644
--- a/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/PmdProfileImporterTest.java
+++ b/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/PmdProfileImporterTest.java
@@ -19,31 +19,27 @@
*/
package org.sonar.plugins.pmd;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.nullValue;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.io.Reader;
-import java.io.StringReader;
-
import org.junit.Before;
import org.junit.Test;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.sonar.api.profiles.RulesProfile;
-import org.sonar.api.rules.ActiveRule;
-import org.sonar.api.rules.Rule;
-import org.sonar.api.rules.RuleFinder;
-import org.sonar.api.rules.RulePriority;
-import org.sonar.api.rules.RuleQuery;
+import org.sonar.api.rules.*;
import org.sonar.api.utils.ValidationMessages;
import org.sonar.plugins.pmd.xml.PmdRuleset;
import org.sonar.test.TestUtils;
+import java.io.Reader;
+import java.io.StringReader;
+
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.nullValue;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Matchers.anyObject;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
public class PmdProfileImporterTest {
private PmdProfileImporter importer;
@@ -156,7 +152,7 @@ public class PmdProfileImporterTest {
public Rule answer(InvocationOnMock iom) throws Throwable {
RuleQuery query = (RuleQuery) iom.getArguments()[0];
Rule rule = Rule.create(query.getRepositoryKey(), query.getConfigKey(), "Rule name - " + query.getConfigKey())
- .setConfigKey(query.getConfigKey()).setPriority(RulePriority.BLOCKER);
+ .setConfigKey(query.getConfigKey()).setSeverity(RulePriority.BLOCKER);
if (rule.getConfigKey().equals("rulesets/coupling.xml/ExcessiveImports")) {
rule.createParameter("max");
}
diff --git a/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/SonarWayProfileTest.java b/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/SonarWayProfileTest.java
index 844dfa9100e..ba5abe42307 100644
--- a/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/SonarWayProfileTest.java
+++ b/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/SonarWayProfileTest.java
@@ -19,13 +19,6 @@
*/
package org.sonar.plugins.pmd;
-import static org.hamcrest.core.Is.is;
-import static org.hamcrest.number.OrderingComparisons.greaterThan;
-import static org.junit.Assert.assertThat;
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
import org.junit.Test;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
@@ -37,6 +30,13 @@ import org.sonar.api.rules.RulePriority;
import org.sonar.api.rules.RuleQuery;
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;
+import static org.mockito.Matchers.anyObject;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
public class SonarWayProfileTest {
@Test
@@ -56,7 +56,7 @@ public class SonarWayProfileTest {
public Rule answer(InvocationOnMock iom) throws Throwable {
RuleQuery query = (RuleQuery) iom.getArguments()[0];
Rule rule = Rule.create(query.getRepositoryKey(), query.getConfigKey(), "Rule name - " + query.getConfigKey())
- .setConfigKey(query.getConfigKey()).setPriority(RulePriority.BLOCKER);
+ .setConfigKey(query.getConfigKey()).setSeverity(RulePriority.BLOCKER);
return rule;
}
});
diff --git a/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/SonarWayWithFindbugsProfileTest.java b/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/SonarWayWithFindbugsProfileTest.java
index 7f0aa81c969..9e0ab0018f3 100644
--- a/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/SonarWayWithFindbugsProfileTest.java
+++ b/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/SonarWayWithFindbugsProfileTest.java
@@ -19,13 +19,6 @@
*/
package org.sonar.plugins.pmd;
-import static org.hamcrest.core.Is.is;
-import static org.hamcrest.number.OrderingComparisons.greaterThan;
-import static org.junit.Assert.assertThat;
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
import org.junit.Test;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
@@ -36,6 +29,13 @@ import org.sonar.api.rules.RulePriority;
import org.sonar.api.rules.RuleQuery;
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;
+import static org.mockito.Matchers.anyObject;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
public class SonarWayWithFindbugsProfileTest {
@Test
@@ -55,7 +55,7 @@ public class SonarWayWithFindbugsProfileTest {
public Rule answer(InvocationOnMock iom) throws Throwable {
RuleQuery query = (RuleQuery) iom.getArguments()[0];
Rule rule = Rule.create(query.getRepositoryKey(), query.getConfigKey(), "Rule name - " + query.getConfigKey())
- .setConfigKey(query.getConfigKey()).setPriority(RulePriority.BLOCKER);
+ .setConfigKey(query.getConfigKey()).setSeverity(RulePriority.BLOCKER);
return rule;
}
});
diff --git a/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/SunConventionsProfileTest.java b/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/SunConventionsProfileTest.java
index cdd9f1e396d..b55a44b773f 100644
--- a/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/SunConventionsProfileTest.java
+++ b/plugins/sonar-pmd-plugin/src/test/java/org/sonar/plugins/pmd/SunConventionsProfileTest.java
@@ -19,13 +19,6 @@
*/
package org.sonar.plugins.pmd;
-import static org.hamcrest.core.Is.is;
-import static org.hamcrest.number.OrderingComparisons.greaterThan;
-import static org.junit.Assert.assertThat;
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
import org.junit.Test;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
@@ -36,6 +29,13 @@ import org.sonar.api.rules.RulePriority;
import org.sonar.api.rules.RuleQuery;
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;
+import static org.mockito.Matchers.anyObject;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
public class SunConventionsProfileTest {
@Test
public void shouldCreateProfile() {
@@ -54,7 +54,7 @@ public class SunConventionsProfileTest {
public Rule answer(InvocationOnMock iom) throws Throwable {
RuleQuery query = (RuleQuery) iom.getArguments()[0];
Rule rule = Rule.create(query.getRepositoryKey(), query.getConfigKey(), "Rule name - " + query.getConfigKey())
- .setConfigKey(query.getConfigKey()).setPriority(RulePriority.BLOCKER);
+ .setConfigKey(query.getConfigKey()).setSeverity(RulePriority.BLOCKER);
return rule;
}
});