aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-05-24 16:31:10 +0200
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-05-26 17:27:07 +0200
commit8cd57ce8858b6229246c2a96dff5daf5bf0050fc (patch)
tree54053508ddcef905fb87c5158270e4b0a72e433a
parent7444c7415579f72d46e77fa8c6a3c818fc98539f (diff)
downloadsonarqube-8cd57ce8858b6229246c2a96dff5daf5bf0050fc.tar.gz
sonarqube-8cd57ce8858b6229246c2a96dff5daf5bf0050fc.zip
SONAR-9028 remove any support to table authors from code
-rw-r--r--server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java2
-rw-r--r--server/sonar-db-core/src/main/java/org/sonar/db/version/SqTables.java1
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/DaoModule.java2
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/DbClient.java7
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java4
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeCommands.java5
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeMapper.java2
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/user/AuthorDao.java61
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/user/AuthorDto.java80
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/user/AuthorMapper.java38
-rw-r--r--server/sonar-db-dao/src/main/resources/org/sonar/db/purge/PurgeMapper.xml9
-rw-r--r--server/sonar-db-dao/src/main/resources/org/sonar/db/user/AuthorMapper.xml33
-rw-r--r--server/sonar-db-dao/src/test/java/org/sonar/db/DaoModuleTest.java2
-rw-r--r--server/sonar-db-dao/src/test/java/org/sonar/db/purge/PurgeCommandsTest.java2
-rw-r--r--server/sonar-db-dao/src/test/java/org/sonar/db/user/AuthorDaoTest.java97
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteResource.xml10
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/add_missing_module_uuid_path-result.xml29
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/add_missing_module_uuid_path.xml2
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/countDeveloperLogins.xml7
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldInsertAuthor-result.xml8
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldInsertAuthor.xml2
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldInsertAuthorAndDeveloper-result.xml15
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldInsertAuthorAndDeveloper.xml2
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsAndDevelopersDuplication-result.xml18
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsAndDevelopersDuplication.xml18
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsDuplication-result.xml5
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsDuplication.xml5
-rw-r--r--server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldSelectByLogin.xml8
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/platform/BackendCleanup.java1
29 files changed, 2 insertions, 473 deletions
diff --git a/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java b/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java
index 1e4445ed39f..889499f0354 100644
--- a/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java
+++ b/server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java
@@ -135,7 +135,7 @@ public class ComputeEngineContainerImplTest {
assertThat(picoContainer.getParent().getParent().getParent().getComponentAdapters()).hasSize(
COMPONENTS_IN_LEVEL_1_AT_CONSTRUCTION
+ 23 // level 1
- + 46 // content of DaoModule
+ + 45 // content of DaoModule
+ 3 // content of EsSearchModule
+ 56 // content of CorePropertyDefinitions
);
diff --git a/server/sonar-db-core/src/main/java/org/sonar/db/version/SqTables.java b/server/sonar-db-core/src/main/java/org/sonar/db/version/SqTables.java
index 6bfd1a9a592..b3be68dc6c6 100644
--- a/server/sonar-db-core/src/main/java/org/sonar/db/version/SqTables.java
+++ b/server/sonar-db-core/src/main/java/org/sonar/db/version/SqTables.java
@@ -48,7 +48,6 @@ public final class SqTables {
public static final Set<String> TABLES = ImmutableSet.of(
"active_rules",
"active_rule_parameters",
- "authors",
"ce_activity",
"ce_queue",
"ce_task_input",
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/DaoModule.java b/server/sonar-db-dao/src/main/java/org/sonar/db/DaoModule.java
index 17e164dfd1d..d94eb8ef217 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/DaoModule.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/DaoModule.java
@@ -60,7 +60,6 @@ import org.sonar.db.rule.RuleDao;
import org.sonar.db.rule.RuleRepositoryDao;
import org.sonar.db.schemamigration.SchemaMigrationDao;
import org.sonar.db.source.FileSourceDao;
-import org.sonar.db.user.AuthorDao;
import org.sonar.db.user.GroupDao;
import org.sonar.db.user.GroupMembershipDao;
import org.sonar.db.user.RoleDao;
@@ -75,7 +74,6 @@ public class DaoModule extends Module {
// for readability and easier merge, keep list ordered alphabetically
// =====================================================================
ActiveRuleDao.class,
- AuthorDao.class,
AuthorizationDao.class,
CeActivityDao.class,
CeQueueDao.class,
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/DbClient.java b/server/sonar-db-dao/src/main/java/org/sonar/db/DbClient.java
index c36d7934c0b..b88fc81baf5 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/DbClient.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/DbClient.java
@@ -59,7 +59,6 @@ import org.sonar.db.rule.RuleDao;
import org.sonar.db.rule.RuleRepositoryDao;
import org.sonar.db.schemamigration.SchemaMigrationDao;
import org.sonar.db.source.FileSourceDao;
-import org.sonar.db.user.AuthorDao;
import org.sonar.db.user.GroupDao;
import org.sonar.db.user.GroupMembershipDao;
import org.sonar.db.user.RoleDao;
@@ -100,7 +99,6 @@ public class DbClient {
private final CeTaskInputDao ceTaskInputDao;
private final CeScannerContextDao ceScannerContextDao;
private final FileSourceDao fileSourceDao;
- private final AuthorDao authorDao;
private final ComponentLinkDao componentLinkDao;
private final EventDao eventDao;
private final PurgeDao purgeDao;
@@ -155,7 +153,6 @@ public class DbClient {
ceTaskInputDao = getDao(map, CeTaskInputDao.class);
ceScannerContextDao = getDao(map, CeScannerContextDao.class);
fileSourceDao = getDao(map, FileSourceDao.class);
- authorDao = getDao(map, AuthorDao.class);
componentLinkDao = getDao(map, ComponentLinkDao.class);
eventDao = getDao(map, EventDao.class);
purgeDao = getDao(map, PurgeDao.class);
@@ -295,10 +292,6 @@ public class DbClient {
return fileSourceDao;
}
- public AuthorDao authorDao() {
- return authorDao;
- }
-
public ComponentLinkDao componentLinkDao() {
return componentLinkDao;
}
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java b/server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java
index e60a2dede42..0b847ed1d7d 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java
@@ -105,8 +105,6 @@ import org.sonar.db.rule.RuleRepositoryMapper;
import org.sonar.db.schemamigration.SchemaMigrationDto;
import org.sonar.db.schemamigration.SchemaMigrationMapper;
import org.sonar.db.source.FileSourceMapper;
-import org.sonar.db.user.AuthorDto;
-import org.sonar.db.user.AuthorMapper;
import org.sonar.db.user.GroupDto;
import org.sonar.db.user.GroupMapper;
import org.sonar.db.user.GroupMembershipDto;
@@ -139,7 +137,6 @@ public class MyBatis implements Startable {
// DTO aliases, keep them sorted alphabetically
confBuilder.loadAlias("ActiveRule", ActiveRuleDto.class);
confBuilder.loadAlias("ActiveRuleParam", ActiveRuleParamDto.class);
- confBuilder.loadAlias("Author", AuthorDto.class);
confBuilder.loadAlias("Component", ComponentDto.class);
confBuilder.loadAlias("ComponentLink", ComponentLinkDto.class);
confBuilder.loadAlias("ComponentWithSnapshot", ComponentDtoWithSnapshotId.class);
@@ -190,7 +187,6 @@ public class MyBatis implements Startable {
// keep them sorted alphabetically
Class<?>[] mappers = {
ActiveRuleMapper.class,
- AuthorMapper.class,
AuthorizationMapper.class,
CeActivityMapper.class,
CeQueueMapper.class,
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeCommands.java b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeCommands.java
index 8c25c7fc219..a2abbe53182 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeCommands.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeCommands.java
@@ -113,11 +113,6 @@ class PurgeCommands {
componentUuidsPartitions.forEach(purgeMapper::deleteComponents);
session.commit();
profiler.stop();
-
- profiler.start("deleteAuthors (authors)");
- componentIdPartitions.forEach(purgeMapper::deleteAuthors);
- session.commit();
- profiler.stop();
}
public void deleteComponentMeasures(List<String> analysisUuids, List<String> componentUuids) {
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeMapper.java
index d9fa8209e7c..08ec08c0a16 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeMapper.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeMapper.java
@@ -64,8 +64,6 @@ public interface PurgeMapper {
void deleteComponentEvents(@Param("componentUuids") List<String> componentUuids);
- void deleteAuthors(@Param("resourceIds") List<Long> resourceIds);
-
List<PurgeableAnalysisDto> selectPurgeableAnalysesWithEvents(@Param("componentUuid") String componentUuid);
List<PurgeableAnalysisDto> selectPurgeableAnalysesWithoutEvents(@Param("componentUuid") String componentUuid);
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/user/AuthorDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/user/AuthorDao.java
deleted file mode 100644
index 3063127d210..00000000000
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/user/AuthorDao.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.db.user;
-
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-import org.sonar.db.Dao;
-import org.sonar.db.DbSession;
-
-import static org.sonar.db.DatabaseUtils.executeLargeInputs;
-
-/**
- * Be careful when updating this class because it's used by the Dev Cockpit plugin.
- */
-public class AuthorDao implements Dao {
-
- public AuthorDto selectByLogin(DbSession session, String login) {
- return getMapper(session).selectByLogin(login);
- }
-
- public int countDeveloperLogins(DbSession session, long developerId) {
- return getMapper(session).countDeveloperLogins(developerId);
- }
-
- public void insertAuthor(DbSession session, String login, long personId) {
- Date now = new Date();
- AuthorDto authorDto = new AuthorDto()
- .setLogin(login)
- .setPersonId(personId)
- .setCreatedAt(now)
- .setUpdatedAt(now);
-
- getMapper(session).insert(authorDto);
- }
-
- public List<String> selectScmAccountsByDeveloperUuids(final DbSession session, Collection<String> developerUuids) {
- return executeLargeInputs(developerUuids, getMapper(session)::selectScmAccountsByDeveloperUuids);
- }
-
- private static AuthorMapper getMapper(DbSession session) {
- return session.getMapper(AuthorMapper.class);
- }
-}
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/user/AuthorDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/user/AuthorDto.java
deleted file mode 100644
index 00b93c40a64..00000000000
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/user/AuthorDto.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.db.user;
-
-import java.util.Date;
-
-/**
- * @since 3.0
- */
-public final class AuthorDto {
-
- private Long id;
- private Long personId;
- private String login;
- private Date createdAt;
- private Date updatedAt;
-
- public Long getId() {
- return id;
- }
-
- public AuthorDto setId(Long id) {
- this.id = id;
- return this;
- }
-
- public Long getPersonId() {
- return personId;
- }
-
- public AuthorDto setPersonId(Long personId) {
- this.personId = personId;
- return this;
- }
-
- public String getLogin() {
- return login;
- }
-
- public AuthorDto setLogin(String login) {
- this.login = login;
- return this;
- }
-
- public Date getCreatedAt() {
- return createdAt;// NOSONAR May expose internal representation by returning reference to mutable object
- }
-
- public AuthorDto setCreatedAt(Date createdAt) {
- this.createdAt = createdAt;// NOSONAR May expose internal representation by incorporating reference to mutable object
- return this;
- }
-
- public Date getUpdatedAt() {
- return updatedAt;// NOSONAR May expose internal representation by returning reference to mutable object
- }
-
- public AuthorDto setUpdatedAt(Date updatedAt) {
- this.updatedAt = updatedAt;// NOSONAR May expose internal representation by incorporating reference to mutable object
- return this;
- }
-
-}
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/user/AuthorMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/user/AuthorMapper.java
deleted file mode 100644
index 63321fc7687..00000000000
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/user/AuthorMapper.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.db.user;
-
-import java.util.Collection;
-import java.util.List;
-import org.apache.ibatis.annotations.Param;
-
-/**
- * @since 3.0
- */
-public interface AuthorMapper {
-
- AuthorDto selectByLogin(String login);
-
- void insert(AuthorDto authorDto);
-
- int countDeveloperLogins(long developerId);
-
- List<String> selectScmAccountsByDeveloperUuids(@Param("uuids") Collection<String> uuids);
-}
diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/purge/PurgeMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/purge/PurgeMapper.xml
index b36aeb52638..67eec7c0f76 100644
--- a/server/sonar-db-dao/src/main/resources/org/sonar/db/purge/PurgeMapper.xml
+++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/purge/PurgeMapper.xml
@@ -212,15 +212,6 @@
</foreach>
</delete>
- <delete id="deleteAuthors" parameterType="map">
- delete from authors
- where
- person_id in
- <foreach collection="resourceIds" open="(" close=")" item="resourceId" separator=",">
- #{resourceId}
- </foreach>
- </delete>
-
<delete id="deleteComponentIssueChanges" parameterType="map">
delete from issue_changes ic
where exists (select * from issues i where i.kee=ic.issue_key and i.component_uuid in
diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/user/AuthorMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/user/AuthorMapper.xml
deleted file mode 100644
index 39e13226f0f..00000000000
--- a/server/sonar-db-dao/src/main/resources/org/sonar/db/user/AuthorMapper.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-
-<mapper namespace="org.sonar.db.user.AuthorMapper">
-
- <select id="selectByLogin" parameterType="string" resultType="Author">
- SELECT id, person_id AS personId, login, created_at AS createdAt, updated_at AS updatedAt
- FROM authors WHERE login=#{id}
- </select>
-
- <select id="countDeveloperLogins" parameterType="long" resultType="int">
- SELECT count(1)
- FROM authors WHERE person_id=#{id}
- </select>
-
- <insert id="insert" parameterType="Author" keyColumn="id" useGeneratedKeys="true" keyProperty="id">
- INSERT INTO authors (person_id, login, created_at, updated_at)
- VALUES (#{personId}, #{login},
- #{createdAt}, #{updatedAt})
- </insert>
-
- <select id="selectScmAccountsByDeveloperUuids" parameterType="String" resultType="String">
- SELECT a.login
- FROM authors a
- INNER JOIN projects p ON p.id=a.person_id
- <where>
- and p.uuid in
- <foreach collection="uuids" open="(" close=")" item="uuid" separator=",">
- #{uuid}
- </foreach>
- </where>
- </select>
-</mapper>
diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/DaoModuleTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/DaoModuleTest.java
index 4e2c7cb812e..914622cfd1e 100644
--- a/server/sonar-db-dao/src/test/java/org/sonar/db/DaoModuleTest.java
+++ b/server/sonar-db-dao/src/test/java/org/sonar/db/DaoModuleTest.java
@@ -29,6 +29,6 @@ public class DaoModuleTest {
public void verify_count_of_added_components() {
ComponentContainer container = new ComponentContainer();
new DaoModule().configure(container);
- assertThat(container.size()).isEqualTo(2 + 46);
+ assertThat(container.size()).isEqualTo(2 + 45);
}
}
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 82db2b299a5..656a69f9cb4 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
@@ -88,7 +88,6 @@ public class PurgeCommandsTest {
assertThat(dbTester.countRowsOfTable("events")).isEqualTo(2);
assertThat(dbTester.countRowsOfTable("issues")).isZero();
assertThat(dbTester.countRowsOfTable("issue_changes")).isZero();
- assertThat(dbTester.countRowsOfTable("authors")).isZero();
}
@@ -104,7 +103,6 @@ public class PurgeCommandsTest {
assertThat(dbTester.countRowsOfTable("events")).isEqualTo(0);
assertThat(dbTester.countRowsOfTable("issues")).isEqualTo(1);
assertThat(dbTester.countRowsOfTable("issue_changes")).isEqualTo(1);
- assertThat(dbTester.countRowsOfTable("authors")).isEqualTo(2);
}
/**
diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/user/AuthorDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/user/AuthorDaoTest.java
deleted file mode 100644
index 553ce7ca7fe..00000000000
--- a/server/sonar-db-dao/src/test/java/org/sonar/db/user/AuthorDaoTest.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.db.user;
-
-import org.junit.After;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-import org.sonar.api.utils.System2;
-import org.sonar.db.DbSession;
-import org.sonar.db.DbTester;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-
-public class AuthorDaoTest {
-
- @Rule
- public DbTester dbTester = DbTester.create(System2.INSTANCE);
- @Rule
- public ExpectedException expectedException = ExpectedException.none();
-
- DbSession dbSession = dbTester.getSession();
- AuthorDao dao = dbTester.getDbClient().authorDao();
-
- @After
- public void tearDown() throws Exception {
- dbSession.close();
- }
-
- @Test
- public void shouldSelectByLogin() {
- dbTester.prepareDbUnit(getClass(), "shouldSelectByLogin.xml");
- dbSession.commit();
-
- AuthorDto authorDto = dao.selectByLogin(dbSession, "godin");
- assertThat(authorDto.getId()).isEqualTo(1L);
- assertThat(authorDto.getPersonId()).isEqualTo(13L);
- assertThat(authorDto.getLogin()).isEqualTo("godin");
-
- assertThat(dao.selectByLogin(dbSession, "simon")).isNull();
- }
-
- @Test
- public void shouldInsertAuthor() {
- dbTester.prepareDbUnit(getClass(), "shouldInsertAuthor.xml");
- dbSession.commit();
-
- dao.insertAuthor(dbSession, "godin", 13L);
- dbSession.commit();
-
- dbTester.assertDbUnit(getClass(), "shouldInsertAuthor-result.xml", new String[] {"created_at", "updated_at"}, "authors");
- }
-
- @Test
- public void countDeveloperLogins() {
- dbTester.prepareDbUnit(getClass(), "countDeveloperLogins.xml");
- dbSession.commit();
-
- assertThat(dao.countDeveloperLogins(dbSession, 1L)).isEqualTo(2);
- assertThat(dao.countDeveloperLogins(dbSession, 98765L)).isEqualTo(0);
- }
-
- @Test
- public void shouldPreventAuthorsDuplication() {
- dbTester.prepareDbUnit(getClass(), "shouldPreventAuthorsDuplication.xml");
- dbSession.commit();
-
- expectedException.expect(RuntimeException.class);
-
- try {
- dao.insertAuthor(dbSession, "godin", 20L);
- } catch (RuntimeException ex) {
- dbSession.commit();
- dbTester.assertDbUnit(getClass(), "shouldPreventAuthorsDuplication-result.xml", new String[] {"created_at", "updated_at"}, "authors");
- throw ex;
- }
- }
-
-}
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteResource.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteResource.xml
index 6bc921f26ee..1a269703e3c 100644
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteResource.xml
+++ b/server/sonar-db-dao/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteResource.xml
@@ -105,14 +105,4 @@
change_type="comment"
change_data="this is a comment"/>
- <authors id="1"
- person_id="1"
- login="tartanpion"
- created_at="[null]"
- updated_at="[null]"/>
- <authors id="2"
- person_id="1"
- login="fanfoue"
- created_at="[null]"
- updated_at="[null]"/>
</dataset>
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/add_missing_module_uuid_path-result.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/add_missing_module_uuid_path-result.xml
deleted file mode 100644
index fb7d71381e9..00000000000
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/add_missing_module_uuid_path-result.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<dataset>
- <projects organization_uuid="org1"
- uuid="ABCD"
- uuid_path="NOT_USED"
- project_uuid="ABCD"
- module_uuid="[null]"
- module_uuid_path=".ABCD."
- id="1"
- kee="developer"
- name="developer@company.net"
- qualifier="DEV"/>
- <authors id="1"
- person_id="1"
- login="developer@company.net"/>
-
- <projects organization_uuid="org1"
- uuid="BCDE"
- uuid_path="NOT_USED"
- project_uuid="BCDE"
- module_uuid="[null]"
- module_uuid_path=".BCDE."
- id="2"
- kee="developer2"
- name="developer2@company.net"
- qualifier="DEV"/>
- <authors id="2"
- person_id="2"
- login="developer2@company.net"/>
-</dataset>
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/add_missing_module_uuid_path.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/add_missing_module_uuid_path.xml
deleted file mode 100644
index fb0854fccbe..00000000000
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/add_missing_module_uuid_path.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<dataset>
-</dataset>
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/countDeveloperLogins.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/countDeveloperLogins.xml
deleted file mode 100644
index 42776255866..00000000000
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/countDeveloperLogins.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<dataset>
-
- <authors id="1" person_id="1" login="godin"/>
- <authors id="2" person_id="1" login="evgeny"/>
- <authors id="3" person_id="2" login="simon"/>
-
-</dataset>
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldInsertAuthor-result.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldInsertAuthor-result.xml
deleted file mode 100644
index 40e855c7588..00000000000
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldInsertAuthor-result.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<dataset>
-
- <authors
- id="1"
- person_id="13"
- login="godin"/>
-
-</dataset>
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldInsertAuthor.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldInsertAuthor.xml
deleted file mode 100644
index fb0854fccbe..00000000000
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldInsertAuthor.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<dataset>
-</dataset>
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldInsertAuthorAndDeveloper-result.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldInsertAuthorAndDeveloper-result.xml
deleted file mode 100644
index 70b0c58d48b..00000000000
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldInsertAuthorAndDeveloper-result.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<dataset>
- <projects organization_uuid="org1"
- uuid="ABCD"
- uuid_path="NOT_USED"
- project_uuid="ABCD"
- module_uuid="[null]"
- module_uuid_path="."
- id="1"
- kee="developer"
- name="developer@company.net"
- qualifier="DEV"/>
- <authors id="1"
- person_id="1"
- login="developer@company.net"/>
-</dataset>
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldInsertAuthorAndDeveloper.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldInsertAuthorAndDeveloper.xml
deleted file mode 100644
index fb0854fccbe..00000000000
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldInsertAuthorAndDeveloper.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<dataset>
-</dataset>
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsAndDevelopersDuplication-result.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsAndDevelopersDuplication-result.xml
deleted file mode 100644
index dfd6673d49f..00000000000
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsAndDevelopersDuplication-result.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<dataset>
-
- <projects organization_uuid="org1"
- uuid="[null]"
- uuid_path="NOT_USED"
- project_uuid="[null]"
- module_uuid="[null]"
- module_uuid_path="."
- id="1"
- kee="developer"
- name="developer@company.net"
- qualifier="DEV"/>
-
- <authors id="1"
- person_id="1"
- login="developer@company.net"/>
-
-</dataset>
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsAndDevelopersDuplication.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsAndDevelopersDuplication.xml
deleted file mode 100644
index dfd6673d49f..00000000000
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsAndDevelopersDuplication.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<dataset>
-
- <projects organization_uuid="org1"
- uuid="[null]"
- uuid_path="NOT_USED"
- project_uuid="[null]"
- module_uuid="[null]"
- module_uuid_path="."
- id="1"
- kee="developer"
- name="developer@company.net"
- qualifier="DEV"/>
-
- <authors id="1"
- person_id="1"
- login="developer@company.net"/>
-
-</dataset>
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsDuplication-result.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsDuplication-result.xml
deleted file mode 100644
index 8203f8edbc2..00000000000
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsDuplication-result.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<dataset>
-
- <authors id="1" person_id="10" login="godin"/>
-
-</dataset>
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsDuplication.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsDuplication.xml
deleted file mode 100644
index 8203f8edbc2..00000000000
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsDuplication.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<dataset>
-
- <authors id="1" person_id="10" login="godin"/>
-
-</dataset>
diff --git a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldSelectByLogin.xml b/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldSelectByLogin.xml
deleted file mode 100644
index 40e855c7588..00000000000
--- a/server/sonar-db-dao/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldSelectByLogin.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<dataset>
-
- <authors
- id="1"
- person_id="13"
- login="godin"/>
-
-</dataset>
diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/BackendCleanup.java b/server/sonar-server/src/main/java/org/sonar/server/platform/BackendCleanup.java
index 6cf963f55f4..d465a9a8ba5 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/platform/BackendCleanup.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/platform/BackendCleanup.java
@@ -47,7 +47,6 @@ import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery;
public class BackendCleanup {
private static final String[] ANALYSIS_TABLES = {
- "authors",
"ce_activity", "ce_queue", "ce_task_input", "ce_scanner_context",
"duplications_index", "events", "issues", "issue_changes", "manual_measures",
"notifications", "project_links", "project_measures", "projects",