aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2016-03-24 15:15:52 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2016-03-25 15:02:45 +0100
commit3c0e6beb1a4d64c17f8df3b10d5a4c19389b4615 (patch)
tree6503345322e03bcc9c34615c955b7466592bff24 /sonar-db
parent2404ce6699a1aa3a5c0cc8313f2953ad8af4d784 (diff)
downloadsonarqube-3c0e6beb1a4d64c17f8df3b10d5a4c19389b4615.tar.gz
sonarqube-3c0e6beb1a4d64c17f8df3b10d5a4c19389b4615.zip
SONAR-7466 Remove ACTION_PLANS table and related code
Diffstat (limited to 'sonar-db')
-rw-r--r--sonar-db/src/main/java/org/sonar/core/issue/ActionPlanStats.java75
-rw-r--r--sonar-db/src/main/java/org/sonar/core/issue/package-info.java24
-rw-r--r--sonar-db/src/main/java/org/sonar/db/DaoModule.java4
-rw-r--r--sonar-db/src/main/java/org/sonar/db/DbClient.java14
-rw-r--r--sonar-db/src/main/java/org/sonar/db/MyBatis.java8
-rw-r--r--sonar-db/src/main/java/org/sonar/db/issue/ActionPlanDao.java123
-rw-r--r--sonar-db/src/main/java/org/sonar/db/issue/ActionPlanDto.java205
-rw-r--r--sonar-db/src/main/java/org/sonar/db/issue/ActionPlanMapper.java43
-rw-r--r--sonar-db/src/main/java/org/sonar/db/issue/ActionPlanStatsDao.java43
-rw-r--r--sonar-db/src/main/java/org/sonar/db/issue/ActionPlanStatsDto.java191
-rw-r--r--sonar-db/src/main/java/org/sonar/db/issue/ActionPlanStatsMapper.java34
-rw-r--r--sonar-db/src/main/java/org/sonar/db/issue/IssueDao.java4
-rw-r--r--sonar-db/src/main/java/org/sonar/db/issue/IssueDto.java10
-rw-r--r--sonar-db/src/main/java/org/sonar/db/issue/IssueMapper.java2
-rw-r--r--sonar-db/src/main/java/org/sonar/db/purge/PurgeCommands.java7
-rw-r--r--sonar-db/src/main/java/org/sonar/db/purge/PurgeMapper.java2
-rw-r--r--sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java3
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/issue/ActionPlanMapper.xml89
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/issue/ActionPlanStatsMapper.xml36
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/issue/IssueMapper.xml21
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/purge/PurgeMapper.xml7
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql2
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl17
-rw-r--r--sonar-db/src/test/java/org/sonar/core/issue/ActionPlanStatsTest.java42
-rw-r--r--sonar-db/src/test/java/org/sonar/db/DaoModuleTest.java2
-rw-r--r--sonar-db/src/test/java/org/sonar/db/issue/ActionPlanDaoTest.java121
-rw-r--r--sonar-db/src/test/java/org/sonar/db/issue/ActionPlanStatsDaoTest.java52
-rw-r--r--sonar-db/src/test/java/org/sonar/db/issue/IssueDaoTest.java39
-rw-r--r--sonar-db/src/test/java/org/sonar/db/issue/IssueMapperTest.java4
-rw-r--r--sonar-db/src/test/java/org/sonar/db/purge/PurgeDaoTest.java1
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/shared.xml5
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_delete_action_plan-result.xml6
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_delete_action_plan.xml9
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_find_by_key.xml6
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_find_by_keys.xml12
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_find_by_name_and_project_id.xml12
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_find_open_by_project_id.xml12
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_insert_new_action_plan-result.xml6
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_update_action_plan-result.xml6
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_update_action_plan.xml6
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanStatsDaoTest/shared.xml5
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanStatsDaoTest/should_find_by_project.xml84
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/find_by_action_plan.xml30
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteProject.xml3
44 files changed, 7 insertions, 1420 deletions
diff --git a/sonar-db/src/main/java/org/sonar/core/issue/ActionPlanStats.java b/sonar-db/src/main/java/org/sonar/core/issue/ActionPlanStats.java
deleted file mode 100644
index 0704154c9d5..00000000000
--- a/sonar-db/src/main/java/org/sonar/core/issue/ActionPlanStats.java
+++ /dev/null
@@ -1,75 +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.core.issue;
-
-import java.util.Date;
-import org.sonar.api.issue.ActionPlan;
-import org.sonar.core.util.Uuids;
-
-public class ActionPlanStats extends DefaultActionPlan {
-
- private int totalIssues;
- private int unresolvedIssues;
-
- private ActionPlanStats() {
-
- }
-
- public static ActionPlanStats create(String name) {
- ActionPlanStats actionPlan = new ActionPlanStats();
- actionPlan.setKey(Uuids.create());
- Date now = new Date();
- actionPlan.setName(name);
- actionPlan.setStatus(ActionPlan.STATUS_OPEN);
- actionPlan.setCreatedAt(now).setUpdatedAt(now);
- return actionPlan;
- }
-
- public int totalIssues() {
- return totalIssues;
- }
-
- public ActionPlanStats setTotalIssues(int totalIssues) {
- this.totalIssues = totalIssues;
- return this;
- }
-
- public int unresolvedIssues() {
- return unresolvedIssues;
- }
-
- public ActionPlanStats setUnresolvedIssues(int unresolvedIssues) {
- this.unresolvedIssues = unresolvedIssues;
- return this;
- }
-
- public int resolvedIssues() {
- return totalIssues - unresolvedIssues;
- }
-
- public boolean isOpen() {
- return ActionPlan.STATUS_OPEN.equals(status());
- }
-
- public boolean overDue() {
- Date deadline = deadLine();
- return isOpen() && deadline != null && new Date().after(deadline);
- }
-}
diff --git a/sonar-db/src/main/java/org/sonar/core/issue/package-info.java b/sonar-db/src/main/java/org/sonar/core/issue/package-info.java
deleted file mode 100644
index 0476e218487..00000000000
--- a/sonar-db/src/main/java/org/sonar/core/issue/package-info.java
+++ /dev/null
@@ -1,24 +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.
- */
-@ParametersAreNonnullByDefault
-package org.sonar.core.issue;
-
-import javax.annotation.ParametersAreNonnullByDefault;
-
diff --git a/sonar-db/src/main/java/org/sonar/db/DaoModule.java b/sonar-db/src/main/java/org/sonar/db/DaoModule.java
index ef2eb59fdab..a3895860f78 100644
--- a/sonar-db/src/main/java/org/sonar/db/DaoModule.java
+++ b/sonar-db/src/main/java/org/sonar/db/DaoModule.java
@@ -37,8 +37,6 @@ import org.sonar.db.dashboard.WidgetDao;
import org.sonar.db.dashboard.WidgetPropertyDao;
import org.sonar.db.duplication.DuplicationDao;
import org.sonar.db.event.EventDao;
-import org.sonar.db.issue.ActionPlanDao;
-import org.sonar.db.issue.ActionPlanStatsDao;
import org.sonar.db.issue.IssueChangeDao;
import org.sonar.db.issue.IssueDao;
import org.sonar.db.issue.IssueFilterDao;
@@ -72,8 +70,6 @@ import org.sonar.db.user.UserTokenDao;
public class DaoModule extends Module {
private static final List<Class<? extends Dao>> classes = ImmutableList.<Class<? extends Dao>>builder().add(
- ActionPlanDao.class,
- ActionPlanStatsDao.class,
ActiveDashboardDao.class,
ActivityDao.class,
AuthorDao.class,
diff --git a/sonar-db/src/main/java/org/sonar/db/DbClient.java b/sonar-db/src/main/java/org/sonar/db/DbClient.java
index 1927db7cace..600e68689b8 100644
--- a/sonar-db/src/main/java/org/sonar/db/DbClient.java
+++ b/sonar-db/src/main/java/org/sonar/db/DbClient.java
@@ -37,8 +37,6 @@ import org.sonar.db.dashboard.WidgetDao;
import org.sonar.db.dashboard.WidgetPropertyDao;
import org.sonar.db.duplication.DuplicationDao;
import org.sonar.db.event.EventDao;
-import org.sonar.db.issue.ActionPlanDao;
-import org.sonar.db.issue.ActionPlanStatsDao;
import org.sonar.db.issue.IssueChangeDao;
import org.sonar.db.issue.IssueDao;
import org.sonar.db.issue.IssueFilterDao;
@@ -97,8 +95,6 @@ public class DbClient {
private final IssueFilterDao issueFilterDao;
private final IssueFilterFavouriteDao issueFilterFavouriteDao;
private final IssueChangeDao issueChangeDao;
- private final ActionPlanDao actionPlanDao;
- private final ActionPlanStatsDao actionPlanStatsDao;
private final CeQueueDao ceQueueDao;
private final CeActivityDao ceActivityDao;
private final DashboardDao dashboardDao;
@@ -153,8 +149,6 @@ public class DbClient {
issueFilterDao = getDao(map, IssueFilterDao.class);
issueFilterFavouriteDao = getDao(map, IssueFilterFavouriteDao.class);
issueChangeDao = getDao(map, IssueChangeDao.class);
- actionPlanDao = getDao(map, ActionPlanDao.class);
- actionPlanStatsDao = getDao(map, ActionPlanStatsDao.class);
ceQueueDao = getDao(map, CeQueueDao.class);
ceActivityDao = getDao(map, CeActivityDao.class);
dashboardDao = getDao(map, DashboardDao.class);
@@ -289,10 +283,6 @@ public class DbClient {
return permissionTemplateDao;
}
- public ActionPlanDao actionPlanDao() {
- return actionPlanDao;
- }
-
public CeQueueDao ceQueueDao() {
return ceQueueDao;
}
@@ -341,10 +331,6 @@ public class DbClient {
return purgeDao;
}
- public ActionPlanStatsDao getActionPlanStatsDao() {
- return actionPlanStatsDao;
- }
-
public QualityGateDao qualityGateDao() {
return qualityGateDao;
}
diff --git a/sonar-db/src/main/java/org/sonar/db/MyBatis.java b/sonar-db/src/main/java/org/sonar/db/MyBatis.java
index b7517208fc8..3b02b65e6ed 100644
--- a/sonar-db/src/main/java/org/sonar/db/MyBatis.java
+++ b/sonar-db/src/main/java/org/sonar/db/MyBatis.java
@@ -61,10 +61,6 @@ import org.sonar.db.duplication.DuplicationMapper;
import org.sonar.db.duplication.DuplicationUnitDto;
import org.sonar.db.event.EventDto;
import org.sonar.db.event.EventMapper;
-import org.sonar.db.issue.ActionPlanDto;
-import org.sonar.db.issue.ActionPlanMapper;
-import org.sonar.db.issue.ActionPlanStatsDto;
-import org.sonar.db.issue.ActionPlanStatsMapper;
import org.sonar.db.issue.IssueChangeDto;
import org.sonar.db.issue.IssueChangeMapper;
import org.sonar.db.issue.IssueDto;
@@ -195,8 +191,6 @@ public class MyBatis {
confBuilder.loadAlias("IssueChange", IssueChangeDto.class);
confBuilder.loadAlias("IssueFilter", IssueFilterDto.class);
confBuilder.loadAlias("IssueFilterFavourite", IssueFilterFavouriteDto.class);
- confBuilder.loadAlias("ActionPlanIssue", ActionPlanDto.class);
- confBuilder.loadAlias("ActionPlanStats", ActionPlanStatsDto.class);
confBuilder.loadAlias("PermissionTemplate", PermissionTemplateDto.class);
confBuilder.loadAlias("PermissionTemplateUser", PermissionTemplateUserDto.class);
confBuilder.loadAlias("PermissionTemplateGroup", PermissionTemplateGroupDto.class);
@@ -230,7 +224,7 @@ public class MyBatis {
ResourceKeyUpdaterMapper.class, ResourceIndexMapper.class, RoleMapper.class, RuleMapper.class,
SchemaMigrationMapper.class, WidgetMapper.class, WidgetPropertyMapper.class,
UserMapper.class, GroupMapper.class, UserGroupMapper.class, UserTokenMapper.class,
- FileSourceMapper.class, ActionPlanMapper.class, ActionPlanStatsMapper.class,
+ FileSourceMapper.class,
NotificationQueueMapper.class,
GroupMembershipMapper.class, QualityProfileMapper.class, ActiveRuleMapper.class,
MeasureMapper.class, MetricMapper.class, CustomMeasureMapper.class, QualityGateMapper.class, QualityGateConditionMapper.class, ComponentMapper.class, SnapshotMapper.class,
diff --git a/sonar-db/src/main/java/org/sonar/db/issue/ActionPlanDao.java b/sonar-db/src/main/java/org/sonar/db/issue/ActionPlanDao.java
deleted file mode 100644
index 928d224c3d6..00000000000
--- a/sonar-db/src/main/java/org/sonar/db/issue/ActionPlanDao.java
+++ /dev/null
@@ -1,123 +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.db.issue;
-
-import com.google.common.base.Function;
-import java.util.Collection;
-import java.util.List;
-import javax.annotation.Nonnull;
-import org.apache.ibatis.session.SqlSession;
-import org.sonar.db.Dao;
-import org.sonar.db.DatabaseUtils;
-import org.sonar.db.DbSession;
-import org.sonar.db.MyBatis;
-
-public class ActionPlanDao implements Dao {
-
- private final MyBatis mybatis;
-
- public ActionPlanDao(MyBatis mybatis) {
- this.mybatis = mybatis;
- }
-
- public void save(ActionPlanDto actionPlanDto) {
- SqlSession session = mybatis.openSession(false);
- try {
- session.getMapper(ActionPlanMapper.class).insert(actionPlanDto);
- session.commit();
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
- public void update(ActionPlanDto actionPlanDto) {
- SqlSession session = mybatis.openSession(false);
- try {
- session.getMapper(ActionPlanMapper.class).update(actionPlanDto);
- session.commit();
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
- public void delete(String key) {
- SqlSession session = mybatis.openSession(false);
- try {
- session.getMapper(ActionPlanMapper.class).delete(key);
- session.commit();
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
- public ActionPlanDto selectByKey(String key) {
- SqlSession session = mybatis.openSession(false);
- try {
- return session.getMapper(ActionPlanMapper.class).findByKey(key);
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
- public List<ActionPlanDto> selectByKeys(Collection<String> keys) {
- DbSession session = mybatis.openSession(false);
- try {
- return selectByKeys(session, keys);
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
- public List<ActionPlanDto> selectByKeys(DbSession dbSession, Collection<String> keys) {
- return DatabaseUtils.executeLargeInputs(keys, new SelectByKeys(dbSession.getMapper(ActionPlanMapper.class)));
- }
-
- private static class SelectByKeys implements Function<List<String>, List<ActionPlanDto>> {
- private final ActionPlanMapper mapper;
-
- private SelectByKeys(ActionPlanMapper mapper) {
- this.mapper = mapper;
- }
-
- @Override
- public List<ActionPlanDto> apply(@Nonnull List<String> partitionOfKeys) {
- return mapper.findByKeys(partitionOfKeys);
- }
- }
-
- public List<ActionPlanDto> selectOpenByProjectId(Long projectId) {
- SqlSession session = mybatis.openSession(false);
- try {
- return session.getMapper(ActionPlanMapper.class).findOpenByProjectId(projectId);
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
- public List<ActionPlanDto> selectByNameAndProjectId(String name, Long projectId) {
- SqlSession session = mybatis.openSession(false);
- try {
- return session.getMapper(ActionPlanMapper.class).findByNameAndProjectId(name, projectId);
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
-}
diff --git a/sonar-db/src/main/java/org/sonar/db/issue/ActionPlanDto.java b/sonar-db/src/main/java/org/sonar/db/issue/ActionPlanDto.java
deleted file mode 100644
index 6d8bdec9db3..00000000000
--- a/sonar-db/src/main/java/org/sonar/db/issue/ActionPlanDto.java
+++ /dev/null
@@ -1,205 +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.db.issue;
-
-import java.util.Date;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
-import org.sonar.api.issue.ActionPlan;
-import org.sonar.core.issue.DefaultActionPlan;
-
-/**
- * @since 3.6
- */
-public class ActionPlanDto {
-
- private Long id;
- private String kee;
- private String name;
- private String description;
- private String userLogin;
- private Long projectId;
- private String status;
- private Date deadLine;
- private Date createdAt;
- private Date updatedAt;
-
- // return by joins
- private String projectKey;
- private String projectUuid;
-
- public Long getId() {
- return id;
- }
-
- public ActionPlanDto setId(Long id) {
- this.id = id;
- return this;
- }
-
- public String getKey() {
- return kee;
- }
-
- public ActionPlanDto setKey(String kee) {
- this.kee = kee;
- return this;
- }
-
- public String getName() {
- return name;
- }
-
- public ActionPlanDto setName(String name) {
- this.name = name;
- return this;
- }
-
- @CheckForNull
- public String getDescription() {
- return description;
- }
-
- public ActionPlanDto setDescription(@Nullable String description) {
- this.description = description;
- return this;
- }
-
- public String getUserLogin() {
- return userLogin;
- }
-
- public ActionPlanDto setUserLogin(String userLogin) {
- this.userLogin = userLogin;
- return this;
- }
-
- public Long getProjectId() {
- return projectId;
- }
-
- public ActionPlanDto setProjectId(Long projectId) {
- this.projectId = projectId;
- return this;
- }
-
- public String getStatus() {
- return status;
- }
-
- public ActionPlanDto setStatus(String status) {
- this.status = status;
- return this;
- }
-
- @CheckForNull
- public Date getDeadLine() {
- return deadLine;
- }
-
- public ActionPlanDto setDeadLine(@Nullable Date deadLine) {
- this.deadLine = deadLine;
- return this;
- }
-
- public Date getCreatedAt() {
- return createdAt;
- }
-
- public ActionPlanDto setCreatedAt(Date createdAt) {
- this.createdAt = createdAt;
- return this;
- }
-
- public Date getUpdatedAt() {
- return updatedAt;
- }
-
- public ActionPlanDto setUpdatedAt(Date updatedAt) {
- this.updatedAt = updatedAt;
- return this;
- }
-
- public String getProjectKey() {
- return projectKey;
- }
-
- /**
- * Only for unit tests
- */
- public ActionPlanDto setProjectKey_unit_test_only(String projectKey) {
- this.projectKey = projectKey;
- return this;
- }
-
- public String getProjectUuid() {
- return projectUuid;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- ActionPlanDto actionPlanDto = (ActionPlanDto) o;
- return !((id != null) ? !id.equals(actionPlanDto.id) : (actionPlanDto.id != null));
- }
-
- @Override
- public int hashCode() {
- return id != null ? id.hashCode() : 0;
- }
-
- @Override
- public String toString() {
- return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
- }
-
- public DefaultActionPlan toActionPlan() {
- return new DefaultActionPlan()
- .setName(name)
- .setKey(kee)
- .setProjectKey(projectKey)
- .setDescription(description)
- .setStatus(status)
- .setDeadLine(deadLine)
- .setUserLogin(userLogin)
- .setCreatedAt(createdAt)
- .setUpdatedAt(updatedAt);
- }
-
- public static ActionPlanDto toActionDto(ActionPlan actionPlan, Long projectId) {
- return new ActionPlanDto().setKey(actionPlan.key())
- .setName(actionPlan.name())
- .setProjectId(projectId)
- .setDescription(actionPlan.description())
- .setStatus(actionPlan.status())
- .setDeadLine(actionPlan.deadLine())
- .setUserLogin(actionPlan.userLogin())
- .setCreatedAt(actionPlan.createdAt())
- .setUpdatedAt(actionPlan.updatedAt());
- }
-}
diff --git a/sonar-db/src/main/java/org/sonar/db/issue/ActionPlanMapper.java b/sonar-db/src/main/java/org/sonar/db/issue/ActionPlanMapper.java
deleted file mode 100644
index f68c5bfe86c..00000000000
--- a/sonar-db/src/main/java/org/sonar/db/issue/ActionPlanMapper.java
+++ /dev/null
@@ -1,43 +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.db.issue;
-
-import java.util.List;
-import org.apache.ibatis.annotations.Param;
-
-/**
- * @since 3.6
- */
-public interface ActionPlanMapper {
-
- void insert(ActionPlanDto actionPlanDto);
-
- void update(ActionPlanDto actionPlanDto);
-
- void delete(@Param("key") String key);
-
- List<ActionPlanDto> findByKeys(@Param("keys") List<String> keys);
-
- ActionPlanDto findByKey(@Param("key") String key);
-
- List<ActionPlanDto> findOpenByProjectId(@Param("projectId") Long projectId);
-
- List<ActionPlanDto> findByNameAndProjectId(@Param("name") String name, @Param("projectId") Long projectId);
-}
diff --git a/sonar-db/src/main/java/org/sonar/db/issue/ActionPlanStatsDao.java b/sonar-db/src/main/java/org/sonar/db/issue/ActionPlanStatsDao.java
deleted file mode 100644
index d69fea41906..00000000000
--- a/sonar-db/src/main/java/org/sonar/db/issue/ActionPlanStatsDao.java
+++ /dev/null
@@ -1,43 +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.db.issue;
-
-import java.util.List;
-import org.apache.ibatis.session.SqlSession;
-import org.sonar.api.utils.System2;
-import org.sonar.db.AbstractDao;
-import org.sonar.db.MyBatis;
-
-public class ActionPlanStatsDao extends AbstractDao {
-
- public ActionPlanStatsDao(MyBatis myBatis, System2 system2) {
- super(myBatis, system2);
- }
-
- public List<ActionPlanStatsDto> selectByProjectId(Long projectId) {
- SqlSession session = myBatis().openSession(false);
- try {
- return session.getMapper(ActionPlanStatsMapper.class).findByProjectId(projectId);
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
-}
diff --git a/sonar-db/src/main/java/org/sonar/db/issue/ActionPlanStatsDto.java b/sonar-db/src/main/java/org/sonar/db/issue/ActionPlanStatsDto.java
deleted file mode 100644
index 1b84a6cee4c..00000000000
--- a/sonar-db/src/main/java/org/sonar/db/issue/ActionPlanStatsDto.java
+++ /dev/null
@@ -1,191 +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.db.issue;
-
-import java.util.Date;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
-import org.sonar.core.issue.ActionPlanStats;
-
-/**
- * @since 3.6
- */
-public class ActionPlanStatsDto {
-
- private Integer id;
- private String kee;
- private String name;
- private String description;
- private String userLogin;
- private Integer projectId;
- private String status;
- private Date deadLine;
- private Date createdAt;
- private Date updatedAt;
- private int totalIssues;
- private int unresolvedIssues;
- // return by joins
- private String projectKey;
- private String projectUuid;
-
- public Integer getId() {
- return id;
- }
-
- public ActionPlanStatsDto setId(Integer id) {
- this.id = id;
- return this;
- }
-
- public String getKee() {
- return kee;
- }
-
- public ActionPlanStatsDto setKee(String kee) {
- this.kee = kee;
- return this;
- }
-
- public String getName() {
- return name;
- }
-
- public ActionPlanStatsDto setName(String name) {
- this.name = name;
- return this;
- }
-
- public String getDescription() {
- return description;
- }
-
- public ActionPlanStatsDto setDescription(String description) {
- this.description = description;
- return this;
- }
-
- public String getUserLogin() {
- return userLogin;
- }
-
- public ActionPlanStatsDto setUserLogin(String userLogin) {
- this.userLogin = userLogin;
- return this;
- }
-
- public Integer getProjectId() {
- return projectId;
- }
-
- public ActionPlanStatsDto setProjectId(Integer projectId) {
- this.projectId = projectId;
- return this;
- }
-
- public String getStatus() {
- return status;
- }
-
- public ActionPlanStatsDto setStatus(String status) {
- this.status = status;
- return this;
- }
-
- public Date getDeadLine() {
- return deadLine;
- }
-
- public ActionPlanStatsDto setDeadLine(Date deadLine) {
- this.deadLine = deadLine;
- return this;
- }
-
- public Date getCreatedAt() {
- return createdAt;
- }
-
- public ActionPlanStatsDto setCreatedAt(Date createdAt) {
- this.createdAt = createdAt;
- return this;
- }
-
- public Date getUpdatedAt() {
- return updatedAt;
- }
-
- public ActionPlanStatsDto setUpdatedAt(Date updatedAt) {
- this.updatedAt = updatedAt;
- return this;
- }
-
- public int getTotalIssues() {
- return totalIssues;
- }
-
- public ActionPlanStatsDto setTotalIssues(int totalIssues) {
- this.totalIssues = totalIssues;
- return this;
- }
-
- public int getUnresolvedIssues() {
- return unresolvedIssues;
- }
-
- public ActionPlanStatsDto setUnresolvedIssues(int unresolvedIssues) {
- this.unresolvedIssues = unresolvedIssues;
- return this;
- }
-
- public String getProjectKey() {
- return projectKey;
- }
-
- /**
- * Only for unit tests
- */
- public ActionPlanStatsDto setProjectKey_unit_test_only(String projectKey) {
- this.projectKey = projectKey;
- return this;
- }
-
- public String getProjectUuid() {
- return projectUuid;
- }
-
- @Override
- public String toString() {
- return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
- }
-
- public ActionPlanStats toActionPlanStat() {
- return ((ActionPlanStats) ActionPlanStats.create(name)
- .setKey(kee)
- .setProjectKey(projectKey)
- .setDescription(description)
- .setStatus(status)
- .setDeadLine(deadLine)
- .setUserLogin(userLogin)
- .setCreatedAt(createdAt)
- .setUpdatedAt(updatedAt))
- .setTotalIssues(totalIssues)
- .setUnresolvedIssues(unresolvedIssues);
- }
-
-}
diff --git a/sonar-db/src/main/java/org/sonar/db/issue/ActionPlanStatsMapper.java b/sonar-db/src/main/java/org/sonar/db/issue/ActionPlanStatsMapper.java
deleted file mode 100644
index b8baa64ce9a..00000000000
--- a/sonar-db/src/main/java/org/sonar/db/issue/ActionPlanStatsMapper.java
+++ /dev/null
@@ -1,34 +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.db.issue;
-
-import java.util.List;
-import org.apache.ibatis.annotations.Param;
-
-/**
- * @since 3.6
- */
-public interface ActionPlanStatsMapper {
-
- /**
- * @since3.6
- */
- List<ActionPlanStatsDto> findByProjectId(@Param("projectId") Long projectId);
-}
diff --git a/sonar-db/src/main/java/org/sonar/db/issue/IssueDao.java b/sonar-db/src/main/java/org/sonar/db/issue/IssueDao.java
index 6e0f9665589..0f111cc9400 100644
--- a/sonar-db/src/main/java/org/sonar/db/issue/IssueDao.java
+++ b/sonar-db/src/main/java/org/sonar/db/issue/IssueDao.java
@@ -69,10 +69,6 @@ public class IssueDao implements Dao {
return issue.get();
}
- public List<IssueDto> selectByActionPlan(DbSession session, String actionPlan) {
- return mapper(session).selectByActionPlan(actionPlan);
- }
-
/**
* Gets a list issues by their keys. The result does NOT contain {@code null} values for issues not found, so
* the size of result may be less than the number of keys. A single issue is returned
diff --git a/sonar-db/src/main/java/org/sonar/db/issue/IssueDto.java b/sonar-db/src/main/java/org/sonar/db/issue/IssueDto.java
index 0fe823de213..56d267a6b6b 100644
--- a/sonar-db/src/main/java/org/sonar/db/issue/IssueDto.java
+++ b/sonar-db/src/main/java/org/sonar/db/issue/IssueDto.java
@@ -72,7 +72,6 @@ public final class IssueDto implements Serializable {
private String reporter;
private String assignee;
private String authorLogin;
- private String actionPlanKey;
private String issueAttributes;
private byte[] locations;
private long createdAt;
@@ -128,7 +127,6 @@ public final class IssueDto implements Serializable {
.setComponentUuid(issue.componentUuid())
.setProjectUuid(issue.projectUuid())
.setProjectKey(issue.projectKey())
- .setActionPlanKey(issue.actionPlanKey())
.setIssueAttributes(KeyValueFormat.format(issue.attributes()))
.setAuthorLogin(issue.authorLogin())
.setIssueCreationDate(issue.creationDate())
@@ -167,7 +165,6 @@ public final class IssueDto implements Serializable {
.setManualSeverity(issue.manualSeverity())
.setReporter(issue.reporter())
.setAssignee(issue.assignee())
- .setActionPlanKey(issue.actionPlanKey())
.setIssueAttributes(KeyValueFormat.format(issue.attributes()))
.setAuthorLogin(issue.authorLogin())
.setRuleKey(issue.ruleKey().repository(), issue.ruleKey().rule())
@@ -243,14 +240,8 @@ public final class IssueDto implements Serializable {
return this;
}
- @CheckForNull
- public String getActionPlanKey() {
- return actionPlanKey;
- }
-
public IssueDto setActionPlanKey(@Nullable String s) {
checkArgument(s == null || s.length() <= 50, "Value is too long for issue action plan: %s", s);
- this.actionPlanKey = s;
return this;
}
@@ -744,7 +735,6 @@ public final class IssueDto implements Serializable {
issue.setRuleKey(getRuleKey());
issue.setTags(getTags());
issue.setLanguage(language);
- issue.setActionPlanKey(actionPlanKey);
issue.setAuthorLogin(authorLogin);
issue.setNew(false);
issue.setCreationDate(longToDate(issueCreationDate));
diff --git a/sonar-db/src/main/java/org/sonar/db/issue/IssueMapper.java b/sonar-db/src/main/java/org/sonar/db/issue/IssueMapper.java
index d801ed634cc..a5e84d9e77b 100644
--- a/sonar-db/src/main/java/org/sonar/db/issue/IssueMapper.java
+++ b/sonar-db/src/main/java/org/sonar/db/issue/IssueMapper.java
@@ -34,8 +34,6 @@ public interface IssueMapper {
List<IssueDto> selectByKeys(List<String> keys);
- List<IssueDto> selectByActionPlan(String actionPlan);
-
void insert(IssueDto issue);
int update(IssueDto issue);
diff --git a/sonar-db/src/main/java/org/sonar/db/purge/PurgeCommands.java b/sonar-db/src/main/java/org/sonar/db/purge/PurgeCommands.java
index 806703ebf6a..7e62eabfc55 100644
--- a/sonar-db/src/main/java/org/sonar/db/purge/PurgeCommands.java
+++ b/sonar-db/src/main/java/org/sonar/db/purge/PurgeCommands.java
@@ -132,13 +132,6 @@ class PurgeCommands {
session.commit();
profiler.stop();
- profiler.start("deleteResourceActionPlans (action_plans)");
- for (List<Long> partResourceIds : componentIdPartitions) {
- purgeMapper.deleteResourceActionPlans(partResourceIds);
- }
- session.commit();
- profiler.stop();
-
profiler.start("deleteComponentEvents (events)");
for (List<String> componentUuidPartition : componentUuidsPartitions) {
purgeMapper.deleteComponentEvents(componentUuidPartition);
diff --git a/sonar-db/src/main/java/org/sonar/db/purge/PurgeMapper.java b/sonar-db/src/main/java/org/sonar/db/purge/PurgeMapper.java
index 0bf335d1bb9..f8c3149c64a 100644
--- a/sonar-db/src/main/java/org/sonar/db/purge/PurgeMapper.java
+++ b/sonar-db/src/main/java/org/sonar/db/purge/PurgeMapper.java
@@ -72,8 +72,6 @@ public interface PurgeMapper {
void deleteComponentEvents(@Param("componentUuids") List<String> componentUuids);
- void deleteResourceActionPlans(@Param("resourceIds") List<Long> resourceIds);
-
void deleteAuthors(@Param("resourceIds") List<Long> resourceIds);
List<PurgeableSnapshotDto> selectPurgeableSnapshotsWithEvents(long resourceId);
diff --git a/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java b/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java
index adc1dfa4d8d..d6e3e3c87f2 100644
--- a/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java
+++ b/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java
@@ -29,7 +29,7 @@ import org.sonar.db.MyBatis;
public class DatabaseVersion {
- public static final int LAST_VERSION = 1120;
+ public static final int LAST_VERSION = 1122;
/**
* The minimum supported version which can be upgraded. Lower
@@ -44,7 +44,6 @@ public class DatabaseVersion {
* for all the supported databases, particularly due to Oracle results.
*/
public static final List<String> TABLES = ImmutableList.of(
- "action_plans",
"active_dashboards",
"active_rules",
"active_rule_parameters",
diff --git a/sonar-db/src/main/resources/org/sonar/db/issue/ActionPlanMapper.xml b/sonar-db/src/main/resources/org/sonar/db/issue/ActionPlanMapper.xml
deleted file mode 100644
index c9054f54e1e..00000000000
--- a/sonar-db/src/main/resources/org/sonar/db/issue/ActionPlanMapper.xml
+++ /dev/null
@@ -1,89 +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-mappei.dtd">
-
-<mapper namespace="org.sonar.db.issue.ActionPlanMapper">
-
- <sql id="actionPlanColumns">
- ap.id,
- ap.kee as kee,
- ap.name as name,
- ap.description as description,
- ap.user_login as userLogin,
- ap.project_id as projectId,
- ap.status as status,
- ap.deadline as deadLine,
- ap.created_at as createdAt,
- ap.updated_at as updatedAt,
- p.kee as projectKey,
- p.uuid as projectUuid
- </sql>
-
- <insert id="insert" parameterType="ActionPlanIssue" keyColumn="id" useGeneratedKeys="true" keyProperty="id">
- INSERT INTO action_plans (kee, name, description, user_login, project_id, status, deadline, created_at, updated_at)
- VALUES (#{kee}, #{name}, #{description}, #{userLogin}, #{projectId}, #{status}, #{deadLine}, #{createdAt},
- #{updatedAt})
- </insert>
-
- <update id="update" parameterType="ActionPlanIssue">
- update action_plans set
- name=#{name},
- description=#{description},
- user_login=#{userLogin},
- project_id=#{projectId},
- status=#{status},
- deadline=#{deadLine},
- updated_at=current_timestamp
- where kee = #{kee}
- </update>
-
- <delete id="delete" parameterType="String">
- delete from action_plans where kee=#{key}
- </delete>
-
- <select id="findByKey" parameterType="long" resultType="ActionPlanIssue">
- select
- <include refid="actionPlanColumns"/>
- from action_plans ap, projects p
- <where>
- and ap.kee=#{key}
- and ap.project_id=p.id
- </where>
- </select>
-
- <select id="findByKeys" parameterType="long" resultType="ActionPlanIssue">
- select
- <include refid="actionPlanColumns"/>
- from action_plans ap, projects p
- <where>
- and ap.kee in
- <foreach collection="keys" open="(" close=")" item="key" separator=",">
- #{key}
- </foreach>
- and ap.project_id=p.id
- </where>
- </select>
-
- <select id="findOpenByProjectId" parameterType="long" resultType="ActionPlanIssue">
- select
- <include refid="actionPlanColumns"/>
- from action_plans ap, projects p
- <where>
- and ap.project_id=#{projectId}
- and ap.status='OPEN'
- and ap.project_id=p.id
- </where>
- </select>
-
- <select id="findByNameAndProjectId" parameterType="long" resultType="ActionPlanIssue">
- select
- <include refid="actionPlanColumns"/>
- from action_plans ap, projects p
- <where>
- and ap.project_id=#{projectId}
- and ap.name=#{name}
- and ap.project_id=p.id
- </where>
- </select>
-
-</mapper>
diff --git a/sonar-db/src/main/resources/org/sonar/db/issue/ActionPlanStatsMapper.xml b/sonar-db/src/main/resources/org/sonar/db/issue/ActionPlanStatsMapper.xml
deleted file mode 100644
index 30793f0de97..00000000000
--- a/sonar-db/src/main/resources/org/sonar/db/issue/ActionPlanStatsMapper.xml
+++ /dev/null
@@ -1,36 +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-mappei.dtd">
-
-<mapper namespace="org.sonar.db.issue.ActionPlanStatsMapper">
-
- <sql id="actionPlanColumns">
- ap.id as id,
- ap.kee as kee,
- ap.name as name,
- ap.description as description,
- ap.user_login as userLogin,
- ap.project_id as projectId,
- ap.status as status,
- ap.deadline as deadLine,
- ap.created_at as createdAt,
- ap.updated_at as updatedAt,
- p.kee as projectKey,
- p.uuid as projectUuid
- </sql>
-
- <select id="findByProjectId" parameterType="map" resultType="ActionPlanStats">
- select<include refid="actionPlanColumns"/>, count(total_issues.id) as totalIssues, count(open_issues.id) as
- unresolvedIssues
- from action_plans ap
- left join projects p on p.id = ap.project_id
- left join issues total_issues on total_issues.action_plan_key = ap.kee
- left join issues open_issues on open_issues.id = total_issues.id and open_issues.resolution is null
- <where>
- and ap.project_id = #{projectId}
- </where>
- group by ap.id, ap.kee, ap.name, ap.description, ap.user_login, ap.project_id, ap.status, ap.deadline,
- ap.created_at, ap.updated_at, p.kee, p.uuid
- </select>
-
-</mapper>
diff --git a/sonar-db/src/main/resources/org/sonar/db/issue/IssueMapper.xml b/sonar-db/src/main/resources/org/sonar/db/issue/IssueMapper.xml
index 63b2c388781..8c13afdc31c 100644
--- a/sonar-db/src/main/resources/org/sonar/db/issue/IssueMapper.xml
+++ b/sonar-db/src/main/resources/org/sonar/db/issue/IssueMapper.xml
@@ -8,7 +8,6 @@
i.id,
i.kee as kee,
i.rule_id as ruleId,
- i.action_plan_key as actionPlanKey,
i.severity as severity,
i.manual_severity as manualSeverity,
i.message as message,
@@ -68,11 +67,11 @@
</sql>
<insert id="insert" parameterType="Issue" useGeneratedKeys="false" keyProperty="id">
- INSERT INTO issues (kee, rule_id, action_plan_key, severity, manual_severity,
+ INSERT INTO issues (kee, rule_id, severity, manual_severity,
message, line, locations, gap, effort, status, tags,
resolution, checksum, reporter, assignee, author_login, issue_attributes, issue_creation_date, issue_update_date,
issue_close_date, created_at, updated_at, component_uuid, project_uuid, issue_type)
- VALUES (#{kee,jdbcType=VARCHAR}, #{ruleId,jdbcType=INTEGER}, #{actionPlanKey,jdbcType=VARCHAR},
+ VALUES (#{kee,jdbcType=VARCHAR}, #{ruleId,jdbcType=INTEGER},
#{severity,jdbcType=VARCHAR},
#{manualSeverity,jdbcType=BOOLEAN}, #{message,jdbcType=VARCHAR}, #{line,jdbcType=INTEGER},
#{locations,jdbcType=BINARY},
@@ -90,7 +89,6 @@
-->
<update id="update" parameterType="Issue">
update issues set
- action_plan_key=#{actionPlanKey,jdbcType=VARCHAR},
severity=#{severity,jdbcType=VARCHAR},
manual_severity=#{manualSeverity,jdbcType=BOOLEAN},
message=#{message,jdbcType=VARCHAR},
@@ -120,7 +118,6 @@
-->
<update id="updateIfBeforeSelectedDate" parameterType="Issue">
update issues set
- action_plan_key=#{actionPlanKey,jdbcType=VARCHAR},
severity=#{severity,jdbcType=VARCHAR},
manual_severity=#{manualSeverity,jdbcType=BOOLEAN},
message=#{message,jdbcType=VARCHAR},
@@ -174,7 +171,6 @@
i.rule_id as ruleId,
i.component_uuid as componentUuid,
i.project_uuid as projectUuid,
- i.action_plan_key as actionPlanKey,
i.severity as severity,
i.manual_severity as manualSeverity,
i.message as message,
@@ -226,18 +222,5 @@
#{key}
</foreach>
</select>
-
- <select id="selectByActionPlan" parameterType="map" resultType="Issue">
- select
- <include refid="issueColumns"/>
- from issues i
- inner join rules r on r.id=i.rule_id
- inner join projects p on p.uuid=i.component_uuid
- inner join projects root on root.uuid=i.project_uuid
- <where>
- and i.action_plan_key=#{action_plan}
- </where>
- </select>
-
</mapper>
diff --git a/sonar-db/src/main/resources/org/sonar/db/purge/PurgeMapper.xml b/sonar-db/src/main/resources/org/sonar/db/purge/PurgeMapper.xml
index 5c64bb131ec..aee39d1763a 100644
--- a/sonar-db/src/main/resources/org/sonar/db/purge/PurgeMapper.xml
+++ b/sonar-db/src/main/resources/org/sonar/db/purge/PurgeMapper.xml
@@ -207,13 +207,6 @@
</foreach>
</delete>
- <delete id="deleteResourceActionPlans" parameterType="map">
- delete from action_plans where project_id in
- <foreach collection="resourceIds" open="(" close=")" item="resourceId" separator=",">
- #{resourceId}
- </foreach>
- </delete>
-
<delete id="deleteAuthors" parameterType="map">
delete from authors where person_id in
<foreach collection="resourceIds" open="(" close=")" item="resourceId" separator=",">
diff --git a/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql b/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql
index d4ca8b75db1..9b1fe44c018 100644
--- a/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql
+++ b/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql
@@ -398,6 +398,8 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1117');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1118');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1119');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1120');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1121');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1122');
INSERT INTO USERS(ID, LOGIN, NAME, EMAIL, EXTERNAL_IDENTITY, EXTERNAL_IDENTITY_PROVIDER, USER_LOCAL, CRYPTED_PASSWORD, SALT, CREATED_AT, UPDATED_AT, REMEMBER_TOKEN, REMEMBER_TOKEN_EXPIRES_AT) VALUES (1, 'admin', 'Administrator', '', 'admin', 'sonarqube', true, 'a373a0e667abb2604c1fd571eb4ad47fe8cc0878', '48bc4b0d93179b5103fd3885ea9119498e9d161b', '1418215735482', '1418215735482', null, null);
ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2;
diff --git a/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl b/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl
index eb657209f2e..1bbd3df88ce 100644
--- a/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl
+++ b/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl
@@ -355,19 +355,6 @@ CREATE TABLE "RESOURCE_INDEX" (
"QUALIFIER" VARCHAR(10) NOT NULL
);
-CREATE TABLE "ACTION_PLANS" (
- "ID" BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
- "KEE" VARCHAR(100),
- "NAME" VARCHAR(200),
- "DESCRIPTION" VARCHAR(1000),
- "DEADLINE" TIMESTAMP,
- "USER_LOGIN" VARCHAR(255),
- "PROJECT_ID" INTEGER,
- "STATUS" VARCHAR(10),
- "CREATED_AT" TIMESTAMP,
- "UPDATED_AT" TIMESTAMP
-);
-
CREATE TABLE "AUTHORS" (
"ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
"PERSON_ID" INTEGER,
@@ -622,8 +609,6 @@ CREATE INDEX "RESOURCE_INDEX_KEY" ON "RESOURCE_INDEX" ("KEE");
CREATE INDEX "RESOURCE_INDEX_RID" ON "RESOURCE_INDEX" ("RESOURCE_ID");
-CREATE INDEX "INDEX_ACTION_PLANS_ON_PROJET_ID" ON "ACTION_PLANS" ("PROJECT_ID");
-
CREATE UNIQUE INDEX "UNIQ_AUTHOR_LOGINS" ON "AUTHORS" ("LOGIN");
CREATE INDEX "MEASURE_FILTERS_NAME" ON "MEASURE_FILTERS" ("NAME");
@@ -642,8 +627,6 @@ CREATE INDEX "ISSUES_RESOLUTION" ON "ISSUES" ("RESOLUTION");
CREATE INDEX "ISSUES_ASSIGNEE" ON "ISSUES" ("ASSIGNEE");
-CREATE INDEX "ISSUES_ACTION_PLAN_KEY" ON "ISSUES" ("ACTION_PLAN_KEY");
-
CREATE INDEX "ISSUES_CREATION_DATE" ON "ISSUES" ("ISSUE_CREATION_DATE");
CREATE INDEX "ISSUES_UPDATED_AT" ON "ISSUES" ("UPDATED_AT");
diff --git a/sonar-db/src/test/java/org/sonar/core/issue/ActionPlanStatsTest.java b/sonar-db/src/test/java/org/sonar/core/issue/ActionPlanStatsTest.java
deleted file mode 100644
index 1d76471a7f6..00000000000
--- a/sonar-db/src/test/java/org/sonar/core/issue/ActionPlanStatsTest.java
+++ /dev/null
@@ -1,42 +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.core.issue;
-
-import java.util.Date;
-import org.apache.commons.lang.time.DateUtils;
-import org.junit.Test;
-import org.sonar.api.issue.ActionPlan;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ActionPlanStatsTest {
-
- @Test
- public void test_over_due() throws Exception {
- Date yesterday = DateUtils.addDays(new Date(), -1);
- Date tomorrow = DateUtils.addDays(new Date(), 1);
-
- assertThat(((ActionPlanStats) ActionPlanStats.create("Short term").setStatus(ActionPlan.STATUS_OPEN).setDeadLine(tomorrow)).overDue()).isFalse();
- assertThat(((ActionPlanStats) ActionPlanStats.create("Short term").setStatus(ActionPlan.STATUS_OPEN).setDeadLine(yesterday)).overDue()).isTrue();
- assertThat(((ActionPlanStats) ActionPlanStats.create("Short term").setStatus(ActionPlan.STATUS_CLOSED).setDeadLine(tomorrow)).overDue()).isFalse();
- assertThat(((ActionPlanStats) ActionPlanStats.create("Short term").setStatus(ActionPlan.STATUS_CLOSED).setDeadLine(yesterday)).overDue()).isFalse();
- assertThat(((ActionPlanStats) ActionPlanStats.create("Short term").setStatus(ActionPlan.STATUS_CLOSED)).overDue()).isFalse();
- }
-}
diff --git a/sonar-db/src/test/java/org/sonar/db/DaoModuleTest.java b/sonar-db/src/test/java/org/sonar/db/DaoModuleTest.java
index 7e5f79e1d22..e666e3a2435 100644
--- a/sonar-db/src/test/java/org/sonar/db/DaoModuleTest.java
+++ b/sonar-db/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(49);
+ assertThat(container.size()).isEqualTo(2 + 45);
}
}
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
deleted file mode 100644
index 2d9edc4db87..00000000000
--- a/sonar-db/src/test/java/org/sonar/db/issue/ActionPlanDaoTest.java
+++ /dev/null
@@ -1,121 +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.db.issue;
-
-import java.util.Collection;
-import java.util.List;
-import org.junit.Rule;
-import org.junit.Test;
-import org.sonar.api.utils.System2;
-import org.sonar.db.DbTester;
-
-import static com.google.common.collect.Lists.newArrayList;
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class ActionPlanDaoTest {
-
- private static final String[] EXCLUDED_COLUMNS = new String[] {"id", "created_at", "updated_at"};
-
- @Rule
- public DbTester dbTester = DbTester.create(System2.INSTANCE);
-
- ActionPlanDao dao = dbTester.getDbClient().actionPlanDao();
-
- @Test
- public void should_insert_new_action_plan() {
- dbTester.truncateTables();
-
- ActionPlanDto actionPlanDto = new ActionPlanDto().setKey("ABC").setName("Long term").setDescription("Long term action plan").setStatus("OPEN")
- .setProjectId(1l).setUserLogin("arthur");
-
- dao.save(actionPlanDto);
-
- dbTester.assertDbUnit(getClass(), "should_insert_new_action_plan-result.xml", EXCLUDED_COLUMNS, "action_plans");
- }
-
- @Test
- public void should_update_action_plan() {
- dbTester.prepareDbUnit(getClass(), "should_update_action_plan.xml");
-
- ActionPlanDto actionPlanDto = new ActionPlanDto().setKey("ABC").setName("Long term").setDescription("Long term action plan").setStatus("OPEN")
- .setProjectId(1l).setUserLogin("arthur");
- dao.update(actionPlanDto);
-
- dbTester.assertDbUnit(getClass(), "should_update_action_plan-result.xml", EXCLUDED_COLUMNS, "action_plans");
- }
-
- @Test
- public void should_delete_action_plan() {
- dbTester.prepareDbUnit(getClass(), "should_delete_action_plan.xml");
-
- dao.delete("BCD");
-
- dbTester.assertDbUnit(getClass(), "should_delete_action_plan-result.xml", EXCLUDED_COLUMNS, "action_plans");
- }
-
- @Test
- public void should_find_by_key() {
- dbTester.prepareDbUnit(getClass(), "shared.xml", "should_find_by_key.xml");
-
- ActionPlanDto result = dao.selectByKey("ABC");
- assertThat(result).isNotNull();
- assertThat(result.getKey()).isEqualTo("ABC");
- assertThat(result.getProjectKey()).isEqualTo("PROJECT_KEY");
- assertThat(result.getProjectUuid()).isEqualTo("PROJECT_UUID");
- }
-
- @Test
- public void should_find_by_keys() {
- dbTester.prepareDbUnit(getClass(), "shared.xml", "should_find_by_keys.xml");
-
- Collection<ActionPlanDto> result = dao.selectByKeys(newArrayList("ABC", "ABD", "ABE"));
- assertThat(result).hasSize(3);
- }
-
- @Test
- public void should_find_by_keys_on_huge_number_of_keys() {
- dbTester.prepareDbUnit(getClass(), "shared.xml");
-
- List<String> hugeNbOKeys = newArrayList();
- for (int i = 0; i < 4500; i++) {
- hugeNbOKeys.add("ABCD" + i);
- }
- List<ActionPlanDto> result = dao.selectByKeys(hugeNbOKeys);
-
- // The goal of this test is only to check that the query do no fail, not to check the number of results
- assertThat(result).isEmpty();
- }
-
- @Test
- public void should_find_open_by_project_id() {
- dbTester.prepareDbUnit(getClass(), "shared.xml", "should_find_open_by_project_id.xml");
-
- Collection<ActionPlanDto> result = dao.selectOpenByProjectId(1l);
- assertThat(result).hasSize(2);
- }
-
- @Test
- public void should_find_by_name_and_project_id() {
- dbTester.prepareDbUnit(getClass(), "shared.xml", "should_find_by_name_and_project_id.xml");
-
- Collection<ActionPlanDto> result = dao.selectByNameAndProjectId("SHORT_TERM", 1l);
- assertThat(result).hasSize(2);
- }
-}
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
deleted file mode 100644
index fed54670c62..00000000000
--- a/sonar-db/src/test/java/org/sonar/db/issue/ActionPlanStatsDaoTest.java
+++ /dev/null
@@ -1,52 +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.db.issue;
-
-import java.util.Collection;
-import org.junit.Rule;
-import org.junit.Test;
-import org.sonar.api.utils.System2;
-import org.sonar.db.DbTester;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-
-public class ActionPlanStatsDaoTest {
-
- @Rule
- public DbTester dbTester = DbTester.create(System2.INSTANCE);
-
- ActionPlanStatsDao dao = dbTester.getDbClient().getActionPlanStatsDao();
-
- @Test
- public void should_find_by_project() {
- dbTester.prepareDbUnit(getClass(), "shared.xml", "should_find_by_project.xml");
-
- Collection<ActionPlanStatsDto> result = dao.selectByProjectId(1l);
- assertThat(result).isNotEmpty();
-
- ActionPlanStatsDto actionPlanStatsDto = result.iterator().next();
- assertThat(actionPlanStatsDto.getProjectKey()).isEqualTo("PROJECT_KEY");
- assertThat(actionPlanStatsDto.getProjectUuid()).isEqualTo("PROJECT_UUID");
- assertThat(actionPlanStatsDto.getTotalIssues()).isEqualTo(3);
- assertThat(actionPlanStatsDto.getUnresolvedIssues()).isEqualTo(1);
- }
-
-}
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 26cfaecff55..9f2290ad1e9 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
@@ -26,7 +26,6 @@ import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.utils.System2;
-import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
import org.sonar.db.RowNotFoundException;
import org.sonar.db.component.ComponentDto;
@@ -169,43 +168,6 @@ public class IssueDaoTest {
assertThat(issues).extracting("key").containsExactly("I2", "I1");
}
- @Test
- public void selectByActionPlan() {
- dbTester.prepareDbUnit(getClass(), "shared.xml", "find_by_action_plan.xml");
-
- List<IssueDto> issues = underTest.selectByActionPlan(dbTester.getSession(), "AP-1");
- assertThat(issues).hasSize(1);
-
- IssueDto issue = issues.get(0);
- assertThat(issue.getKee()).isEqualTo("ABCDE");
- assertThat(issue.getActionPlanKey()).isEqualTo("AP-1");
- assertThat(issue.getComponentUuid()).isEqualTo("CDEF");
- assertThat(issue.getProjectUuid()).isEqualTo("ABCD");
- assertThat(issue.getRuleId()).isEqualTo(500);
- assertThat(issue.getLanguage()).isEqualTo("java");
- assertThat(issue.getSeverity()).isEqualTo("BLOCKER");
- assertThat(issue.isManualSeverity()).isFalse();
- assertThat(issue.getMessage()).isNull();
- assertThat(issue.getLine()).isEqualTo(200);
- assertThat(issue.getGap()).isEqualTo(4.2);
- assertThat(issue.getStatus()).isEqualTo("OPEN");
- assertThat(issue.getResolution()).isEqualTo("FIXED");
- assertThat(issue.getChecksum()).isEqualTo("XXX");
- assertThat(issue.getAuthorLogin()).isEqualTo("karadoc");
- assertThat(issue.getReporter()).isEqualTo("arthur");
- assertThat(issue.getAssignee()).isEqualTo("perceval");
- assertThat(issue.getIssueAttributes()).isEqualTo("JIRA=FOO-1234");
- assertThat(issue.getIssueCreationDate()).isNotNull();
- assertThat(issue.getIssueUpdateDate()).isNotNull();
- assertThat(issue.getIssueCloseDate()).isNotNull();
- assertThat(issue.getCreatedAt()).isNotNull();
- assertThat(issue.getUpdatedAt()).isNotNull();
- assertThat(issue.getRuleRepo()).isEqualTo("squid");
- assertThat(issue.getRule()).isEqualTo("AvoidCycle");
- assertThat(issue.getComponentKey()).isEqualTo("Action.java");
- assertThat(issue.getProjectKey()).isEqualTo("struts");
- }
-
private static IssueDto newIssueDto(String key) {
IssueDto dto = new IssueDto();
dto.setComponent(new ComponentDto().setKey("struts:Action").setId(123L).setUuid("component-uuid"));
@@ -222,7 +184,6 @@ public class IssueDaoTest {
dto.setReporter("emmerik");
dto.setAuthorLogin("morgan");
dto.setAssignee("karadoc");
- dto.setActionPlanKey("current_sprint");
dto.setIssueAttributes("JIRA=FOO-1234");
dto.setChecksum("123456789");
dto.setMessage("the message");
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 2bf9d9cb891..0091675d756 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
@@ -77,7 +77,6 @@ public class IssueMapperTest {
assertThat(result.getReporter()).isEqualTo("emmerik");
assertThat(result.getAuthorLogin()).isEqualTo("morgan");
assertThat(result.getAssignee()).isEqualTo("karadoc");
- assertThat(result.getActionPlanKey()).isEqualTo("current_sprint");
assertThat(result.getIssueAttributes()).isEqualTo("JIRA=FOO-1234");
assertThat(result.getChecksum()).isEqualTo("123456789");
assertThat(result.getMessage()).isEqualTo("the message");
@@ -109,7 +108,6 @@ public class IssueMapperTest {
update.setReporter("emmerik");
update.setAuthorLogin("morgan");
update.setAssignee("karadoc");
- update.setActionPlanKey("current_sprint");
update.setIssueAttributes("JIRA=FOO-1234");
update.setChecksum("123456789");
update.setMessage("the message");
@@ -141,7 +139,6 @@ public class IssueMapperTest {
assertThat(result.getReporter()).isEqualTo("emmerik");
assertThat(result.getAuthorLogin()).isEqualTo("morgan");
assertThat(result.getAssignee()).isEqualTo("karadoc");
- assertThat(result.getActionPlanKey()).isEqualTo("current_sprint");
assertThat(result.getIssueAttributes()).isEqualTo("JIRA=FOO-1234");
assertThat(result.getChecksum()).isEqualTo("123456789");
assertThat(result.getMessage()).isEqualTo("the message");
@@ -227,7 +224,6 @@ public class IssueMapperTest {
.setReporter("emmerik")
.setAuthorLogin("morgan")
.setAssignee("karadoc")
- .setActionPlanKey("current_sprint")
.setIssueAttributes("JIRA=FOO-1234")
.setChecksum("123456789")
.setMessage("the message")
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 9f4099b8ea1..e44fa62511e 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
@@ -117,7 +117,6 @@ public class PurgeDaoTest {
dbSession.commit();
assertThat(dbTester.countRowsOfTable("projects")).isZero();
assertThat(dbTester.countRowsOfTable("snapshots")).isZero();
- assertThat(dbTester.countRowsOfTable("action_plans")).isZero();
assertThat(dbTester.countRowsOfTable("issues")).isZero();
assertThat(dbTester.countRowsOfTable("issue_changes")).isZero();
assertThat(dbTester.countRowsOfTable("file_sources")).isZero();
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/shared.xml b/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/shared.xml
deleted file mode 100644
index dfac83a8e2d..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/shared.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<dataset>
-
- <projects id="1" uuid="PROJECT_UUID" kee="PROJECT_KEY" root_id="[null]"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_delete_action_plan-result.xml b/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_delete_action_plan-result.xml
deleted file mode 100644
index 2b855c97f05..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_delete_action_plan-result.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<dataset>
-
- <action_plans id="1" kee="ABC" project_id="1" name="Long term" description="Long term action plan" deadline="[null]"
- user_login="arthur" status="OPEN" created_at="[null]" updated_at="[null]"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_delete_action_plan.xml b/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_delete_action_plan.xml
deleted file mode 100644
index eaa959cccf9..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_delete_action_plan.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<dataset>
-
- <action_plans id="1" kee="ABC" project_id="1" name="Long term" description="Long term action plan" deadline="[null]"
- user_login="arthur" status="OPEN" created_at="[null]" updated_at="[null]"/>
-
- <action_plans id="2" kee="BCD" project_id="1" name="Short term" description="Short term action plan" deadline="[null]"
- user_login="arthur" status="CLOSED" created_at="[null]" updated_at="[null]"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_find_by_key.xml b/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_find_by_key.xml
deleted file mode 100644
index c21cd9325e4..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_find_by_key.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<dataset>
-
- <action_plans id="1" kee="ABC" project_id="1" name="SHORT_TERM" description="[null]" deadline="[null]"
- user_login="igor" status="[null]" created_at="[null]" updated_at="[null]"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_find_by_keys.xml b/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_find_by_keys.xml
deleted file mode 100644
index a682d59fd17..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_find_by_keys.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<dataset>
-
- <action_plans id="1" kee="ABC" project_id="1" name="SHORT_TERM" description="[null]" deadline="[null]"
- user_login="igor" status="[null]" created_at="[null]" updated_at="[null]"/>
-
- <action_plans id="2" kee="ABD" project_id="1" name="SHORT_TERM" description="[null]" deadline="[null]"
- user_login="igor" status="[null]" created_at="[null]" updated_at="[null]"/>
-
- <action_plans id="3" kee="ABE" project_id="1" name="SHORT_TERM" description="[null]" deadline="[null]"
- user_login="igor" status="[null]" created_at="[null]" updated_at="[null]"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_find_by_name_and_project_id.xml b/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_find_by_name_and_project_id.xml
deleted file mode 100644
index e99d5b3eb3a..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_find_by_name_and_project_id.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<dataset>
-
- <action_plans id="1" kee="ABC" project_id="1" name="SHORT_TERM" description="[null]" deadline="[null]"
- user_login="igor" status="OPEN" created_at="[null]" updated_at="[null]"/>
-
- <action_plans id="2" kee="ABD" project_id="1" name="SHORT_TERM" description="[null]" deadline="[null]"
- user_login="igor" status="OPEN" created_at="[null]" updated_at="[null]"/>
-
- <action_plans id="3" kee="ABE" project_id="2" name="SHORT_TERM" description="[null]" deadline="[null]"
- user_login="igor" status="OPEN" created_at="[null]" updated_at="[null]"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_find_open_by_project_id.xml b/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_find_open_by_project_id.xml
deleted file mode 100644
index e15d4d0bbec..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_find_open_by_project_id.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<dataset>
-
- <action_plans id="1" kee="ABC" project_id="1" name="SHORT_TERM" description="[null]" deadline="[null]"
- user_login="igor" status="OPEN" created_at="[null]" updated_at="[null]"/>
-
- <action_plans id="2" kee="ABD" project_id="1" name="SHORT_TERM" description="[null]" deadline="[null]"
- user_login="igor" status="OPEN" created_at="[null]" updated_at="[null]"/>
-
- <action_plans id="3" kee="ABE" project_id="1" name="SHORT_TERM" description="[null]" deadline="[null]"
- user_login="igor" status="CLOSED" created_at="[null]" updated_at="[null]"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_insert_new_action_plan-result.xml b/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_insert_new_action_plan-result.xml
deleted file mode 100644
index 2b855c97f05..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_insert_new_action_plan-result.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<dataset>
-
- <action_plans id="1" kee="ABC" project_id="1" name="Long term" description="Long term action plan" deadline="[null]"
- user_login="arthur" status="OPEN" created_at="[null]" updated_at="[null]"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_update_action_plan-result.xml b/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_update_action_plan-result.xml
deleted file mode 100644
index 2b855c97f05..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_update_action_plan-result.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<dataset>
-
- <action_plans id="1" kee="ABC" project_id="1" name="Long term" description="Long term action plan" deadline="[null]"
- user_login="arthur" status="OPEN" created_at="[null]" updated_at="[null]"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_update_action_plan.xml b/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_update_action_plan.xml
deleted file mode 100644
index 3da5c2083b5..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanDaoTest/should_update_action_plan.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<dataset>
-
- <action_plans id="1" kee="ABC" project_id="1" name="Old name" description="Old desc" deadline="[null]"
- user_login="[null]" status="CLOSED" created_at="[null]" updated_at="[null]"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanStatsDaoTest/shared.xml b/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanStatsDaoTest/shared.xml
deleted file mode 100644
index dfac83a8e2d..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanStatsDaoTest/shared.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<dataset>
-
- <projects id="1" uuid="PROJECT_UUID" kee="PROJECT_KEY" root_id="[null]"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanStatsDaoTest/should_find_by_project.xml b/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanStatsDaoTest/should_find_by_project.xml
deleted file mode 100644
index 4db99c6f324..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/ActionPlanStatsDaoTest/should_find_by_project.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<dataset>
-
- <action_plans id="1" kee="ABC" project_id="1" name="SHORT_TERM" description="[null]" deadline="[null]"
- user_login="igor" status="OPEN" created_at="[null]" updated_at="[null]"/>
-
- <issues
- id="100"
- kee="ABCDE"
- component_uuid="uuid-400"
- project_uuid="uuid-400"
- rule_id="500"
- severity="BLOCKER"
- manual_severity="[false]"
- message="[null]"
- line="200"
- status="OPEN"
- resolution="[null]"
- checksum="XXX"
- reporter="arthur"
- assignee="perceval"
- author_login="[null]"
- issue_attributes="JIRA=FOO-1234"
- action_plan_key="ABC"
- issue_creation_date="1366063200000"
- issue_update_date="1366063200000"
- issue_close_date="1366063200000"
- created_at="1400000000000"
- updated_at="1400000000000"
- locations="[null]"
- />
-
- <issues
- id="101"
- kee="ABCDF"
- component_uuid="uuid-400"
- project_uuid="uuid-400"
- rule_id="500"
- severity="BLOCKER"
- manual_severity="[false]"
- message="[null]"
- line="200"
- status="CLOSED"
- resolution="FIXED"
- checksum="XXX"
- reporter="arthur"
- assignee="perceval"
- author_login="[null]"
- issue_attributes="JIRA=FOO-1234"
- action_plan_key="ABC"
- issue_creation_date="1366063200000"
- issue_update_date="1366063200000"
- issue_close_date="1366063200000"
- created_at="1400000000000"
- updated_at="1400000000000"
- locations="[null]"
- />
-
- <issues
- id="102"
- kee="ABCDG"
- component_uuid="uuid-400"
- project_uuid="uuid-400"
- rule_id="500"
- severity="BLOCKER"
- manual_severity="[false]"
- message="[null]"
- line="200"
- status="CLOSED"
- resolution="FIXED"
- checksum="XXX"
- reporter="arthur"
- assignee="perceval"
- author_login="[null]"
- issue_attributes="JIRA=FOO-1234"
- action_plan_key="ABC"
- issue_creation_date="1366063200000"
- issue_update_date="1366063200000"
- issue_close_date="1366063200000"
- created_at="1400000000000"
- updated_at="1400000000000"
- locations="[null]"
- />
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/find_by_action_plan.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/find_by_action_plan.xml
deleted file mode 100644
index 7a280fa52b6..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueDaoTest/find_by_action_plan.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<dataset>
-
- <issues
- id="100"
- kee="ABCDE"
- component_uuid="CDEF"
- project_uuid="ABCD"
- rule_id="500"
- severity="BLOCKER"
- manual_severity="[false]"
- message="[null]"
- line="200"
- gap="4.2"
- status="OPEN"
- resolution="FIXED"
- checksum="XXX"
- reporter="arthur"
- assignee="perceval"
- action_plan_key="AP-1"
- author_login="karadoc"
- issue_attributes="JIRA=FOO-1234"
- issue_creation_date="1366063200000"
- issue_update_date="1366063200000"
- issue_close_date="1366063200000"
- created_at="1400000000000"
- updated_at="1400000000000"
- locations="[null]"
- />
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteProject.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteProject.xml
index f1948def485..0649f12708c 100644
--- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteProject.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteProject.xml
@@ -18,9 +18,6 @@
build_date="1228222680000"
version="[null]" path="[null]"/>
- <action_plans id="1" kee="ABCD" project_id="1" name="SHORT_TERM" description="[null]" deadline="[null]"
- user_login="igor" status="[null]" created_at="[null]" updated_at="[null]"/>
-
<issues id="1" kee="ABCDE" component_uuid="A" project_uuid="A" status="CLOSED" resolution="[null]" line="200"
severity="BLOCKER"
reporter="perceval" assignee="arthur" rule_id="500"