From c5d1b2b0665adf51abf4a448df7d1555ffed8e20 Mon Sep 17 00:00:00 2001 From: David Gageot Date: Mon, 14 May 2012 12:24:30 +0200 Subject: Fix warnings --- .../java/org/sonar/api/batch/BatchExtensionDictionnaryTest.java | 1 - .../test/java/org/sonar/api/checks/AnnotationCheckFactoryTest.java | 7 ++----- .../org/sonar/api/measures/SumChildDistributionFormulaTest.java | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) (limited to 'sonar-plugin-api') 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. 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. emptyList()); assertNull(formula.calculate(data, context)); } -- cgit v1.2.3