From 872b3923f80d9a2bcc13713f41cf801f2a7024eb Mon Sep 17 00:00:00 2001 From: David Gageot Date: Tue, 24 Apr 2012 10:12:28 +0200 Subject: Remove warnings --- .../api/checks/AnnotationCheckFactoryTest.java | 26 +++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'sonar-plugin-api/src/test/java/org/sonar/api/checks') 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 60670a372d3..895e37952e6 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 @@ -29,9 +29,13 @@ import org.sonar.api.utils.SonarException; import java.util.Arrays; -import static org.hamcrest.Matchers.*; +import static org.hamcrest.Matchers.hasItems; +import static org.hamcrest.Matchers.not; +import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.*; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertThat; public class AnnotationCheckFactoryTest { @@ -42,7 +46,7 @@ public class AnnotationCheckFactoryTest { public void createCheckWithoutProperties() { RulesProfile profile = RulesProfile.create("repo", "java"); ActiveRule activeRule = profile.activateRule(Rule.create("repo", "org.sonar.api.checks.CheckWithoutProperties", ""), null); - AnnotationCheckFactory factory = AnnotationCheckFactory.create(profile, "repo", Arrays.asList(CheckWithoutProperties.class)); + AnnotationCheckFactory factory = AnnotationCheckFactory.create(profile, "repo", Arrays. asList(CheckWithoutProperties.class)); Object check = factory.getCheck(activeRule); assertNotNull(check); @@ -57,7 +61,7 @@ public class AnnotationCheckFactoryTest { ActiveRule activeRule = profile.activateRule(rule, null); activeRule.setParameter("pattern", "foo"); - AnnotationCheckFactory factory = AnnotationCheckFactory.create(profile, "repo", Arrays.asList(CheckWithStringProperty.class)); + AnnotationCheckFactory factory = AnnotationCheckFactory.create(profile, "repo", Arrays. asList(CheckWithStringProperty.class)); Object check = factory.getCheck(activeRule); assertNotNull(check); @@ -75,7 +79,7 @@ public class AnnotationCheckFactoryTest { ActiveRule activeRule = profile.activateRule(rule, null); activeRule.setParameter("unknown", "bar"); - AnnotationCheckFactory.create(profile, "repo", Arrays.asList(CheckWithStringProperty.class)); + AnnotationCheckFactory.create(profile, "repo", Arrays. asList(CheckWithStringProperty.class)); } @Test @@ -88,7 +92,7 @@ public class AnnotationCheckFactoryTest { ActiveRule activeRule = profile.activateRule(rule, null); activeRule.setParameter("max", "300"); activeRule.setParameter("ignore", "true"); - AnnotationCheckFactory factory = AnnotationCheckFactory.create(profile, "repo", Arrays.asList(CheckWithPrimitiveProperties.class)); + AnnotationCheckFactory factory = AnnotationCheckFactory.create(profile, "repo", Arrays. asList(CheckWithPrimitiveProperties.class)); Object check = factory.getCheck(activeRule); assertThat(((CheckWithPrimitiveProperties) check).getMax(), is(300)); @@ -103,7 +107,7 @@ public class AnnotationCheckFactoryTest { ActiveRule activeRule = profile.activateRule(rule, null); activeRule.setParameter("max", "300"); - AnnotationCheckFactory factory = AnnotationCheckFactory.create(profile, "repo", Arrays.asList(CheckWithIntegerProperty.class)); + AnnotationCheckFactory factory = AnnotationCheckFactory.create(profile, "repo", Arrays. asList(CheckWithIntegerProperty.class)); Object check = factory.getCheck(activeRule); assertThat(((CheckWithIntegerProperty) check).getMax(), is(300)); @@ -120,7 +124,7 @@ public class AnnotationCheckFactoryTest { ActiveRule activeRule = profile.activateRule(rule, null); activeRule.setParameter("max", "300"); - AnnotationCheckFactory factory = AnnotationCheckFactory.create(profile, "repo", Arrays.asList(ImplementedCheck.class)); + AnnotationCheckFactory factory = AnnotationCheckFactory.create(profile, "repo", Arrays. asList(ImplementedCheck.class)); Object check = factory.getCheck(activeRule); assertThat(((ImplementedCheck) check).getMax(), is(300)); @@ -136,7 +140,7 @@ public class AnnotationCheckFactoryTest { ActiveRule activeRule = profile.activateRule(rule, null); activeRule.setParameter("max", "300"); - AnnotationCheckFactory.create(profile, "repo", Arrays.asList(CheckWithUnsupportedPropertyType.class)); + AnnotationCheckFactory.create(profile, "repo", Arrays. asList(CheckWithUnsupportedPropertyType.class)); } @Test @@ -147,7 +151,7 @@ public class AnnotationCheckFactoryTest { ActiveRule activeRule = profile.activateRule(rule, null); activeRule.setParameter("maximum", "300"); - AnnotationCheckFactory factory = AnnotationCheckFactory.create(profile, "repo", Arrays.asList(CheckWithOverriddenPropertyKey.class)); + AnnotationCheckFactory factory = AnnotationCheckFactory.create(profile, "repo", Arrays. asList(CheckWithOverriddenPropertyKey.class)); Object check = factory.getCheck(activeRule); assertThat(((CheckWithOverriddenPropertyKey) check).getMax(), is(300)); @@ -161,7 +165,7 @@ public class AnnotationCheckFactoryTest { profile.activateRule(rule, null); profile.activateRule(clonedRule, null); - AnnotationCheckFactory factory = AnnotationCheckFactory.create(profile, "repo", Arrays.asList(CheckWithKey.class)); + AnnotationCheckFactory factory = AnnotationCheckFactory.create(profile, "repo", Arrays. asList(CheckWithKey.class)); assertThat(factory.getChecks(), (Matcher) not(hasItems(nullValue()))); } -- cgit v1.2.3