diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2016-10-20 11:14:12 +0200 |
---|---|---|
committer | Julien HENRY <henryju@yahoo.fr> | 2016-10-21 13:17:30 +0200 |
commit | f8703a4155668ee958bd38d59776c1415fce0f82 (patch) | |
tree | d07fed881bf1d2beb3ef2db8c0ecea60dc12d8b1 /plugins/sonar-xoo-plugin | |
parent | 87660673df0efcb981b8bd1c831d3df33e75810a (diff) | |
download | sonarqube-f8703a4155668ee958bd38d59776c1415fce0f82.tar.gz sonarqube-f8703a4155668ee958bd38d59776c1415fce0f82.zip |
SONAR-8281 Update SensorContextTester to no more expose coverage type
Diffstat (limited to 'plugins/sonar-xoo-plugin')
3 files changed, 18 insertions, 30 deletions
diff --git a/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/coverage/ItCoverageSensorTest.java b/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/coverage/ItCoverageSensorTest.java index 2175768d03e..0b8c81f6c81 100644 --- a/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/coverage/ItCoverageSensorTest.java +++ b/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/coverage/ItCoverageSensorTest.java @@ -19,6 +19,8 @@ */ package org.sonar.xoo.coverage; +import java.io.File; +import java.io.IOException; import org.apache.commons.io.FileUtils; import org.junit.Before; import org.junit.Rule; @@ -26,13 +28,9 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.rules.TemporaryFolder; import org.sonar.api.batch.fs.internal.DefaultInputFile; -import org.sonar.api.batch.sensor.coverage.CoverageType; import org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor; import org.sonar.api.batch.sensor.internal.SensorContextTester; -import java.io.File; -import java.io.IOException; - import static org.assertj.core.api.Assertions.assertThat; public class ItCoverageSensorTest { @@ -76,7 +74,7 @@ public class ItCoverageSensorTest { sensor.execute(context); - assertThat(context.lineHits("foo:src/foo.xoo", CoverageType.IT, 1)).isEqualTo(3); + assertThat(context.lineHits("foo:src/foo.xoo", 1)).isEqualTo(3); } @Test @@ -88,8 +86,8 @@ public class ItCoverageSensorTest { sensor.execute(context); - assertThat(context.lineHits("foo:src/foo.xoo", CoverageType.IT, 1)).isEqualTo(3); - assertThat(context.conditions("foo:src/foo.xoo", CoverageType.IT, 1)).isEqualTo(4); - assertThat(context.coveredConditions("foo:src/foo.xoo", CoverageType.IT, 1)).isEqualTo(2); + assertThat(context.lineHits("foo:src/foo.xoo", 1)).isEqualTo(3); + assertThat(context.conditions("foo:src/foo.xoo", 1)).isEqualTo(4); + assertThat(context.coveredConditions("foo:src/foo.xoo", 1)).isEqualTo(2); } } diff --git a/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/coverage/OverallCoverageSensorTest.java b/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/coverage/OverallCoverageSensorTest.java index 401c0b6f388..825760416e3 100644 --- a/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/coverage/OverallCoverageSensorTest.java +++ b/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/coverage/OverallCoverageSensorTest.java @@ -19,6 +19,8 @@ */ package org.sonar.xoo.coverage; +import java.io.File; +import java.io.IOException; import org.apache.commons.io.FileUtils; import org.junit.Before; import org.junit.Rule; @@ -26,13 +28,9 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.rules.TemporaryFolder; import org.sonar.api.batch.fs.internal.DefaultInputFile; -import org.sonar.api.batch.sensor.coverage.CoverageType; import org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor; import org.sonar.api.batch.sensor.internal.SensorContextTester; -import java.io.File; -import java.io.IOException; - import static org.assertj.core.api.Assertions.assertThat; public class OverallCoverageSensorTest { @@ -76,7 +74,7 @@ public class OverallCoverageSensorTest { sensor.execute(context); - assertThat(context.lineHits("foo:src/foo.xoo", CoverageType.OVERALL, 1)).isEqualTo(3); + assertThat(context.lineHits("foo:src/foo.xoo", 1)).isEqualTo(3); } @Test @@ -88,8 +86,8 @@ public class OverallCoverageSensorTest { sensor.execute(context); - assertThat(context.lineHits("foo:src/foo.xoo", CoverageType.OVERALL, 1)).isEqualTo(3); - assertThat(context.conditions("foo:src/foo.xoo", CoverageType.OVERALL, 1)).isEqualTo(4); - assertThat(context.coveredConditions("foo:src/foo.xoo", CoverageType.OVERALL, 1)).isEqualTo(2); + assertThat(context.lineHits("foo:src/foo.xoo", 1)).isEqualTo(3); + assertThat(context.conditions("foo:src/foo.xoo", 1)).isEqualTo(4); + assertThat(context.coveredConditions("foo:src/foo.xoo", 1)).isEqualTo(2); } } diff --git a/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/coverage/UtCoverageSensorTest.java b/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/coverage/UtCoverageSensorTest.java index 62fb62b8449..129e430f0c6 100644 --- a/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/coverage/UtCoverageSensorTest.java +++ b/plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/coverage/UtCoverageSensorTest.java @@ -19,6 +19,8 @@ */ package org.sonar.xoo.coverage; +import java.io.File; +import java.io.IOException; import org.apache.commons.io.FileUtils; import org.junit.Before; import org.junit.Rule; @@ -26,13 +28,9 @@ import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.rules.TemporaryFolder; import org.sonar.api.batch.fs.internal.DefaultInputFile; -import org.sonar.api.batch.sensor.coverage.CoverageType; import org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor; import org.sonar.api.batch.sensor.internal.SensorContextTester; -import java.io.File; -import java.io.IOException; - import static org.assertj.core.api.Assertions.assertThat; public class UtCoverageSensorTest { @@ -76,9 +74,7 @@ public class UtCoverageSensorTest { sensor.execute(context); - assertThat(context.lineHits("foo:src/foo.xoo", CoverageType.UNIT, 1)).isEqualTo(3); - assertThat(context.lineHits("foo:src/foo.xoo", CoverageType.IT, 1)).isNull(); - assertThat(context.lineHits("foo:src/foo.xoo", CoverageType.OVERALL, 1)).isNull(); + assertThat(context.lineHits("foo:src/foo.xoo", 1)).isEqualTo(3); } @Test @@ -90,12 +86,8 @@ public class UtCoverageSensorTest { sensor.execute(context); - assertThat(context.lineHits("foo:src/foo.xoo", CoverageType.UNIT, 1)).isEqualTo(3); - assertThat(context.conditions("foo:src/foo.xoo", CoverageType.UNIT, 1)).isEqualTo(4); - assertThat(context.conditions("foo:src/foo.xoo", CoverageType.IT, 1)).isNull(); - assertThat(context.conditions("foo:src/foo.xoo", CoverageType.OVERALL, 1)).isNull(); - assertThat(context.coveredConditions("foo:src/foo.xoo", CoverageType.UNIT, 1)).isEqualTo(2); - assertThat(context.coveredConditions("foo:src/foo.xoo", CoverageType.IT, 1)).isNull(); - assertThat(context.coveredConditions("foo:src/foo.xoo", CoverageType.OVERALL, 1)).isNull(); + assertThat(context.lineHits("foo:src/foo.xoo", 1)).isEqualTo(3); + assertThat(context.conditions("foo:src/foo.xoo", 1)).isEqualTo(4); + assertThat(context.coveredConditions("foo:src/foo.xoo", 1)).isEqualTo(2); } } |