From: Simon Brandhof Date: Mon, 29 Feb 2016 14:06:59 +0000 (+0100) Subject: Remove unused annotation @DbTests X-Git-Tag: 5.5-M6~41 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=48d5099ff593ac7ec66cbdf69572019cf952037d;p=sonarqube.git Remove unused annotation @DbTests --- diff --git a/server/sonar-server/src/test/java/org/sonar/server/activity/index/ActivityResultSetIteratorTest.java b/server/sonar-server/src/test/java/org/sonar/server/activity/index/ActivityResultSetIteratorTest.java index 26ac3f4c71a..6a49a0b1af5 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/activity/index/ActivityResultSetIteratorTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/activity/index/ActivityResultSetIteratorTest.java @@ -25,15 +25,13 @@ import org.elasticsearch.action.update.UpdateRequest; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.DateUtils; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class ActivityResultSetIteratorTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/batch/IssuesActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/batch/IssuesActionTest.java index 4b89eb124db..9e1d18b0a36 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/batch/IssuesActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/batch/IssuesActionTest.java @@ -26,7 +26,6 @@ import org.junit.Before; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.config.Settings; import org.sonar.api.platform.Server; @@ -50,13 +49,12 @@ import org.sonar.server.issue.index.IssueIndexDefinition; import org.sonar.server.issue.index.IssueIndexer; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static com.google.common.collect.Lists.newArrayList; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; -@Category(DbTests.class) + public class IssuesActionTest { final static String PROJECT_KEY = "struts"; diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/ComponentFinderTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/ComponentFinderTest.java index f2f21566f44..8902b9a0a59 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/component/ComponentFinderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/component/ComponentFinderTest.java @@ -21,7 +21,6 @@ package org.sonar.server.component; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.db.DbSession; @@ -29,13 +28,12 @@ import org.sonar.db.DbTester; import org.sonar.db.component.ComponentDbTester; import org.sonar.db.component.ComponentDto; import org.sonar.server.exceptions.NotFoundException; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.db.component.ComponentTesting.newProjectDto; import static org.sonar.server.component.ComponentFinder.ParamNames.ID_AND_KEY; -@Category(DbTests.class) + public class ComponentFinderTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/ComponentServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/ComponentServiceTest.java index 9174296e265..054af12960b 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/component/ComponentServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/component/ComponentServiceTest.java @@ -27,7 +27,6 @@ import org.assertj.core.api.Fail; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; import org.sonar.api.i18n.I18n; @@ -45,7 +44,6 @@ import org.sonar.server.exceptions.BadRequestException; import org.sonar.server.exceptions.ForbiddenException; import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.tester.UserSessionRule; -import org.sonar.test.DbTests; import static com.google.common.collect.Lists.newArrayList; import static org.assertj.core.api.Assertions.assertThat; @@ -59,7 +57,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.sonar.core.permission.GlobalPermissions.PROVISIONING; -@Category(DbTests.class) + public class ComponentServiceTest { System2 system2 = System2.INSTANCE; diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/ws/SearchViewComponentsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/ws/SearchViewComponentsActionTest.java index b1f6c800912..19081b3c698 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/component/ws/SearchViewComponentsActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/component/ws/SearchViewComponentsActionTest.java @@ -22,7 +22,6 @@ package org.sonar.server.component.ws; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.server.ws.WebService.Param; import org.sonar.api.utils.System2; @@ -32,11 +31,10 @@ import org.sonar.server.component.ComponentFinder; import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static org.mockito.Mockito.mock; -@Category(DbTests.class) + public class SearchViewComponentsActionTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/ws/ShowActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/ws/ShowActionTest.java index 28402bb663a..571cd76d854 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/component/ws/ShowActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/component/ws/ShowActionTest.java @@ -25,7 +25,6 @@ import java.io.InputStream; import javax.annotation.Nullable; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.resources.Qualifiers; import org.sonar.api.utils.System2; @@ -41,7 +40,6 @@ import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.TestRequest; import org.sonar.server.ws.WsActionTester; -import org.sonar.test.DbTests; import org.sonarqube.ws.MediaTypes; import org.sonarqube.ws.WsComponents.ShowWsResponse; @@ -53,7 +51,7 @@ import static org.sonar.test.JsonAssert.assertJson; import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_ID; import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_KEY; -@Category(DbTests.class) + public class ShowActionTest { @Rule public ExpectedException expectedException = ExpectedException.none(); diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/ws/TreeActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/ws/TreeActionTest.java index b2616105467..015d4e35673 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/component/ws/TreeActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/component/ws/TreeActionTest.java @@ -32,7 +32,6 @@ import org.apache.commons.io.IOUtils; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.mockito.Mockito; import org.sonar.api.i18n.I18n; @@ -54,7 +53,6 @@ import org.sonar.server.exceptions.ForbiddenException; import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsActionTester; -import org.sonar.test.DbTests; import org.sonar.test.JsonAssert; import org.sonarqube.ws.MediaTypes; import org.sonarqube.ws.WsComponents; @@ -70,7 +68,7 @@ import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_BAS import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_QUALIFIERS; import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_STRATEGY; -@Category(DbTests.class) + public class TreeActionTest { @Rule public ExpectedException expectedException = ExpectedException.none(); diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/component/SettingsRepositoryTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/component/SettingsRepositoryTest.java index ecb9a0cb0fc..a51fe7a8e68 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/component/SettingsRepositoryTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/component/SettingsRepositoryTest.java @@ -23,23 +23,21 @@ import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.config.Settings; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; import org.sonar.db.DbSession; import org.sonar.db.DbTester; import org.sonar.db.component.ComponentDto; +import org.sonar.db.component.ComponentTesting; import org.sonar.db.property.PropertiesDao; import org.sonar.db.property.PropertyDto; -import org.sonar.db.component.ComponentTesting; import org.sonar.server.properties.ProjectSettingsFactory; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.server.computation.component.Component.Type.PROJECT; -@Category(DbTests.class) + public class SettingsRepositoryTest { private static final Component ROOT = ReportComponent.builder(PROJECT, 1).setKey("ROOT").build(); diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MapBasedRawMeasureRepositoryTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MapBasedRawMeasureRepositoryTest.java index d824f8bc7d3..59c5203aefd 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MapBasedRawMeasureRepositoryTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MapBasedRawMeasureRepositoryTest.java @@ -33,7 +33,6 @@ import javax.annotation.Nullable; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.sonar.api.rule.RuleKey; @@ -50,7 +49,6 @@ import org.sonar.server.computation.metric.Metric; import org.sonar.server.computation.metric.MetricImpl; import org.sonar.server.computation.metric.MetricRepository; import org.sonar.server.computation.metric.ReportMetricValidator; -import org.sonar.test.DbTests; import static com.google.common.collect.FluentIterable.from; import static java.lang.String.format; @@ -62,7 +60,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; @RunWith(DataProviderRunner.class) -@Category(DbTests.class) + public class MapBasedRawMeasureRepositoryTest { @Rule public DbTester dbTester = DbTester.create(System2.INSTANCE); diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/metric/MetricRepositoryImplTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/metric/MetricRepositoryImplTest.java index b73340b2af8..5ddc98e7621 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/metric/MetricRepositoryImplTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/metric/MetricRepositoryImplTest.java @@ -22,16 +22,14 @@ package org.sonar.server.computation.metric; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class MetricRepositoryImplTest { private static final String SOME_KEY = "some_key"; private static final long SOME_ID = 156; diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ApplyPermissionsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ApplyPermissionsStepTest.java index 2dde7f4b0ff..bdd0e090e05 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ApplyPermissionsStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ApplyPermissionsStepTest.java @@ -27,7 +27,6 @@ import org.junit.Before; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.config.Settings; import org.sonar.api.security.DefaultGroups; import org.sonar.api.utils.System2; @@ -48,7 +47,6 @@ import org.sonar.server.computation.component.ViewsComponent; import org.sonar.server.es.EsTester; import org.sonar.server.issue.index.IssueAuthorizationIndexer; import org.sonar.server.issue.index.IssueIndexDefinition; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.db.component.ComponentTesting.newView; @@ -56,7 +54,7 @@ import static org.sonar.db.permission.PermissionTemplateTesting.newPermissionTem import static org.sonar.server.computation.component.Component.Type.PROJECT; import static org.sonar.server.computation.component.Component.Type.VIEW; -@Category(DbTests.class) + public class ApplyPermissionsStepTest extends BaseStepTest { private static final String ROOT_KEY = "ROOT_KEY"; diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/BuildComponentTreeStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/BuildComponentTreeStepTest.java index 3c112c1540a..f4493dc1213 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/BuildComponentTreeStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/BuildComponentTreeStepTest.java @@ -27,7 +27,6 @@ import java.util.Map; import javax.annotation.Nullable; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.sonar.api.utils.System2; import org.sonar.batch.protocol.Constants; @@ -42,7 +41,6 @@ import org.sonar.server.computation.analysis.MutableAnalysisMetadataHolderRule; import org.sonar.server.computation.batch.BatchReportReaderRule; import org.sonar.server.computation.component.Component; import org.sonar.server.computation.component.MutableTreeRootHolderRule; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.batch.protocol.Constants.ComponentType.DIRECTORY; @@ -55,7 +53,7 @@ import static org.sonar.db.component.ComponentTesting.newModuleDto; import static org.sonar.db.component.ComponentTesting.newProjectDto; import static org.sonar.db.component.SnapshotTesting.newSnapshotForProject; -@Category(DbTests.class) + @RunWith(DataProviderRunner.class) public class BuildComponentTreeStepTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/CustomMeasuresCopyStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/CustomMeasuresCopyStepTest.java index 9d83c4ec0e3..5179282d64d 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/CustomMeasuresCopyStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/CustomMeasuresCopyStepTest.java @@ -22,7 +22,6 @@ package org.sonar.server.computation.step; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; import org.sonar.db.DbTester; @@ -37,7 +36,6 @@ import org.sonar.server.computation.measure.MeasureRepositoryRule; import org.sonar.server.computation.metric.Metric; import org.sonar.server.computation.metric.MetricImpl; import org.sonar.server.computation.metric.MetricRepositoryRule; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.guava.api.Assertions.assertThat; @@ -54,7 +52,7 @@ import static org.sonar.server.computation.measure.MeasureRepoEntry.entryOf; import static org.sonar.server.computation.measure.MeasureRepoEntry.toEntries; import static org.sonar.server.computation.step.CustomMeasuresCopyStep.dtoToMeasure; -@Category(DbTests.class) + public class CustomMeasuresCopyStepTest { static final int PROJECT_REF = 1; diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/LoadPeriodsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/LoadPeriodsStepTest.java index c54057e3373..877425180ae 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/LoadPeriodsStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/LoadPeriodsStepTest.java @@ -27,7 +27,6 @@ import java.util.List; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.sonar.api.config.Settings; import org.sonar.api.utils.System2; @@ -42,7 +41,6 @@ import org.sonar.server.computation.component.SettingsRepository; import org.sonar.server.computation.component.ViewsComponent; import org.sonar.server.computation.period.Period; import org.sonar.server.computation.period.PeriodsHolderImpl; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; @@ -53,7 +51,7 @@ import static org.sonar.core.config.CorePropertyDefinitions.TIMEMACHINE_MODE_PRE import static org.sonar.core.config.CorePropertyDefinitions.TIMEMACHINE_MODE_PREVIOUS_VERSION; import static org.sonar.core.config.CorePropertyDefinitions.TIMEMACHINE_MODE_VERSION; -@Category(DbTests.class) + @RunWith(DataProviderRunner.class) public class LoadPeriodsStepTest extends BaseStepTest { diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistEventsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistEventsStepTest.java index 6e87c33ebc5..0d11cc44bbf 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistEventsStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistEventsStepTest.java @@ -25,7 +25,6 @@ import java.util.Date; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; import org.sonar.server.computation.analysis.AnalysisMetadataHolderRule; @@ -35,13 +34,12 @@ import org.sonar.server.computation.component.DbIdsRepositoryImpl; import org.sonar.server.computation.component.ReportComponent; import org.sonar.server.computation.event.Event; import org.sonar.server.computation.event.EventRepository; -import org.sonar.test.DbTests; import static org.mockito.Matchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -@Category(DbTests.class) + public class PersistEventsStepTest extends BaseStepTest { System2 system2 = mock(System2.class); diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistFileSourcesStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistFileSourcesStepTest.java index 87b65814ed8..f17ed019831 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistFileSourcesStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistFileSourcesStepTest.java @@ -23,7 +23,6 @@ import java.util.Arrays; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.batch.protocol.Constants; @@ -46,14 +45,13 @@ import org.sonar.server.computation.duplication.TextBlock; import org.sonar.server.computation.scm.Changeset; import org.sonar.server.computation.scm.ScmInfoRepositoryRule; import org.sonar.server.computation.source.SourceLinesRepositoryRule; -import org.sonar.test.DbTests; import static com.google.common.collect.Lists.newArrayList; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -@Category(DbTests.class) + public class PersistFileSourcesStepTest extends BaseStepTest { private static final int FILE_REF = 3; diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistMeasuresStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistMeasuresStepTest.java index 65c5c85f33d..3a93a3d00e9 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistMeasuresStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistMeasuresStepTest.java @@ -24,7 +24,6 @@ import java.util.Map; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.measures.Metric; import org.sonar.api.utils.System2; import org.sonar.core.util.Uuids; @@ -43,7 +42,6 @@ import org.sonar.server.computation.measure.MeasureRepositoryRule; import org.sonar.server.computation.measure.MeasureToMeasureDto; import org.sonar.server.computation.metric.MetricRepositoryRule; import org.sonar.server.computation.period.Period; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.api.measures.CoreMetrics.CLASS_COMPLEXITY_DISTRIBUTION; @@ -62,7 +60,7 @@ import static org.sonar.server.computation.component.Component.Type.VIEW; import static org.sonar.server.computation.measure.Measure.newMeasureBuilder; import static org.sonar.server.computation.measure.MeasureVariations.newMeasureVariationsBuilder; -@Category(DbTests.class) + public class PersistMeasuresStepTest extends BaseStepTest { private static final String STRING_METRIC_KEY = "string-metric-key"; diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistProjectLinksStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistProjectLinksStepTest.java index 611137e3e46..35e973fc5ca 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistProjectLinksStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistProjectLinksStepTest.java @@ -23,7 +23,6 @@ import java.util.Locale; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.i18n.I18n; import org.sonar.api.utils.System2; import org.sonar.batch.protocol.Constants; @@ -34,14 +33,13 @@ import org.sonar.server.computation.batch.TreeRootHolderRule; import org.sonar.server.computation.component.Component; import org.sonar.server.computation.component.ReportComponent; import org.sonar.server.computation.component.VisitException; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.failBecauseExceptionWasNotThrown; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -@Category(DbTests.class) + public class PersistProjectLinksStepTest extends BaseStepTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportComputeMeasureVariationsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportComputeMeasureVariationsStepTest.java index 5f85e850677..dabf56743ec 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportComputeMeasureVariationsStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportComputeMeasureVariationsStepTest.java @@ -22,7 +22,6 @@ package org.sonar.server.computation.step; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; import org.sonar.db.DbSession; @@ -43,14 +42,13 @@ import org.sonar.server.computation.metric.MetricImpl; import org.sonar.server.computation.metric.MetricRepositoryRule; import org.sonar.server.computation.period.Period; import org.sonar.server.computation.period.PeriodsHolderRule; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.db.component.SnapshotTesting.createForComponent; import static org.sonar.db.component.SnapshotTesting.newSnapshotForProject; import static org.sonar.server.computation.measure.Measure.newMeasureBuilder; -@Category(DbTests.class) + public class ReportComputeMeasureVariationsStepTest { static final Metric ISSUES_METRIC = new MetricImpl(1, "violations", "violations", Metric.MetricType.INT); diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportPersistComponentsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportPersistComponentsStepTest.java index 67d7011ae20..9353f579eda 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportPersistComponentsStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportPersistComponentsStepTest.java @@ -25,7 +25,6 @@ import java.util.Date; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.DateUtils; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; @@ -36,7 +35,6 @@ import org.sonar.server.computation.batch.TreeRootHolderRule; import org.sonar.server.computation.component.Component; import org.sonar.server.computation.component.FileAttributes; import org.sonar.server.computation.component.MutableDbIdsRepositoryRule; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.guava.api.Assertions.assertThat; @@ -47,7 +45,7 @@ import static org.sonar.server.computation.component.Component.Type.FILE; import static org.sonar.server.computation.component.Component.Type.PROJECT; import static org.sonar.server.computation.component.ReportComponent.builder; -@Category(DbTests.class) + public class ReportPersistComponentsStepTest extends BaseStepTest { private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportPersistSnapshotsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportPersistSnapshotsStepTest.java index b605e1f31a7..6c1d3a465fe 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportPersistSnapshotsStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportPersistSnapshotsStepTest.java @@ -23,7 +23,6 @@ import java.util.List; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.DateUtils; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; @@ -41,7 +40,6 @@ import org.sonar.server.computation.component.FileAttributes; import org.sonar.server.computation.component.ReportComponent; import org.sonar.server.computation.period.Period; import org.sonar.server.computation.period.PeriodsHolderRule; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; @@ -49,7 +47,7 @@ import static org.mockito.Mockito.when; import static org.sonar.core.config.CorePropertyDefinitions.TIMEMACHINE_MODE_DATE; import static org.sonar.core.config.CorePropertyDefinitions.TIMEMACHINE_MODE_PREVIOUS_ANALYSIS; -@Category(DbTests.class) + public class ReportPersistSnapshotsStepTest extends BaseStepTest { private static final String PROJECT_KEY = "PROJECT_KEY"; diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/SwitchSnapshotStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/SwitchSnapshotStepTest.java index 10d1cf4809f..8417d049bae 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/SwitchSnapshotStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/SwitchSnapshotStepTest.java @@ -22,7 +22,6 @@ package org.sonar.server.computation.step; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.DateUtils; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; @@ -32,12 +31,11 @@ import org.sonar.server.computation.batch.TreeRootHolderRule; import org.sonar.server.computation.component.Component; import org.sonar.server.computation.component.DbIdsRepositoryImpl; import org.sonar.server.computation.component.ReportComponent; -import org.sonar.test.DbTests; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -@Category(DbTests.class) + public class SwitchSnapshotStepTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ValidateProjectStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ValidateProjectStepTest.java index 33b8bcb2622..840096b6794 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ValidateProjectStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ValidateProjectStepTest.java @@ -23,7 +23,6 @@ import java.util.Date; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.DateUtils; import org.sonar.api.utils.MessageException; @@ -40,9 +39,8 @@ import org.sonar.server.computation.batch.BatchReportReaderRule; import org.sonar.server.computation.batch.TreeRootHolderRule; import org.sonar.server.computation.component.Component; import org.sonar.server.computation.component.ReportComponent; -import org.sonar.test.DbTests; -@Category(DbTests.class) + public class ValidateProjectStepTest { static long DEFAULT_ANALYSIS_TIME = 1433131200000L; // 2015-06-01 diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsComputeMeasureVariationsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsComputeMeasureVariationsStepTest.java index be5f57befc7..b66676144e4 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsComputeMeasureVariationsStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsComputeMeasureVariationsStepTest.java @@ -22,7 +22,6 @@ package org.sonar.server.computation.step; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; import org.sonar.db.DbSession; @@ -42,14 +41,13 @@ import org.sonar.server.computation.metric.MetricImpl; import org.sonar.server.computation.metric.MetricRepositoryRule; import org.sonar.server.computation.period.Period; import org.sonar.server.computation.period.PeriodsHolderRule; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.db.component.SnapshotTesting.createForComponent; import static org.sonar.db.component.SnapshotTesting.newSnapshotForProject; import static org.sonar.db.component.SnapshotTesting.newSnapshotForView; -@Category(DbTests.class) + public class ViewsComputeMeasureVariationsStepTest { static final Metric ISSUES_METRIC = new MetricImpl(1, "violations", "violations", Metric.MetricType.INT); diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsPersistComponentsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsPersistComponentsStepTest.java index 7db2e977b6f..3dde69b489e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsPersistComponentsStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsPersistComponentsStepTest.java @@ -24,7 +24,6 @@ import java.util.Date; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.resources.Qualifiers; import org.sonar.api.resources.Scopes; import org.sonar.api.utils.System2; @@ -36,7 +35,6 @@ import org.sonar.server.computation.batch.TreeRootHolderRule; import org.sonar.server.computation.component.MutableDbIdsRepositoryRule; import org.sonar.server.computation.component.ProjectViewAttributes; import org.sonar.server.computation.component.ViewsComponent; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; @@ -46,7 +44,7 @@ import static org.sonar.server.computation.component.Component.Type.SUBVIEW; import static org.sonar.server.computation.component.Component.Type.VIEW; import static org.sonar.server.computation.component.ViewsComponent.builder; -@Category(DbTests.class) + public class ViewsPersistComponentsStepTest extends BaseStepTest { private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsPersistSnapshotsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsPersistSnapshotsStepTest.java index d557f0b7e10..0b812822820 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsPersistSnapshotsStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsPersistSnapshotsStepTest.java @@ -23,7 +23,6 @@ import java.util.List; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.DateUtils; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; @@ -38,7 +37,6 @@ import org.sonar.server.computation.component.MapBasedDbIdsRepository; import org.sonar.server.computation.component.ViewsComponent; import org.sonar.server.computation.period.Period; import org.sonar.server.computation.period.PeriodsHolderRule; -import org.sonar.test.DbTests; import static java.lang.String.valueOf; import static org.assertj.core.api.Assertions.assertThat; @@ -55,7 +53,7 @@ import static org.sonar.server.computation.component.Component.Type.SUBVIEW; import static org.sonar.server.computation.component.Component.Type.VIEW; import static org.sonar.server.computation.component.ComponentFunctions.toKey; -@Category(DbTests.class) + public class ViewsPersistSnapshotsStepTest extends BaseStepTest { private static final int PROJECT_KEY = 1; diff --git a/server/sonar-server/src/test/java/org/sonar/server/dashboard/template/ProjectCustomDashboardTest.java b/server/sonar-server/src/test/java/org/sonar/server/dashboard/template/ProjectCustomDashboardTest.java index 0618be7e1b9..817b4ab68d4 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/dashboard/template/ProjectCustomDashboardTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/dashboard/template/ProjectCustomDashboardTest.java @@ -22,17 +22,15 @@ package org.sonar.server.dashboard.template; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.api.web.Dashboard; import org.sonar.api.web.DashboardLayout; import org.sonar.db.DbTester; import org.sonar.db.issue.IssueFilterDao; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class ProjectCustomDashboardTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsParserTest.java b/server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsParserTest.java index 73f08478e43..c1addc7c9bc 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsParserTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsParserTest.java @@ -31,19 +31,17 @@ import javax.annotation.Nullable; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbSession; import org.sonar.db.DbTester; import org.sonar.db.component.ComponentDao; import org.sonar.db.component.ComponentDto; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.db.component.ComponentTesting.newFileDto; import static org.sonar.db.component.ComponentTesting.newProjectDto; -@Category(DbTests.class) + public class DuplicationsParserTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueStorageTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueStorageTest.java index c3c088b4fc1..94f6424afa3 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueStorageTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueStorageTest.java @@ -22,7 +22,6 @@ package org.sonar.server.issue; import java.util.Collection; import java.util.Date; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.rule.RuleKey; import org.sonar.api.rules.Rule; import org.sonar.api.rules.RuleFinder; @@ -40,9 +39,8 @@ import org.sonar.db.DbTester; import org.sonar.db.component.ComponentDto; import org.sonar.db.issue.IssueDto; import org.sonar.db.issue.IssueMapper; -import org.sonar.test.DbTests; -@Category(DbTests.class) + public class IssueStorageTest { IssueChangeContext context = IssueChangeContext.createUser(new Date(), "emmerik"); diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ServerIssueStorageTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ServerIssueStorageTest.java index 0e9d8841337..e5ee04959c2 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/ServerIssueStorageTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/ServerIssueStorageTest.java @@ -23,7 +23,6 @@ import java.util.Collection; import java.util.Date; import org.junit.Before; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.rule.RuleKey; import org.sonar.api.rules.Rule; import org.sonar.api.rules.RuleFinder; @@ -38,13 +37,12 @@ import org.sonar.core.issue.IssueType; import org.sonar.db.DbClient; import org.sonar.db.DbTester; import org.sonar.server.issue.index.IssueIndexer; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -@Category(DbTests.class) + public class ServerIssueStorageTest { System2 system = mock(System2.class); diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/filter/RegisterIssueFiltersTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/filter/RegisterIssueFiltersTest.java index d438b2b66a9..f8a9537fbfc 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/filter/RegisterIssueFiltersTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/filter/RegisterIssueFiltersTest.java @@ -23,18 +23,16 @@ import java.util.Date; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.DateUtils; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; import org.sonar.db.issue.IssueFilterDao; import org.sonar.db.loadedtemplate.LoadedTemplateDao; -import org.sonar.test.DbTests; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -@Category(DbTests.class) + public class RegisterIssueFiltersTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/filter/SearchActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/filter/SearchActionTest.java index 7729bc881a1..06753364261 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/filter/SearchActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/filter/SearchActionTest.java @@ -22,7 +22,6 @@ package org.sonar.server.issue.filter; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; @@ -33,11 +32,10 @@ import org.sonar.db.issue.IssueFilterFavouriteDto; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.TestResponse; import org.sonar.server.ws.WsActionTester; -import org.sonar.test.DbTests; import static org.sonar.test.JsonAssert.assertJson; -@Category(DbTests.class) + public class SearchActionTest { static final String EMPTY_ISSUE_FILTERS_JSON = "{" + " \"issueFilters\": []" + diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationDaoTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationDaoTest.java index 494799edf1f..8ba8dbcfc2a 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationDaoTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationDaoTest.java @@ -25,14 +25,12 @@ import java.util.Collection; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class IssueAuthorizationDaoTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationIndexerTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationIndexerTest.java index d7625e4842d..86a5c3645fd 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationIndexerTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationIndexerTest.java @@ -27,17 +27,15 @@ import org.junit.Before; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.config.Settings; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; import org.sonar.db.DbTester; import org.sonar.server.es.EsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class IssueAuthorizationIndexerTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexerTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexerTest.java index 8dc6def6f34..e85ac324ecb 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexerTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueIndexerTest.java @@ -25,18 +25,16 @@ import org.junit.Before; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.config.Settings; import org.sonar.api.rule.RuleKey; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; import org.sonar.db.DbTester; import org.sonar.server.es.EsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class IssueIndexerTest { @ClassRule diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueResultSetIteratorTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueResultSetIteratorTest.java index 89799c9ff5d..50768cd4c0a 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueResultSetIteratorTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueResultSetIteratorTest.java @@ -26,16 +26,13 @@ import javax.annotation.Nonnull; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.rule.RuleKey; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; -import org.sonarqube.ws.Issues; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class IssueResultSetIteratorTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterExecutorTest.java b/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterExecutorTest.java index 96513c938fd..6f8d2adabb7 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterExecutorTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/measure/MeasureFilterExecutorTest.java @@ -26,7 +26,6 @@ import java.util.List; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.measures.CoreMetrics; import org.sonar.api.measures.Metric; import org.sonar.api.utils.DateUtils; @@ -34,12 +33,11 @@ import org.sonar.api.utils.System2; import org.sonar.db.DbTester; import org.sonar.db.component.ResourceDao; import org.sonar.db.component.SnapshotDto; -import org.sonar.test.DbTests; import static com.google.common.collect.Lists.newArrayList; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class MeasureFilterExecutorTest { private static final long JAVA_PROJECT_ID = 1L; diff --git a/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/CreateActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/CreateActionTest.java index 6a1b8390c65..dc0f19fea55 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/CreateActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/CreateActionTest.java @@ -27,7 +27,6 @@ import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.config.Settings; import org.sonar.api.measures.Metric; @@ -56,7 +55,6 @@ import org.sonar.server.user.index.UserIndex; import org.sonar.server.user.index.UserIndexDefinition; import org.sonar.server.user.ws.UserJsonWriter; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.data.Offset.offset; @@ -68,7 +66,7 @@ import static org.sonar.api.measures.Metric.ValueType.STRING; import static org.sonar.api.measures.Metric.ValueType.WORK_DUR; import static org.sonar.server.util.TypeValidationsTesting.newFullTypeValidations; -@Category(DbTests.class) + public class CreateActionTest { private static final String DEFAULT_PROJECT_UUID = "project-uuid"; diff --git a/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/DeleteActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/DeleteActionTest.java index 6cd5248f53e..82a10096f4e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/DeleteActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/DeleteActionTest.java @@ -22,7 +22,6 @@ package org.sonar.server.measure.custom.ws; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.api.web.UserRole; @@ -37,13 +36,12 @@ import org.sonar.db.measure.custom.CustomMeasureDto; import org.sonar.server.exceptions.ForbiddenException; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.db.measure.custom.CustomMeasureTesting.newCustomMeasureDto; import static org.sonar.server.measure.custom.ws.DeleteAction.PARAM_ID; -@Category(DbTests.class) + public class DeleteActionTest { public static final String ACTION = "delete"; diff --git a/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/MetricsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/MetricsActionTest.java index eff72fcae4d..be70459b8e9 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/MetricsActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/MetricsActionTest.java @@ -24,7 +24,6 @@ import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.config.Settings; import org.sonar.api.measures.Metric; @@ -45,7 +44,6 @@ import org.sonar.server.tester.UserSessionRule; import org.sonar.server.user.index.UserDoc; import org.sonar.server.user.index.UserIndexDefinition; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.db.measure.custom.CustomMeasureTesting.newCustomMeasureDto; @@ -53,7 +51,7 @@ import static org.sonar.db.metric.MetricTesting.newMetricDto; import static org.sonar.server.measure.custom.ws.CustomMeasuresWs.ENDPOINT; import static org.sonar.server.measure.custom.ws.MetricsAction.ACTION; -@Category(DbTests.class) + public class MetricsActionTest { private static final String DEFAULT_PROJECT_UUID = "project-uuid"; private static final String DEFAULT_PROJECT_KEY = "project-key"; diff --git a/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/UpdateActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/UpdateActionTest.java index e29422b08ac..fafb7305e0f 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/UpdateActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/UpdateActionTest.java @@ -24,7 +24,6 @@ import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.config.Settings; import org.sonar.api.measures.Metric.ValueType; @@ -49,7 +48,6 @@ import org.sonar.server.user.index.UserIndex; import org.sonar.server.user.index.UserIndexDefinition; import org.sonar.server.user.ws.UserJsonWriter; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.data.Offset.offset; @@ -61,7 +59,7 @@ import static org.sonar.server.measure.custom.ws.UpdateAction.PARAM_ID; import static org.sonar.server.measure.custom.ws.UpdateAction.PARAM_VALUE; import static org.sonar.server.util.TypeValidationsTesting.newFullTypeValidations; -@Category(DbTests.class) + public class UpdateActionTest { @Rule public ExpectedException expectedException = ExpectedException.none(); diff --git a/server/sonar-server/src/test/java/org/sonar/server/measure/ws/ComponentActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/measure/ws/ComponentActionTest.java index ce70587be12..804c274a898 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/measure/ws/ComponentActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/measure/ws/ComponentActionTest.java @@ -25,7 +25,6 @@ import java.io.InputStream; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.resources.Qualifiers; import org.sonar.api.utils.System2; @@ -44,7 +43,6 @@ import org.sonar.server.exceptions.ForbiddenException; import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsActionTester; -import org.sonar.test.DbTests; import org.sonarqube.ws.MediaTypes; import org.sonarqube.ws.WsMeasures.ComponentWsResponse; @@ -62,7 +60,7 @@ import static org.sonarqube.ws.client.measure.MeasuresWsParameters.PARAM_ADDITIO import static org.sonarqube.ws.client.measure.MeasuresWsParameters.PARAM_COMPONENT_ID; import static org.sonarqube.ws.client.measure.MeasuresWsParameters.PARAM_METRIC_KEYS; -@Category(DbTests.class) + public class ComponentActionTest { private static final String PROJECT_UUID = "project-uuid"; diff --git a/server/sonar-server/src/test/java/org/sonar/server/measure/ws/ComponentTreeActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/measure/ws/ComponentTreeActionTest.java index fddd838e358..7ed74774d4b 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/measure/ws/ComponentTreeActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/measure/ws/ComponentTreeActionTest.java @@ -26,7 +26,6 @@ import java.util.List; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.measures.Metric.ValueType; import org.sonar.api.resources.Qualifiers; @@ -51,7 +50,6 @@ import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.TestRequest; import org.sonar.server.ws.TestResponse; import org.sonar.server.ws.WsActionTester; -import org.sonar.test.DbTests; import org.sonarqube.ws.Common; import org.sonarqube.ws.MediaTypes; import org.sonarqube.ws.WsMeasures; @@ -78,7 +76,7 @@ import static org.sonarqube.ws.client.measure.MeasuresWsParameters.PARAM_METRIC_ import static org.sonarqube.ws.client.measure.MeasuresWsParameters.PARAM_QUALIFIERS; import static org.sonarqube.ws.client.measure.MeasuresWsParameters.PARAM_STRATEGY; -@Category(DbTests.class) + public class ComponentTreeActionTest { @Rule public UserSessionRule userSession = UserSessionRule.standalone(); diff --git a/server/sonar-server/src/test/java/org/sonar/server/metric/DefaultMetricFinderTest.java b/server/sonar-server/src/test/java/org/sonar/server/metric/DefaultMetricFinderTest.java index bbb6b9e2b78..154827c1b54 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/metric/DefaultMetricFinderTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/metric/DefaultMetricFinderTest.java @@ -23,18 +23,16 @@ import java.util.Arrays; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; import org.sonar.db.DbTester; import org.sonar.db.metric.MetricDao; -import org.sonar.test.DbTests; import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsNull.nullValue; import static org.junit.Assert.assertThat; -@Category(DbTests.class) + public class DefaultMetricFinderTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/metric/ws/CreateActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/metric/ws/CreateActionTest.java index b7372d6a3c6..c685157aac0 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/metric/ws/CreateActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/metric/ws/CreateActionTest.java @@ -22,7 +22,6 @@ package org.sonar.server.metric.ws; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.measures.Metric.ValueType; import org.sonar.api.utils.System2; @@ -38,7 +37,6 @@ import org.sonar.server.exceptions.ServerException; import org.sonar.server.ruby.RubyBridge; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.RETURNS_DEEP_STUBS; @@ -49,7 +47,7 @@ import static org.sonar.server.metric.ws.CreateAction.PARAM_KEY; import static org.sonar.server.metric.ws.CreateAction.PARAM_NAME; import static org.sonar.server.metric.ws.CreateAction.PARAM_TYPE; -@Category(DbTests.class) + public class CreateActionTest { private static final String DEFAULT_KEY = "custom-metric-key"; diff --git a/server/sonar-server/src/test/java/org/sonar/server/metric/ws/DeleteActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/metric/ws/DeleteActionTest.java index 629206bff29..60f1609b644 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/metric/ws/DeleteActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/metric/ws/DeleteActionTest.java @@ -24,7 +24,6 @@ import java.util.List; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.core.permission.GlobalPermissions; @@ -39,14 +38,13 @@ import org.sonar.server.exceptions.ForbiddenException; import org.sonar.server.ruby.RubyBridge; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.RETURNS_DEEP_STUBS; import static org.mockito.Mockito.mock; import static org.sonar.db.metric.MetricTesting.newMetricDto; -@Category(DbTests.class) + public class DeleteActionTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/metric/ws/DomainsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/metric/ws/DomainsActionTest.java index 8c404d4ea3b..135c9f646ba 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/metric/ws/DomainsActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/metric/ws/DomainsActionTest.java @@ -23,7 +23,6 @@ import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; import org.sonar.db.DbSession; @@ -31,12 +30,11 @@ import org.sonar.db.DbTester; import org.sonar.db.metric.MetricDao; import org.sonar.db.metric.MetricDto; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import org.sonar.test.JsonAssert; import static org.sonar.db.metric.MetricTesting.newMetricDto; -@Category(DbTests.class) + public class DomainsActionTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/metric/ws/SearchActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/metric/ws/SearchActionTest.java index 59a4bc9a3ce..359a41b0870 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/metric/ws/SearchActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/metric/ws/SearchActionTest.java @@ -23,7 +23,6 @@ import org.apache.commons.lang.StringUtils; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.server.ws.WebService.Param; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; @@ -31,13 +30,12 @@ import org.sonar.db.DbSession; import org.sonar.db.DbTester; import org.sonar.db.metric.MetricDto; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.db.metric.MetricTesting.newMetricDto; import static org.sonar.server.metric.ws.SearchAction.PARAM_IS_CUSTOM; -@Category(DbTests.class) + public class SearchActionTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/metric/ws/UpdateActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/metric/ws/UpdateActionTest.java index 705f66d8e97..f2e38b7f456 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/metric/ws/UpdateActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/metric/ws/UpdateActionTest.java @@ -22,7 +22,6 @@ package org.sonar.server.metric.ws; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.measures.Metric.ValueType; import org.sonar.api.utils.System2; @@ -36,7 +35,6 @@ import org.sonar.server.exceptions.ServerException; import org.sonar.server.ruby.RubyBridge; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.RETURNS_DEEP_STUBS; @@ -49,7 +47,7 @@ import static org.sonar.server.metric.ws.UpdateAction.PARAM_KEY; import static org.sonar.server.metric.ws.UpdateAction.PARAM_NAME; import static org.sonar.server.metric.ws.UpdateAction.PARAM_TYPE; -@Category(DbTests.class) + public class UpdateActionTest { private static final String DEFAULT_KEY = "custom-metric-key"; diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/AddGroupActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/AddGroupActionTest.java index 8ed42033698..6c01be3d067 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/AddGroupActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/AddGroupActionTest.java @@ -22,7 +22,6 @@ package org.sonar.server.permission.ws; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.mockito.ArgumentCaptor; import org.sonar.api.resources.Qualifiers; @@ -43,7 +42,6 @@ import org.sonar.server.permission.PermissionUpdater; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.usergroups.ws.UserGroupFinder; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; @@ -59,7 +57,7 @@ import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_P import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_ID; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY; -@Category(DbTests.class) + public class AddGroupActionTest { UserSessionRule userSession = UserSessionRule.standalone(); WsTester ws; diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/AddUserActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/AddUserActionTest.java index aa5eac89458..26e0c56e1e4 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/AddUserActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/AddUserActionTest.java @@ -22,7 +22,6 @@ package org.sonar.server.permission.ws; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.mockito.ArgumentCaptor; import org.sonar.api.resources.Qualifiers; @@ -42,7 +41,6 @@ import org.sonar.server.permission.PermissionUpdater; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.usergroups.ws.UserGroupFinder; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; @@ -58,7 +56,7 @@ import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_P import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_USER_LOGIN; -@Category(DbTests.class) + public class AddUserActionTest { @Rule public DbTester db = DbTester.create(System2.INSTANCE); diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/GroupsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/GroupsActionTest.java index ef7e5ae04d6..75aab287879 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/GroupsActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/GroupsActionTest.java @@ -23,7 +23,6 @@ import com.google.common.io.Resources; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.resources.Qualifiers; import org.sonar.api.security.DefaultGroups; @@ -48,7 +47,6 @@ import org.sonar.server.permission.PermissionFinder; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.usergroups.ws.UserGroupFinder; import org.sonar.server.ws.WsActionTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.api.server.ws.WebService.Param.SELECTED; @@ -57,12 +55,12 @@ import static org.sonar.core.permission.GlobalPermissions.SCAN_EXECUTION; import static org.sonar.core.permission.GlobalPermissions.SYSTEM_ADMIN; import static org.sonar.db.component.ComponentTesting.newProjectDto; import static org.sonar.db.component.ComponentTesting.newView; +import static org.sonar.test.JsonAssert.assertJson; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_ID; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY; -import static org.sonar.test.JsonAssert.assertJson; -@Category(DbTests.class) + public class GroupsActionTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/RemoveGroupActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/RemoveGroupActionTest.java index 96686f92d8e..3df7726edc8 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/RemoveGroupActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/RemoveGroupActionTest.java @@ -22,7 +22,6 @@ package org.sonar.server.permission.ws; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.mockito.ArgumentCaptor; import org.sonar.api.resources.Qualifiers; @@ -43,7 +42,6 @@ import org.sonar.server.permission.PermissionUpdater; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.usergroups.ws.UserGroupFinder; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; @@ -60,7 +58,7 @@ import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_P import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_ID; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY; -@Category(DbTests.class) + public class RemoveGroupActionTest { UserSessionRule userSession = UserSessionRule.standalone(); WsTester ws; diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/RemoveUserActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/RemoveUserActionTest.java index f0618543348..1b6ceb69fec 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/RemoveUserActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/RemoveUserActionTest.java @@ -22,7 +22,6 @@ package org.sonar.server.permission.ws; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.mockito.ArgumentCaptor; import org.sonar.api.resources.Qualifiers; @@ -42,7 +41,6 @@ import org.sonar.server.permission.PermissionUpdater; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.usergroups.ws.UserGroupFinder; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; @@ -58,7 +56,7 @@ import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_P import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_USER_LOGIN; -@Category(DbTests.class) + public class RemoveUserActionTest { @Rule public DbTester db = DbTester.create(System2.INSTANCE); diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/SearchGlobalPermissionsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/SearchGlobalPermissionsActionTest.java index 23e444fde7e..42f0a75ed32 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/SearchGlobalPermissionsActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/SearchGlobalPermissionsActionTest.java @@ -24,7 +24,6 @@ import javax.annotation.Nullable; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; @@ -37,7 +36,6 @@ import org.sonar.server.exceptions.UnauthorizedException; import org.sonar.server.i18n.I18nRule; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsActionTester; -import org.sonar.test.DbTests; import org.sonarqube.ws.MediaTypes; import org.sonarqube.ws.WsPermissions; @@ -49,7 +47,7 @@ import static org.sonar.core.permission.GlobalPermissions.SCAN_EXECUTION; import static org.sonar.core.permission.GlobalPermissions.SYSTEM_ADMIN; import static org.sonar.test.JsonAssert.assertJson; -@Category(DbTests.class) + public class SearchGlobalPermissionsActionTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/SearchProjectPermissionsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/SearchProjectPermissionsActionTest.java index 8d451aeae79..6118c8b0c70 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/SearchProjectPermissionsActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/SearchProjectPermissionsActionTest.java @@ -24,7 +24,6 @@ import javax.annotation.Nullable; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.resources.Qualifiers; import org.sonar.api.utils.System2; @@ -47,7 +46,6 @@ import org.sonar.server.tester.UserSessionRule; import org.sonar.server.usergroups.ws.UserGroupFinder; import org.sonar.server.ws.TestResponse; import org.sonar.server.ws.WsActionTester; -import org.sonar.test.DbTests; import org.sonarqube.ws.MediaTypes; import org.sonarqube.ws.WsPermissions.SearchProjectPermissionsWsResponse; @@ -65,7 +63,7 @@ import static org.sonar.test.JsonAssert.assertJson; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_ID; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_QUALIFIER; -@Category(DbTests.class) + public class SearchProjectPermissionsActionTest { @Rule public ExpectedException expectedException = ExpectedException.none(); diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/TemplateGroupsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/TemplateGroupsActionTest.java index 2d05e9f9463..73649de6322 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/TemplateGroupsActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/TemplateGroupsActionTest.java @@ -25,7 +25,6 @@ import javax.annotation.Nullable; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.resources.Qualifiers; import org.sonar.api.server.ws.WebService.Param; @@ -45,11 +44,10 @@ import org.sonar.server.exceptions.BadRequestException; import org.sonar.server.exceptions.ForbiddenException; import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.exceptions.UnauthorizedException; -import org.sonarqube.ws.MediaTypes; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.usergroups.ws.UserGroupFinder; import org.sonar.server.ws.WsActionTester; -import org.sonar.test.DbTests; +import org.sonarqube.ws.MediaTypes; import org.sonarqube.ws.WsPermissions.WsGroupsResponse; import static org.assertj.core.api.Assertions.assertThat; @@ -61,12 +59,12 @@ import static org.sonar.core.permission.GlobalPermissions.SYSTEM_ADMIN; import static org.sonar.db.permission.PermissionTemplateTesting.newPermissionTemplateDto; import static org.sonar.db.permission.PermissionTemplateTesting.newPermissionTemplateGroupDto; import static org.sonar.db.user.GroupTesting.newGroupDto; +import static org.sonar.test.JsonAssert.assertJson; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION; -import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID; -import static org.sonar.test.JsonAssert.assertJson; +import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME; + -@Category(DbTests.class) public class TemplateGroupsActionTest { @Rule public ExpectedException expectedException = ExpectedException.none(); diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/TemplateUsersActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/TemplateUsersActionTest.java index b6b8ac62fc7..701fc6ac60a 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/TemplateUsersActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/TemplateUsersActionTest.java @@ -25,7 +25,6 @@ import javax.annotation.Nullable; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.resources.Qualifiers; import org.sonar.api.server.ws.WebService; @@ -48,7 +47,6 @@ import org.sonar.server.tester.UserSessionRule; import org.sonar.server.usergroups.ws.UserGroupFinder; import org.sonar.server.ws.TestRequest; import org.sonar.server.ws.WsActionTester; -import org.sonar.test.DbTests; import org.sonarqube.ws.WsPermissions; import org.sonarqube.ws.WsPermissions.UsersWsResponse; @@ -60,7 +58,7 @@ import static org.sonar.test.JsonAssert.assertJson; import static org.sonarqube.ws.MediaTypes.PROTOBUF; import static org.sonarqube.ws.WsPermissions.UsersWsResponse.parseFrom; -@Category(DbTests.class) + public class TemplateUsersActionTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/UsersActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/UsersActionTest.java index 7d5fa5970e6..8a3435cfea3 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/UsersActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/UsersActionTest.java @@ -22,7 +22,6 @@ package org.sonar.server.permission.ws; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.resources.Qualifiers; import org.sonar.api.server.ws.WebService.Param; @@ -44,7 +43,6 @@ import org.sonar.server.permission.PermissionFinder; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.usergroups.ws.UserGroupFinder; import org.sonar.server.ws.WsActionTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.api.web.UserRole.ISSUE_ADMIN; @@ -52,12 +50,12 @@ import static org.sonar.core.permission.GlobalPermissions.SCAN_EXECUTION; import static org.sonar.core.permission.GlobalPermissions.SYSTEM_ADMIN; import static org.sonar.db.component.ComponentTesting.newProjectDto; import static org.sonar.db.user.UserTesting.newUserDto; +import static org.sonar.test.JsonAssert.assertJson; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_ID; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY; -import static org.sonar.test.JsonAssert.assertJson; -@Category(DbTests.class) + public class UsersActionTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/AddGroupToTemplateActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/AddGroupToTemplateActionTest.java index 0eb3af22e32..f94005ad729 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/AddGroupToTemplateActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/AddGroupToTemplateActionTest.java @@ -26,7 +26,6 @@ import javax.annotation.Nullable; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.resources.Qualifiers; import org.sonar.api.utils.System2; @@ -50,7 +49,6 @@ import org.sonar.server.tester.UserSessionRule; import org.sonar.server.usergroups.ws.UserGroupFinder; import org.sonar.server.ws.TestRequest; import org.sonar.server.ws.WsActionTester; -import org.sonar.test.DbTests; import static com.google.common.collect.FluentIterable.from; import static org.assertj.core.api.Assertions.assertThat; @@ -67,7 +65,7 @@ import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_P import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME; -@Category(DbTests.class) + public class AddGroupToTemplateActionTest { private static final String GROUP_NAME = "group-name"; diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/AddUserToTemplateActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/AddUserToTemplateActionTest.java index 37151af9468..d82607564d3 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/AddUserToTemplateActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/AddUserToTemplateActionTest.java @@ -26,7 +26,6 @@ import javax.annotation.Nullable; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.resources.Qualifiers; import org.sonar.api.utils.System2; @@ -49,7 +48,6 @@ import org.sonar.server.tester.UserSessionRule; import org.sonar.server.usergroups.ws.UserGroupFinder; import org.sonar.server.ws.TestRequest; import org.sonar.server.ws.WsActionTester; -import org.sonar.test.DbTests; import static com.google.common.collect.FluentIterable.from; import static org.assertj.core.api.Assertions.assertThat; @@ -62,7 +60,7 @@ import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_P import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_USER_LOGIN; -@Category(DbTests.class) + public class AddUserToTemplateActionTest { private static final String USER_LOGIN = "user-login"; diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/ApplyTemplateActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/ApplyTemplateActionTest.java index 89e66222946..973e760cdf8 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/ApplyTemplateActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/ApplyTemplateActionTest.java @@ -26,7 +26,6 @@ import javax.annotation.Nullable; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.config.Settings; import org.sonar.api.resources.Qualifiers; @@ -60,7 +59,6 @@ import org.sonar.server.usergroups.ws.UserGroupFinder; import org.sonar.server.ws.TestRequest; import org.sonar.server.ws.TestResponse; import org.sonar.server.ws.WsActionTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; @@ -75,7 +73,7 @@ import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_P import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME; -@Category(DbTests.class) + public class ApplyTemplateActionTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/RemoveGroupFromTemplateActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/RemoveGroupFromTemplateActionTest.java index 4cb879224e4..ad649dd0a38 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/RemoveGroupFromTemplateActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/RemoveGroupFromTemplateActionTest.java @@ -26,7 +26,6 @@ import javax.annotation.Nullable; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.resources.Qualifiers; import org.sonar.api.utils.System2; @@ -49,7 +48,6 @@ import org.sonar.server.tester.UserSessionRule; import org.sonar.server.usergroups.ws.UserGroupFinder; import org.sonar.server.ws.TestRequest; import org.sonar.server.ws.WsActionTester; -import org.sonar.test.DbTests; import static com.google.common.collect.FluentIterable.from; import static org.assertj.core.api.Assertions.assertThat; @@ -64,7 +62,7 @@ import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_P import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME; -@Category(DbTests.class) + public class RemoveGroupFromTemplateActionTest { private static final String GROUP_NAME = "group-name"; diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/RemoveUserFromTemplateActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/RemoveUserFromTemplateActionTest.java index 867ebcacb34..770d3b4f2d9 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/RemoveUserFromTemplateActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/RemoveUserFromTemplateActionTest.java @@ -26,7 +26,6 @@ import javax.annotation.Nullable; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.resources.Qualifiers; import org.sonar.api.utils.System2; @@ -49,7 +48,6 @@ import org.sonar.server.tester.UserSessionRule; import org.sonar.server.usergroups.ws.UserGroupFinder; import org.sonar.server.ws.TestRequest; import org.sonar.server.ws.WsActionTester; -import org.sonar.test.DbTests; import static com.google.common.collect.FluentIterable.from; import static org.assertj.core.api.Assertions.assertThat; @@ -62,7 +60,7 @@ import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_P import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_USER_LOGIN; -@Category(DbTests.class) + public class RemoveUserFromTemplateActionTest { private static final String USER_LOGIN = "user-login"; diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/SearchTemplatesActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/SearchTemplatesActionTest.java index 3a2a52733d2..ca3c2f0e539 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/SearchTemplatesActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/SearchTemplatesActionTest.java @@ -26,7 +26,6 @@ import org.junit.Before; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.config.Settings; import org.sonar.api.resources.Qualifiers; @@ -44,7 +43,6 @@ import org.sonar.server.exceptions.UnauthorizedException; import org.sonar.server.i18n.I18nRule; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsActionTester; -import org.sonar.test.DbTests; import static java.util.Arrays.asList; import static org.assertj.core.api.Assertions.assertThat; @@ -60,7 +58,7 @@ import static org.sonar.db.user.UserTesting.newUserDto; import static org.sonar.server.permission.DefaultPermissionTemplates.defaultRootQualifierTemplateProperty; import static org.sonar.test.JsonAssert.assertJson; -@Category(DbTests.class) + public class SearchTemplatesActionTest { @ClassRule public static DbTester db = DbTester.create(System2.INSTANCE); diff --git a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/SetDefaultTemplateActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/SetDefaultTemplateActionTest.java index c2bbd63a448..b9ecd37cdec 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/SetDefaultTemplateActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/permission/ws/template/SetDefaultTemplateActionTest.java @@ -25,7 +25,6 @@ import javax.annotation.Nullable; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.config.PropertyDefinitions; import org.sonar.api.resources.Qualifiers; @@ -50,7 +49,6 @@ import org.sonar.server.tester.UserSessionRule; import org.sonar.server.usergroups.ws.UserGroupFinder; import org.sonar.server.ws.TestRequest; import org.sonar.server.ws.WsActionTester; -import org.sonar.test.DbTests; import static java.util.Arrays.asList; import static java.util.Collections.singletonList; @@ -65,7 +63,7 @@ import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_Q import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID; import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME; -@Category(DbTests.class) + public class SetDefaultTemplateActionTest { @Rule public DbTester db = DbTester.create(System2.INSTANCE); diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/BackendCleanupMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/BackendCleanupMediumTest.java index 527e6d0f3b7..eafe0444f8e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/BackendCleanupMediumTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/BackendCleanupMediumTest.java @@ -24,7 +24,6 @@ import org.junit.Before; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.config.Settings; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; @@ -37,12 +36,11 @@ import org.sonar.server.rule.index.RuleIndexDefinition; import org.sonar.server.search.IndexDefinition; import org.sonar.server.view.index.ViewDoc; import org.sonar.server.view.index.ViewIndexDefinition; -import org.sonar.test.DbTests; import static com.google.common.collect.Lists.newArrayList; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class BackendCleanupMediumTest { @ClassRule diff --git a/server/sonar-server/src/test/java/org/sonar/server/project/ws/BulkDeleteActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/project/ws/BulkDeleteActionTest.java index f60fa055b0e..f617522b853 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/project/ws/BulkDeleteActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/project/ws/BulkDeleteActionTest.java @@ -25,7 +25,6 @@ import org.junit.Before; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.config.Settings; import org.sonar.api.resources.Qualifiers; @@ -58,7 +57,6 @@ import org.sonar.server.test.index.TestIndexDefinition; import org.sonar.server.test.index.TestIndexer; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Matchers.anyString; @@ -67,7 +65,7 @@ import static org.mockito.Mockito.when; import static org.sonar.server.project.ws.BulkDeleteAction.PARAM_IDS; import static org.sonar.server.project.ws.BulkDeleteAction.PARAM_KEYS; -@Category(DbTests.class) + public class BulkDeleteActionTest { private static final String ACTION = "bulk_delete"; diff --git a/server/sonar-server/src/test/java/org/sonar/server/project/ws/DeleteActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/project/ws/DeleteActionTest.java index 16b166639ce..8ca823216c7 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/project/ws/DeleteActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/project/ws/DeleteActionTest.java @@ -24,7 +24,6 @@ import org.junit.Before; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.config.Settings; import org.sonar.api.resources.Qualifiers; @@ -56,7 +55,6 @@ import org.sonar.server.test.index.TestIndexDefinition; import org.sonar.server.test.index.TestIndexer; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.guava.api.Assertions.assertThat; @@ -66,7 +64,7 @@ import static org.mockito.Mockito.when; import static org.sonar.server.project.ws.DeleteAction.PARAM_ID; import static org.sonar.server.project.ws.DeleteAction.PARAM_KEY; -@Category(DbTests.class) + public class DeleteActionTest { private static final String ACTION = "delete"; diff --git a/server/sonar-server/src/test/java/org/sonar/server/project/ws/GhostsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/project/ws/GhostsActionTest.java index a15c4ddebb1..71982fbb07e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/project/ws/GhostsActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/project/ws/GhostsActionTest.java @@ -24,7 +24,6 @@ import org.apache.commons.lang.StringUtils; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.server.ws.WebService.Param; import org.sonar.api.utils.DateUtils; import org.sonar.api.utils.System2; @@ -32,18 +31,17 @@ import org.sonar.api.web.UserRole; import org.sonar.db.DbClient; import org.sonar.db.DbTester; import org.sonar.db.component.ComponentDto; -import org.sonar.db.component.SnapshotDto; import org.sonar.db.component.ComponentTesting; +import org.sonar.db.component.SnapshotDto; import org.sonar.db.component.SnapshotTesting; import org.sonar.server.exceptions.ForbiddenException; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import org.sonar.test.JsonAssert; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class GhostsActionTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/project/ws/ProvisionedActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/project/ws/ProvisionedActionTest.java index 2bdcd180b7c..c85c9c77684 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/project/ws/ProvisionedActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/project/ws/ProvisionedActionTest.java @@ -24,7 +24,6 @@ import org.apache.commons.lang.StringUtils; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.server.ws.WebService.Param; import org.sonar.api.utils.DateUtils; @@ -34,18 +33,17 @@ import org.sonar.db.DbClient; import org.sonar.db.DbTester; import org.sonar.db.component.ComponentDao; import org.sonar.db.component.ComponentDto; -import org.sonar.db.component.SnapshotDto; import org.sonar.db.component.ComponentTesting; +import org.sonar.db.component.SnapshotDto; import org.sonar.db.component.SnapshotTesting; import org.sonar.server.exceptions.ForbiddenException; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import org.sonar.test.JsonAssert; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class ProvisionedActionTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/ProjectStatusActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/ProjectStatusActionTest.java index f383983114f..ca96b5c2c37 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/ProjectStatusActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/ProjectStatusActionTest.java @@ -25,7 +25,6 @@ import org.apache.commons.io.IOUtils; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.measures.CoreMetrics; import org.sonar.api.utils.System2; @@ -41,7 +40,6 @@ import org.sonar.server.exceptions.ForbiddenException; import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsActionTester; -import org.sonar.test.DbTests; import org.sonarqube.ws.MediaTypes; import org.sonarqube.ws.WsQualityGates.ProjectStatusWsResponse; import org.sonarqube.ws.WsQualityGates.ProjectStatusWsResponse.Status; @@ -59,7 +57,7 @@ import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_PROJECT_ID; import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_PROJECT_KEY; -@Category(DbTests.class) + public class ProjectStatusActionTest { private static final String ANALYSIS_ID = "task-uuid"; @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/index/ActiveRuleIndexerTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/index/ActiveRuleIndexerTest.java index 45f38494334..01c2f5ad051 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/index/ActiveRuleIndexerTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/index/ActiveRuleIndexerTest.java @@ -25,7 +25,6 @@ import org.junit.Before; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.config.Settings; import org.sonar.api.rule.RuleKey; import org.sonar.api.rule.Severity; @@ -39,7 +38,6 @@ import org.sonar.db.rule.RuleTesting; import org.sonar.server.es.EsTester; import org.sonar.server.qualityprofile.ActiveRuleChange; import org.sonar.server.rule.index.RuleIndexDefinition; -import org.sonar.test.DbTests; import static java.util.Arrays.asList; import static java.util.Collections.singletonList; @@ -50,7 +48,7 @@ import static org.sonar.server.qualityprofile.index.ActiveRuleDocTesting.newDoc; import static org.sonar.server.rule.index.RuleIndexDefinition.INDEX; import static org.sonar.server.rule.index.RuleIndexDefinition.TYPE_ACTIVE_RULE; -@Category(DbTests.class) + public class ActiveRuleIndexerTest { static final RuleKey RULE_KEY_1 = RuleTesting.XOO_X1; diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/index/ActiveRuleResultSetIteratorTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/index/ActiveRuleResultSetIteratorTest.java index 3a5010b690b..354db25ad5a 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/index/ActiveRuleResultSetIteratorTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/index/ActiveRuleResultSetIteratorTest.java @@ -26,13 +26,11 @@ import javax.annotation.Nonnull; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.rule.RuleKey; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; import org.sonar.db.qualityprofile.ActiveRuleKey; import org.sonar.server.qualityprofile.ActiveRule; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.api.rule.Severity.BLOCKER; @@ -40,7 +38,7 @@ import static org.sonar.api.rule.Severity.CRITICAL; import static org.sonar.api.rule.Severity.INFO; import static org.sonar.server.qualityprofile.ActiveRule.Inheritance.INHERITED; -@Category(DbTests.class) + public class ActiveRuleResultSetIteratorTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ProjectsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ProjectsActionTest.java index c57f9dfadb6..ad9bc747a7e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ProjectsActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/ProjectsActionTest.java @@ -23,7 +23,6 @@ import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.api.web.UserRole; import org.sonar.db.DbClient; @@ -45,11 +44,10 @@ import org.sonar.server.qualityprofile.QProfileTesting; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsTester; import org.sonar.server.ws.WsTester.TestRequest; -import org.sonar.test.DbTests; import static org.mockito.Mockito.mock; -@Category(DbTests.class) + public class ProjectsActionTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/SearchActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/SearchActionTest.java index bd709310be9..5791fe931b3 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/SearchActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/SearchActionTest.java @@ -24,7 +24,6 @@ import java.util.Date; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.resources.Language; import org.sonar.api.resources.Languages; @@ -43,7 +42,6 @@ import org.sonar.server.qualityprofile.QProfileFactory; import org.sonar.server.qualityprofile.QProfileLoader; import org.sonar.server.qualityprofile.QProfileLookup; import org.sonar.server.ws.WsActionTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; @@ -54,7 +52,7 @@ import static org.sonar.server.qualityprofile.ws.SearchAction.PARAM_PROFILE_NAME import static org.sonar.server.qualityprofile.ws.SearchAction.PARAM_PROJECT_KEY; import static org.sonar.test.JsonAssert.assertJson; -@Category(DbTests.class) + public class SearchActionTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesTest.java index b5a617d1b91..d0c2b3332ba 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesTest.java @@ -25,7 +25,6 @@ import java.util.List; import org.junit.Before; import org.junit.ClassRule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.config.Settings; import org.sonar.api.resources.Language; import org.sonar.api.resources.Languages; @@ -46,7 +45,6 @@ import org.sonar.server.rule.index.RuleIndex; import org.sonar.server.rule.index.RuleIndexDefinition; import org.sonar.server.rule.index.RuleIndexer; import org.sonar.server.rule.index.RuleQuery; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; @@ -54,7 +52,7 @@ import static org.mockito.Mockito.when; import static org.sonar.api.rule.Severity.BLOCKER; import static org.sonar.api.rule.Severity.INFO; -@Category(DbTests.class) + public class RegisterRulesTest { static final Date DATE1 = DateUtils.parseDateTime("2014-01-01T19:10:03+0100"); diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexerTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexerTest.java index a3c8a206f88..780876b7fc6 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexerTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexerTest.java @@ -24,7 +24,6 @@ import org.junit.Before; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.config.Settings; import org.sonar.api.rule.RuleKey; import org.sonar.api.rule.RuleStatus; @@ -33,11 +32,10 @@ import org.sonar.db.DbTester; import org.sonar.db.rule.RuleDto; import org.sonar.db.rule.RuleTesting; import org.sonar.server.es.EsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class RuleIndexerTest { @ClassRule diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleResultSetIteratorTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleResultSetIteratorTest.java index 5bcf35f40a4..afe8c73be5e 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleResultSetIteratorTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleResultSetIteratorTest.java @@ -26,17 +26,15 @@ import javax.annotation.Nonnull; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.rule.RuleKey; import org.sonar.api.rule.RuleStatus; import org.sonar.api.rule.Severity; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class RuleResultSetIteratorTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/source/ws/HashActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/source/ws/HashActionTest.java index 3ff68c2d15d..23840652517 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/source/ws/HashActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/source/ws/HashActionTest.java @@ -22,7 +22,6 @@ package org.sonar.server.source.ws; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.mockito.runners.MockitoJUnitRunner; import org.sonar.api.utils.System2; @@ -34,13 +33,12 @@ import org.sonar.server.exceptions.ForbiddenException; import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; @RunWith(MockitoJUnitRunner.class) -@Category(DbTests.class) + public class HashActionTest { final static String COMPONENT_KEY = "Action.java"; diff --git a/server/sonar-server/src/test/java/org/sonar/server/startup/RegisterMetricsTest.java b/server/sonar-server/src/test/java/org/sonar/server/startup/RegisterMetricsTest.java index 0e230feeca3..005bfc29318 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/startup/RegisterMetricsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/startup/RegisterMetricsTest.java @@ -23,19 +23,17 @@ import java.util.Collections; import java.util.List; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.measures.CoreMetrics; import org.sonar.api.measures.Metric; import org.sonar.api.measures.Metrics; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static java.util.Arrays.asList; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class RegisterMetricsTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/startup/RenameIssueWidgetsTest.java b/server/sonar-server/src/test/java/org/sonar/server/startup/RenameIssueWidgetsTest.java index 40faecfcf18..dbbb8130e07 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/startup/RenameIssueWidgetsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/startup/RenameIssueWidgetsTest.java @@ -24,7 +24,6 @@ import java.util.List; import java.util.Map; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.DateUtils; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; @@ -34,13 +33,12 @@ import org.sonar.db.dashboard.WidgetDao; import org.sonar.db.dashboard.WidgetPropertyDao; import org.sonar.db.issue.IssueFilterDao; import org.sonar.db.loadedtemplate.LoadedTemplateDao; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -@Category(DbTests.class) + public class RenameIssueWidgetsTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/test/index/TestIndexerTest.java b/server/sonar-server/src/test/java/org/sonar/server/test/index/TestIndexerTest.java index 1f7c272b882..cec9a7dac65 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/test/index/TestIndexerTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/test/index/TestIndexerTest.java @@ -34,7 +34,6 @@ import org.junit.Before; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.config.Settings; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; @@ -42,7 +41,6 @@ import org.sonar.db.protobuf.DbFileSources; import org.sonar.server.es.EsTester; import org.sonar.server.source.index.FileSourcesUpdaterHelper; import org.sonar.server.test.db.TestTesting; -import org.sonar.test.DbTests; import org.sonar.test.TestUtils; import static org.assertj.core.api.Assertions.assertThat; @@ -58,7 +56,7 @@ import static org.sonar.server.test.index.TestIndexDefinition.FIELD_TEST_UUID; import static org.sonar.server.test.index.TestIndexDefinition.INDEX; import static org.sonar.server.test.index.TestIndexDefinition.TYPE; -@Category(DbTests.class) + public class TestIndexerTest { @ClassRule diff --git a/server/sonar-server/src/test/java/org/sonar/server/test/index/TestResultSetIteratorTest.java b/server/sonar-server/src/test/java/org/sonar/server/test/index/TestResultSetIteratorTest.java index 76ad210717b..7485db97ce0 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/test/index/TestResultSetIteratorTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/test/index/TestResultSetIteratorTest.java @@ -27,13 +27,11 @@ import org.elasticsearch.action.update.UpdateRequest; import org.junit.After; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; import org.sonar.db.protobuf.DbFileSources; import org.sonar.server.source.index.FileSourcesUpdaterHelper; import org.sonar.server.test.db.TestTesting; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.fail; @@ -49,7 +47,7 @@ import static org.sonar.server.test.index.TestIndexDefinition.FIELD_STATUS; import static org.sonar.server.test.index.TestIndexDefinition.FIELD_TEST_UUID; import static org.sonar.server.test.index.TestIndexDefinition.FIELD_UPDATED_AT; -@Category(DbTests.class) + public class TestResultSetIteratorTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/test/ws/ListActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/test/ws/ListActionTest.java index 8e15837b7ce..18589727abd 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/test/ws/ListActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/test/ws/ListActionTest.java @@ -25,7 +25,6 @@ import org.junit.Before; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.config.Settings; import org.sonar.api.utils.System2; import org.sonar.api.web.UserRole; @@ -41,9 +40,8 @@ import org.sonar.server.test.index.TestIndex; import org.sonar.server.test.index.TestIndexDefinition; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; -@Category(DbTests.class) + public class ListActionTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/GroupMembershipServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/GroupMembershipServiceTest.java index 476d434bd6a..c62315399b1 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/GroupMembershipServiceTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/GroupMembershipServiceTest.java @@ -23,12 +23,10 @@ import com.google.common.collect.ImmutableMap; import java.util.List; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.core.user.GroupMembership; import org.sonar.db.DbTester; import org.sonar.server.exceptions.NotFoundException; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; @@ -36,7 +34,7 @@ import static org.junit.Assert.fail; /** * Use BbUnit tests because there's no IT on this feature for the moment */ -@Category(DbTests.class) + public class GroupMembershipServiceTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterTest.java index 4d5ee091f5f..f41e3188288 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/UserUpdaterTest.java @@ -26,7 +26,6 @@ import org.junit.Before; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.mockito.ArgumentCaptor; import org.sonar.api.config.Settings; import org.sonar.api.platform.NewUserHandler; @@ -49,7 +48,6 @@ import org.sonar.server.exceptions.ServerException; import org.sonar.server.user.index.UserIndexDefinition; import org.sonar.server.user.index.UserIndexer; import org.sonar.server.util.Validation; -import org.sonar.test.DbTests; import static com.google.common.collect.Lists.newArrayList; import static org.assertj.core.api.Assertions.assertThat; @@ -61,7 +59,7 @@ import static org.mockito.Mockito.when; import static org.sonar.api.CoreProperties.CORE_AUTHENTICATOR_LOCAL_USERS; import static org.sonar.api.CoreProperties.CORE_DEFAULT_GROUP; -@Category(DbTests.class) + public class UserUpdaterTest { static final String DEFAULT_LOGIN = "marius"; diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/index/UserIndexerTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/index/UserIndexerTest.java index a4ae7145a5d..7747d073660 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/index/UserIndexerTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/index/UserIndexerTest.java @@ -24,17 +24,15 @@ import org.junit.Before; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.config.Settings; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; import org.sonar.db.DbTester; import org.sonar.server.es.EsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class UserIndexerTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/index/UserResultSetIteratorTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/index/UserResultSetIteratorTest.java index 9414c646739..958f6ae0d51 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/index/UserResultSetIteratorTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/index/UserResultSetIteratorTest.java @@ -25,14 +25,12 @@ import java.util.Map; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class UserResultSetIteratorTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/ws/CreateActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/ws/CreateActionTest.java index bbb6374e95d..7f3671be323 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/ws/CreateActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/ws/CreateActionTest.java @@ -25,7 +25,6 @@ import org.junit.Before; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.config.Settings; import org.sonar.api.i18n.I18n; import org.sonar.api.server.ws.WebService; @@ -50,13 +49,12 @@ import org.sonar.server.user.index.UserIndex; import org.sonar.server.user.index.UserIndexDefinition; import org.sonar.server.user.index.UserIndexer; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -@Category(DbTests.class) + public class CreateActionTest { static final Settings settings = new Settings().setProperty("sonar.defaultGroup", "sonar-users"); diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/ws/DeactivateActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/ws/DeactivateActionTest.java index c313c7030de..e1c4cdd4c47 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/ws/DeactivateActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/ws/DeactivateActionTest.java @@ -23,7 +23,6 @@ import org.junit.Before; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.config.Settings; import org.sonar.api.server.ws.WebService; import org.sonar.api.utils.System2; @@ -48,13 +47,12 @@ import org.sonar.server.user.index.UserIndex; import org.sonar.server.user.index.UserIndexDefinition; import org.sonar.server.user.index.UserIndexer; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.sonar.db.user.UserTokenTesting.newUserToken; -@Category(DbTests.class) + public class DeactivateActionTest { static final Settings settings = new Settings(); diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/ws/SearchActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/ws/SearchActionTest.java index aba79a5f0a6..d9bf93548c7 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/user/ws/SearchActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/user/ws/SearchActionTest.java @@ -25,7 +25,6 @@ import org.junit.Before; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.config.Settings; import org.sonar.api.server.ws.WebService.Param; import org.sonar.api.utils.System2; @@ -43,14 +42,13 @@ import org.sonar.server.user.index.UserDoc; import org.sonar.server.user.index.UserIndex; import org.sonar.server.user.index.UserIndexDefinition; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.db.user.UserTesting.newUserDto; import static org.sonar.db.user.UserTokenTesting.newUserToken; -@Category(DbTests.class) + public class SearchActionTest { @ClassRule diff --git a/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/AddUserActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/AddUserActionTest.java index 5532539e51a..58b4f5137a1 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/AddUserActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/AddUserActionTest.java @@ -25,7 +25,6 @@ import org.apache.commons.lang.StringUtils; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.core.permission.GlobalPermissions; @@ -42,13 +41,12 @@ import org.sonar.db.user.UserGroupDto; import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.server.usergroups.ws.UserGroupsWsParameters.PARAM_GROUP_NAME; import static org.sonar.server.usergroups.ws.UserGroupsWsParameters.PARAM_LOGIN; -@Category(DbTests.class) + public class AddUserActionTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/CreateActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/CreateActionTest.java index 0bc8114db1c..0118dd9993d 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/CreateActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/CreateActionTest.java @@ -24,7 +24,6 @@ import org.apache.commons.lang.StringUtils; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.core.permission.GlobalPermissions; @@ -37,9 +36,8 @@ import org.sonar.server.exceptions.ForbiddenException; import org.sonar.server.exceptions.ServerException; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; -@Category(DbTests.class) + public class CreateActionTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/DeleteActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/DeleteActionTest.java index eb8c57b6dac..736aab507a4 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/DeleteActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/DeleteActionTest.java @@ -22,7 +22,6 @@ package org.sonar.server.usergroups.ws; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.CoreProperties; import org.sonar.api.config.Settings; import org.sonar.api.utils.System2; @@ -41,13 +40,12 @@ import org.sonar.db.user.UserGroupDto; import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.db.user.GroupTesting.newGroupDto; import static org.sonar.server.usergroups.ws.UserGroupsWsParameters.PARAM_GROUP_NAME; -@Category(DbTests.class) + public class DeleteActionTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/RemoveUserActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/RemoveUserActionTest.java index 29d6c00b905..cc206a856b0 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/RemoveUserActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/RemoveUserActionTest.java @@ -24,7 +24,6 @@ import org.apache.commons.lang.StringUtils; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.core.permission.GlobalPermissions; @@ -40,13 +39,12 @@ import org.sonar.db.user.UserGroupDto; import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.server.usergroups.ws.UserGroupsWsParameters.PARAM_GROUP_NAME; import static org.sonar.server.usergroups.ws.UserGroupsWsParameters.PARAM_LOGIN; -@Category(DbTests.class) + public class RemoveUserActionTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/SearchActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/SearchActionTest.java index 6c0a3bc3d08..605db91747d 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/SearchActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/SearchActionTest.java @@ -23,7 +23,6 @@ import org.apache.commons.lang.StringUtils; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.server.ws.WebService.Param; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; @@ -34,12 +33,11 @@ import org.sonar.db.user.GroupMembershipDao; import org.sonar.db.user.UserGroupDao; import org.sonar.db.user.UserGroupDto; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.db.user.GroupTesting.newGroupDto; -@Category(DbTests.class) + public class SearchActionTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/UpdateActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/UpdateActionTest.java index f9db4440af9..f0aa9741138 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/UpdateActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/UpdateActionTest.java @@ -24,7 +24,6 @@ import org.apache.commons.lang.StringUtils; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.core.permission.GlobalPermissions; @@ -40,9 +39,8 @@ import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.exceptions.ServerException; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsTester; -import org.sonar.test.DbTests; -@Category(DbTests.class) + public class UpdateActionTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/UsersActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/UsersActionTest.java index d3453675ed7..4c1b09f0697 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/UsersActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/usergroups/ws/UsersActionTest.java @@ -22,7 +22,6 @@ package org.sonar.server.usergroups.ws; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.server.ws.WebService.Param; import org.sonar.api.server.ws.WebService.SelectionMode; import org.sonar.api.utils.System2; @@ -38,12 +37,11 @@ import org.sonar.server.exceptions.NotFoundException; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.WsTester; import org.sonar.server.ws.WsTester.TestRequest; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.server.usergroups.ws.UserGroupsWsParameters.PARAM_GROUP_NAME; -@Category(DbTests.class) + public class UsersActionTest { @Rule diff --git a/server/sonar-server/src/test/java/org/sonar/server/usertoken/UserTokenAuthenticatorTest.java b/server/sonar-server/src/test/java/org/sonar/server/usertoken/UserTokenAuthenticatorTest.java index cb120c2b0c5..74de38b0037 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/usertoken/UserTokenAuthenticatorTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/usertoken/UserTokenAuthenticatorTest.java @@ -22,20 +22,18 @@ package org.sonar.server.usertoken; import com.google.common.base.Optional; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; import org.sonar.db.DbSession; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import static org.sonar.db.user.UserTokenTesting.newUserToken; -@Category(DbTests.class) + public class UserTokenAuthenticatorTest { static final String GRACE_HOPPER = "grace.hopper"; static final String ADA_LOVELACE = "ada.lovelace"; diff --git a/server/sonar-server/src/test/java/org/sonar/server/usertoken/ws/GenerateActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/usertoken/ws/GenerateActionTest.java index 942c205eee5..bc04573b3c7 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/usertoken/ws/GenerateActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/usertoken/ws/GenerateActionTest.java @@ -25,7 +25,6 @@ import javax.annotation.Nullable; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.core.permission.GlobalPermissions; @@ -38,7 +37,6 @@ import org.sonar.server.tester.UserSessionRule; import org.sonar.server.usertoken.TokenGenerator; import org.sonar.server.ws.TestRequest; import org.sonar.server.ws.WsActionTester; -import org.sonar.test.DbTests; import org.sonarqube.ws.MediaTypes; import org.sonarqube.ws.WsUserTokens.GenerateWsResponse; @@ -53,7 +51,7 @@ import static org.sonar.test.JsonAssert.assertJson; import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_LOGIN; import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_NAME; -@Category(DbTests.class) + public class GenerateActionTest { private static final String GRACE_HOPPER = "grace.hopper"; private static final String ADA_LOVELACE = "ada.lovelace"; diff --git a/server/sonar-server/src/test/java/org/sonar/server/usertoken/ws/RevokeActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/usertoken/ws/RevokeActionTest.java index a2c5d12d22a..9a25f4148fa 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/usertoken/ws/RevokeActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/usertoken/ws/RevokeActionTest.java @@ -23,7 +23,6 @@ import javax.annotation.Nullable; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.core.permission.GlobalPermissions; @@ -35,14 +34,13 @@ import org.sonar.server.exceptions.ForbiddenException; import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.TestRequest; import org.sonar.server.ws.WsActionTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.db.user.UserTokenTesting.newUserToken; import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_LOGIN; import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_NAME; -@Category(DbTests.class) + public class RevokeActionTest { static final String GRACE_HOPPER = "grace.hopper"; static final String ADA_LOVELACE = "ada.lovelace"; diff --git a/server/sonar-server/src/test/java/org/sonar/server/usertoken/ws/SearchActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/usertoken/ws/SearchActionTest.java index 0dadb0b5755..5ae4ae3139f 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/usertoken/ws/SearchActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/usertoken/ws/SearchActionTest.java @@ -25,7 +25,6 @@ import javax.annotation.Nullable; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.core.permission.GlobalPermissions; @@ -39,7 +38,6 @@ import org.sonar.server.tester.UserSessionRule; import org.sonar.server.ws.TestRequest; import org.sonar.server.ws.TestResponse; import org.sonar.server.ws.WsActionTester; -import org.sonar.test.DbTests; import org.sonarqube.ws.MediaTypes; import org.sonarqube.ws.WsUserTokens.SearchWsResponse; @@ -49,7 +47,7 @@ import static org.sonar.db.user.UserTokenTesting.newUserToken; import static org.sonar.test.JsonAssert.assertJson; import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_LOGIN; -@Category(DbTests.class) + public class SearchActionTest { static final String GRACE_HOPPER = "grace.hopper"; static final String ADA_LOVELACE = "ada.lovelace"; diff --git a/server/sonar-server/src/test/java/org/sonar/server/view/index/ViewIndexerTest.java b/server/sonar-server/src/test/java/org/sonar/server/view/index/ViewIndexerTest.java index 998c20bd503..1427ed94892 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/view/index/ViewIndexerTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/view/index/ViewIndexerTest.java @@ -27,7 +27,6 @@ import org.junit.Before; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.config.Settings; import org.sonar.api.utils.System2; import org.sonar.api.web.UserRole; @@ -51,12 +50,11 @@ import org.sonar.server.issue.index.IssueIndex; import org.sonar.server.issue.index.IssueIndexDefinition; import org.sonar.server.issue.index.IssueIndexer; import org.sonar.server.tester.UserSessionRule; -import org.sonar.test.DbTests; import static com.google.common.collect.Lists.newArrayList; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class ViewIndexerTest { @Rule diff --git a/sonar-db/pom.xml b/sonar-db/pom.xml index 9cb8dc2b64c..06406d3470f 100644 --- a/sonar-db/pom.xml +++ b/sonar-db/pom.xml @@ -200,9 +200,6 @@ with-db-drivers - - org.sonar.test.DbTests - mysql diff --git a/sonar-db/src/test/java/org/sonar/core/user/DeprecatedUserFinderTest.java b/sonar-db/src/test/java/org/sonar/core/user/DeprecatedUserFinderTest.java index 39af3583edc..427b0473118 100644 --- a/sonar-db/src/test/java/org/sonar/core/user/DeprecatedUserFinderTest.java +++ b/sonar-db/src/test/java/org/sonar/core/user/DeprecatedUserFinderTest.java @@ -22,19 +22,17 @@ package org.sonar.core.user; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.database.model.User; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; import org.sonar.db.user.UserDao; -import org.sonar.test.DbTests; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; import static org.junit.Assert.assertThat; import static org.mockito.Mockito.mock; -@Category(DbTests.class) + public class DeprecatedUserFinderTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/DatabaseUtilsTest.java b/sonar-db/src/test/java/org/sonar/db/DatabaseUtilsTest.java index 31c928808f1..b529c18ebd6 100644 --- a/sonar-db/src/test/java/org/sonar/db/DatabaseUtilsTest.java +++ b/sonar-db/src/test/java/org/sonar/db/DatabaseUtilsTest.java @@ -33,14 +33,12 @@ import java.util.Objects; import javax.annotation.Nullable; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.api.utils.log.LogTester; import org.sonar.api.utils.log.LoggerLevel; import org.sonar.api.utils.log.Loggers; import org.sonar.db.dialect.Oracle; -import org.sonar.test.DbTests; import static com.google.common.collect.Lists.newArrayList; import static java.util.Arrays.asList; @@ -55,7 +53,7 @@ import static org.sonar.db.WildcardPosition.AFTER; import static org.sonar.db.WildcardPosition.BEFORE; import static org.sonar.db.WildcardPosition.BEFORE_AND_AFTER; -@Category(DbTests.class) + public class DatabaseUtilsTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/IsAliveMapperTest.java b/sonar-db/src/test/java/org/sonar/db/IsAliveMapperTest.java index 34e7b76c17c..50a893e9d06 100644 --- a/sonar-db/src/test/java/org/sonar/db/IsAliveMapperTest.java +++ b/sonar-db/src/test/java/org/sonar/db/IsAliveMapperTest.java @@ -23,13 +23,11 @@ import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class IsAliveMapperTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/ResultSetIteratorTest.java b/sonar-db/src/test/java/org/sonar/db/ResultSetIteratorTest.java index da9e6a5797f..3124f158fad 100644 --- a/sonar-db/src/test/java/org/sonar/db/ResultSetIteratorTest.java +++ b/sonar-db/src/test/java/org/sonar/db/ResultSetIteratorTest.java @@ -26,14 +26,12 @@ import java.sql.SQLException; import java.util.NoSuchElementException; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; -@Category(DbTests.class) + public class ResultSetIteratorTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/activity/ActivityDaoTest.java b/sonar-db/src/test/java/org/sonar/db/activity/ActivityDaoTest.java index 752336c0b8e..d43fb92738f 100644 --- a/sonar-db/src/test/java/org/sonar/db/activity/ActivityDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/activity/ActivityDaoTest.java @@ -22,16 +22,14 @@ package org.sonar.db.activity; import java.util.Map; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -@Category(DbTests.class) + public class ActivityDaoTest { System2 system = mock(System2.class); diff --git a/sonar-db/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java b/sonar-db/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java index 05ab62daee3..8b2b03adde9 100644 --- a/sonar-db/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java @@ -24,16 +24,14 @@ import java.util.Collections; import java.util.List; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.internal.TestSystem2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.db.ce.CeTaskTypes.REPORT; -@Category(DbTests.class) + public class CeActivityDaoTest { TestSystem2 system2 = new TestSystem2().setNow(1_450_000_000_000L); diff --git a/sonar-db/src/test/java/org/sonar/db/ce/CeQueueDaoTest.java b/sonar-db/src/test/java/org/sonar/db/ce/CeQueueDaoTest.java index 471c0a29944..9cefc290f36 100644 --- a/sonar-db/src/test/java/org/sonar/db/ce/CeQueueDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/ce/CeQueueDaoTest.java @@ -24,19 +24,17 @@ import java.util.Collections; import java.util.List; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.Paging; import org.sonar.api.utils.System2; import org.sonar.api.utils.internal.TestSystem2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static com.google.common.collect.Lists.newArrayList; import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.db.ce.CeQueueTesting.newCeQueueDto; -@Category(DbTests.class) + public class CeQueueDaoTest { System2 system2 = new TestSystem2().setNow(1_450_000_000_000L); diff --git a/sonar-db/src/test/java/org/sonar/db/component/ComponentDaoTest.java b/sonar-db/src/test/java/org/sonar/db/component/ComponentDaoTest.java index dd5c13782ca..edbb597dc98 100644 --- a/sonar-db/src/test/java/org/sonar/db/component/ComponentDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/component/ComponentDaoTest.java @@ -24,7 +24,6 @@ import java.util.Collections; import java.util.List; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.resources.Qualifiers; import org.sonar.api.utils.DateUtils; @@ -32,7 +31,6 @@ import org.sonar.api.utils.System2; import org.sonar.db.DbSession; import org.sonar.db.DbTester; import org.sonar.db.RowNotFoundException; -import org.sonar.test.DbTests; import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.Sets.newHashSet; @@ -48,7 +46,7 @@ import static org.sonar.db.component.ComponentTesting.newProjectDto; import static org.sonar.db.component.ComponentTesting.newSubView; import static org.sonar.db.component.ComponentTesting.newView; -@Category(DbTests.class) + public class ComponentDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/component/ComponentDaoWithDuplicatedKeysTest.java b/sonar-db/src/test/java/org/sonar/db/component/ComponentDaoWithDuplicatedKeysTest.java index 122c108ed03..6adf642245d 100644 --- a/sonar-db/src/test/java/org/sonar/db/component/ComponentDaoWithDuplicatedKeysTest.java +++ b/sonar-db/src/test/java/org/sonar/db/component/ComponentDaoWithDuplicatedKeysTest.java @@ -21,12 +21,10 @@ package org.sonar.db.component; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; import org.sonar.db.DbSession; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.db.component.ComponentTesting.newProjectDto; @@ -34,7 +32,7 @@ import static org.sonar.db.component.ComponentTesting.newProjectDto; /** * On H2, the index on PROJECTS.KEE is unique. In order to simulate the MySQL behaviour where the index is not unique, we need to create a schema where there's no unique index on PROJECTS.KEE */ -@Category(DbTests.class) + public class ComponentDaoWithDuplicatedKeysTest { static final String PROJECT_KEY = "PROJECT_KEY"; diff --git a/sonar-db/src/test/java/org/sonar/db/component/ComponentLinkDaoTest.java b/sonar-db/src/test/java/org/sonar/db/component/ComponentLinkDaoTest.java index 3700d5cc1a7..39ad48d9ae5 100644 --- a/sonar-db/src/test/java/org/sonar/db/component/ComponentLinkDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/component/ComponentLinkDaoTest.java @@ -22,14 +22,12 @@ package org.sonar.db.component; import java.util.List; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class ComponentLinkDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/component/ResourceDaoTest.java b/sonar-db/src/test/java/org/sonar/db/component/ResourceDaoTest.java index 4d918699a40..0c13476bde8 100644 --- a/sonar-db/src/test/java/org/sonar/db/component/ResourceDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/component/ResourceDaoTest.java @@ -26,20 +26,18 @@ import java.util.List; import javax.annotation.Nullable; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.component.Component; import org.sonar.api.resources.Qualifiers; import org.sonar.api.resources.Scopes; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static com.google.common.collect.Lists.newArrayList; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -@Category(DbTests.class) + public class ResourceDaoTest { static System2 system = mock(System2.class); diff --git a/sonar-db/src/test/java/org/sonar/db/component/ResourceIndexDaoTest.java b/sonar-db/src/test/java/org/sonar/db/component/ResourceIndexDaoTest.java index 9c393f0e67c..9c33e3e3d4d 100644 --- a/sonar-db/src/test/java/org/sonar/db/component/ResourceIndexDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/component/ResourceIndexDaoTest.java @@ -22,16 +22,14 @@ package org.sonar.db.component; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.resources.Qualifiers; import org.sonar.api.utils.System2; import org.sonar.db.DbSession; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class ResourceIndexDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/component/ResourceKeyUpdaterDaoTest.java b/sonar-db/src/test/java/org/sonar/db/component/ResourceKeyUpdaterDaoTest.java index 6ddbf7e99e3..c71fd65f1b4 100644 --- a/sonar-db/src/test/java/org/sonar/db/component/ResourceKeyUpdaterDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/component/ResourceKeyUpdaterDaoTest.java @@ -22,15 +22,13 @@ package org.sonar.db.component; import java.util.Map; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class ResourceKeyUpdaterDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/component/SnapshotDaoTest.java b/sonar-db/src/test/java/org/sonar/db/component/SnapshotDaoTest.java index 59bbea74db0..4fdd5c749bd 100644 --- a/sonar-db/src/test/java/org/sonar/db/component/SnapshotDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/component/SnapshotDaoTest.java @@ -23,7 +23,6 @@ import java.util.Date; import java.util.List; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.resources.Qualifiers; import org.sonar.api.resources.Scopes; @@ -31,7 +30,6 @@ import org.sonar.api.utils.DateUtils; import org.sonar.api.utils.System2; import org.sonar.db.DbSession; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static com.google.common.collect.Lists.newArrayList; import static org.assertj.core.api.Assertions.assertThat; @@ -41,7 +39,7 @@ import static org.sonar.db.component.SnapshotQuery.SORT_ORDER.ASC; import static org.sonar.db.component.SnapshotQuery.SORT_ORDER.DESC; import static org.sonar.db.component.SnapshotTesting.newSnapshotForProject; -@Category(DbTests.class) + public class SnapshotDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/dashboard/ActiveDashboardDaoTest.java b/sonar-db/src/test/java/org/sonar/db/dashboard/ActiveDashboardDaoTest.java index 38d0d20bff9..ba0fa867d56 100644 --- a/sonar-db/src/test/java/org/sonar/db/dashboard/ActiveDashboardDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/dashboard/ActiveDashboardDaoTest.java @@ -21,15 +21,13 @@ package org.sonar.db.dashboard; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbSession; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class ActiveDashboardDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/dashboard/DashboardDaoTest.java b/sonar-db/src/test/java/org/sonar/db/dashboard/DashboardDaoTest.java index e9c1c5de4ba..d3185180edc 100644 --- a/sonar-db/src/test/java/org/sonar/db/dashboard/DashboardDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/dashboard/DashboardDaoTest.java @@ -22,17 +22,15 @@ package org.sonar.db.dashboard; import java.util.Date; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThat; -@Category(DbTests.class) + public class DashboardDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/dashboard/WidgetDaoTest.java b/sonar-db/src/test/java/org/sonar/db/dashboard/WidgetDaoTest.java index 52719045e3b..569235c609f 100644 --- a/sonar-db/src/test/java/org/sonar/db/dashboard/WidgetDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/dashboard/WidgetDaoTest.java @@ -22,14 +22,11 @@ package org.sonar.db.dashboard; import java.util.Collection; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) public class WidgetDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/duplication/DuplicationDaoTest.java b/sonar-db/src/test/java/org/sonar/db/duplication/DuplicationDaoTest.java index b9cd5e367dc..eeaf8e5e07a 100644 --- a/sonar-db/src/test/java/org/sonar/db/duplication/DuplicationDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/duplication/DuplicationDaoTest.java @@ -22,16 +22,14 @@ package org.sonar.db.duplication; import java.util.List; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbSession; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class DuplicationDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/event/EventDaoTest.java b/sonar-db/src/test/java/org/sonar/db/event/EventDaoTest.java index cf62f001775..649b941006a 100644 --- a/sonar-db/src/test/java/org/sonar/db/event/EventDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/event/EventDaoTest.java @@ -22,14 +22,12 @@ package org.sonar.db.event; import java.util.List; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class EventDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/issue/ActionPlanDaoTest.java b/sonar-db/src/test/java/org/sonar/db/issue/ActionPlanDaoTest.java index 86a52e8e491..2d9edc4db87 100644 --- a/sonar-db/src/test/java/org/sonar/db/issue/ActionPlanDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/issue/ActionPlanDaoTest.java @@ -23,15 +23,12 @@ import java.util.Collection; import java.util.List; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static com.google.common.collect.Lists.newArrayList; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) public class ActionPlanDaoTest { private static final String[] EXCLUDED_COLUMNS = new String[] {"id", "created_at", "updated_at"}; diff --git a/sonar-db/src/test/java/org/sonar/db/issue/ActionPlanStatsDaoTest.java b/sonar-db/src/test/java/org/sonar/db/issue/ActionPlanStatsDaoTest.java index 6425575b858..fed54670c62 100644 --- a/sonar-db/src/test/java/org/sonar/db/issue/ActionPlanStatsDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/issue/ActionPlanStatsDaoTest.java @@ -22,14 +22,12 @@ package org.sonar.db.issue; import java.util.Collection; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class ActionPlanStatsDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/issue/IssueChangeDaoTest.java b/sonar-db/src/test/java/org/sonar/db/issue/IssueChangeDaoTest.java index a87dd5370b1..c6cd4492344 100644 --- a/sonar-db/src/test/java/org/sonar/db/issue/IssueChangeDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/issue/IssueChangeDaoTest.java @@ -24,20 +24,18 @@ import java.util.Collections; import java.util.List; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.DateUtils; import org.sonar.api.utils.System2; import org.sonar.core.issue.DefaultIssueComment; import org.sonar.core.issue.FieldDiffs; import org.sonar.db.DbSession; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static com.google.common.collect.Lists.newArrayList; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; -@Category(DbTests.class) + public class IssueChangeDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/issue/IssueChangeMapperTest.java b/sonar-db/src/test/java/org/sonar/db/issue/IssueChangeMapperTest.java index f1b62efdfc9..0d929d96185 100644 --- a/sonar-db/src/test/java/org/sonar/db/issue/IssueChangeMapperTest.java +++ b/sonar-db/src/test/java/org/sonar/db/issue/IssueChangeMapperTest.java @@ -22,12 +22,10 @@ package org.sonar.db.issue; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; -@Category(DbTests.class) + public class IssueChangeMapperTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/issue/IssueDaoTest.java b/sonar-db/src/test/java/org/sonar/db/issue/IssueDaoTest.java index 853205ccf4a..c6b6f214611 100644 --- a/sonar-db/src/test/java/org/sonar/db/issue/IssueDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/issue/IssueDaoTest.java @@ -23,7 +23,6 @@ import java.util.List; import org.apache.ibatis.executor.result.DefaultResultHandler; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.rule.RuleKey; import org.sonar.api.utils.System2; @@ -33,12 +32,11 @@ import org.sonar.db.component.ComponentDto; import org.sonar.db.component.ComponentTesting; import org.sonar.db.rule.RuleDto; import org.sonar.db.rule.RuleTesting; -import org.sonar.test.DbTests; import static java.util.Arrays.asList; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class IssueDaoTest { public static final RuleDto RULE = RuleTesting.newXooX1(); diff --git a/sonar-db/src/test/java/org/sonar/db/issue/IssueFilterDaoTest.java b/sonar-db/src/test/java/org/sonar/db/issue/IssueFilterDaoTest.java index cdea57dde3c..e4d9af8d143 100644 --- a/sonar-db/src/test/java/org/sonar/db/issue/IssueFilterDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/issue/IssueFilterDaoTest.java @@ -22,14 +22,12 @@ package org.sonar.db.issue; import java.util.List; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class IssueFilterDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/issue/IssueFilterFavouriteDaoTest.java b/sonar-db/src/test/java/org/sonar/db/issue/IssueFilterFavouriteDaoTest.java index 142a66f22eb..1450adb0994 100644 --- a/sonar-db/src/test/java/org/sonar/db/issue/IssueFilterFavouriteDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/issue/IssueFilterFavouriteDaoTest.java @@ -22,14 +22,12 @@ package org.sonar.db.issue; import java.util.List; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class IssueFilterFavouriteDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/issue/IssueMapperTest.java b/sonar-db/src/test/java/org/sonar/db/issue/IssueMapperTest.java index af47700e03e..812f5a7452b 100644 --- a/sonar-db/src/test/java/org/sonar/db/issue/IssueMapperTest.java +++ b/sonar-db/src/test/java/org/sonar/db/issue/IssueMapperTest.java @@ -21,15 +21,13 @@ package org.sonar.db.issue; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.DateUtils; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class IssueMapperTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/measure/MeasureDaoTest.java b/sonar-db/src/test/java/org/sonar/db/measure/MeasureDaoTest.java index fa2985530b7..a807759c70b 100644 --- a/sonar-db/src/test/java/org/sonar/db/measure/MeasureDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/measure/MeasureDaoTest.java @@ -31,7 +31,6 @@ import java.util.Map; import javax.annotation.Nullable; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; import org.sonar.db.DbSession; @@ -39,14 +38,13 @@ import org.sonar.db.DbTester; import org.sonar.db.component.ComponentDto; import org.sonar.db.component.ComponentTesting; import org.sonar.db.component.SnapshotDto; -import org.sonar.test.DbTests; import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.Sets.newHashSet; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.guava.api.Assertions.assertThat; -@Category(DbTests.class) + public class MeasureDaoTest { private static final int SNAPSHOT_ID = 5; diff --git a/sonar-db/src/test/java/org/sonar/db/measure/custom/CustomMeasureDaoTest.java b/sonar-db/src/test/java/org/sonar/db/measure/custom/CustomMeasureDaoTest.java index 1c9216a6887..29de726f6c7 100644 --- a/sonar-db/src/test/java/org/sonar/db/measure/custom/CustomMeasureDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/measure/custom/CustomMeasureDaoTest.java @@ -24,19 +24,17 @@ import java.util.List; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.db.DbSession; import org.sonar.db.DbTester; import org.sonar.db.RowNotFoundException; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.offset; import static org.sonar.db.measure.custom.CustomMeasureTesting.newCustomMeasureDto; -@Category(DbTests.class) + public class CustomMeasureDaoTest { @Rule public DbTester db = DbTester.create(System2.INSTANCE); diff --git a/sonar-db/src/test/java/org/sonar/db/metric/MetricDaoTest.java b/sonar-db/src/test/java/org/sonar/db/metric/MetricDaoTest.java index 5cdff639b91..369e263b383 100644 --- a/sonar-db/src/test/java/org/sonar/db/metric/MetricDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/metric/MetricDaoTest.java @@ -25,19 +25,17 @@ import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.db.DbSession; import org.sonar.db.DbTester; import org.sonar.db.RowNotFoundException; -import org.sonar.test.DbTests; import static com.google.common.collect.Sets.newHashSet; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.db.metric.MetricTesting.newMetricDto; -@Category(DbTests.class) + public class MetricDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/permission/GroupWithPermissionDaoTest.java b/sonar-db/src/test/java/org/sonar/db/permission/GroupWithPermissionDaoTest.java index ddb3b5b9923..a77ea0debe8 100644 --- a/sonar-db/src/test/java/org/sonar/db/permission/GroupWithPermissionDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/permission/GroupWithPermissionDaoTest.java @@ -27,13 +27,11 @@ import org.apache.ibatis.session.ResultContext; import org.apache.ibatis.session.ResultHandler; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbSession; import org.sonar.db.DbTester; import org.sonar.db.user.GroupDto; import org.sonar.db.user.GroupRoleDto; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.api.web.UserRole.ADMIN; @@ -41,7 +39,7 @@ import static org.sonar.api.web.UserRole.ISSUE_ADMIN; import static org.sonar.api.web.UserRole.USER; import static org.sonar.db.user.GroupTesting.newGroupDto; -@Category(DbTests.class) + public class GroupWithPermissionDaoTest { private static final long COMPONENT_ID = 100L; diff --git a/sonar-db/src/test/java/org/sonar/db/permission/GroupWithPermissionTemplateDaoTest.java b/sonar-db/src/test/java/org/sonar/db/permission/GroupWithPermissionTemplateDaoTest.java index 97f08216a52..b6838b1df55 100644 --- a/sonar-db/src/test/java/org/sonar/db/permission/GroupWithPermissionTemplateDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/permission/GroupWithPermissionTemplateDaoTest.java @@ -22,16 +22,14 @@ package org.sonar.db.permission; import java.util.List; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.api.web.UserRole; import org.sonar.db.DbSession; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class GroupWithPermissionTemplateDaoTest { private static final long TEMPLATE_ID = 50L; diff --git a/sonar-db/src/test/java/org/sonar/db/permission/PermissionRepositoryTest.java b/sonar-db/src/test/java/org/sonar/db/permission/PermissionRepositoryTest.java index 241730df743..fbce7f1857e 100644 --- a/sonar-db/src/test/java/org/sonar/db/permission/PermissionRepositoryTest.java +++ b/sonar-db/src/test/java/org/sonar/db/permission/PermissionRepositoryTest.java @@ -22,7 +22,6 @@ package org.sonar.db.permission; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.config.Settings; import org.sonar.api.utils.System2; @@ -30,13 +29,12 @@ import org.sonar.api.web.UserRole; import org.sonar.db.DbSession; import org.sonar.db.DbTester; import org.sonar.db.user.RoleDao; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -@Category(DbTests.class) + public class PermissionRepositoryTest { static final String DEFAULT_TEMPLATE = "default_20130101_010203"; diff --git a/sonar-db/src/test/java/org/sonar/db/permission/PermissionTemplateDaoTest.java b/sonar-db/src/test/java/org/sonar/db/permission/PermissionTemplateDaoTest.java index a6a2696806b..6998f5c7cce 100644 --- a/sonar-db/src/test/java/org/sonar/db/permission/PermissionTemplateDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/permission/PermissionTemplateDaoTest.java @@ -30,7 +30,6 @@ import org.apache.ibatis.session.ResultContext; import org.apache.ibatis.session.ResultHandler; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; @@ -38,7 +37,6 @@ import org.sonar.db.DbSession; import org.sonar.db.DbTester; import org.sonar.db.user.GroupDto; import org.sonar.db.user.UserDto; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; @@ -51,7 +49,7 @@ import static org.sonar.db.permission.PermissionTemplateTesting.newPermissionTem import static org.sonar.db.user.GroupTesting.newGroupDto; import static org.sonar.db.user.UserTesting.newUserDto; -@Category(DbTests.class) + public class PermissionTemplateDaoTest { System2 system = mock(System2.class); diff --git a/sonar-db/src/test/java/org/sonar/db/permission/UserWithPermissionDaoTest.java b/sonar-db/src/test/java/org/sonar/db/permission/UserWithPermissionDaoTest.java index 62654a5fdf6..a7891ba046c 100644 --- a/sonar-db/src/test/java/org/sonar/db/permission/UserWithPermissionDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/permission/UserWithPermissionDaoTest.java @@ -29,13 +29,11 @@ import org.apache.ibatis.session.ResultContext; import org.apache.ibatis.session.ResultHandler; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbSession; import org.sonar.db.DbTester; import org.sonar.db.user.UserDto; import org.sonar.db.user.UserRoleDto; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.api.web.UserRole.ADMIN; @@ -43,7 +41,7 @@ import static org.sonar.api.web.UserRole.ISSUE_ADMIN; import static org.sonar.api.web.UserRole.USER; import static org.sonar.db.user.UserTesting.newUserDto; -@Category(DbTests.class) + public class UserWithPermissionDaoTest { private static final long COMPONENT_ID = 100L; diff --git a/sonar-db/src/test/java/org/sonar/db/permission/UserWithPermissionTemplateDaoTest.java b/sonar-db/src/test/java/org/sonar/db/permission/UserWithPermissionTemplateDaoTest.java index cd4c537b827..7665ce965ea 100644 --- a/sonar-db/src/test/java/org/sonar/db/permission/UserWithPermissionTemplateDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/permission/UserWithPermissionTemplateDaoTest.java @@ -25,14 +25,12 @@ import java.util.List; import javax.annotation.Nullable; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class UserWithPermissionTemplateDaoTest { private static final Long TEMPLATE_ID = 50L; diff --git a/sonar-db/src/test/java/org/sonar/db/property/PropertiesDaoTest.java b/sonar-db/src/test/java/org/sonar/db/property/PropertiesDaoTest.java index 1df9b30d760..0071be12609 100644 --- a/sonar-db/src/test/java/org/sonar/db/property/PropertiesDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/property/PropertiesDaoTest.java @@ -24,17 +24,15 @@ import java.util.Arrays; import java.util.List; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; -@Category(DbTests.class) + public class PropertiesDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/purge/PurgeCommandsTest.java b/sonar-db/src/test/java/org/sonar/db/purge/PurgeCommandsTest.java index 35beff8a242..c2955d9d029 100644 --- a/sonar-db/src/test/java/org/sonar/db/purge/PurgeCommandsTest.java +++ b/sonar-db/src/test/java/org/sonar/db/purge/PurgeCommandsTest.java @@ -22,15 +22,13 @@ package org.sonar.db.purge; import java.util.List; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static com.google.common.collect.Lists.newArrayList; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class PurgeCommandsTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/purge/PurgeDaoTest.java b/sonar-db/src/test/java/org/sonar/db/purge/PurgeDaoTest.java index 5c7192d66ee..9f4099b8ea1 100644 --- a/sonar-db/src/test/java/org/sonar/db/purge/PurgeDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/purge/PurgeDaoTest.java @@ -22,7 +22,6 @@ package org.sonar.db.purge; import java.util.List; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.resources.Scopes; import org.sonar.api.utils.System2; import org.sonar.core.util.Uuids; @@ -33,14 +32,13 @@ import org.sonar.db.ce.CeActivityDto; import org.sonar.db.ce.CeQueueDto; import org.sonar.db.component.ComponentDto; import org.sonar.db.component.ComponentTesting; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import static org.sonar.db.ce.CeTaskTypes.REPORT; -@Category(DbTests.class) + public class PurgeDaoTest { System2 system2 = mock(System2.class); diff --git a/sonar-db/src/test/java/org/sonar/db/qualitygate/ProjectQgateAssociationDaoTest.java b/sonar-db/src/test/java/org/sonar/db/qualitygate/ProjectQgateAssociationDaoTest.java index a02e6b67b24..cc83b038bcc 100644 --- a/sonar-db/src/test/java/org/sonar/db/qualitygate/ProjectQgateAssociationDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/qualitygate/ProjectQgateAssociationDaoTest.java @@ -22,14 +22,12 @@ package org.sonar.db.qualitygate; import java.util.List; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class ProjectQgateAssociationDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/qualitygate/QualityGateConditionDaoTest.java b/sonar-db/src/test/java/org/sonar/db/qualitygate/QualityGateConditionDaoTest.java index 84a6c4d446f..93e54d3b518 100644 --- a/sonar-db/src/test/java/org/sonar/db/qualitygate/QualityGateConditionDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/qualitygate/QualityGateConditionDaoTest.java @@ -21,14 +21,12 @@ package org.sonar.db.qualitygate; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class QualityGateConditionDaoTest { private static final String[] COLUMNS_WITHOUT_TIMESTAMPS = { diff --git a/sonar-db/src/test/java/org/sonar/db/qualitygate/QualityGateDaoTest.java b/sonar-db/src/test/java/org/sonar/db/qualitygate/QualityGateDaoTest.java index 423db45d1fb..9520893eead 100644 --- a/sonar-db/src/test/java/org/sonar/db/qualitygate/QualityGateDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/qualitygate/QualityGateDaoTest.java @@ -23,14 +23,12 @@ import java.util.Collection; import java.util.Iterator; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class QualityGateDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/qualityprofile/ActiveRuleDaoTest.java b/sonar-db/src/test/java/org/sonar/db/qualityprofile/ActiveRuleDaoTest.java index e04b39f9296..2286653cbfa 100644 --- a/sonar-db/src/test/java/org/sonar/db/qualityprofile/ActiveRuleDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/qualityprofile/ActiveRuleDaoTest.java @@ -22,7 +22,6 @@ package org.sonar.db.qualityprofile; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.rule.Severity; import org.sonar.api.utils.System2; import org.sonar.db.DbClient; @@ -30,7 +29,6 @@ import org.sonar.db.DbSession; import org.sonar.db.DbTester; import org.sonar.db.rule.RuleDto; import org.sonar.db.rule.RuleTesting; -import org.sonar.test.DbTests; import static java.util.Arrays.asList; import static org.assertj.core.api.Assertions.assertThat; @@ -38,7 +36,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; // TODO add missing tests -@Category(DbTests.class) + public class ActiveRuleDaoTest { static final long NOW = 10000000L; diff --git a/sonar-db/src/test/java/org/sonar/db/qualityprofile/QualityProfileDaoTest.java b/sonar-db/src/test/java/org/sonar/db/qualityprofile/QualityProfileDaoTest.java index ca6ff253912..f53a1edd2b1 100644 --- a/sonar-db/src/test/java/org/sonar/db/qualityprofile/QualityProfileDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/qualityprofile/QualityProfileDaoTest.java @@ -24,17 +24,15 @@ import org.assertj.core.data.MapEntry; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.core.util.UtcDateUtils; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -@Category(DbTests.class) + public class QualityProfileDaoTest { System2 system = mock(System2.class); diff --git a/sonar-db/src/test/java/org/sonar/db/rule/RuleDaoTest.java b/sonar-db/src/test/java/org/sonar/db/rule/RuleDaoTest.java index 8da2677ea43..41d2b9dcb70 100644 --- a/sonar-db/src/test/java/org/sonar/db/rule/RuleDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/rule/RuleDaoTest.java @@ -29,7 +29,6 @@ import org.apache.ibatis.session.ResultContext; import org.apache.ibatis.session.ResultHandler; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.rule.RuleKey; import org.sonar.api.rule.RuleStatus; @@ -40,14 +39,13 @@ import org.sonar.api.utils.DateUtils; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; import org.sonar.db.RowNotFoundException; -import org.sonar.test.DbTests; import static java.util.Arrays.asList; import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.guava.api.Assertions.assertThat; -@Category(DbTests.class) + public class RuleDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/source/FileSourceDaoTest.java b/sonar-db/src/test/java/org/sonar/db/source/FileSourceDaoTest.java index 454df6985cd..7047b7a34e4 100644 --- a/sonar-db/src/test/java/org/sonar/db/source/FileSourceDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/source/FileSourceDaoTest.java @@ -25,16 +25,14 @@ import java.io.Reader; import org.apache.commons.io.IOUtils; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbSession; import org.sonar.db.DbTester; import org.sonar.db.source.FileSourceDto.Type; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class FileSourceDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/user/AuthorDaoTest.java b/sonar-db/src/test/java/org/sonar/db/user/AuthorDaoTest.java index bfc70d53abc..6b930fe76cb 100644 --- a/sonar-db/src/test/java/org/sonar/db/user/AuthorDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/user/AuthorDaoTest.java @@ -22,16 +22,14 @@ package org.sonar.db.user; import org.junit.After; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.db.DbSession; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class AuthorDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/user/AuthorizationDaoTest.java b/sonar-db/src/test/java/org/sonar/db/user/AuthorizationDaoTest.java index 75cfe32d742..635c8da8cc8 100644 --- a/sonar-db/src/test/java/org/sonar/db/user/AuthorizationDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/user/AuthorizationDaoTest.java @@ -24,14 +24,12 @@ import java.util.Collection; import java.util.Collections; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class AuthorizationDaoTest { private static final int USER = 100; diff --git a/sonar-db/src/test/java/org/sonar/db/user/GroupDaoTest.java b/sonar-db/src/test/java/org/sonar/db/user/GroupDaoTest.java index efd1887a503..cf6fedb69fb 100644 --- a/sonar-db/src/test/java/org/sonar/db/user/GroupDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/user/GroupDaoTest.java @@ -22,19 +22,17 @@ package org.sonar.db.user; import java.util.List; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.DateUtils; import org.sonar.api.utils.System2; import org.sonar.db.DbSession; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import static org.sonar.db.user.GroupTesting.newGroupDto; -@Category(DbTests.class) + public class GroupDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/user/GroupMembershipDaoTest.java b/sonar-db/src/test/java/org/sonar/db/user/GroupMembershipDaoTest.java index 6b82b32bf70..ec8203c87cb 100644 --- a/sonar-db/src/test/java/org/sonar/db/user/GroupMembershipDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/user/GroupMembershipDaoTest.java @@ -24,15 +24,13 @@ import java.util.Arrays; import java.util.List; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.data.MapEntry.entry; -@Category(DbTests.class) + public class GroupMembershipDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/user/RoleDaoTest.java b/sonar-db/src/test/java/org/sonar/db/user/RoleDaoTest.java index 808b732d9f5..70fde5c27c1 100644 --- a/sonar-db/src/test/java/org/sonar/db/user/RoleDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/user/RoleDaoTest.java @@ -21,18 +21,16 @@ package org.sonar.db.user; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.security.DefaultGroups; import org.sonar.api.utils.System2; import org.sonar.api.web.UserRole; import org.sonar.core.permission.GlobalPermissions; import org.sonar.db.DbClient; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class RoleDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/user/RoleMapperTest.java b/sonar-db/src/test/java/org/sonar/db/user/RoleMapperTest.java index 2d6ebbc22a8..83826c130fe 100644 --- a/sonar-db/src/test/java/org/sonar/db/user/RoleMapperTest.java +++ b/sonar-db/src/test/java/org/sonar/db/user/RoleMapperTest.java @@ -21,14 +21,12 @@ package org.sonar.db.user; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class RoleMapperTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/user/UserDaoTest.java b/sonar-db/src/test/java/org/sonar/db/user/UserDaoTest.java index 55d413370f2..6724dbe11ad 100644 --- a/sonar-db/src/test/java/org/sonar/db/user/UserDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/user/UserDaoTest.java @@ -26,7 +26,6 @@ import java.util.List; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.user.UserQuery; import org.sonar.api.utils.DateUtils; @@ -43,7 +42,6 @@ import org.sonar.db.measure.MeasureFilterDto; import org.sonar.db.measure.MeasureFilterFavouriteDto; import org.sonar.db.property.PropertyDto; import org.sonar.db.property.PropertyQuery; -import org.sonar.test.DbTests; import static java.util.Arrays.asList; import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric; @@ -54,7 +52,7 @@ import static org.mockito.Mockito.when; import static org.sonar.db.user.GroupMembershipQuery.IN; import static org.sonar.db.user.GroupMembershipQuery.builder; -@Category(DbTests.class) + public class UserDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/user/UserGroupDaoTest.java b/sonar-db/src/test/java/org/sonar/db/user/UserGroupDaoTest.java index b7cb5c7a3a7..af1ae76cb62 100644 --- a/sonar-db/src/test/java/org/sonar/db/user/UserGroupDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/user/UserGroupDaoTest.java @@ -21,12 +21,10 @@ package org.sonar.db.user; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; -@Category(DbTests.class) + public class UserGroupDaoTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/user/UserTokenDaoTest.java b/sonar-db/src/test/java/org/sonar/db/user/UserTokenDaoTest.java index bfe27081188..2cc593393ac 100644 --- a/sonar-db/src/test/java/org/sonar/db/user/UserTokenDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/user/UserTokenDaoTest.java @@ -25,19 +25,17 @@ import org.assertj.guava.api.Assertions; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.db.DbSession; import org.sonar.db.DbTester; import org.sonar.db.RowNotFoundException; -import org.sonar.test.DbTests; import static com.google.common.collect.Lists.newArrayList; import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.db.user.UserTokenTesting.newUserToken; -@Category(DbTests.class) + public class UserTokenDaoTest { @Rule public DbTester db = DbTester.create(System2.INSTANCE); diff --git a/sonar-db/src/test/java/org/sonar/db/version/BaseDataChangeTest.java b/sonar-db/src/test/java/org/sonar/db/version/BaseDataChangeTest.java index b5bba854537..329f54955e2 100644 --- a/sonar-db/src/test/java/org/sonar/db/version/BaseDataChangeTest.java +++ b/sonar-db/src/test/java/org/sonar/db/version/BaseDataChangeTest.java @@ -26,19 +26,17 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; import org.sonar.db.BatchSession; import org.sonar.db.DbTester; import org.sonar.db.version.Select.Row; import org.sonar.db.version.Select.RowReader; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; -@Category(DbTests.class) + public class BaseDataChangeTest { @Rule diff --git a/sonar-db/src/test/java/org/sonar/db/version/DatabaseVersionTest.java b/sonar-db/src/test/java/org/sonar/db/version/DatabaseVersionTest.java index 5f937f0eb06..a36ae4045a0 100644 --- a/sonar-db/src/test/java/org/sonar/db/version/DatabaseVersionTest.java +++ b/sonar-db/src/test/java/org/sonar/db/version/DatabaseVersionTest.java @@ -21,14 +21,12 @@ package org.sonar.db.version; import org.junit.Rule; import org.junit.Test; -import org.junit.experimental.categories.Category; import org.sonar.api.utils.System2; import org.sonar.db.DbTester; -import org.sonar.test.DbTests; import static org.assertj.core.api.Assertions.assertThat; -@Category(DbTests.class) + public class DatabaseVersionTest { @Rule diff --git a/sonar-testing-harness/src/main/java/org/sonar/test/DbTests.java b/sonar-testing-harness/src/main/java/org/sonar/test/DbTests.java deleted file mode 100644 index 3287d88ce65..00000000000 --- a/sonar-testing-harness/src/main/java/org/sonar/test/DbTests.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program 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. - * - * This program 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.test; - -/** - * JUnit category declared on all the tests that interact with database. These tests - * are executed on all the supported DB, not only on the default embedded H2. - */ -public interface DbTests { -}