diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-06-20 00:43:47 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-06-20 00:45:34 +0200 |
commit | 2f779df51e9da5b07ad6f837fe1c98eab9fbf439 (patch) | |
tree | d2be9202eb947ecb005c72368bbcb4f1b86e8e68 /sonar-plugin-api | |
parent | 24ec2501f751dc2a122f1e5f905ee4151ec8b891 (diff) | |
download | sonarqube-2f779df51e9da5b07ad6f837fe1c98eab9fbf439.tar.gz sonarqube-2f779df51e9da5b07ad6f837fe1c98eab9fbf439.zip |
Upgrade hamcrest and fix conflicts with JUnit and Mockito
Diffstat (limited to 'sonar-plugin-api')
21 files changed, 30 insertions, 28 deletions
diff --git a/sonar-plugin-api/pom.xml b/sonar-plugin-api/pom.xml index 09d12366d3f..0ca8294a407 100644 --- a/sonar-plugin-api/pom.xml +++ b/sonar-plugin-api/pom.xml @@ -157,7 +157,7 @@ </dependency> <dependency> <groupId>org.mockito</groupId> - <artifactId>mockito-all</artifactId> + <artifactId>mockito-core</artifactId> <scope>test</scope> </dependency> <dependency> diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectDefinitionTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectDefinitionTest.java index 1b613d555ac..ea63a12f5f9 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectDefinitionTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectDefinitionTest.java @@ -19,7 +19,7 @@ */ package org.sonar.api.batch.bootstrap; -import static org.hamcrest.CoreMatchers.nullValue; +import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/batch/maven/MavenUtilsTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/batch/maven/MavenUtilsTest.java index 32f16e35baa..1eb9b637281 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/batch/maven/MavenUtilsTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/batch/maven/MavenUtilsTest.java @@ -27,7 +27,7 @@ import org.sonar.api.test.MavenTestUtils; import java.nio.charset.Charset; -import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/config/AesCipherTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/config/AesCipherTest.java index 6e279661bd3..7631b6b9b85 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/config/AesCipherTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/config/AesCipherTest.java @@ -34,7 +34,9 @@ import java.security.InvalidKeyException; import java.security.Key; import static org.hamcrest.Matchers.greaterThan; +import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.core.Is.is; +import static org.hamcrest.core.Is.isA; import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; @@ -94,7 +96,7 @@ public class AesCipherTest { fail(); } catch (RuntimeException e) { - assertThat(e.getCause(), is(InvalidKeyException.class)); + assertThat(e.getCause(), instanceOf(InvalidKeyException.class)); } } @@ -109,7 +111,7 @@ public class AesCipherTest { fail(); } catch (RuntimeException e) { - assertThat(e.getCause(), is(BadPaddingException.class)); + assertThat(e.getCause(), instanceOf(BadPaddingException.class)); } } diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/config/EncryptionTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/config/EncryptionTest.java index 6473578f6ae..265a7cc4f2d 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/config/EncryptionTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/config/EncryptionTest.java @@ -21,7 +21,7 @@ package org.sonar.api.config; import org.junit.Test; -import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; public class EncryptionTest { diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/measures/CountDistributionBuilderTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/measures/CountDistributionBuilderTest.java index 0f9a2786c5d..4e15d1ed2fe 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/measures/CountDistributionBuilderTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/measures/CountDistributionBuilderTest.java @@ -19,7 +19,7 @@ */ package org.sonar.api.measures; -import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; import org.junit.Test; import static org.mockito.Mockito.mock; diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/measures/MeanAggregationFormulaTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/measures/MeanAggregationFormulaTest.java index 645138e1f00..c1443832c7b 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/measures/MeanAggregationFormulaTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/measures/MeanAggregationFormulaTest.java @@ -25,7 +25,7 @@ import org.junit.Test; import java.util.Arrays; import java.util.Collections; -import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThat; import static org.mockito.Mockito.mock; diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/measures/MeasureUtilsTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/measures/MeasureUtilsTest.java index 50a565bfd3b..1935e5c19a7 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/measures/MeasureUtilsTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/measures/MeasureUtilsTest.java @@ -19,7 +19,7 @@ */ package org.sonar.api.measures; -import static org.hamcrest.CoreMatchers.nullValue; +import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThat; diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/measures/PersistenceModeTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/measures/PersistenceModeTest.java index 5dda2277b0f..1c8ee20eb69 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/measures/PersistenceModeTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/measures/PersistenceModeTest.java @@ -19,7 +19,7 @@ */ package org.sonar.api.measures; -import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; import org.junit.Test; diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/measures/PropertiesBuilderTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/measures/PropertiesBuilderTest.java index 0db658419e2..d540ddb1a61 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/measures/PropertiesBuilderTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/measures/PropertiesBuilderTest.java @@ -19,7 +19,7 @@ */ package org.sonar.api.measures; -import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertThat; import org.junit.Test; 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 c5eddfc84cc..8d31362cf1d 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 @@ -30,8 +30,8 @@ import java.util.Collections; import java.util.List; import static junit.framework.Assert.assertNull; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.nullValue; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/resources/DirectoryTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/resources/DirectoryTest.java index bb5bef018f9..0c83e6a8ba9 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/resources/DirectoryTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/resources/DirectoryTest.java @@ -25,8 +25,8 @@ import org.junit.rules.TemporaryFolder; import java.io.IOException; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.nullValue; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.nullValue; import static org.junit.Assert.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/resources/FileTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/resources/FileTest.java index 3fe4593e2b0..27a88f14ed4 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/resources/FileTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/resources/FileTest.java @@ -26,8 +26,8 @@ import org.junit.rules.TemporaryFolder; import java.io.IOException; import static org.fest.assertions.Assertions.assertThat; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.nullValue; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.nullValue; import static org.junit.Assert.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/resources/ResourceTypeTreeTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/resources/ResourceTypeTreeTest.java index 00d2653e6ef..f53b5902b15 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/resources/ResourceTypeTreeTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/resources/ResourceTypeTreeTest.java @@ -21,7 +21,7 @@ package org.sonar.api.resources; import org.junit.Test; -import static org.hamcrest.collection.IsCollectionContaining.hasItems; +import static org.hamcrest.Matchers.hasItems; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; import static org.sonar.api.resources.ResourceTypesTest.qualifiers; diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/DateUtilsTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/DateUtilsTest.java index 136d6c818e2..63b785960bb 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/DateUtilsTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/DateUtilsTest.java @@ -28,9 +28,9 @@ import java.util.Date; import java.util.List; import static org.hamcrest.core.Is.is; -import static org.hamcrest.number.OrderingComparisons.greaterThan; -import static org.hamcrest.number.OrderingComparisons.greaterThanOrEqualTo; -import static org.hamcrest.text.StringStartsWith.startsWith; +import static org.hamcrest.Matchers.greaterThan; +import static org.hamcrest.Matchers.greaterThanOrEqualTo; +import static org.hamcrest.Matchers.startsWith; import static org.junit.Assert.*; public class DateUtilsTest { diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/DeprecatedKeyValueFormatTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/DeprecatedKeyValueFormatTest.java index 6031606b2aa..de49842346a 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/DeprecatedKeyValueFormatTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/DeprecatedKeyValueFormatTest.java @@ -29,7 +29,7 @@ import java.util.Map; import java.util.TreeMap; import static junit.framework.Assert.assertEquals; -import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; public class DeprecatedKeyValueFormatTest { diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/KeyValueFormatTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/KeyValueFormatTest.java index 9e13ef58f24..54a34757d10 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/KeyValueFormatTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/KeyValueFormatTest.java @@ -30,8 +30,8 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.Map; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.nullValue; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.nullValue; import static org.junit.Assert.assertThat; public class KeyValueFormatTest { diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/LocalizedMessagesTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/LocalizedMessagesTest.java index 601c075baec..e2bcda16ded 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/LocalizedMessagesTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/LocalizedMessagesTest.java @@ -30,7 +30,7 @@ import java.util.List; import java.util.Locale; import java.util.MissingResourceException; -import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; import static org.junit.matchers.JUnitMatchers.hasItems; diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/ParsingUtilsTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/ParsingUtilsTest.java index 36295795f3f..d5f14fa912c 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/ParsingUtilsTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/ParsingUtilsTest.java @@ -19,7 +19,7 @@ */ package org.sonar.api.utils; -import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; import org.junit.Test; diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/WildcardPatternTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/WildcardPatternTest.java index cdc60323002..6e3001795d8 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/WildcardPatternTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/WildcardPatternTest.java @@ -19,7 +19,7 @@ */ package org.sonar.api.utils; -import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/web/AbstractRubyTemplateTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/web/AbstractRubyTemplateTest.java index 54152af7d42..813aa79a4cb 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/web/AbstractRubyTemplateTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/web/AbstractRubyTemplateTest.java @@ -19,7 +19,7 @@ */ package org.sonar.api.web; -import static org.hamcrest.CoreMatchers.nullValue; +import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; import org.junit.Test; |