aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Mandrikov <mandrikov@gmail.com>2012-03-14 10:10:31 +0400
committerEvgeny Mandrikov <mandrikov@gmail.com>2012-03-14 10:11:51 +0400
commit7e83fc767544821bd204d3b70f602e88cf61d25a (patch)
tree39b4a03fa27776133103c891d6f6801bc7c7ced5
parentabb8bac7ab3717b32adea21fa58d20adb6ea7499 (diff)
downloadsonarqube-7e83fc767544821bd204d3b70f602e88cf61d25a.tar.gz
sonarqube-7e83fc767544821bd204d3b70f602e88cf61d25a.zip
Fix quality flaws in tests: remove unused imports
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ViolationSeverityUpdater.java1
-rw-r--r--plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/ViolationsDecoratorTest.java5
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/BatchTest.java2
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/ProjectTreeTest.java17
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginRepositoryTest.java1
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/bootstrap/ProjectExtensionInstallerTest.java2
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/index/MemoryOptimizerTest.java1
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/index/SourcePersisterTest.java2
-rw-r--r--sonar-core/src/test/java/org/sonar/core/persistence/MyBatisTest.java3
-rw-r--r--sonar-core/src/test/java/org/sonar/core/review/ReviewDaoTest.java3
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/batch/AbstractSourceImporterTest.java47
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectBuilderTest.java1
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectReactorTest.java3
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionsTest.java11
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/resources/JavaFileTest.java9
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/resources/ProjectTest.java6
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/rules/RulePriorityTest.java2
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/rules/RuleUtilsTest.java13
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/rules/XMLRuleParserTest.java1
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandTest.java1
-rw-r--r--sonar-server/src/test/java/org/sonar/server/configuration/BackupTest.java6
-rw-r--r--sonar-server/src/test/java/org/sonar/server/configuration/InheritedProfilesTest.java1
-rw-r--r--sonar-server/src/test/java/org/sonar/server/configuration/PropertiesBackupTest.java1
-rw-r--r--sonar-server/src/test/java/org/sonar/server/configuration/RuleChangeTest.java13
-rw-r--r--sonar-server/src/test/java/org/sonar/server/filters/DateCriterionTest.java5
25 files changed, 39 insertions, 118 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ViolationSeverityUpdater.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ViolationSeverityUpdater.java
index 4c421260848..b44df630d2d 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ViolationSeverityUpdater.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ViolationSeverityUpdater.java
@@ -23,7 +23,6 @@ import com.google.common.collect.Maps;
import org.sonar.api.batch.*;
import org.sonar.api.resources.Project;
import org.sonar.api.resources.Resource;
-import org.sonar.api.resources.ResourceUtils;
import org.sonar.api.rules.RulePriority;
import org.sonar.api.rules.Violation;
import org.sonar.core.review.ReviewDao;
diff --git a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/ViolationsDecoratorTest.java b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/ViolationsDecoratorTest.java
index d0e04fcfee5..665b59aa721 100644
--- a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/ViolationsDecoratorTest.java
+++ b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/ViolationsDecoratorTest.java
@@ -31,15 +31,12 @@ import org.sonar.api.resources.Scopes;
import org.sonar.api.rules.Rule;
import org.sonar.api.rules.RulePriority;
import org.sonar.api.rules.Violation;
-import org.sonar.api.test.IsMeasure;
import org.sonar.api.test.IsRuleMeasure;
import java.util.Collections;
import java.util.List;
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Matchers.argThat;
-import static org.mockito.Matchers.eq;
+import static org.mockito.Matchers.*;
import static org.mockito.Mockito.*;
public class ViolationsDecoratorTest {
diff --git a/sonar-batch/src/test/java/org/sonar/batch/BatchTest.java b/sonar-batch/src/test/java/org/sonar/batch/BatchTest.java
index 090a3471f8d..8931f08e437 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/BatchTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/BatchTest.java
@@ -21,8 +21,6 @@ package org.sonar.batch;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.junit.Test;
-import org.sonar.api.batch.bootstrap.ProjectDefinition;
-import org.sonar.api.batch.bootstrap.ProjectReactor;
import org.sonar.batch.bootstrap.Module;
import java.util.Properties;
diff --git a/sonar-batch/src/test/java/org/sonar/batch/ProjectTreeTest.java b/sonar-batch/src/test/java/org/sonar/batch/ProjectTreeTest.java
index 26918cbb425..24f913239bd 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/ProjectTreeTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/ProjectTreeTest.java
@@ -19,29 +19,12 @@
*/
package org.sonar.batch;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertNull;
-import static org.junit.internal.matchers.IsCollectionContaining.hasItem;
-
import org.apache.commons.configuration.PropertiesConfiguration;
-import org.apache.commons.io.FileUtils;
-import org.apache.maven.model.Model;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.junit.Ignore;
-import org.junit.Test;
-import org.sonar.api.batch.bootstrap.ProjectDefinition;
import org.sonar.api.resources.Project;
import org.sonar.jpa.test.AbstractDbUnitTestCase;
-import java.io.File;
-import java.io.IOException;
-import java.io.StringReader;
-import java.net.URISyntaxException;
-import java.util.Arrays;
-
@Ignore
public class ProjectTreeTest extends AbstractDbUnitTestCase {
diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginRepositoryTest.java b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginRepositoryTest.java
index 13deeb0d083..bb50e80b9a3 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginRepositoryTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginRepositoryTest.java
@@ -20,7 +20,6 @@
package org.sonar.batch.bootstrap;
import com.google.common.collect.Lists;
-import org.apache.commons.configuration.PropertiesConfiguration;
import org.codehaus.plexus.util.FileUtils;
import org.hamcrest.Matchers;
import org.junit.After;
diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/ProjectExtensionInstallerTest.java b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/ProjectExtensionInstallerTest.java
index 374ff37272a..a7147e1a37d 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/ProjectExtensionInstallerTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/ProjectExtensionInstallerTest.java
@@ -20,8 +20,6 @@
package org.sonar.batch.bootstrap;
import com.google.common.collect.Maps;
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.maven.project.MavenProject;
import org.junit.Test;
import org.sonar.api.*;
diff --git a/sonar-batch/src/test/java/org/sonar/batch/index/MemoryOptimizerTest.java b/sonar-batch/src/test/java/org/sonar/batch/index/MemoryOptimizerTest.java
index 57aed7a43e9..8844f185b01 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/index/MemoryOptimizerTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/index/MemoryOptimizerTest.java
@@ -19,7 +19,6 @@
*/
package org.sonar.batch.index;
-import org.hamcrest.core.IsNull;
import org.junit.Test;
import org.sonar.api.database.model.MeasureData;
import org.sonar.api.database.model.MeasureModel;
diff --git a/sonar-batch/src/test/java/org/sonar/batch/index/SourcePersisterTest.java b/sonar-batch/src/test/java/org/sonar/batch/index/SourcePersisterTest.java
index fb9fb159d14..4febb06f6d5 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/index/SourcePersisterTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/index/SourcePersisterTest.java
@@ -24,9 +24,7 @@ import org.junit.Test;
import org.sonar.api.database.model.Snapshot;
import org.sonar.api.resources.DuplicatedSourceException;
import org.sonar.api.resources.JavaFile;
-import org.sonar.api.resources.Project;
import org.sonar.api.resources.Resource;
-import org.sonar.api.utils.SonarException;
import org.sonar.jpa.test.AbstractDbUnitTestCase;
import static org.mockito.Matchers.anyObject;
diff --git a/sonar-core/src/test/java/org/sonar/core/persistence/MyBatisTest.java b/sonar-core/src/test/java/org/sonar/core/persistence/MyBatisTest.java
index 254881f268e..1905ded8649 100644
--- a/sonar-core/src/test/java/org/sonar/core/persistence/MyBatisTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/persistence/MyBatisTest.java
@@ -20,7 +20,6 @@
package org.sonar.core.persistence;
import org.apache.ibatis.session.Configuration;
-import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.SqlSession;
import org.hamcrest.core.Is;
import org.junit.AfterClass;
@@ -38,7 +37,7 @@ public class MyBatisTest {
static {
DerbyUtils.fixDerbyLogs();
}
-
+
private static MyBatis myBatis;
private static InMemoryDatabase database;
diff --git a/sonar-core/src/test/java/org/sonar/core/review/ReviewDaoTest.java b/sonar-core/src/test/java/org/sonar/core/review/ReviewDaoTest.java
index 3602ac3c588..155ba0f3d76 100644
--- a/sonar-core/src/test/java/org/sonar/core/review/ReviewDaoTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/review/ReviewDaoTest.java
@@ -28,7 +28,6 @@ import java.util.Collection;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.nullValue;
-import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
public class ReviewDaoTest extends DaoTestCase {
@@ -96,7 +95,7 @@ public class ReviewDaoTest extends DaoTestCase {
review.setUpdatedAt(DateUtils.parseDate("2012-07-01"));
dao.update(reviews);
-
+
checkTables("update", "reviews");
}
}
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;
diff --git a/sonar-server/src/test/java/org/sonar/server/configuration/BackupTest.java b/sonar-server/src/test/java/org/sonar/server/configuration/BackupTest.java
index 83ad7087b5f..13ac73eb6eb 100644
--- a/sonar-server/src/test/java/org/sonar/server/configuration/BackupTest.java
+++ b/sonar-server/src/test/java/org/sonar/server/configuration/BackupTest.java
@@ -25,7 +25,6 @@ import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.CharEncoding;
import org.custommonkey.xmlunit.Diff;
import org.custommonkey.xmlunit.XMLUnit;
-import org.hamcrest.Matchers;
import org.junit.Test;
import org.sonar.api.database.DatabaseSession;
import org.sonar.api.database.configuration.Property;
@@ -43,10 +42,7 @@ import java.util.*;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
diff --git a/sonar-server/src/test/java/org/sonar/server/configuration/InheritedProfilesTest.java b/sonar-server/src/test/java/org/sonar/server/configuration/InheritedProfilesTest.java
index c83aad75cd0..8674f421d4a 100644
--- a/sonar-server/src/test/java/org/sonar/server/configuration/InheritedProfilesTest.java
+++ b/sonar-server/src/test/java/org/sonar/server/configuration/InheritedProfilesTest.java
@@ -22,7 +22,6 @@ package org.sonar.server.configuration;
import org.junit.Before;
import org.junit.Test;
import org.sonar.api.profiles.RulesProfile;
-import org.sonar.api.utils.ValidationMessages;
import org.sonar.jpa.test.AbstractDbUnitTestCase;
import static org.hamcrest.Matchers.is;
diff --git a/sonar-server/src/test/java/org/sonar/server/configuration/PropertiesBackupTest.java b/sonar-server/src/test/java/org/sonar/server/configuration/PropertiesBackupTest.java
index 6a67d6f359b..1a71aba251e 100644
--- a/sonar-server/src/test/java/org/sonar/server/configuration/PropertiesBackupTest.java
+++ b/sonar-server/src/test/java/org/sonar/server/configuration/PropertiesBackupTest.java
@@ -30,7 +30,6 @@ import org.sonar.test.TestUtils;
import java.util.Arrays;
import java.util.Collection;
-import java.util.List;
import static org.hamcrest.Matchers.endsWith;
import static org.hamcrest.Matchers.startsWith;
diff --git a/sonar-server/src/test/java/org/sonar/server/configuration/RuleChangeTest.java b/sonar-server/src/test/java/org/sonar/server/configuration/RuleChangeTest.java
index c0ece24bf48..1b501ee5d22 100644
--- a/sonar-server/src/test/java/org/sonar/server/configuration/RuleChangeTest.java
+++ b/sonar-server/src/test/java/org/sonar/server/configuration/RuleChangeTest.java
@@ -19,16 +19,11 @@
*/
package org.sonar.server.configuration;
-import org.sonar.api.rules.RulePriority;
-
import org.junit.Before;
import org.junit.Test;
+import org.sonar.api.rules.RulePriority;
import org.sonar.jpa.test.AbstractDbUnitTestCase;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.nullValue;
-import static org.junit.Assert.assertThat;
-
public class RuleChangeTest extends AbstractDbUnitTestCase {
private ProfilesManager profilesManager;
@@ -71,21 +66,21 @@ public class RuleChangeTest extends AbstractDbUnitTestCase {
profilesManager.ruleParamChanged(2, 3, "param1", "20", "30", "admin");
checkTablesWithExcludedColumns("ruleParamChanged", new String[]{"change_date"}, "active_rule_changes", "active_rule_param_changes");
}
-
+
@Test
public void testRuleSeverityChanged() {
setupData("initialData");
profilesManager.ruleSeverityChanged(2, 3, RulePriority.BLOCKER, RulePriority.CRITICAL, "admin");
checkTablesWithExcludedColumns("ruleSeverityChanged", new String[]{"change_date"}, "active_rule_changes");
}
-
+
@Test
public void testRuleReverted() {
setupData("ruleReverted");
profilesManager.revert(2, 3, "admin");
checkTablesWithExcludedColumns("ruleReverted", new String[]{"change_date"}, "active_rule_changes", "active_rule_param_changes");
}
-
+
@Test
public void testChangeParentProfile() {
setupData("changeParentProfile");
diff --git a/sonar-server/src/test/java/org/sonar/server/filters/DateCriterionTest.java b/sonar-server/src/test/java/org/sonar/server/filters/DateCriterionTest.java
index 59734a00d98..0a30afe4b1b 100644
--- a/sonar-server/src/test/java/org/sonar/server/filters/DateCriterionTest.java
+++ b/sonar-server/src/test/java/org/sonar/server/filters/DateCriterionTest.java
@@ -27,11 +27,8 @@ import java.util.Date;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
public class DateCriterionTest {
- private static final int DAYS = 24 * 60 * 60 * 1000;
-
@Test
public void ignoreTime() throws ParseException {
DateCriterion criterion = new DateCriterion().setDate(3);
@@ -39,7 +36,7 @@ public class DateCriterionTest {
assertThat(date.getHours(), is(0));
assertThat(date.getMinutes(), is(0));
}
-
+
@Test
public void testDaysAgo() throws ParseException {
DateCriterion criterion = new DateCriterion().setDate(3);