aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2012-05-14 12:24:30 +0200
committerDavid Gageot <david@gageot.net>2012-05-14 13:01:11 +0200
commitc5d1b2b0665adf51abf4a448df7d1555ffed8e20 (patch)
treec223cccf5c1af54b00007b00326c9648dad080d5 /sonar-plugin-api
parentd4176679d0944757b447ca0213cd9de0dfc413ab (diff)
downloadsonarqube-c5d1b2b0665adf51abf4a448df7d1555ffed8e20.tar.gz
sonarqube-c5d1b2b0665adf51abf4a448df7d1555ffed8e20.zip
Fix warnings
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/batch/BatchExtensionDictionnaryTest.java1
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/checks/AnnotationCheckFactoryTest.java7
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/measures/SumChildDistributionFormulaTest.java2
3 files changed, 3 insertions, 7 deletions
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/batch/BatchExtensionDictionnaryTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/batch/BatchExtensionDictionnaryTest.java
index 0b6eedbddf8..fe4feda7d5e 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/batch/BatchExtensionDictionnaryTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/batch/BatchExtensionDictionnaryTest.java
@@ -196,7 +196,6 @@ public class BatchExtensionDictionnaryTest {
BatchExtensionDictionnary selector = newSelector();
BatchExtension wrong = new BatchExtension() {
@DependsUpon
- @SuppressWarnings("unused")
private Object foo() {
return "foo";
}
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/checks/AnnotationCheckFactoryTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/checks/AnnotationCheckFactoryTest.java
index 895e37952e6..093fe3576b2 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/checks/AnnotationCheckFactoryTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/checks/AnnotationCheckFactoryTest.java
@@ -19,7 +19,6 @@
*/
package org.sonar.api.checks;
-import org.hamcrest.Matcher;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.sonar.api.profiles.RulesProfile;
@@ -29,9 +28,7 @@ import org.sonar.api.utils.SonarException;
import java.util.Arrays;
-import static org.hamcrest.Matchers.hasItems;
-import static org.hamcrest.Matchers.not;
-import static org.hamcrest.Matchers.nullValue;
+import static org.fest.assertions.Assertions.assertThat;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
@@ -167,7 +164,7 @@ public class AnnotationCheckFactoryTest {
profile.activateRule(clonedRule, null);
AnnotationCheckFactory factory = AnnotationCheckFactory.create(profile, "repo", Arrays.<Class> asList(CheckWithKey.class));
- assertThat(factory.getChecks(), (Matcher) not(hasItems(nullValue())));
+ assertThat(factory.getChecks()).excludes(new Object[] {null});
}
/**
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/measures/SumChildDistributionFormulaTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/measures/SumChildDistributionFormulaTest.java
index 18421ed4df3..d19ac7e83e2 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/measures/SumChildDistributionFormulaTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/measures/SumChildDistributionFormulaTest.java
@@ -60,7 +60,7 @@ public class SumChildDistributionFormulaTest {
@Test
public void testWhenGetChildrenReturnsEmpty() {
when(context.getTargetMetric()).thenReturn(new Metric("foo"));
- when(data.getChildrenMeasures(new Metric("foo"))).thenReturn((List) Collections.emptyList());
+ when(data.getChildrenMeasures(new Metric("foo"))).thenReturn(Collections.<Measure> emptyList());
assertNull(formula.calculate(data, context));
}