diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2019-06-19 13:56:51 -0500 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-07-12 20:21:14 +0200 |
commit | 93dc9770902dc7e168869d88b5ad731bfc0bedd9 (patch) | |
tree | 97ba885661d5cd9a2115fe212df31bacec9f9947 /server/sonar-db-dao | |
parent | 7c7d9b6b90244d2c974207862071caccdb2c9bb5 (diff) | |
download | sonarqube-93dc9770902dc7e168869d88b5ad731bfc0bedd9.tar.gz sonarqube-93dc9770902dc7e168869d88b5ad731bfc0bedd9.zip |
Extract implementation from plugin API and create new module sonar-plugin-api-impl
Diffstat (limited to 'server/sonar-db-dao')
18 files changed, 22 insertions, 24 deletions
diff --git a/server/sonar-db-dao/build.gradle b/server/sonar-db-dao/build.gradle index 01cc6e29841..12e9ed4500f 100644 --- a/server/sonar-db-dao/build.gradle +++ b/server/sonar-db-dao/build.gradle @@ -21,6 +21,7 @@ dependencies { testCompile 'org.mockito:mockito-core' testCompile project(':sonar-testing-harness') testCompile project(':server:sonar-db-core').sourceSets.test.output + testCompile project(':sonar-plugin-api-impl') testCompileOnly 'com.google.code.findbugs:jsr305' diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/alm/OrganizationAlmBindingDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/alm/OrganizationAlmBindingDaoTest.java index b104f9a6dd4..7e16fe34713 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/alm/OrganizationAlmBindingDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/alm/OrganizationAlmBindingDaoTest.java @@ -24,7 +24,7 @@ import java.util.Optional; import org.junit.Rule; import org.junit.Test; import org.sonar.api.utils.System2; -import org.sonar.api.utils.internal.TestSystem2; +import org.sonar.api.impl.utils.TestSystem2; import org.sonar.core.util.UuidFactory; import org.sonar.db.DbTester; import org.sonar.db.organization.OrganizationDto; diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java index 549f3bb20e2..5478d3ab969 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java @@ -39,7 +39,7 @@ import org.assertj.core.groups.Tuple; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; -import org.sonar.api.utils.internal.TestSystem2; +import org.sonar.api.impl.utils.TestSystem2; import org.sonar.core.util.CloseableIterator; import org.sonar.core.util.UuidFactoryFast; import org.sonar.core.util.stream.MoreCollectors; diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeQueueDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeQueueDaoTest.java index 7e6bce920e5..dd2b3a3aab8 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeQueueDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/ce/CeQueueDaoTest.java @@ -34,9 +34,9 @@ import javax.annotation.Nullable; import org.junit.Rule; import org.junit.Test; import org.mockito.Mockito; +import org.sonar.api.impl.utils.AlwaysIncreasingSystem2; +import org.sonar.api.impl.utils.TestSystem2; import org.sonar.api.utils.System2; -import org.sonar.api.utils.internal.AlwaysIncreasingSystem2; -import org.sonar.api.utils.internal.TestSystem2; import org.sonar.db.DbTester; import static com.google.common.collect.FluentIterable.from; @@ -178,7 +178,7 @@ public class CeQueueDaoTest { long time = alwaysIncreasingSystem2.now() + 10_000; insertPending("p1", dto -> { dto.setCreatedAt(time); - dto.setUpdatedAt(time+500); + dto.setUpdatedAt(time + 500); dto.setMainComponentUuid("c1"); }); insertPending("p2", dto -> { @@ -198,7 +198,7 @@ public class CeQueueDaoTest { long time = alwaysIncreasingSystem2.now() + 10_000; insertPending("p1", dto -> { dto.setCreatedAt(time); - dto.setUpdatedAt(time+500); + dto.setUpdatedAt(time + 500); dto.setMainComponentUuid("c2"); }); insertPending("p2", dto -> { @@ -215,7 +215,7 @@ public class CeQueueDaoTest { makeInProgress("w1", alwaysIncreasingSystem2.now(), insertPending("i1", dto -> dto.setMainComponentUuid("c1"))); assertThat(underTest.selectCreationDateOfOldestPendingByMainComponentUuid(db.getSession(), "c1")) - .isEqualTo(Optional.of(time+2000)); + .isEqualTo(Optional.of(time + 2000)); } @Test diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/component/AnalysisPropertiesDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/component/AnalysisPropertiesDaoTest.java index 2ddbc0c36c6..cd739ae558e 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/component/AnalysisPropertiesDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/component/AnalysisPropertiesDaoTest.java @@ -26,7 +26,7 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; -import org.sonar.api.utils.internal.TestSystem2; +import org.sonar.api.impl.utils.TestSystem2; import org.sonar.db.DbSession; import org.sonar.db.DbTester; diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/component/BranchDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/component/BranchDaoTest.java index e43fca45abd..08ef36f8c54 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/component/BranchDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/component/BranchDaoTest.java @@ -28,7 +28,7 @@ import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.sonar.api.utils.System2; -import org.sonar.api.utils.internal.TestSystem2; +import org.sonar.api.impl.utils.TestSystem2; import org.sonar.db.DbSession; import org.sonar.db.DbTester; import org.sonar.db.protobuf.DbProjectBranches; diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/component/ProjectLinkDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/component/ProjectLinkDaoTest.java index 17bb6b45f24..3c8509ee851 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/component/ProjectLinkDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/component/ProjectLinkDaoTest.java @@ -23,7 +23,7 @@ import java.util.Collections; import org.junit.Rule; import org.junit.Test; import org.sonar.api.utils.System2; -import org.sonar.api.utils.internal.TestSystem2; +import org.sonar.api.impl.utils.TestSystem2; import org.sonar.db.DbTester; import static java.util.Arrays.asList; diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/es/EsQueueDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/es/EsQueueDaoTest.java index 41707c4e73c..00776044ce6 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/es/EsQueueDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/es/EsQueueDaoTest.java @@ -25,7 +25,7 @@ import java.util.Random; import java.util.stream.IntStream; import org.junit.Rule; import org.junit.Test; -import org.sonar.api.utils.internal.TestSystem2; +import org.sonar.api.impl.utils.TestSystem2; import org.sonar.core.util.UuidFactoryFast; import org.sonar.db.DbSession; import org.sonar.db.DbTester; diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueMapperTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueMapperTest.java index ed19baa0efb..04bd0f63e8b 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueMapperTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueMapperTest.java @@ -35,11 +35,11 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; +import org.sonar.api.impl.utils.AlwaysIncreasingSystem2; import org.sonar.api.issue.Issue; import org.sonar.api.rules.RuleType; import org.sonar.api.utils.DateUtils; import org.sonar.api.utils.System2; -import org.sonar.api.utils.internal.AlwaysIncreasingSystem2; import org.sonar.core.issue.FieldDiffs; import org.sonar.core.util.UuidFactoryFast; import org.sonar.db.DbSession; diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/purge/PurgeCommandsTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/purge/PurgeCommandsTest.java index 849dd53dfe7..716c1e30337 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/purge/PurgeCommandsTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/purge/PurgeCommandsTest.java @@ -23,8 +23,8 @@ import java.util.List; import org.junit.After; import org.junit.Rule; import org.junit.Test; +import org.sonar.api.impl.utils.AlwaysIncreasingSystem2; import org.sonar.api.utils.System2; -import org.sonar.api.utils.internal.AlwaysIncreasingSystem2; import org.sonar.db.DbTester; import org.sonar.db.component.ComponentDto; import org.sonar.db.organization.OrganizationDto; @@ -36,7 +36,6 @@ import static com.google.common.collect.Lists.newArrayList; import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; - public class PurgeCommandsTest { @Rule @@ -106,7 +105,6 @@ public class PurgeCommandsTest { assertThat(dbTester.countRowsOfTable("issue_changes")).isEqualTo(1); } - @Test public void shouldDeleteAnalyses() { dbTester.prepareDbUnit(getClass(), "shouldDeleteResource.xml"); @@ -122,7 +120,6 @@ public class PurgeCommandsTest { assertThat(dbTester.countRowsOfTable("issue_changes")).isEqualTo(1); } - @Test public void shouldDeleteIssuesAndIssueChanges() { dbTester.prepareDbUnit(getClass(), "shouldDeleteResource.xml"); diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/purge/PurgeConfigurationTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/purge/PurgeConfigurationTest.java index 4d83aa022e7..fe0d5668a76 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/purge/PurgeConfigurationTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/purge/PurgeConfigurationTest.java @@ -23,7 +23,7 @@ import java.util.Date; import java.util.Optional; import org.junit.Test; import org.sonar.api.config.PropertyDefinitions; -import org.sonar.api.config.internal.MapSettings; +import org.sonar.api.impl.config.MapSettings; import org.sonar.api.resources.Scopes; import org.sonar.api.utils.DateUtils; import org.sonar.api.utils.System2; diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/ActiveRuleDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/ActiveRuleDaoTest.java index abfb197c980..a9db8b7a367 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/ActiveRuleDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/ActiveRuleDaoTest.java @@ -32,7 +32,7 @@ import org.sonar.api.rule.Severity; import org.sonar.api.rules.RuleType; import org.sonar.api.server.rule.RuleParamType; import org.sonar.api.utils.System2; -import org.sonar.api.utils.internal.TestSystem2; +import org.sonar.api.impl.utils.TestSystem2; import org.sonar.db.DbSession; import org.sonar.db.DbTester; import org.sonar.db.organization.OrganizationDto; diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QProfileChangeDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QProfileChangeDaoTest.java index 530239bc91a..4d26dcc207a 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QProfileChangeDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QProfileChangeDaoTest.java @@ -25,8 +25,8 @@ import javax.annotation.Nullable; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; +import org.sonar.api.impl.utils.AlwaysIncreasingSystem2; import org.sonar.api.utils.System2; -import org.sonar.api.utils.internal.AlwaysIncreasingSystem2; import org.sonar.core.util.SequenceUuidFactory; import org.sonar.core.util.UuidFactory; import org.sonar.db.DbSession; diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QProfileEditGroupsDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QProfileEditGroupsDaoTest.java index c95aeca5fe0..06b3aa1ccee 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QProfileEditGroupsDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QProfileEditGroupsDaoTest.java @@ -22,7 +22,7 @@ package org.sonar.db.qualityprofile; import org.junit.Rule; import org.junit.Test; import org.sonar.api.utils.System2; -import org.sonar.api.utils.internal.TestSystem2; +import org.sonar.api.impl.utils.TestSystem2; import org.sonar.db.DbTester; import org.sonar.db.Pagination; import org.sonar.db.organization.OrganizationDto; diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QProfileEditUsersDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QProfileEditUsersDaoTest.java index cb915cd8044..5331f8d3098 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QProfileEditUsersDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QProfileEditUsersDaoTest.java @@ -24,7 +24,7 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.sonar.api.utils.System2; -import org.sonar.api.utils.internal.TestSystem2; +import org.sonar.api.impl.utils.TestSystem2; import org.sonar.db.DbTester; import org.sonar.db.Pagination; import org.sonar.db.organization.OrganizationDto; diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleRepositoryDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleRepositoryDaoTest.java index 520636d1eaf..d011fa394cb 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleRepositoryDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleRepositoryDaoTest.java @@ -27,8 +27,8 @@ import java.util.stream.IntStream; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; +import org.sonar.api.impl.utils.AlwaysIncreasingSystem2; import org.sonar.api.utils.System2; -import org.sonar.api.utils.internal.AlwaysIncreasingSystem2; import org.sonar.db.DbSession; import org.sonar.db.DbTester; diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/user/UserDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/user/UserDaoTest.java index 5e55b7a7706..e739b57e69a 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/user/UserDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/user/UserDaoTest.java @@ -27,7 +27,7 @@ import org.junit.Rule; import org.junit.Test; import org.sonar.api.user.UserQuery; import org.sonar.api.utils.DateUtils; -import org.sonar.api.utils.internal.TestSystem2; +import org.sonar.api.impl.utils.TestSystem2; import org.sonar.db.DatabaseUtils; import org.sonar.db.DbClient; import org.sonar.db.DbSession; diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/user/UserPropertiesDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/user/UserPropertiesDaoTest.java index 89029d67899..8fba61e47b4 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/user/UserPropertiesDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/user/UserPropertiesDaoTest.java @@ -23,7 +23,7 @@ import java.util.List; import java.util.Map; import org.junit.Rule; import org.junit.Test; -import org.sonar.api.utils.internal.TestSystem2; +import org.sonar.api.impl.utils.TestSystem2; import org.sonar.db.DbTester; import static org.assertj.core.api.Assertions.assertThat; |