diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2012-03-14 10:10:31 +0400 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2012-03-14 10:11:51 +0400 |
commit | 7e83fc767544821bd204d3b70f602e88cf61d25a (patch) | |
tree | 39b4a03fa27776133103c891d6f6801bc7c7ced5 /sonar-plugin-api/src | |
parent | abb8bac7ab3717b32adea21fa58d20adb6ea7499 (diff) | |
download | sonarqube-7e83fc767544821bd204d3b70f602e88cf61d25a.tar.gz sonarqube-7e83fc767544821bd204d3b70f602e88cf61d25a.zip |
Fix quality flaws in tests: remove unused imports
Diffstat (limited to 'sonar-plugin-api/src')
10 files changed, 30 insertions, 64 deletions
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/batch/AbstractSourceImporterTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/batch/AbstractSourceImporterTest.java index 7887c2be826..d2eacf3eb51 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/batch/AbstractSourceImporterTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/batch/AbstractSourceImporterTest.java @@ -19,47 +19,30 @@ */ package org.sonar.api.batch; -import static org.hamcrest.Matchers.is; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Matchers.anyString; -import static org.mockito.Matchers.argThat; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import java.io.File; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.nio.charset.Charset; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; - import com.google.common.collect.Lists; -import org.apache.commons.configuration.Configuration; import org.apache.commons.configuration.MapConfiguration; import org.apache.commons.configuration.PropertiesConfiguration; import org.apache.commons.lang.CharEncoding; import org.hamcrest.BaseMatcher; import org.hamcrest.Description; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.mockito.exceptions.verification.junit.ArgumentsAreDifferent; -import org.sonar.api.CoreProperties; -import org.sonar.api.resources.ProjectFileSystem; -import org.sonar.api.resources.Java; -import org.sonar.api.resources.JavaFile; -import org.sonar.api.resources.Language; -import org.sonar.api.resources.Project; -import org.sonar.api.resources.ProjectFileSystem; -import org.sonar.api.resources.Resource; +import org.sonar.api.resources.*; + +import java.io.File; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.nio.charset.Charset; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; + +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.*; +import static org.mockito.Mockito.*; public class AbstractSourceImporterTest { diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectBuilderTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectBuilderTest.java index 0276b61a372..f0f10dcdd38 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectBuilderTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectBuilderTest.java @@ -24,7 +24,6 @@ import org.apache.commons.configuration.PropertiesConfiguration; import org.junit.Test; import java.io.File; -import java.util.Properties; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectReactorTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectReactorTest.java index 20f17ad154e..fc357559502 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectReactorTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectReactorTest.java @@ -21,9 +21,6 @@ package org.sonar.api.batch.bootstrap; import org.junit.Test; -import java.io.File; -import java.util.Properties; - import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionsTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionsTest.java index 9140f6e877b..a5d8a0b2add 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionsTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionsTest.java @@ -23,8 +23,6 @@ import org.junit.Test; import org.sonar.api.Properties; import org.sonar.api.Property; -import java.util.Arrays; - import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.nullValue; import static org.junit.Assert.assertThat; @@ -62,13 +60,12 @@ public class PropertyDefinitionsTest { } @Properties({ - @Property(key = "one", name = "One"), - @Property(key = "two", name = "Two", defaultValue = "2") + @Property(key = "one", name = "One"), + @Property(key = "two", name = "Two", defaultValue = "2") }) static final class PluginWithProperties { } - @Test public void testCategories() { PropertyDefinitions def = new PropertyDefinitions(Categories.class); @@ -85,8 +82,8 @@ public class PropertyDefinitionsTest { } @Properties({ - @Property(key = "inCateg", name="In Categ", category = "categ"), - @Property(key = "noCateg", name="No categ") + @Property(key = "inCateg", name = "In Categ", category = "categ"), + @Property(key = "noCateg", name = "No categ") }) static final class Categories { } diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/resources/JavaFileTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/resources/JavaFileTest.java index e596be6d6b6..402c1be457f 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/resources/JavaFileTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/resources/JavaFileTest.java @@ -19,10 +19,6 @@ */ package org.sonar.api.resources; -import org.apache.commons.io.FileUtils; -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.*; - import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; @@ -32,11 +28,14 @@ import java.io.IOException; import java.util.Arrays; import java.util.List; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.*; + public class JavaFileTest { @Rule public TemporaryFolder tempFolder = new TemporaryFolder(); - + @Test public void testNewClass() { JavaFile javaClass = new JavaFile("org.foo.bar.Hello", false); diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/resources/ProjectTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/resources/ProjectTest.java index 7c46bf97f58..d88ea57e211 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/resources/ProjectTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/resources/ProjectTest.java @@ -25,14 +25,10 @@ import org.hamcrest.MatcherAssert; import org.hamcrest.core.Is; import org.junit.Test; import org.sonar.api.CoreProperties; -import org.sonar.api.config.Settings; import org.sonar.api.test.MavenTestUtils; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; -import static org.junit.internal.matchers.IsCollectionContaining.hasItems; +import static org.junit.Assert.*; public class ProjectTest { @Test diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/rules/RulePriorityTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/rules/RulePriorityTest.java index cb838683ed5..c55a96e107a 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/rules/RulePriorityTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/rules/RulePriorityTest.java @@ -19,8 +19,6 @@ */ package org.sonar.api.rules; -import static junit.framework.Assert.assertEquals; - import junit.framework.Assert; import org.junit.Test; diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/rules/RuleUtilsTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/rules/RuleUtilsTest.java index 22502494acb..bf11f7c24a1 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/rules/RuleUtilsTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/rules/RuleUtilsTest.java @@ -20,19 +20,18 @@ package org.sonar.api.rules; import org.apache.commons.configuration.Configuration; -import static org.hamcrest.Matchers.is; -import static org.junit.Assert.assertThat; import org.junit.Test; -import static org.mockito.Matchers.anyString; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - import org.mockito.Matchers; import org.sonar.api.CoreProperties; import java.util.Map; +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertThat; +import static org.mockito.Matchers.anyString; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + public class RuleUtilsTest { @Test diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/rules/XMLRuleParserTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/rules/XMLRuleParserTest.java index d73ee11cb3a..e72d7044dc4 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/rules/XMLRuleParserTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/rules/XMLRuleParserTest.java @@ -20,7 +20,6 @@ package org.sonar.api.rules; import org.hamcrest.core.Is; -import org.hamcrest.core.IsNull; import org.junit.Test; import org.sonar.api.utils.SonarException; import org.sonar.check.Cardinality; diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandTest.java index 529bfec73b9..b069ac4f931 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandTest.java @@ -19,7 +19,6 @@ */ package org.sonar.api.utils.command; -import org.hamcrest.CoreMatchers; import org.junit.Test; import java.io.File; |