Przeglądaj źródła

Upgrade hamcrest and fix conflicts with JUnit and Mockito

tags/4.4-RC1
Simon Brandhof 10 lat temu
rodzic
commit
2f779df51e
100 zmienionych plików z 262 dodań i 239 usunięć
  1. 1
    1
      plugins/sonar-core-plugin/pom.xml
  2. 2
    2
      plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/UnitTestDecoratorTest.java
  3. 1
    1
      plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/TendencyDecoratorTest.java
  4. 7
    1
      plugins/sonar-cpd-plugin/pom.xml
  5. 2
    2
      plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/decorators/SumDuplicationsDecoratorTest.java
  6. 6
    1
      plugins/sonar-dbcleaner-plugin/pom.xml
  7. 1
    1
      plugins/sonar-dbcleaner-plugin/src/test/java/org/sonar/plugins/dbcleaner/period/DeleteAllFilterTest.java
  8. 3
    3
      plugins/sonar-dbcleaner-plugin/src/test/java/org/sonar/plugins/dbcleaner/period/KeepOneFilterTest.java
  9. 1
    1
      plugins/sonar-design-plugin/src/test/java/org/sonar/plugins/design/DesignPluginTest.java
  10. 1
    1
      plugins/sonar-email-notifications-plugin/pom.xml
  11. 5
    1
      plugins/sonar-l10n-en-plugin/pom.xml
  12. 19
    7
      pom.xml
  13. 6
    1
      sonar-application/pom.xml
  14. 1
    1
      sonar-application/src/test/java/org/sonar/application/ConfigurationUtilsTest.java
  15. 1
    1
      sonar-application/src/test/java/org/sonar/application/EncryptionTest.java
  16. 2
    1
      sonar-application/src/test/java/org/sonar/application/LoggingTest.java
  17. 0
    1
      sonar-application/src/test/java/org/sonar/application/StartServerTest.java
  18. 2
    1
      sonar-application/src/test/java/org/sonar/application/WebappTest.java
  19. 4
    9
      sonar-batch/pom.xml
  20. 1
    1
      sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchExtensionDictionnaryTest.java
  21. 2
    2
      sonar-batch/src/test/java/org/sonar/batch/components/PastMeasuresLoaderTest.java
  22. 1
    1
      sonar-batch/src/test/java/org/sonar/batch/components/PastSnapshotFinderByDateTest.java
  23. 1
    1
      sonar-batch/src/test/java/org/sonar/batch/components/PastSnapshotFinderByDaysTest.java
  24. 1
    1
      sonar-batch/src/test/java/org/sonar/batch/components/PastSnapshotFinderByPreviousAnalysisTest.java
  25. 2
    2
      sonar-batch/src/test/java/org/sonar/batch/index/BucketTest.java
  26. 1
    1
      sonar-batch/src/test/java/org/sonar/batch/index/DefaultResourcePersisterTest.java
  27. 1
    1
      sonar-batch/src/test/java/org/sonar/batch/maven/DefaultMavenPluginExecutorTest.java
  28. 3
    3
      sonar-batch/src/test/java/org/sonar/batch/scan/filesystem/ModuleFileSystemInitializerTest.java
  29. 2
    0
      sonar-colorizer/pom.xml
  30. 14
    1
      sonar-core/pom.xml
  31. 0
    42
      sonar-core/src/main/java/org/sonar/jpa/dao/BaseDao.java
  32. 10
    9
      sonar-core/src/main/java/org/sonar/jpa/dao/MeasuresDao.java
  33. 2
    2
      sonar-core/src/test/java/org/sonar/core/dashboard/DashboardDaoTest.java
  34. 2
    2
      sonar-core/src/test/java/org/sonar/core/i18n/GwtI18nTest.java
  35. 1
    1
      sonar-core/src/test/java/org/sonar/core/i18n/RuleI18nManagerTest.java
  36. 1
    1
      sonar-core/src/test/java/org/sonar/core/purge/PurgeDaoTest.java
  37. 1
    1
      sonar-core/src/test/java/org/sonar/core/purge/PurgeableSnapshotDtoTest.java
  38. 1
    1
      sonar-core/src/test/java/org/sonar/core/resource/ResourceIndexerDaoTest.java
  39. 1
    1
      sonar-core/src/test/java/org/sonar/core/rule/CacheRuleFinderTest.java
  40. 1
    1
      sonar-core/src/test/java/org/sonar/jpa/session/DatabaseSessionTest.java
  41. 6
    1
      sonar-deprecated/pom.xml
  42. 1
    1
      sonar-deprecated/src/test/java/org/sonar/api/resources/MethodTest.java
  43. 1
    1
      sonar-deprecated/src/test/java/org/sonar/api/utils/CoberturaReportParserUtilsTest.java
  44. 1
    1
      sonar-duplications/pom.xml
  45. 1
    1
      sonar-duplications/src/test/java/org/sonar/duplications/block/BlockChunkerTestCase.java
  46. 3
    3
      sonar-duplications/src/test/java/org/sonar/duplications/detector/CloneGroupMatcher.java
  47. 2
    2
      sonar-duplications/src/test/java/org/sonar/duplications/detector/DetectorTestCase.java
  48. 1
    1
      sonar-duplications/src/test/java/org/sonar/duplications/detector/original/BlocksGroupTest.java
  49. 10
    12
      sonar-duplications/src/test/java/org/sonar/duplications/detector/suffixtree/SuffixTreeTest.java
  50. 1
    1
      sonar-duplications/src/test/java/org/sonar/duplications/internal/pmd/TokenizerBridgeTest.java
  51. 1
    1
      sonar-duplications/src/test/java/org/sonar/duplications/java/JavaDuplicationsFunctionalTest.java
  52. 3
    3
      sonar-duplications/src/test/java/org/sonar/duplications/java/JavaTokenProducerTest.java
  53. 1
    1
      sonar-duplications/src/test/java/org/sonar/duplications/statement/StatementChannelTest.java
  54. 6
    1
      sonar-home/pom.xml
  55. 1
    1
      sonar-java-api/src/test/java/org/sonar/java/api/JavaClassTest.java
  56. 1
    1
      sonar-java-api/src/test/java/org/sonar/java/api/JavaMethodTest.java
  57. 1
    1
      sonar-java-api/src/test/java/org/sonar/java/api/JavaUtilsTest.java
  58. 5
    0
      sonar-markdown/pom.xml
  59. 6
    1
      sonar-maven-plugin/pom.xml
  60. 1
    1
      sonar-plugin-api/pom.xml
  61. 1
    1
      sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectDefinitionTest.java
  62. 1
    1
      sonar-plugin-api/src/test/java/org/sonar/api/batch/maven/MavenUtilsTest.java
  63. 4
    2
      sonar-plugin-api/src/test/java/org/sonar/api/config/AesCipherTest.java
  64. 1
    1
      sonar-plugin-api/src/test/java/org/sonar/api/config/EncryptionTest.java
  65. 1
    1
      sonar-plugin-api/src/test/java/org/sonar/api/measures/CountDistributionBuilderTest.java
  66. 1
    1
      sonar-plugin-api/src/test/java/org/sonar/api/measures/MeanAggregationFormulaTest.java
  67. 1
    1
      sonar-plugin-api/src/test/java/org/sonar/api/measures/MeasureUtilsTest.java
  68. 1
    1
      sonar-plugin-api/src/test/java/org/sonar/api/measures/PersistenceModeTest.java
  69. 1
    1
      sonar-plugin-api/src/test/java/org/sonar/api/measures/PropertiesBuilderTest.java
  70. 2
    2
      sonar-plugin-api/src/test/java/org/sonar/api/measures/SumChildDistributionFormulaTest.java
  71. 2
    2
      sonar-plugin-api/src/test/java/org/sonar/api/resources/DirectoryTest.java
  72. 2
    2
      sonar-plugin-api/src/test/java/org/sonar/api/resources/FileTest.java
  73. 1
    1
      sonar-plugin-api/src/test/java/org/sonar/api/resources/ResourceTypeTreeTest.java
  74. 3
    3
      sonar-plugin-api/src/test/java/org/sonar/api/utils/DateUtilsTest.java
  75. 1
    1
      sonar-plugin-api/src/test/java/org/sonar/api/utils/DeprecatedKeyValueFormatTest.java
  76. 2
    2
      sonar-plugin-api/src/test/java/org/sonar/api/utils/KeyValueFormatTest.java
  77. 1
    1
      sonar-plugin-api/src/test/java/org/sonar/api/utils/LocalizedMessagesTest.java
  78. 1
    1
      sonar-plugin-api/src/test/java/org/sonar/api/utils/ParsingUtilsTest.java
  79. 1
    1
      sonar-plugin-api/src/test/java/org/sonar/api/utils/WildcardPatternTest.java
  80. 1
    1
      sonar-plugin-api/src/test/java/org/sonar/api/web/AbstractRubyTemplateTest.java
  81. 6
    6
      sonar-server/pom.xml
  82. 3
    2
      sonar-server/src/test/java/org/sonar/server/platform/ClassLoaderUtilsTest.java
  83. 1
    1
      sonar-server/src/test/java/org/sonar/server/platform/RailsAppsDeployerTest.java
  84. 1
    1
      sonar-server/src/test/java/org/sonar/server/platform/ServerIdGeneratorTest.java
  85. 2
    2
      sonar-server/src/test/java/org/sonar/server/ui/ViewProxyTest.java
  86. 4
    4
      sonar-testing-harness/pom.xml
  87. 25
    20
      sonar-testing-harness/src/test/java/org/sonar/test/i18n/BundleSynchronizedMatcherTest.java
  88. 5
    5
      sonar-ws-client/pom.xml
  89. 6
    11
      sonar-ws-client/src/test/java/org/sonar/wsclient/SonarTest.java
  90. 2
    2
      sonar-ws-client/src/test/java/org/sonar/wsclient/services/ResourceTest.java
  91. 1
    1
      sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/DependencyUnmarshallerTest.java
  92. 2
    2
      sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/JsonUtilsTest.java
  93. 1
    1
      sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ManualMeasureUnmarshallerTest.java
  94. 1
    1
      sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/MetricUnmarshallerTest.java
  95. 1
    1
      sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ProfileUnmarshallerTest.java
  96. 1
    1
      sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/PropertyUnmarshallerTest.java
  97. 1
    1
      sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ResourceSearchUnmarshallerTest.java
  98. 2
    2
      sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ResourceUnmarshallerTest.java
  99. 1
    1
      sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ServerSetupUnmarshallerTest.java
  100. 0
    0
      sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ServerUnmarshallerTest.java

+ 1
- 1
plugins/sonar-core-plugin/pom.xml Wyświetl plik

@@ -71,7 +71,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>

+ 2
- 2
plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/UnitTestDecoratorTest.java Wyświetl plik

@@ -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) {

+ 1
- 1
plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/timemachine/TendencyDecoratorTest.java Wyświetl plik

@@ -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;

+ 7
- 1
plugins/sonar-cpd-plugin/pom.xml Wyświetl plik

@@ -43,9 +43,15 @@
<artifactId>sonar-testing-harness</artifactId>
<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>

+ 2
- 2
plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/decorators/SumDuplicationsDecoratorTest.java Wyświetl plik

@@ -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;

+ 6
- 1
plugins/sonar-dbcleaner-plugin/pom.xml Wyświetl plik

@@ -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>

+ 1
- 1
plugins/sonar-dbcleaner-plugin/src/test/java/org/sonar/plugins/dbcleaner/period/DeleteAllFilterTest.java Wyświetl plik

@@ -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 {


+ 3
- 3
plugins/sonar-dbcleaner-plugin/src/test/java/org/sonar/plugins/dbcleaner/period/KeepOneFilterTest.java Wyświetl plik

@@ -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)));

+ 1
- 1
plugins/sonar-design-plugin/src/test/java/org/sonar/plugins/design/DesignPluginTest.java Wyświetl plik

@@ -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;


+ 1
- 1
plugins/sonar-email-notifications-plugin/pom.xml Wyświetl plik

@@ -36,7 +36,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>

+ 5
- 1
plugins/sonar-l10n-en-plugin/pom.xml Wyświetl plik

@@ -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>

+ 19
- 7
pom.xml Wyświetl plik

@@ -907,19 +907,20 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
<version>1.9.5</version>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.easytesting</groupId>
<artifactId>fest-assert</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
@@ -1048,10 +1049,21 @@
<artifactId>jsonassert</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<version>4.11</version>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>xmlunit</groupId>

+ 6
- 1
sonar-application/pom.xml Wyświetl plik

@@ -192,6 +192,11 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easytesting</groupId>
<artifactId>fest-assert</artifactId>
@@ -199,7 +204,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>

+ 1
- 1
sonar-application/src/test/java/org/sonar/application/ConfigurationUtilsTest.java Wyświetl plik

@@ -25,7 +25,7 @@ import org.junit.Test;
import java.util.Map;
import java.util.Properties;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

public class ConfigurationUtilsTest {

+ 1
- 1
sonar-application/src/test/java/org/sonar/application/EncryptionTest.java Wyświetl plik

@@ -22,7 +22,7 @@ package org.sonar.application;

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 {

+ 2
- 1
sonar-application/src/test/java/org/sonar/application/LoggingTest.java Wyświetl plik

@@ -33,6 +33,7 @@ import org.mockito.Mockito;
import org.slf4j.Logger;

import java.io.File;
import java.io.IOException;
import java.util.Properties;

import static org.mockito.Matchers.argThat;
@@ -47,7 +48,7 @@ public class LoggingTest {
public TemporaryFolder temp = new TemporaryFolder();

@Before
public void setHome() {
public void setHome() throws IOException {
File homeDir = temp.newFolder("home");
System.setProperty("SONAR_HOME", homeDir.getAbsolutePath());
}

+ 0
- 1
sonar-application/src/test/java/org/sonar/application/StartServerTest.java Wyświetl plik

@@ -27,7 +27,6 @@ import org.junit.Test;
import org.junit.rules.TemporaryFolder;

import java.io.File;
import java.io.IOException;

import static org.fest.assertions.Assertions.assertThat;
import static org.fest.assertions.Fail.fail;

+ 2
- 1
sonar-application/src/test/java/org/sonar/application/WebappTest.java Wyświetl plik

@@ -27,6 +27,7 @@ import org.junit.Test;
import org.junit.rules.TemporaryFolder;

import java.io.File;
import java.io.IOException;
import java.util.Properties;

import static org.fest.assertions.Assertions.assertThat;
@@ -44,7 +45,7 @@ public class WebappTest {
private Env env;

@Before
public void initEnv() {
public void initEnv() throws IOException {
env = mock(Env.class);
File sonarHome = temp.newFolder("home");
when(env.rootDir()).thenReturn(sonarHome);

+ 4
- 9
sonar-batch/pom.xml Wyświetl plik

@@ -116,18 +116,13 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-testing-harness</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-testing-harness</artifactId>
<scope>test</scope>
</dependency>
<dependency>

+ 1
- 1
sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchExtensionDictionnaryTest.java Wyświetl plik

@@ -33,7 +33,7 @@ import java.util.Collection;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.internal.matchers.IsCollectionContaining.hasItem;
import static org.hamcrest.Matchers.hasItem;
import static org.mockito.Mockito.mock;

public class BatchExtensionDictionnaryTest {

+ 2
- 2
sonar-batch/src/test/java/org/sonar/batch/components/PastMeasuresLoaderTest.java Wyświetl plik

@@ -27,10 +27,10 @@ import org.sonar.jpa.test.AbstractDbUnitTestCase;
import java.util.Arrays;
import java.util.List;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.internal.matchers.IsCollectionContaining.hasItems;
import static org.hamcrest.Matchers.hasItems;

public class PastMeasuresLoaderTest extends AbstractDbUnitTestCase {


+ 1
- 1
sonar-batch/src/test/java/org/sonar/batch/components/PastSnapshotFinderByDateTest.java Wyświetl plik

@@ -27,7 +27,7 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

public class PastSnapshotFinderByDateTest extends AbstractDbUnitTestCase {

+ 1
- 1
sonar-batch/src/test/java/org/sonar/batch/components/PastSnapshotFinderByDaysTest.java Wyświetl plik

@@ -31,7 +31,7 @@ import java.util.Collections;
import java.util.Date;
import java.util.List;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThat;


+ 1
- 1
sonar-batch/src/test/java/org/sonar/batch/components/PastSnapshotFinderByPreviousAnalysisTest.java Wyświetl plik

@@ -23,7 +23,7 @@ import org.junit.Test;
import org.sonar.api.database.model.Snapshot;
import org.sonar.jpa.test.AbstractDbUnitTestCase;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.core.IsNull.nullValue;
import static org.junit.Assert.assertThat;


+ 2
- 2
sonar-batch/src/test/java/org/sonar/batch/index/BucketTest.java Wyświetl plik

@@ -24,12 +24,12 @@ import org.sonar.api.measures.Metric;
import org.sonar.api.resources.Directory;
import org.sonar.api.resources.File;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.core.IsNot.not;
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.hasItem;
import static org.hamcrest.Matchers.hasItem;

public class BucketTest {


+ 1
- 1
sonar-batch/src/test/java/org/sonar/batch/index/DefaultResourcePersisterTest.java Wyświetl plik

@@ -36,7 +36,7 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;

import static org.fest.assertions.Assertions.assertThat;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.notNullValue;
import static org.mockito.Mockito.mock;

+ 1
- 1
sonar-batch/src/test/java/org/sonar/batch/maven/DefaultMavenPluginExecutorTest.java Wyświetl plik

@@ -28,7 +28,7 @@ import org.sonar.batch.scan.filesystem.DefaultModuleFileSystem;

import java.io.File;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyList;

+ 3
- 3
sonar-batch/src/test/java/org/sonar/batch/scan/filesystem/ModuleFileSystemInitializerTest.java Wyświetl plik

@@ -21,7 +21,7 @@ package org.sonar.batch.scan.filesystem;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.sonar.api.batch.bootstrap.ProjectDefinition;
@@ -36,8 +36,8 @@ import static org.mockito.Mockito.mock;

public class ModuleFileSystemInitializerTest {

@ClassRule
public static TemporaryFolder temp = new TemporaryFolder();
@Rule
public TemporaryFolder temp = new TemporaryFolder();

PathResolver pathResolver = new PathResolver();


+ 2
- 0
sonar-colorizer/pom.xml Wyświetl plik

@@ -31,8 +31,10 @@
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.easytesting</groupId>
<artifactId>fest-assert</artifactId>

+ 14
- 1
sonar-core/pom.xml Wyświetl plik

@@ -135,7 +135,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
@@ -153,6 +153,19 @@
<artifactId>fest-assert</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.bean-matchers</groupId>
<artifactId>bean-matchers</artifactId>
<version>0.9</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
</dependency>


<!--
JDBC drivers for MyBatis integration tests.

+ 0
- 42
sonar-core/src/main/java/org/sonar/jpa/dao/BaseDao.java Wyświetl plik

@@ -1,42 +0,0 @@
/*
* SonarQube, open source software quality management tool.
* Copyright (C) 2008-2014 SonarSource
* mailto:contact AT sonarsource DOT com
*
* SonarQube is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* SonarQube is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

package org.sonar.jpa.dao;

import org.sonar.api.database.DatabaseSession;

/**
* @deprecated stop using Hibernate
*/
@Deprecated
public class BaseDao {

private final DatabaseSession session;

public BaseDao(DatabaseSession session) {
super();
this.session = session;
}

public DatabaseSession getSession() {
return session;
}

}

+ 10
- 9
sonar-core/src/main/java/org/sonar/jpa/dao/MeasuresDao.java Wyświetl plik

@@ -31,12 +31,13 @@ import java.util.Map;

import static com.google.common.collect.Lists.newArrayList;

public class MeasuresDao extends BaseDao {
public class MeasuresDao {

private final DatabaseSession session;
private final Map<String, Metric> metricsByName = new HashMap<String, Metric>();

public MeasuresDao(DatabaseSession session) {
super(session);
this.session = session;
}

public Metric getMetric(Metric metric) {
@@ -77,8 +78,8 @@ public class MeasuresDao extends BaseDao {
}

public void disableAutomaticMetrics() {
getSession().createQuery("update " + Metric.class.getSimpleName() + " m set m.enabled=false where m.userManaged=false").executeUpdate();
getSession().commit();
session.createQuery("update " + Metric.class.getSimpleName() + " m set m.enabled=false where m.userManaged=false").executeUpdate();
session.commit();
metricsByName.clear();
}

@@ -88,7 +89,7 @@ public class MeasuresDao extends BaseDao {
metric.setEnabled(Boolean.TRUE);
persistMetricWithoutClear(metric);
}
getSession().commit();
session.commit();
}
metricsByName.clear();
}
@@ -97,10 +98,10 @@ public class MeasuresDao extends BaseDao {
Metric dbMetric = getMetric(metric);
if (dbMetric != null) {
dbMetric.merge(metric);
getSession().getEntityManager().merge(dbMetric);
session.getEntityManager().merge(dbMetric);

} else {
getSession().getEntityManager().persist(new Metric().merge(metric));
session.getEntityManager().persist(new Metric().merge(metric));
}
}

@@ -112,14 +113,14 @@ public class MeasuresDao extends BaseDao {
public void disabledMetrics(Collection<Metric> metrics) {
for (Metric metric : metrics) {
metric.setEnabled(Boolean.FALSE);
getSession().getEntityManager().persist(metric);
session.getEntityManager().persist(metric);
metricsByName.put(metric.getName(), metric);
}
}

private Map<String, Metric> getMetricsByName() {
if (metricsByName.isEmpty()) {
List<Metric> metrics = getSession().getResults(Metric.class);
List<Metric> metrics = session.getResults(Metric.class);
for (Metric metric : metrics) {
metricsByName.put(metric.getKey(), metric);
}

+ 2
- 2
sonar-core/src/test/java/org/sonar/core/dashboard/DashboardDaoTest.java Wyświetl plik

@@ -25,8 +25,8 @@ import org.sonar.core.persistence.AbstractDaoTestCase;

import java.util.Date;

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.assertNull;
import static org.junit.Assert.assertThat;


+ 2
- 2
sonar-core/src/test/java/org/sonar/core/i18n/GwtI18nTest.java Wyświetl plik

@@ -27,9 +27,9 @@ import org.junit.Test;
import java.util.Locale;
import java.util.ResourceBundle;

import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.containsString;
import static org.junit.Assert.assertThat;
import static org.junit.internal.matchers.StringContains.containsString;
import static org.junit.matchers.JUnitMatchers.hasItems;
import static org.mockito.Mockito.mock;


+ 1
- 1
sonar-core/src/test/java/org/sonar/core/i18n/RuleI18nManagerTest.java Wyświetl plik

@@ -24,7 +24,7 @@ import org.junit.Test;

import java.util.Locale;

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 static org.mockito.Mockito.*;

+ 1
- 1
sonar-core/src/test/java/org/sonar/core/purge/PurgeDaoTest.java Wyświetl plik

@@ -33,7 +33,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;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;


+ 1
- 1
sonar-core/src/test/java/org/sonar/core/purge/PurgeableSnapshotDtoTest.java Wyświetl plik

@@ -22,7 +22,7 @@ package org.sonar.core.purge;
import org.junit.Test;

import static org.hamcrest.core.Is.is;
import static org.hamcrest.number.OrderingComparisons.greaterThan;
import static org.hamcrest.Matchers.greaterThan;
import static org.junit.Assert.assertThat;

public class PurgeableSnapshotDtoTest {

+ 1
- 1
sonar-core/src/test/java/org/sonar/core/resource/ResourceIndexerDaoTest.java Wyświetl plik

@@ -29,7 +29,7 @@ import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;

import static org.hamcrest.number.OrderingComparisons.greaterThan;
import static org.hamcrest.Matchers.greaterThan;
import static org.junit.Assert.assertThat;

public class ResourceIndexerDaoTest extends AbstractDaoTestCase {

+ 1
- 1
sonar-core/src/test/java/org/sonar/core/rule/CacheRuleFinderTest.java Wyświetl plik

@@ -25,7 +25,7 @@ import org.sonar.api.rules.RuleFinder;
import org.sonar.core.rule.CacheRuleFinder;
import org.sonar.jpa.test.AbstractDbUnitTestCase;

import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNull.notNullValue;
import static org.junit.Assert.assertThat;

+ 1
- 1
sonar-core/src/test/java/org/sonar/jpa/session/DatabaseSessionTest.java Wyświetl plik

@@ -20,9 +20,9 @@
package org.sonar.jpa.session;

import org.hamcrest.Matchers;
import org.hamcrest.core.IsCollectionContaining;
import org.junit.Before;
import org.junit.Test;
import org.junit.internal.matchers.IsCollectionContaining;
import org.sonar.api.database.model.MeasureModel;
import org.sonar.api.database.model.ResourceModel;
import org.sonar.api.database.model.Snapshot;

+ 6
- 1
sonar-deprecated/pom.xml Wyświetl plik

@@ -30,6 +30,11 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sonar-plugin-api</artifactId>
@@ -40,7 +45,7 @@

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>

+ 1
- 1
sonar-deprecated/src/test/java/org/sonar/api/resources/MethodTest.java Wyświetl plik

@@ -21,7 +21,7 @@ package org.sonar.api.resources;

import org.junit.Test;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

public class MethodTest {

+ 1
- 1
sonar-deprecated/src/test/java/org/sonar/api/utils/CoberturaReportParserUtilsTest.java Wyświetl plik

@@ -35,7 +35,7 @@ import org.sonar.api.utils.CoberturaReportParserUtils.FileResolver;
import java.io.File;
import java.net.URISyntaxException;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.is;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyDouble;
import static org.mockito.Matchers.argThat;

+ 1
- 1
sonar-duplications/pom.xml Wyświetl plik

@@ -65,7 +65,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>

+ 1
- 1
sonar-duplications/src/test/java/org/sonar/duplications/block/BlockChunkerTestCase.java Wyświetl plik

@@ -26,7 +26,7 @@ import org.sonar.duplications.statement.Statement;
import java.util.Collections;
import java.util.List;

import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.assertThat;

/**

+ 3
- 3
sonar-duplications/src/test/java/org/sonar/duplications/detector/CloneGroupMatcher.java Wyświetl plik

@@ -19,17 +19,17 @@
*/
package org.sonar.duplications.detector;

import org.hamcrest.CoreMatchers;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;
import org.hamcrest.TypeSafeMatcher;
import org.sonar.duplications.index.CloneGroup;
import org.sonar.duplications.index.ClonePart;

public class CloneGroupMatcher extends TypeSafeMatcher<CloneGroup> {

public static Matcher<Iterable<CloneGroup>> hasCloneGroup(int expectedLen, ClonePart... expectedParts) {
return Matchers.hasItem(new CloneGroupMatcher(expectedLen, expectedParts));
public static Matcher<Iterable<? super CloneGroup>> hasCloneGroup(int expectedLen, ClonePart... expectedParts) {
return CoreMatchers.hasItem(new CloneGroupMatcher(expectedLen, expectedParts));
}

private final int expectedLen;

+ 2
- 2
sonar-duplications/src/test/java/org/sonar/duplications/detector/DetectorTestCase.java Wyświetl plik

@@ -34,8 +34,8 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.List;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.sameInstance;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.sameInstance;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.matchers.JUnitMatchers.hasItem;

+ 1
- 1
sonar-duplications/src/test/java/org/sonar/duplications/detector/original/BlocksGroupTest.java Wyświetl plik

@@ -22,7 +22,7 @@ package org.sonar.duplications.detector.original;
import org.junit.Test;
import org.sonar.duplications.block.Block;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

public class BlocksGroupTest {

+ 10
- 12
sonar-duplications/src/test/java/org/sonar/duplications/detector/suffixtree/SuffixTreeTest.java Wyświetl plik

@@ -19,24 +19,22 @@
*/
package org.sonar.duplications.detector.suffixtree;

import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.lessThan;
import static org.junit.Assert.assertThat;

import java.util.Arrays;
import java.util.Collection;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

import java.util.Arrays;
import java.util.Collection;

import static org.fest.assertions.Assertions.assertThat;

@RunWith(Parameterized.class)
public class SuffixTreeTest {

@Parameters
public static Collection<Object[]> generateData() {
return Arrays.asList(new Object[][] { { "banana" }, { "mississippi" }, { "book" }, { "bookke" }, { "cacao" }, { "googol" }, { "abababc" }, { "aaaaa" } });
return Arrays.asList(new Object[][] { {"banana"}, {"mississippi"}, {"book"}, {"bookke"}, {"cacao"}, {"googol"}, {"abababc"}, {"aaaaa"}});
}

private final String data;
@@ -50,14 +48,14 @@ public class SuffixTreeTest {
String text = this.data + "$";
StringSuffixTree tree = StringSuffixTree.create(text);

assertThat("number of leaves", tree.getNumberOfLeafs(), is(text.length()));
assertThat("number of inner nodes", tree.getNumberOfInnerNodes(), lessThan(text.length() - 1));
assertThat("number of edges", tree.getNumberOfEdges(), is(tree.getNumberOfInnerNodes() + tree.getNumberOfLeafs()));
assertThat(tree.getNumberOfLeafs()).as("number of leaves").isEqualTo(text.length());
assertThat(tree.getNumberOfInnerNodes()).as("number of inner nodes").isLessThan(text.length() - 1);
assertThat(tree.getNumberOfEdges()).as("number of edges").isEqualTo(tree.getNumberOfInnerNodes() + tree.getNumberOfLeafs());

for (int beginIndex = 0; beginIndex < text.length(); beginIndex++) {
for (int endIndex = beginIndex + 1; endIndex < text.length() + 1; endIndex++) {
String substring = text.substring(beginIndex, endIndex);
assertThat("index of " + substring + " in " + text, tree.indexOf(substring), is(text.indexOf(substring)));
assertThat(tree.indexOf(substring)).as("index of " + substring + " in " + text).isEqualTo(text.indexOf(substring));
}
}
}

+ 1
- 1
sonar-duplications/src/test/java/org/sonar/duplications/internal/pmd/TokenizerBridgeTest.java Wyświetl plik

@@ -29,7 +29,7 @@ import org.junit.Test;
import java.io.IOException;
import java.util.List;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

public class TokenizerBridgeTest {

+ 1
- 1
sonar-duplications/src/test/java/org/sonar/duplications/java/JavaDuplicationsFunctionalTest.java Wyświetl plik

@@ -35,7 +35,7 @@ import org.sonar.duplications.token.TokenChunker;
import java.util.Collection;
import java.util.List;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

/**

+ 3
- 3
sonar-duplications/src/test/java/org/sonar/duplications/java/JavaTokenProducerTest.java Wyświetl plik

@@ -23,6 +23,7 @@ import com.google.common.base.Charsets;
import com.google.common.collect.Lists;
import org.apache.commons.io.IOUtils;
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;
import org.junit.Test;
import org.sonar.duplications.DuplicationsTestUtil;
import org.sonar.duplications.token.Token;
@@ -37,7 +38,6 @@ import java.io.Reader;
import java.util.Arrays;
import java.util.List;

import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

@@ -303,10 +303,10 @@ public class JavaTokenProducerTest {
@Test
public void realExamples() {
File testFile = DuplicationsTestUtil.findFile("/java/MessageResources.java");
assertThat(chunk(testFile).size(), greaterThan(0));
assertThat(chunk(testFile).size(), Matchers.greaterThan(0));

testFile = DuplicationsTestUtil.findFile("/java/RequestUtils.java");
assertThat(chunk(testFile).size(), greaterThan(0));
assertThat(chunk(testFile).size(), Matchers.greaterThan(0));
}

private TokenQueue chunk(File file) {

+ 1
- 1
sonar-duplications/src/test/java/org/sonar/duplications/statement/StatementChannelTest.java Wyświetl plik

@@ -19,7 +19,7 @@
*/
package org.sonar.duplications.statement;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;

+ 6
- 1
sonar-home/pom.xml Wyświetl plik

@@ -38,6 +38,11 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easytesting</groupId>
<artifactId>fest-assert</artifactId>
@@ -51,7 +56,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>

+ 1
- 1
sonar-java-api/src/test/java/org/sonar/java/api/JavaClassTest.java Wyświetl plik

@@ -23,7 +23,7 @@ import org.junit.Test;
import org.sonar.api.resources.Java;
import org.sonar.api.resources.Language;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

public class JavaClassTest {

+ 1
- 1
sonar-java-api/src/test/java/org/sonar/java/api/JavaMethodTest.java Wyświetl plik

@@ -21,7 +21,7 @@ package org.sonar.java.api;

import org.junit.Test;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

public class JavaMethodTest {

+ 1
- 1
sonar-java-api/src/test/java/org/sonar/java/api/JavaUtilsTest.java Wyświetl plik

@@ -19,7 +19,7 @@
*/
package org.sonar.java.api;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

import org.apache.commons.configuration.BaseConfiguration;

+ 5
- 0
sonar-markdown/pom.xml Wyświetl plik

@@ -41,6 +41,11 @@
<artifactId>fest-assert</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>

+ 6
- 1
sonar-maven-plugin/pom.xml Wyświetl plik

@@ -41,9 +41,14 @@
<artifactId>junit</artifactId>
<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>
<dependency>

+ 1
- 1
sonar-plugin-api/pom.xml Wyświetl plik

@@ -157,7 +157,7 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>

+ 1
- 1
sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectDefinitionTest.java Wyświetl plik

@@ -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;


+ 1
- 1
sonar-plugin-api/src/test/java/org/sonar/api/batch/maven/MavenUtilsTest.java Wyświetl plik

@@ -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;


+ 4
- 2
sonar-plugin-api/src/test/java/org/sonar/api/config/AesCipherTest.java Wyświetl plik

@@ -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));
}
}


+ 1
- 1
sonar-plugin-api/src/test/java/org/sonar/api/config/EncryptionTest.java Wyświetl plik

@@ -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 {

+ 1
- 1
sonar-plugin-api/src/test/java/org/sonar/api/measures/CountDistributionBuilderTest.java Wyświetl plik

@@ -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;

+ 1
- 1
sonar-plugin-api/src/test/java/org/sonar/api/measures/MeanAggregationFormulaTest.java Wyświetl plik

@@ -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;

+ 1
- 1
sonar-plugin-api/src/test/java/org/sonar/api/measures/MeasureUtilsTest.java Wyświetl plik

@@ -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;

+ 1
- 1
sonar-plugin-api/src/test/java/org/sonar/api/measures/PersistenceModeTest.java Wyświetl plik

@@ -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;


+ 1
- 1
sonar-plugin-api/src/test/java/org/sonar/api/measures/PropertiesBuilderTest.java Wyświetl plik

@@ -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;

+ 2
- 2
sonar-plugin-api/src/test/java/org/sonar/api/measures/SumChildDistributionFormulaTest.java Wyświetl plik

@@ -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;

+ 2
- 2
sonar-plugin-api/src/test/java/org/sonar/api/resources/DirectoryTest.java Wyświetl plik

@@ -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;

+ 2
- 2
sonar-plugin-api/src/test/java/org/sonar/api/resources/FileTest.java Wyświetl plik

@@ -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;

+ 1
- 1
sonar-plugin-api/src/test/java/org/sonar/api/resources/ResourceTypeTreeTest.java Wyświetl plik

@@ -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;

+ 3
- 3
sonar-plugin-api/src/test/java/org/sonar/api/utils/DateUtilsTest.java Wyświetl plik

@@ -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 {

+ 1
- 1
sonar-plugin-api/src/test/java/org/sonar/api/utils/DeprecatedKeyValueFormatTest.java Wyświetl plik

@@ -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 {

+ 2
- 2
sonar-plugin-api/src/test/java/org/sonar/api/utils/KeyValueFormatTest.java Wyświetl plik

@@ -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 {

+ 1
- 1
sonar-plugin-api/src/test/java/org/sonar/api/utils/LocalizedMessagesTest.java Wyświetl plik

@@ -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;


+ 1
- 1
sonar-plugin-api/src/test/java/org/sonar/api/utils/ParsingUtilsTest.java Wyświetl plik

@@ -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;


+ 1
- 1
sonar-plugin-api/src/test/java/org/sonar/api/utils/WildcardPatternTest.java Wyświetl plik

@@ -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;

+ 1
- 1
sonar-plugin-api/src/test/java/org/sonar/api/web/AbstractRubyTemplateTest.java Wyświetl plik

@@ -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;

+ 6
- 6
sonar-server/pom.xml Wyświetl plik

@@ -177,7 +177,12 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
@@ -195,11 +200,6 @@
<artifactId>jsonassert</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>

+ 3
- 2
sonar-server/src/test/java/org/sonar/server/platform/ClassLoaderUtilsTest.java Wyświetl plik

@@ -34,6 +34,7 @@ import org.junit.rules.TemporaryFolder;

import javax.annotation.Nullable;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Collection;
@@ -96,7 +97,7 @@ public class ClassLoaderUtilsTest {
}

@Test
public void copyRubyRailsApp() {
public void copyRubyRailsApp() throws IOException {
File toDir = temp.newFolder("dest");
ClassLoaderUtils.copyResources(classLoader, "org/sonar/sqale", toDir, Functions.<String>identity());

@@ -106,7 +107,7 @@ public class ClassLoaderUtilsTest {
}

@Test
public void copyRubyRailsApp_relocate_files() {
public void copyRubyRailsApp_relocate_files() throws IOException {
File toDir = temp.newFolder("dest");
ClassLoaderUtils.copyResources(classLoader, "org/sonar/sqale", toDir, new Function<String, String>() {
public String apply(@Nullable String path) {

+ 1
- 1
sonar-server/src/test/java/org/sonar/server/platform/RailsAppsDeployerTest.java Wyświetl plik

@@ -32,7 +32,7 @@ import java.net.URL;
import java.net.URLClassLoader;
import java.util.Collections;

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;

+ 1
- 1
sonar-server/src/test/java/org/sonar/server/platform/ServerIdGeneratorTest.java Wyświetl plik

@@ -28,7 +28,7 @@ import java.net.InetAddress;
import java.net.UnknownHostException;

import static org.fest.assertions.Assertions.assertThat;
import static org.hamcrest.text.StringStartsWith.startsWith;
import static org.hamcrest.Matchers.startsWith;
import static org.junit.Assert.assertThat;

public class ServerIdGeneratorTest {

+ 2
- 2
sonar-server/src/test/java/org/sonar/server/ui/ViewProxyTest.java Wyświetl plik

@@ -38,9 +38,9 @@ import java.util.List;

import static com.google.common.collect.Iterables.getOnlyElement;
import static org.fest.assertions.Assertions.assertThat;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.lessThan;
import static org.hamcrest.number.OrderingComparisons.greaterThan;
import static org.hamcrest.Matchers.greaterThan;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertThat;


+ 4
- 4
sonar-testing-harness/pom.xml Wyświetl plik

@@ -16,10 +16,6 @@
<groupId>org.easytesting</groupId>
<artifactId>fest-assert</artifactId>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
</dependency>
<dependency>
<groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId>
@@ -32,6 +28,10 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
</dependency>
<dependency>
<!-- used only for org.sonar.test.channel classes -->
<groupId>org.codehaus.sonar</groupId>

+ 25
- 20
sonar-testing-harness/src/test/java/org/sonar/test/i18n/BundleSynchronizedMatcherTest.java Wyświetl plik

@@ -31,20 +31,16 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.SortedMap;

import static org.fest.assertions.Assertions.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.hasItem;
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 junit.framework.TestCase.fail;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

public class BundleSynchronizedMatcherTest {

@Rule
public ExpectedException thrown = ExpectedException.none();

private BundleSynchronizedMatcher matcher;
BundleSynchronizedMatcher matcher;

@Before
public void init() {
@@ -76,26 +72,31 @@ public class BundleSynchronizedMatcherTest {

@Test
public void shouldNotMatchIfNotString() {
assertThat(matcher.matches(3)).isFalse();
assertThat(matcher.matches(3), is(false));
}

@Test
public void testGetBundleFileFromClasspath() {
// OK
assertThat(BundleSynchronizedMatcher.getBundleFileInputStream("myPlugin_fr.properties"))
.isNotNull();
assertThat(BundleSynchronizedMatcher.getBundleFileInputStream("myPlugin_fr.properties"), notNullValue());

// KO
thrown.expect(AssertionError.class);
thrown.expectMessage("File 'unexistingBundle.properties' does not exist in '/org/sonar/l10n/'.");
BundleSynchronizedMatcher.getBundleFileInputStream("unexistingBundle.properties");
try {
BundleSynchronizedMatcher.getBundleFileInputStream("unexistingBundle.properties");
fail();
} catch (AssertionError e) {
assertThat(e.getMessage(), startsWith("File 'unexistingBundle.properties' does not exist in '/org/sonar/l10n/'."));
}
}

@Test
public void testGetDefaultBundleFileFromClasspath() {
thrown.expect(AssertionError.class);
thrown.expectMessage("Default bundle 'unexistingBundle.properties' could not be found: add a dependency to the corresponding plugin in your POM.");
BundleSynchronizedMatcher.getDefaultBundleFileInputStream("unexistingBundle_fr.properties");
try {
BundleSynchronizedMatcher.getDefaultBundleFileInputStream("unexistingBundle_fr.properties");
fail();
} catch (AssertionError e) {
assertThat(e.getMessage(), startsWith("Default bundle 'unexistingBundle.properties' could not be found: add a dependency to the corresponding plugin in your POM."));
}
}

@Test
@@ -105,9 +106,13 @@ public class BundleSynchronizedMatcherTest {
assertThat(BundleSynchronizedMatcher.extractDefaultBundleName("myPlugin_fr_QB.properties"), is("myPlugin.properties"));

// KO
thrown.expect(AssertionError.class);
thrown.expectMessage("The bundle 'myPlugin.properties' is a default bundle (without locale), so it can't be compared.");
BundleSynchronizedMatcher.extractDefaultBundleName("myPlugin.properties");

try {
BundleSynchronizedMatcher.extractDefaultBundleName("myPlugin.properties");
fail();
} catch (AssertionError e) {
assertThat(e.getMessage(), startsWith("The bundle 'myPlugin.properties' is a default bundle (without locale), so it can't be compared."));
}
}

@Test

+ 5
- 5
sonar-ws-client/pom.xml Wyświetl plik

@@ -51,18 +51,18 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>

+ 6
- 11
sonar-ws-client/src/test/java/org/sonar/wsclient/SonarTest.java Wyświetl plik

@@ -20,6 +20,7 @@
package org.sonar.wsclient;

import org.eclipse.jetty.testing.ServletTester;
import org.hamcrest.Matchers;
import org.junit.AfterClass;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,17 +33,11 @@ import org.sonar.wsclient.services.MetricQuery;
import org.sonar.wsclient.services.Query;
import org.sonar.wsclient.services.Server;
import org.sonar.wsclient.services.ServerQuery;
import org.sonar.wsclient.unmarshallers.UnmarshalException;

import java.util.Arrays;
import java.util.Collection;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.number.OrderingComparisons.greaterThan;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import static org.junit.internal.matchers.StringContains.containsString;

@RunWith(value = Parameterized.class)
public class SonarTest {
@@ -86,20 +81,20 @@ public class SonarTest {
@Test
public void findAll() {
Collection<Metric> metrics = sonar.findAll(MetricQuery.all());
assertThat(metrics.size(), greaterThan(1));
assertThat(metrics.size(), Matchers.greaterThan(1));
}

@Test
public void findEmptyResults() {
Query<Metric> query = new EmptyQuery();
Collection<Metric> metrics = sonar.findAll(query);
assertThat(metrics.size(), is(0));
assertThat(metrics.size(), Matchers.is(0));
}

@Test
public void returnNullWhenSingleResultNotFound() {
Query<Metric> query = new EmptyQuery();
assertThat(sonar.find(query), nullValue());
assertThat(sonar.find(query), Matchers.nullValue());
}

@Test(expected = ConnectionException.class)
@@ -111,8 +106,8 @@ public class SonarTest {
@Test
public void getVersion() {
Server server = sonar.find(new ServerQuery());
assertThat(server.getId(), is("123456789"));
assertThat(server.getVersion(), is("2.0"));
assertThat(server.getId(), Matchers.is("123456789"));
assertThat(server.getVersion(), Matchers.is("2.0"));
}

static class EmptyQuery extends Query<Metric> {

+ 2
- 2
sonar-ws-client/src/test/java/org/sonar/wsclient/services/ResourceTest.java Wyświetl plik

@@ -21,8 +21,8 @@ package org.sonar.wsclient.services;

import org.junit.Test;

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 ResourceTest {

+ 1
- 1
sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/DependencyUnmarshallerTest.java Wyświetl plik

@@ -24,7 +24,7 @@ import org.sonar.wsclient.services.Dependency;

import java.util.Collection;

import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;


+ 2
- 2
sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/JsonUtilsTest.java Wyświetl plik

@@ -26,8 +26,8 @@ import org.junit.Test;
import java.util.Date;
import java.util.TimeZone;

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 JsonUtilsTest extends UnmarshallerTestCase {

+ 1
- 1
sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ManualMeasureUnmarshallerTest.java Wyświetl plik

@@ -24,7 +24,7 @@ import org.sonar.wsclient.services.ManualMeasure;

import java.util.List;

import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;


+ 1
- 1
sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/MetricUnmarshallerTest.java Wyświetl plik

@@ -24,7 +24,7 @@ import org.sonar.wsclient.services.Metric;

import java.util.Collection;

import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;

+ 1
- 1
sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ProfileUnmarshallerTest.java Wyświetl plik

@@ -23,7 +23,7 @@ import org.hamcrest.CoreMatchers;
import org.junit.Test;
import org.sonar.wsclient.services.Profile;

import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;


+ 1
- 1
sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/PropertyUnmarshallerTest.java Wyświetl plik

@@ -24,7 +24,7 @@ import org.sonar.wsclient.services.Property;

import java.util.Collection;

import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;


+ 1
- 1
sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ResourceSearchUnmarshallerTest.java Wyświetl plik

@@ -23,7 +23,7 @@ import org.junit.Test;
import org.sonar.wsclient.services.ResourceSearchResult;
import org.sonar.wsclient.services.Server;

import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;


+ 2
- 2
sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ResourceUnmarshallerTest.java Wyświetl plik

@@ -24,8 +24,8 @@ import org.sonar.wsclient.services.Resource;

import java.util.List;

import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;


+ 1
- 1
sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ServerSetupUnmarshallerTest.java Wyświetl plik

@@ -22,7 +22,7 @@ package org.sonar.wsclient.unmarshallers;
import org.junit.Test;
import org.sonar.wsclient.services.ServerSetup;

import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;


+ 0
- 0
sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ServerUnmarshallerTest.java Wyświetl plik


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików

Ładowanie…
Anuluj
Zapisz