aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2014-06-20 00:43:47 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2014-06-20 00:45:34 +0200
commit2f779df51e9da5b07ad6f837fe1c98eab9fbf439 (patch)
treed2be9202eb947ecb005c72368bbcb4f1b86e8e68 /plugins
parent24ec2501f751dc2a122f1e5f905ee4151ec8b891 (diff)
downloadsonarqube-2f779df51e9da5b07ad6f837fe1c98eab9fbf439.tar.gz
sonarqube-2f779df51e9da5b07ad6f837fe1c98eab9fbf439.zip
Upgrade hamcrest and fix conflicts with JUnit and Mockito
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sonar-core-plugin/pom.xml2
-rw-r--r--plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/UnitTestDecoratorTest.java4
-rw-r--r--plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/TendencyDecoratorTest.java2
-rw-r--r--plugins/sonar-cpd-plugin/pom.xml8
-rw-r--r--plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/decorators/SumDuplicationsDecoratorTest.java4
-rw-r--r--plugins/sonar-dbcleaner-plugin/pom.xml7
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/test/java/org/sonar/plugins/dbcleaner/period/DeleteAllFilterTest.java2
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/test/java/org/sonar/plugins/dbcleaner/period/KeepOneFilterTest.java6
-rw-r--r--plugins/sonar-design-plugin/src/test/java/org/sonar/plugins/design/DesignPluginTest.java2
-rw-r--r--plugins/sonar-email-notifications-plugin/pom.xml2
-rw-r--r--plugins/sonar-l10n-en-plugin/pom.xml6
11 files changed, 30 insertions, 15 deletions
diff --git a/plugins/sonar-core-plugin/pom.xml b/plugins/sonar-core-plugin/pom.xml
index 0361cb6cfcb..8214ce000e3 100644
--- a/plugins/sonar-core-plugin/pom.xml
+++ b/plugins/sonar-core-plugin/pom.xml
@@ -71,7 +71,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
+ <artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/UnitTestDecoratorTest.java b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/UnitTestDecoratorTest.java
index 4f52830b5de..86b43609ec6 100644
--- a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/UnitTestDecoratorTest.java
+++ b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/UnitTestDecoratorTest.java
@@ -19,6 +19,7 @@
*/
package org.sonar.plugins.core.sensors;
+import org.hamcrest.Matchers;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
@@ -31,7 +32,6 @@ import org.sonar.api.resources.Project;
import java.util.Arrays;
import static org.fest.assertions.Assertions.assertThat;
-import static org.hamcrest.Matchers.closeTo;
import static org.mockito.Matchers.doubleThat;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.atLeastOnce;
@@ -82,7 +82,7 @@ public class UnitTestDecoratorTest {
verify(context).saveMeasure(eq(CoreMetrics.TEST_FAILURES), eq(2.0));
verify(context).saveMeasure(eq(CoreMetrics.SKIPPED_TESTS), eq(2.0));
verify(context).saveMeasure(eq(CoreMetrics.TEST_EXECUTION_TIME), eq(2.0));
- verify(context).saveMeasure(eq(CoreMetrics.TEST_SUCCESS_DENSITY), doubleThat(closeTo(33.3, 0.1)));
+ verify(context).saveMeasure(eq(CoreMetrics.TEST_SUCCESS_DENSITY), doubleThat(Matchers.closeTo(33.3, 0.1)));
}
private void mockChildrenMeasures(Metric metric, double value) {
diff --git a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/TendencyDecoratorTest.java b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/TendencyDecoratorTest.java
index 7a2c47d57a1..ce7cc6cf5dd 100644
--- a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/TendencyDecoratorTest.java
+++ b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/TendencyDecoratorTest.java
@@ -36,7 +36,7 @@ import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
-import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.Matchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Matchers.anyList;
import static org.mockito.Mockito.mock;
diff --git a/plugins/sonar-cpd-plugin/pom.xml b/plugins/sonar-cpd-plugin/pom.xml
index 13fbe452140..aa992e547f9 100644
--- a/plugins/sonar-cpd-plugin/pom.xml
+++ b/plugins/sonar-cpd-plugin/pom.xml
@@ -44,8 +44,14 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-all</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
+ <artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/decorators/SumDuplicationsDecoratorTest.java b/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/decorators/SumDuplicationsDecoratorTest.java
index 7ebae1da257..0c733e9227a 100644
--- a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/decorators/SumDuplicationsDecoratorTest.java
+++ b/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/decorators/SumDuplicationsDecoratorTest.java
@@ -27,8 +27,8 @@ import org.sonar.api.resources.File;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.test.IsMeasure;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.number.OrderingComparisons.greaterThan;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.greaterThan;
import static org.junit.Assert.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.argThat;
diff --git a/plugins/sonar-dbcleaner-plugin/pom.xml b/plugins/sonar-dbcleaner-plugin/pom.xml
index 38388e21c4d..23d11cd36f0 100644
--- a/plugins/sonar-dbcleaner-plugin/pom.xml
+++ b/plugins/sonar-dbcleaner-plugin/pom.xml
@@ -47,6 +47,11 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-all</artifactId>
+ <scope>test</scope>
+ </dependency>
<!-- TODO http://jira.codehaus.org/browse/SONAR-2011
We need following dependency, otherwise we will receive
@@ -60,7 +65,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
+ <artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/plugins/sonar-dbcleaner-plugin/src/test/java/org/sonar/plugins/dbcleaner/period/DeleteAllFilterTest.java b/plugins/sonar-dbcleaner-plugin/src/test/java/org/sonar/plugins/dbcleaner/period/DeleteAllFilterTest.java
index 744c88cccef..5367c3675b8 100644
--- a/plugins/sonar-dbcleaner-plugin/src/test/java/org/sonar/plugins/dbcleaner/period/DeleteAllFilterTest.java
+++ b/plugins/sonar-dbcleaner-plugin/src/test/java/org/sonar/plugins/dbcleaner/period/DeleteAllFilterTest.java
@@ -29,7 +29,7 @@ import java.util.List;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
-import static org.junit.internal.matchers.IsCollectionContaining.hasItem;
+import static org.hamcrest.Matchers.hasItem;
public class DeleteAllFilterTest {
diff --git a/plugins/sonar-dbcleaner-plugin/src/test/java/org/sonar/plugins/dbcleaner/period/KeepOneFilterTest.java b/plugins/sonar-dbcleaner-plugin/src/test/java/org/sonar/plugins/dbcleaner/period/KeepOneFilterTest.java
index e9faa55c7b9..cd1624644a5 100644
--- a/plugins/sonar-dbcleaner-plugin/src/test/java/org/sonar/plugins/dbcleaner/period/KeepOneFilterTest.java
+++ b/plugins/sonar-dbcleaner-plugin/src/test/java/org/sonar/plugins/dbcleaner/period/KeepOneFilterTest.java
@@ -19,8 +19,8 @@
*/
package org.sonar.plugins.dbcleaner.period;
+import org.hamcrest.core.IsCollectionContaining;
import org.junit.Test;
-import org.junit.internal.matchers.IsCollectionContaining;
import org.sonar.api.utils.DateUtils;
import org.sonar.core.purge.PurgeableSnapshotDto;
import org.sonar.plugins.dbcleaner.DbCleanerTestUtils;
@@ -46,7 +46,7 @@ public class KeepOneFilterTest {
createSnapshotWithDate(4L, "2011-05-19"), // may -> to be deleted
createSnapshotWithDate(5L, "2011-06-01"), // june -> keep
createSnapshotWithDate(6L, "2012-01-01") // out of scope -> keep
- ));
+ ));
assertThat(toDelete.size(), is(2));
assertThat(toDelete, IsCollectionContaining.hasItem(new DbCleanerTestUtils.SnapshotMatcher(3L)));
@@ -62,7 +62,7 @@ public class KeepOneFilterTest {
createSnapshotWithDate(2L, "2011-05-02").setLast(true),
createSnapshotWithDate(3L, "2011-05-19").setHasEvents(true).setLast(false),
createSnapshotWithDate(4L, "2011-05-23") // to be deleted
- ));
+ ));
assertThat(toDelete.size(), is(2));
assertThat(toDelete, IsCollectionContaining.hasItem(new DbCleanerTestUtils.SnapshotMatcher(1L)));
diff --git a/plugins/sonar-design-plugin/src/test/java/org/sonar/plugins/design/DesignPluginTest.java b/plugins/sonar-design-plugin/src/test/java/org/sonar/plugins/design/DesignPluginTest.java
index a6ee36b8ba6..336889f2f81 100644
--- a/plugins/sonar-design-plugin/src/test/java/org/sonar/plugins/design/DesignPluginTest.java
+++ b/plugins/sonar-design-plugin/src/test/java/org/sonar/plugins/design/DesignPluginTest.java
@@ -19,7 +19,7 @@
*/
package org.sonar.plugins.design;
-import static org.hamcrest.number.OrderingComparisons.greaterThan;
+import static org.hamcrest.Matchers.greaterThan;
import static org.junit.Assert.assertThat;
import org.junit.Test;
diff --git a/plugins/sonar-email-notifications-plugin/pom.xml b/plugins/sonar-email-notifications-plugin/pom.xml
index bca732f4fb5..6492f44fb1f 100644
--- a/plugins/sonar-email-notifications-plugin/pom.xml
+++ b/plugins/sonar-email-notifications-plugin/pom.xml
@@ -36,7 +36,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
+ <artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/plugins/sonar-l10n-en-plugin/pom.xml b/plugins/sonar-l10n-en-plugin/pom.xml
index 4018b3a905e..bc1cc822cc6 100644
--- a/plugins/sonar-l10n-en-plugin/pom.xml
+++ b/plugins/sonar-l10n-en-plugin/pom.xml
@@ -51,7 +51,11 @@
<artifactId>fest-assert</artifactId>
<scope>test</scope>
</dependency>
-
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-all</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>