aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2016-11-09 19:16:12 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2016-11-10 09:57:51 +0100
commit0962f303a557888bf6f1fcb92e7515eb2cfa02d7 (patch)
tree0a4f5e8c4211dfb996744091f4f5ae8f5c6c0ee5
parent39338ec2574ab8c019a4baa0385a7dbc795c988c (diff)
downloadsonarqube-0962f303a557888bf6f1fcb92e7515eb2cfa02d7.tar.gz
sonarqube-0962f303a557888bf6f1fcb92e7515eb2cfa02d7.zip
SONAR-8377 Remove issue filters dao
-rw-r--r--server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java2
-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/IssueFilterDao.java147
-rw-r--r--sonar-db/src/main/java/org/sonar/db/issue/IssueFilterDto.java116
-rw-r--r--sonar-db/src/main/java/org/sonar/db/issue/IssueFilterFavouriteDao.java103
-rw-r--r--sonar-db/src/main/java/org/sonar/db/issue/IssueFilterFavouriteDto.java70
-rw-r--r--sonar-db/src/main/java/org/sonar/db/issue/IssueFilterFavouriteMapper.java43
-rw-r--r--sonar-db/src/main/java/org/sonar/db/issue/IssueFilterMapper.java47
-rw-r--r--sonar-db/src/main/java/org/sonar/db/user/UserDao.java2
-rw-r--r--sonar-db/src/main/java/org/sonar/db/user/UserMapper.java4
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/issue/IssueFilterFavouriteMapper.xml48
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/issue/IssueFilterMapper.xml76
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/user/UserMapper.xml8
-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/IssueFilterDaoTest.java128
-rw-r--r--sonar-db/src/test/java/org/sonar/db/issue/IssueFilterFavouriteDaoTest.java98
-rw-r--r--sonar-db/src/test/java/org/sonar/db/user/UserDaoTest.java34
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/shared.xml23
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_delete-result.xml13
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_insert-result.xml34
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_select_by_user.xml33
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_select_by_user_with_only_favorite_filters.xml39
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_select_provided_by_name.xml58
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_update-result.xml23
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterFavouriteDaoTest/shared.xml21
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterFavouriteDaoTest/should_delete-result.xml15
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterFavouriteDaoTest/should_delete_by_issue_filter_id-result.xml9
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterFavouriteDaoTest/should_insert-result.xml27
30 files changed, 2 insertions, 1247 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 b9d1c12bfef..b9b59c7dc48 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
@@ -108,7 +108,7 @@ public class ComputeEngineContainerImplTest {
+ 25 // level 1
+ 46 // content of DaoModule
+ 2 // content of EsSearchModule
- + 64 // content of CorePropertyDefinitions
+ + 62 // content of CorePropertyDefinitions
+ 1 // content of CePropertyDefinitions
);
assertThat(picoContainer.getParent().getParent().getParent().getParent()).isNull();
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 822aab89617..76ac3cb5f18 100644
--- a/sonar-db/src/main/java/org/sonar/db/DaoModule.java
+++ b/sonar-db/src/main/java/org/sonar/db/DaoModule.java
@@ -36,8 +36,6 @@ import org.sonar.db.duplication.DuplicationDao;
import org.sonar.db.event.EventDao;
import org.sonar.db.issue.IssueChangeDao;
import org.sonar.db.issue.IssueDao;
-import org.sonar.db.issue.IssueFilterDao;
-import org.sonar.db.issue.IssueFilterFavouriteDao;
import org.sonar.db.loadedtemplate.LoadedTemplateDao;
import org.sonar.db.measure.MeasureDao;
import org.sonar.db.measure.custom.CustomMeasureDao;
@@ -87,8 +85,6 @@ public class DaoModule extends Module {
InternalPropertiesDao.class,
IssueDao.class,
IssueChangeDao.class,
- IssueFilterDao.class,
- IssueFilterFavouriteDao.class,
LoadedTemplateDao.class,
MeasureDao.class,
MetricDao.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 1c3b438ee2c..1db3feefa48 100644
--- a/sonar-db/src/main/java/org/sonar/db/DbClient.java
+++ b/sonar-db/src/main/java/org/sonar/db/DbClient.java
@@ -36,8 +36,6 @@ import org.sonar.db.duplication.DuplicationDao;
import org.sonar.db.event.EventDao;
import org.sonar.db.issue.IssueChangeDao;
import org.sonar.db.issue.IssueDao;
-import org.sonar.db.issue.IssueFilterDao;
-import org.sonar.db.issue.IssueFilterFavouriteDao;
import org.sonar.db.loadedtemplate.LoadedTemplateDao;
import org.sonar.db.measure.MeasureDao;
import org.sonar.db.measure.custom.CustomMeasureDao;
@@ -93,8 +91,6 @@ public class DbClient {
private final PermissionTemplateDao permissionTemplateDao;
private final PermissionTemplateCharacteristicDao permissionTemplateCharacteristicDao;
private final IssueDao issueDao;
- private final IssueFilterDao issueFilterDao;
- private final IssueFilterFavouriteDao issueFilterFavouriteDao;
private final IssueChangeDao issueChangeDao;
private final CeActivityDao ceActivityDao;
private final CeQueueDao ceQueueDao;
@@ -148,8 +144,6 @@ public class DbClient {
permissionTemplateDao = getDao(map, PermissionTemplateDao.class);
permissionTemplateCharacteristicDao = getDao(map, PermissionTemplateCharacteristicDao.class);
issueDao = getDao(map, IssueDao.class);
- issueFilterDao = getDao(map, IssueFilterDao.class);
- issueFilterFavouriteDao = getDao(map, IssueFilterFavouriteDao.class);
issueChangeDao = getDao(map, IssueChangeDao.class);
ceActivityDao = getDao(map, CeActivityDao.class);
ceQueueDao = getDao(map, CeQueueDao.class);
@@ -200,14 +194,6 @@ public class DbClient {
return issueDao;
}
- public IssueFilterDao issueFilterDao() {
- return issueFilterDao;
- }
-
- public IssueFilterFavouriteDao issueFilterFavouriteDao() {
- return issueFilterFavouriteDao;
- }
-
public IssueChangeDao issueChangeDao() {
return issueChangeDao;
}
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 349ee78df10..cc9b6a98df9 100644
--- a/sonar-db/src/main/java/org/sonar/db/MyBatis.java
+++ b/sonar-db/src/main/java/org/sonar/db/MyBatis.java
@@ -56,10 +56,6 @@ import org.sonar.db.event.EventMapper;
import org.sonar.db.issue.IssueChangeDto;
import org.sonar.db.issue.IssueChangeMapper;
import org.sonar.db.issue.IssueDto;
-import org.sonar.db.issue.IssueFilterDto;
-import org.sonar.db.issue.IssueFilterFavouriteDto;
-import org.sonar.db.issue.IssueFilterFavouriteMapper;
-import org.sonar.db.issue.IssueFilterMapper;
import org.sonar.db.issue.IssueMapper;
import org.sonar.db.loadedtemplate.LoadedTemplateDto;
import org.sonar.db.loadedtemplate.LoadedTemplateMapper;
@@ -170,8 +166,6 @@ public class MyBatis {
confBuilder.loadAlias("IdUuidPair", IdUuidPair.class);
confBuilder.loadAlias("InternalProperty", InternalPropertyDto.class);
confBuilder.loadAlias("IssueChange", IssueChangeDto.class);
- confBuilder.loadAlias("IssueFilterFavourite", IssueFilterFavouriteDto.class);
- confBuilder.loadAlias("IssueFilter", IssueFilterDto.class);
confBuilder.loadAlias("Issue", IssueDto.class);
confBuilder.loadAlias("LoadedTemplate", LoadedTemplateDto.class);
confBuilder.loadAlias("Measure", MeasureDto.class);
@@ -227,8 +221,6 @@ public class MyBatis {
InternalPropertiesMapper.class,
IsAliveMapper.class,
IssueChangeMapper.class,
- IssueFilterFavouriteMapper.class,
- IssueFilterMapper.class,
IssueMapper.class,
LoadedTemplateMapper.class,
MeasureMapper.class,
diff --git a/sonar-db/src/main/java/org/sonar/db/issue/IssueFilterDao.java b/sonar-db/src/main/java/org/sonar/db/issue/IssueFilterDao.java
deleted file mode 100644
index bff0a5597f5..00000000000
--- a/sonar-db/src/main/java/org/sonar/db/issue/IssueFilterDao.java
+++ /dev/null
@@ -1,147 +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 javax.annotation.CheckForNull;
-import org.apache.ibatis.session.SqlSession;
-import org.sonar.db.Dao;
-import org.sonar.db.DbSession;
-import org.sonar.db.MyBatis;
-
-public class IssueFilterDao implements Dao {
-
- private final MyBatis mybatis;
-
- public IssueFilterDao(MyBatis mybatis) {
- this.mybatis = mybatis;
- }
-
- @CheckForNull
- public IssueFilterDto selectById(DbSession session, long id) {
- return mapper(session).selectById(id);
- }
-
- @CheckForNull
- public IssueFilterDto selectById(long id) {
- DbSession session = mybatis.openSession(false);
- try {
- return selectById(session, id);
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
- /**
- * @deprecated since 5.2 use {@link #selectByUser(DbSession, String)}
- */
- @Deprecated
- public List<IssueFilterDto> selectByUser(String user) {
- DbSession session = mybatis.openSession(false);
- try {
- return selectByUser(session, user);
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
- public List<IssueFilterDto> selectByUser(DbSession session, String user) {
- return mapper(session).selectByUser(user);
- }
-
- public List<IssueFilterDto> selectFavoriteFiltersByUser(String user) {
- SqlSession session = mybatis.openSession(false);
- try {
- return mapper(session).selectFavoriteFiltersByUser(user);
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
- public IssueFilterDto selectProvidedFilterByName(String name) {
- SqlSession session = mybatis.openSession(false);
- try {
- return mapper(session).selectProvidedFilterByName(name);
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
- /**
- * @deprecated since 5.2 use {@link #selectSharedFilters(DbSession)}
- */
- @Deprecated
- public List<IssueFilterDto> selectSharedFilters() {
- DbSession session = mybatis.openSession(false);
- try {
- return selectSharedFilters(session);
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
- public List<IssueFilterDto> selectSharedFilters(DbSession session) {
- return mapper(session).selectSharedFilters();
- }
-
- /**
- * @deprecated since 5.2 use {@link #insert(DbSession, IssueFilterDto)}
- */
- @Deprecated
- public void insert(IssueFilterDto filter) {
- DbSession session = mybatis.openSession(false);
- try {
- insert(session, filter);
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
- public IssueFilterDto insert(DbSession session, IssueFilterDto filter) {
- mapper(session).insert(filter);
- session.commit();
-
- return filter;
- }
-
- public void update(IssueFilterDto filter) {
- DbSession session = mybatis.openSession(false);
- try {
- mapper(session).update(filter);
- session.commit();
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
- public void delete(long id) {
- DbSession session = mybatis.openSession(false);
- try {
- mapper(session).delete(id);
- session.commit();
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
- private static IssueFilterMapper mapper(SqlSession session) {
- return session.getMapper(IssueFilterMapper.class);
- }
-}
diff --git a/sonar-db/src/main/java/org/sonar/db/issue/IssueFilterDto.java b/sonar-db/src/main/java/org/sonar/db/issue/IssueFilterDto.java
deleted file mode 100644
index 15e637857de..00000000000
--- a/sonar-db/src/main/java/org/sonar/db/issue/IssueFilterDto.java
+++ /dev/null
@@ -1,116 +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.Nullable;
-
-/**
- * @since 3.7
- */
-public class IssueFilterDto {
-
- private Long id;
- private String name;
- private String userLogin;
- private boolean shared;
- private String description;
- private String data;
- private Date createdAt;
- private Date updatedAt;
-
- public IssueFilterDto() {
- Date now = new Date();
- createdAt = updatedAt = now;
- shared = false;
- }
-
- public Long getId() {
- return id;
- }
-
- public IssueFilterDto setId(Long id) {
- this.id = id;
- return this;
- }
-
- public String getName() {
- return name;
- }
-
- public IssueFilterDto setName(String name) {
- this.name = name;
- return this;
- }
-
- public String getUserLogin() {
- return userLogin;
- }
-
- public IssueFilterDto setUserLogin(String userLogin) {
- this.userLogin = userLogin;
- return this;
- }
-
- public boolean isShared() {
- return shared;
- }
-
- public IssueFilterDto setShared(boolean shared) {
- this.shared = shared;
- return this;
- }
-
- public String getDescription() {
- return description;
- }
-
- public IssueFilterDto setDescription(@Nullable String description) {
- this.description = description;
- return this;
- }
-
- public String getData() {
- return data;
- }
-
- public IssueFilterDto setData(String data) {
- this.data = data;
- return this;
- }
-
- public Date getCreatedAt() {
- return createdAt;
- }
-
- public IssueFilterDto setCreatedAt(Date createdAt) {
- this.createdAt = createdAt;
- return this;
- }
-
- public Date getUpdatedAt() {
- return updatedAt;
- }
-
- public IssueFilterDto setUpdatedAt(Date updatedAt) {
- this.updatedAt = updatedAt;
- return this;
- }
-}
diff --git a/sonar-db/src/main/java/org/sonar/db/issue/IssueFilterFavouriteDao.java b/sonar-db/src/main/java/org/sonar/db/issue/IssueFilterFavouriteDao.java
deleted file mode 100644
index f1b708556d8..00000000000
--- a/sonar-db/src/main/java/org/sonar/db/issue/IssueFilterFavouriteDao.java
+++ /dev/null
@@ -1,103 +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.db.Dao;
-import org.sonar.db.DbSession;
-import org.sonar.db.MyBatis;
-
-public class IssueFilterFavouriteDao implements Dao {
-
- private final MyBatis mybatis;
-
- public IssueFilterFavouriteDao(MyBatis mybatis) {
- this.mybatis = mybatis;
- }
-
- public IssueFilterFavouriteDto selectById(DbSession session, long id) {
- return mapper(session).selectById(id);
- }
-
- public IssueFilterFavouriteDto selectById(long id) {
- DbSession session = mybatis.openSession(false);
- try {
- return selectById(session, id);
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
- public List<IssueFilterFavouriteDto> selectByFilterId(long filterId) {
- SqlSession session = mybatis.openSession(false);
- try {
- return mapper(session).selectByFilterId(filterId);
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
- /**
- * @deprecated since 5.2 use {@link #insert(DbSession, IssueFilterFavouriteDto)}
- */
- @Deprecated
- public void insert(IssueFilterFavouriteDto filter) {
- DbSession session = mybatis.openSession(false);
- try {
- insert(session, filter);
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
- public void insert(DbSession session, IssueFilterFavouriteDto filter) {
- mapper(session).insert(filter);
- session.commit();
- }
-
- public void delete(long id) {
- SqlSession session = mybatis.openSession(false);
- try {
- mapper(session).delete(id);
- session.commit();
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
- public void deleteByFilterId(long filterId) {
- SqlSession session = mybatis.openSession(false);
- try {
- mapper(session).deleteByFilterId(filterId);
- session.commit();
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
- private static IssueFilterFavouriteMapper mapper(SqlSession session) {
- return session.getMapper(IssueFilterFavouriteMapper.class);
- }
-
- public List<IssueFilterFavouriteDto> selectByUser(DbSession dbSession, String login) {
- return mapper(dbSession).selectByUser(login);
- }
-}
diff --git a/sonar-db/src/main/java/org/sonar/db/issue/IssueFilterFavouriteDto.java b/sonar-db/src/main/java/org/sonar/db/issue/IssueFilterFavouriteDto.java
deleted file mode 100644
index 48003934c4b..00000000000
--- a/sonar-db/src/main/java/org/sonar/db/issue/IssueFilterFavouriteDto.java
+++ /dev/null
@@ -1,70 +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;
-
-/**
- * @since 3.7
- */
-public class IssueFilterFavouriteDto {
-
- private Long id;
- private String userLogin;
- private Long issueFilterId;
- private Date createdAt;
-
- public Long getId() {
- return id;
- }
-
- public IssueFilterFavouriteDto setId(Long id) {
- this.id = id;
- return this;
- }
-
- public String getUserLogin() {
- return userLogin;
- }
-
- public IssueFilterFavouriteDto setUserLogin(String userLogin) {
- this.userLogin = userLogin;
- return this;
- }
-
- public Long getIssueFilterId() {
- return issueFilterId;
- }
-
- public IssueFilterFavouriteDto setIssueFilterId(Long issueFilterId) {
- this.issueFilterId = issueFilterId;
- return this;
- }
-
- public Date getCreatedAt() {
- return createdAt;
- }
-
- public IssueFilterFavouriteDto setCreatedAt(Date createdAt) {
- this.createdAt = createdAt;
- return this;
- }
-
-}
diff --git a/sonar-db/src/main/java/org/sonar/db/issue/IssueFilterFavouriteMapper.java b/sonar-db/src/main/java/org/sonar/db/issue/IssueFilterFavouriteMapper.java
deleted file mode 100644
index 87811845c69..00000000000
--- a/sonar-db/src/main/java/org/sonar/db/issue/IssueFilterFavouriteMapper.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 javax.annotation.CheckForNull;
-import org.apache.ibatis.annotations.Param;
-
-/**
- * @since 3.7
- */
-public interface IssueFilterFavouriteMapper {
-
- @CheckForNull
- IssueFilterFavouriteDto selectById(long id);
-
- List<IssueFilterFavouriteDto> selectByFilterId(@Param("filterId") long filterId);
-
- List<IssueFilterFavouriteDto> selectByUser(String login);
-
- void insert(IssueFilterFavouriteDto filterFavourite);
-
- void delete(long id);
-
- void deleteByFilterId(long filterId);
-}
diff --git a/sonar-db/src/main/java/org/sonar/db/issue/IssueFilterMapper.java b/sonar-db/src/main/java/org/sonar/db/issue/IssueFilterMapper.java
deleted file mode 100644
index 7f72abda15a..00000000000
--- a/sonar-db/src/main/java/org/sonar/db/issue/IssueFilterMapper.java
+++ /dev/null
@@ -1,47 +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 javax.annotation.CheckForNull;
-
-/**
- * @since 3.7
- */
-public interface IssueFilterMapper {
-
- @CheckForNull
- IssueFilterDto selectById(long id);
-
- List<IssueFilterDto> selectByUser(String user);
-
- List<IssueFilterDto> selectFavoriteFiltersByUser(String user);
-
- List<IssueFilterDto> selectSharedFilters();
-
- IssueFilterDto selectProvidedFilterByName(String name);
-
- void insert(IssueFilterDto filter);
-
- void update(IssueFilterDto filter);
-
- void delete(long id);
-
-}
diff --git a/sonar-db/src/main/java/org/sonar/db/user/UserDao.java b/sonar-db/src/main/java/org/sonar/db/user/UserDao.java
index 8f92c394f2a..525ffd73385 100644
--- a/sonar-db/src/main/java/org/sonar/db/user/UserDao.java
+++ b/sonar-db/src/main/java/org/sonar/db/user/UserDao.java
@@ -157,8 +157,6 @@ public class UserDao implements Dao {
}
mapper.removeUserFromGroups(dto.getId());
- mapper.deleteUnsharedUserIssueFilters(dto.getLogin());
- mapper.deleteUserIssueFilterFavourites(dto.getLogin());
mapper.deleteUserProperties(dto.getId());
mapper.deleteUserRoles(dto.getId());
mapper.deletePropertiesMatchingLogin(asList(DEFAULT_ISSUE_ASSIGNEE), dto.getLogin());
diff --git a/sonar-db/src/main/java/org/sonar/db/user/UserMapper.java b/sonar-db/src/main/java/org/sonar/db/user/UserMapper.java
index a060c21e66b..b4339ee3e59 100644
--- a/sonar-db/src/main/java/org/sonar/db/user/UserMapper.java
+++ b/sonar-db/src/main/java/org/sonar/db/user/UserMapper.java
@@ -66,10 +66,6 @@ public interface UserMapper {
void removeUserFromGroups(long userId);
- void deleteUnsharedUserIssueFilters(String login);
-
- void deleteUserIssueFilterFavourites(String login);
-
void deleteUserProperties(long userId);
void deleteUserRoles(long userId);
diff --git a/sonar-db/src/main/resources/org/sonar/db/issue/IssueFilterFavouriteMapper.xml b/sonar-db/src/main/resources/org/sonar/db/issue/IssueFilterFavouriteMapper.xml
deleted file mode 100644
index cdcf51ee499..00000000000
--- a/sonar-db/src/main/resources/org/sonar/db/issue/IssueFilterFavouriteMapper.xml
+++ /dev/null
@@ -1,48 +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.issue.IssueFilterFavouriteMapper">
-
- <sql id="issueFilterFavouriteColumns">
- filter_favourites.id as id,
- filter_favourites.user_login as userLogin,
- filter_favourites.issue_filter_id as issueFilterId,
- filter_favourites.created_at as createdAt
- </sql>
-
- <select id="selectById" parameterType="long" resultType="issueFilterFavourite">
- select
- <include refid="issueFilterFavouriteColumns"/>
- from issue_filter_favourites filter_favourites
- where filter_favourites.id=#{id}
- </select>
-
- <select id="selectByFilterId" parameterType="long" resultType="issueFilterFavourite">
- select
- <include refid="issueFilterFavouriteColumns"/>
- from issue_filter_favourites filter_favourites
- where filter_favourites.issue_filter_id=#{filterId}
- </select>
-
- <select id="selectByUser" parameterType="string" resultType="issueFilterFavourite">
- select
- <include refid="issueFilterFavouriteColumns"/>
- from issue_filter_favourites filter_favourites
- where filter_favourites.user_login=#{login}
- </select>
-
- <insert id="insert" parameterType="issueFilterFavourite" keyColumn="id" useGeneratedKeys="true" keyProperty="id">
- INSERT INTO issue_filter_favourites (user_login, issue_filter_id, created_at)
- VALUES (#{userLogin}, #{issueFilterId}, current_timestamp)
- </insert>
-
- <delete id="delete" parameterType="long">
- delete from issue_filter_favourites where id=#{id}
- </delete>
-
- <delete id="deleteByFilterId" parameterType="long">
- delete from issue_filter_favourites where issue_filter_id=#{issueFilterId}
- </delete>
-
-</mapper>
diff --git a/sonar-db/src/main/resources/org/sonar/db/issue/IssueFilterMapper.xml b/sonar-db/src/main/resources/org/sonar/db/issue/IssueFilterMapper.xml
deleted file mode 100644
index aca8dffc6c2..00000000000
--- a/sonar-db/src/main/resources/org/sonar/db/issue/IssueFilterMapper.xml
+++ /dev/null
@@ -1,76 +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.issue.IssueFilterMapper">
-
- <sql id="issueFilterColumns">
- filters.id as id,
- filters.name as name,
- filters.user_login as userLogin,
- filters.shared as shared,
- filters.description as description,
- filters.data as data,
- filters.created_at as createdAt,
- filters.updated_at as updatedAt
- </sql>
-
- <select id="selectById" parameterType="long" resultType="IssueFilter">
- select
- <include refid="issueFilterColumns"/>
- from issue_filters filters
- where filters.id=#{id}
- </select>
-
- <select id="selectByUser" parameterType="String" resultType="IssueFilter">
- select
- <include refid="issueFilterColumns"/>
- from issue_filters filters
- where filters.user_login=#{user}
- </select>
-
- <select id="selectFavoriteFiltersByUser" parameterType="String" resultType="IssueFilter">
- select
- <include refid="issueFilterColumns"/>
- from issue_filters filters
- inner join issue_filter_favourites fav on fav.issue_filter_id = filters.id
- where fav.user_login=#{user}
- </select>
-
- <select id="selectSharedFilters" parameterType="String" resultType="IssueFilter">
- select
- <include refid="issueFilterColumns"/>
- from issue_filters filters
- where filters.shared=${_true}
- </select>
-
- <select id="selectProvidedFilterByName" parameterType="String" resultType="IssueFilter">
- select
- <include refid="issueFilterColumns"/>
- from issue_filters filters
- where filters.user_login is null
- and filters.shared=${_true}
- and filters.name=#{name}
- </select>
-
- <insert id="insert" parameterType="IssueFilter" keyColumn="id" useGeneratedKeys="true" keyProperty="id">
- INSERT INTO issue_filters (name, user_login, shared, description, data, created_at, updated_at)
- VALUES (#{name}, #{userLogin}, #{shared}, #{description}, #{data}, #{createdAt}, #{updatedAt})
- </insert>
-
- <update id="update" parameterType="IssueFilter">
- update issue_filters set
- name=#{name},
- shared=#{shared},
- description=#{description},
- data=#{data},
- user_login=#{userLogin},
- updated_at=current_timestamp
- where id=#{id}
- </update>
-
- <delete id="delete" parameterType="long">
- delete from issue_filters where id=#{id}
- </delete>
-
-</mapper>
diff --git a/sonar-db/src/main/resources/org/sonar/db/user/UserMapper.xml b/sonar-db/src/main/resources/org/sonar/db/user/UserMapper.xml
index 4a940a2ebe0..cb65570170f 100644
--- a/sonar-db/src/main/resources/org/sonar/db/user/UserMapper.xml
+++ b/sonar-db/src/main/resources/org/sonar/db/user/UserMapper.xml
@@ -127,14 +127,6 @@
DELETE FROM properties WHERE user_id=#{id}
</delete>
- <delete id="deleteUnsharedUserIssueFilters" parameterType="String">
- DELETE FROM issue_filters WHERE user_login=#{id} and shared &lt;&gt; ${_true}
- </delete>
-
- <delete id="deleteUserIssueFilterFavourites" parameterType="String">
- DELETE FROM issue_filter_favourites WHERE user_login=#{id}
- </delete>
-
<delete id="deletePropertiesMatchingLogin" parameterType="String">
DELETE FROM properties
<where>
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 c76d29e2dc1..5ccd64f9158 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(2 + 46);
+ assertThat(container.size()).isEqualTo(2 + 44);
}
}
diff --git a/sonar-db/src/test/java/org/sonar/db/issue/IssueFilterDaoTest.java b/sonar-db/src/test/java/org/sonar/db/issue/IssueFilterDaoTest.java
deleted file mode 100644
index e4d9af8d143..00000000000
--- a/sonar-db/src/test/java/org/sonar/db/issue/IssueFilterDaoTest.java
+++ /dev/null
@@ -1,128 +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.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 IssueFilterDaoTest {
-
- @Rule
- public DbTester dbTester = DbTester.create(System2.INSTANCE);
-
- IssueFilterDao dao = dbTester.getDbClient().issueFilterDao();
-
- @Test
- public void should_select_by_id() {
- dbTester.prepareDbUnit(getClass(), "shared.xml");
-
- IssueFilterDto filter = dao.selectById(1L);
-
- assertThat(filter.getId()).isEqualTo(1L);
- assertThat(filter.getName()).isEqualTo("Sonar Issues");
- assertThat(filter.isShared()).isTrue();
-
- assertThat(dao.selectById(123L)).isNull();
- }
-
- @Test
- public void should_select_by_user() {
- dbTester.prepareDbUnit(getClass(), "should_select_by_user.xml");
-
- List<IssueFilterDto> results = dao.selectByUser("michael");
-
- assertThat(results).hasSize(2);
- }
-
- @Test
- public void should_select_by_user_with_only_favorite_filters() {
- dbTester.prepareDbUnit(getClass(), "should_select_by_user_with_only_favorite_filters.xml");
-
- List<IssueFilterDto> results = dao.selectFavoriteFiltersByUser("michael");
-
- assertThat(results).hasSize(1);
- IssueFilterDto issueFilterDto = results.get(0);
- assertThat(issueFilterDto.getId()).isEqualTo(2L);
- }
-
- @Test
- public void should_select_shared() {
- dbTester.prepareDbUnit(getClass(), "shared.xml");
-
- assertThat(dao.selectSharedFilters()).hasSize(1);
- }
-
- @Test
- public void should_select_provided_by_name() {
- dbTester.prepareDbUnit(getClass(), "should_select_provided_by_name.xml");
-
- assertThat(dao.selectProvidedFilterByName("Unresolved Issues").getName()).isEqualTo("Unresolved Issues");
- assertThat(dao.selectProvidedFilterByName("My Unresolved Issues").getName()).isEqualTo("My Unresolved Issues");
- assertThat(dao.selectProvidedFilterByName("Unknown Filter")).isNull();
- }
-
- @Test
- public void should_insert() {
- dbTester.prepareDbUnit(getClass(), "shared.xml");
-
- IssueFilterDto filterDto = new IssueFilterDto();
- filterDto.setName("Sonar Open issues");
- filterDto.setUserLogin("michael");
- filterDto.setShared(true);
- filterDto.setDescription("All open issues on Sonar");
- filterDto.setData("statuses=OPEN|componentRoots=org.codehaus.sonar");
-
- dao.insert(filterDto);
-
- dbTester.assertDbUnit(getClass(), "should_insert-result.xml", new String[]{"created_at", "updated_at"}, "issue_filters");
- }
-
- @Test
- public void should_update() {
- dbTester.prepareDbUnit(getClass(), "shared.xml");
-
- IssueFilterDto filterDto = new IssueFilterDto();
- filterDto.setId(2L);
- filterDto.setName("Closed issues");
- filterDto.setShared(false);
- filterDto.setDescription("All closed issues");
- filterDto.setData("statuses=CLOSED");
- filterDto.setUserLogin("bernard");
-
- dao.update(filterDto);
-
- dbTester.assertDbUnit(getClass(), "should_update-result.xml", new String[]{"created_at", "updated_at"}, "issue_filters");
- }
-
- @Test
- public void should_delete() {
- dbTester.prepareDbUnit(getClass(), "shared.xml");
-
- dao.delete(1l);
-
- dbTester.assertDbUnit(getClass(), "should_delete-result.xml", new String[] {"created_at", "updated_at"}, "issue_filters");
- }
-}
diff --git a/sonar-db/src/test/java/org/sonar/db/issue/IssueFilterFavouriteDaoTest.java b/sonar-db/src/test/java/org/sonar/db/issue/IssueFilterFavouriteDaoTest.java
deleted file mode 100644
index 1450adb0994..00000000000
--- a/sonar-db/src/test/java/org/sonar/db/issue/IssueFilterFavouriteDaoTest.java
+++ /dev/null
@@ -1,98 +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.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 IssueFilterFavouriteDaoTest {
-
- @Rule
- public DbTester dbTester = DbTester.create(System2.INSTANCE);
-
- IssueFilterFavouriteDao dao = dbTester.getDbClient().issueFilterFavouriteDao();
-
- @Test
- public void should_select_by_id() {
- dbTester.prepareDbUnit(getClass(), "shared.xml");
-
- IssueFilterFavouriteDto dto = dao.selectById(1L);
- assertThat(dto.getId()).isEqualTo(1L);
- assertThat(dto.getUserLogin()).isEqualTo("stephane");
- assertThat(dto.getIssueFilterId()).isEqualTo(10L);
- assertThat(dto.getCreatedAt()).isNotNull();
-
- assertThat(dao.selectById(999L)).isNull();
- }
-
- @Test
- public void should_select_by_filter_id() {
- dbTester.prepareDbUnit(getClass(), "shared.xml");
-
- List<IssueFilterFavouriteDto> dtos = dao.selectByFilterId(11L);
- assertThat(dtos).hasSize(1);
- IssueFilterFavouriteDto dto = dtos.get(0);
- assertThat(dto.getId()).isEqualTo(2L);
- assertThat(dto.getUserLogin()).isEqualTo("stephane");
- assertThat(dto.getIssueFilterId()).isEqualTo(11L);
- assertThat(dto.getCreatedAt()).isNotNull();
-
- assertThat(dao.selectByFilterId(10L)).hasSize(2);
- assertThat(dao.selectByFilterId(999L)).isEmpty();
- }
-
- @Test
- public void should_insert() {
- dbTester.prepareDbUnit(getClass(), "shared.xml");
-
- IssueFilterFavouriteDto dto = new IssueFilterFavouriteDto();
- dto.setUserLogin("arthur");
- dto.setIssueFilterId(11L);
-
- dao.insert(dto);
-
- dbTester.assertDbUnit(getClass(), "should_insert-result.xml", new String[]{"created_at"}, "issue_filter_favourites");
- }
-
- @Test
- public void should_delete() {
- dbTester.prepareDbUnit(getClass(), "shared.xml");
-
- dao.delete(3l);
-
- dbTester.assertDbUnit(getClass(), "should_delete-result.xml", new String[]{"created_at"}, "issue_filter_favourites");
- }
-
- @Test
- public void should_delete_by_issue_filter_id() {
- dbTester.prepareDbUnit(getClass(), "shared.xml");
-
- dao.deleteByFilterId(10l);
-
- dbTester.assertDbUnit(getClass(), "should_delete_by_issue_filter_id-result.xml", new String[]{"created_at"}, "issue_filter_favourites");
- }
-
-}
diff --git a/sonar-db/src/test/java/org/sonar/db/user/UserDaoTest.java b/sonar-db/src/test/java/org/sonar/db/user/UserDaoTest.java
index 0d94157377d..de30995ee5d 100644
--- a/sonar-db/src/test/java/org/sonar/db/user/UserDaoTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/user/UserDaoTest.java
@@ -33,8 +33,6 @@ import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
import org.sonar.db.RowNotFoundException;
-import org.sonar.db.issue.IssueFilterDto;
-import org.sonar.db.issue.IssueFilterFavouriteDto;
import org.sonar.db.organization.OrganizationDto;
import org.sonar.db.property.PropertyDto;
import org.sonar.db.property.PropertyQuery;
@@ -395,8 +393,6 @@ public class UserDaoTest {
@Test
public void deactivate_user() throws Exception {
UserDto user = newActiveUser();
- IssueFilterDto issueFilter = insertIssueFilter(user, false);
- IssueFilterFavouriteDto issueFilterFavourite = insertIssueFilterFavourite(issueFilter, user);
PropertyDto property = insertProperty(user);
db.users().insertPermissionOnUser(user, "perm");
insertUserGroup(user);
@@ -421,30 +417,12 @@ public class UserDaoTest {
assertThat(underTest.selectUserById(session, otherUser.getId())).isNotNull();
- assertThat(dbClient.issueFilterDao().selectById(session, issueFilter.getId())).isNull();
- assertThat(dbClient.issueFilterFavouriteDao().selectById(session, issueFilterFavourite.getId())).isNull();
assertThat(dbClient.propertiesDao().selectByQuery(PropertyQuery.builder().setKey(property.getKey()).build(), session)).isEmpty();
assertThat(dbClient.userPermissionDao().selectGlobalPermissionsOfUser(session, user.getId(), db.getDefaultOrganization().getUuid())).isEmpty();
assertThat(dbClient.groupMembershipDao().countGroups(session, builder().login(user.getLogin()).membership(IN).build(), user.getId())).isZero();
}
@Test
- public void deactivate_user_does_not_remove_shared_issue_filter() throws Exception {
- UserDto user = newActiveUser();
- IssueFilterDto notSharedFilter = insertIssueFilter(user, false);
- IssueFilterDto sharedFilter = insertIssueFilter(user, true);
- session.commit();
-
- boolean deactivated = underTest.deactivateUserByLogin(session, user.getLogin());
- assertThat(deactivated).isTrue();
-
- assertThat(dbClient.issueFilterDao().selectById(session, notSharedFilter.getId())).isNull();
- IssueFilterDto sharedFilterReloaded = dbClient.issueFilterDao().selectById(session, sharedFilter.getId());
- assertThat(sharedFilterReloaded).isNotNull();
- assertThat(sharedFilterReloaded.getUserLogin()).isEqualTo(user.getLogin());
- }
-
- @Test
public void deactivate_user_also_remove_default_assignee_login_properties() throws Exception {
UserDto user = newActiveUser();
insertProperty("sonar.issues.defaultAssigneeLogin", user.getLogin(), 10L);
@@ -743,18 +721,6 @@ public class UserDaoTest {
return dto;
}
- private IssueFilterDto insertIssueFilter(UserDto user, boolean shared) {
- IssueFilterDto dto = new IssueFilterDto().setUserLogin(user.getLogin()).setName(randomAlphanumeric(100)).setShared(shared);
- dbClient.issueFilterDao().insert(session, dto);
- return dto;
- }
-
- private IssueFilterFavouriteDto insertIssueFilterFavourite(IssueFilterDto filter, UserDto user) {
- IssueFilterFavouriteDto dto = new IssueFilterFavouriteDto().setUserLogin(user.getLogin()).setIssueFilterId(filter.getId());
- dbClient.issueFilterFavouriteDao().insert(session, dto);
- return dto;
- }
-
private PropertyDto insertProperty(UserDto user) {
PropertyDto dto = new PropertyDto().setKey(randomAlphanumeric(100)).setUserId(user.getId());
dbClient.propertiesDao().saveProperty(session, dto);
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/shared.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/shared.xml
deleted file mode 100644
index 68f9cdc6615..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/shared.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<dataset>
-
- <issue_filters
- id="1"
- name="Sonar Issues"
- user_login="stephane"
- shared="[true]"
- description="All issues of Sonar"
- data="componentRoots=org.codehaus.sonar"
- created_at="2013-06-10"
- updated_at="2013-06-10"/>
-
- <issue_filters
- id="2"
- name="Open issues"
- user_login="michael"
- shared="[false]"
- description="All open issues"
- data="statuses=OPEN"
- created_at="2013-06-10"
- updated_at="2013-06-10"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_delete-result.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_delete-result.xml
deleted file mode 100644
index 7933167cf9a..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_delete-result.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<dataset>
-
- <issue_filters
- id="2"
- name="Open issues"
- user_login="michael"
- shared="[false]"
- description="All open issues"
- data="statuses=OPEN"
- created_at="2013-06-10"
- updated_at="2013-06-10"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_insert-result.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_insert-result.xml
deleted file mode 100644
index 869df62a337..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_insert-result.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<dataset>
-
- <issue_filters
- id="1"
- name="Sonar Issues"
- user_login="stephane"
- shared="[true]"
- description="All issues of Sonar"
- data="componentRoots=org.codehaus.sonar"
- created_at="2013-06-10"
- updated_at="2013-06-10"/>
-
- <issue_filters
- id="2"
- name="Open issues"
- user_login="michael"
- shared="[false]"
- description="All open issues"
- data="statuses=OPEN"
- created_at="2013-06-10"
- updated_at="2013-06-10"/>
-
-
- <issue_filters
- id="3"
- name="Sonar Open issues"
- user_login="michael"
- shared="[true]"
- description="All open issues on Sonar"
- data="statuses=OPEN|componentRoots=org.codehaus.sonar"
- created_at="2013-06-10"
- updated_at="2013-06-10"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_select_by_user.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_select_by_user.xml
deleted file mode 100644
index 0f91cec3cdd..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_select_by_user.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<dataset>
-
- <issue_filters
- id="1"
- name="Sonar Issues"
- user_login="stephane"
- shared="[true]"
- description="All issues of Sonar"
- data="componentRoots=org.codehaus.sonar"
- created_at="2013-06-10"
- updated_at="2013-06-10"/>
-
- <issue_filters
- id="2"
- name="Open issues"
- user_login="michael"
- shared="[false]"
- description="All open issues"
- data="statuses=OPEN"
- created_at="2013-06-10"
- updated_at="2013-06-10"/>
-
- <issue_filters
- id="3"
- name="Sonar Open issues"
- user_login="michael"
- shared="[true]"
- description="All open issues on Sonar"
- data="statuses=OPEN|componentRoots=org.codehaus.sonar"
- created_at="2013-06-10"
- updated_at="2013-06-10"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_select_by_user_with_only_favorite_filters.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_select_by_user_with_only_favorite_filters.xml
deleted file mode 100644
index 47d558307c3..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_select_by_user_with_only_favorite_filters.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<dataset>
-
- <issue_filters
- id="1"
- name="Sonar Issues"
- user_login="stephane"
- shared="[true]"
- description="All issues of Sonar"
- data="componentRoots=org.codehaus.sonar"
- created_at="2013-06-10"
- updated_at="2013-06-10"/>
-
- <issue_filters
- id="2"
- name="Open issues"
- user_login="michael"
- shared="[false]"
- description="All open issues"
- data="statuses=OPEN"
- created_at="2013-06-10"
- updated_at="2013-06-10"/>
-
- <issue_filters
- id="3"
- name="Sonar Open issues"
- user_login="michael"
- shared="[true]"
- description="All open issues on Sonar"
- data="statuses=OPEN|componentRoots=org.codehaus.sonar"
- created_at="2013-06-10"
- updated_at="2013-06-10"/>
-
- <issue_filter_favourites
- id="10"
- user_login="michael"
- issue_filter_id="2"
- created_at="2013-06-10"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_select_provided_by_name.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_select_provided_by_name.xml
deleted file mode 100644
index 81bf84aee21..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_select_provided_by_name.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<dataset>
-
- <!-- This one must be found -->
- <issue_filters
- id="1"
- name="Unresolved Issues"
- user_login="[null]"
- shared="[true]"
- description="[null]"
- data="resolved=false"
- created_at="2011-04-25 01:15:00"
- updated_at="2011-04-25 01:15:00"/>
-
- <!-- This one must NOT be found: belongs to admin -->
- <issue_filters
- id="2"
- name="Unresolved Issues"
- user_login="admin"
- shared="[true]"
- description="[null]"
- data="resolved=false"
- created_at="2011-04-25 01:15:00"
- updated_at="2011-04-25 01:15:00"/>
-
- <!-- This one must NOT be found: not shared -->
- <issue_filters
- id="3"
- name="Unresolved Issues"
- user_login="[null]"
- shared="[false]"
- description="[null]"
- data="resolved=false"
- created_at="2011-04-25 01:15:00"
- updated_at="2011-04-25 01:15:00"/>
-
- <!-- This one must be found -->
- <issue_filters
- id="4"
- name="My Unresolved Issues"
- user_login="[null]"
- shared="[true]"
- description="[null]"
- data="resolved=false|assignees=__me__"
- created_at="2011-04-25 01:15:00"
- updated_at="2011-04-25 01:15:00"/>
-
- <!-- This one must NOT be found: not shared -->
- <issue_filters
- id="5"
- name="Unknown Filter"
- user_login="[null]"
- shared="[false]"
- description="[null]"
- data="resolved=false"
- created_at="2011-04-25 01:15:00"
- updated_at="2011-04-25 01:15:00"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_update-result.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_update-result.xml
deleted file mode 100644
index 0916ece3f0a..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterDaoTest/should_update-result.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<dataset>
-
- <issue_filters
- id="1"
- name="Sonar Issues"
- user_login="stephane"
- shared="[true]"
- description="All issues of Sonar"
- data="componentRoots=org.codehaus.sonar"
- created_at="2013-06-10"
- updated_at="2013-06-10"/>
-
- <issue_filters
- id="2"
- name="Closed issues"
- user_login="bernard"
- shared="[false]"
- description="All closed issues"
- data="statuses=CLOSED"
- created_at="2013-06-10"
- updated_at="2013-06-11"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterFavouriteDaoTest/shared.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterFavouriteDaoTest/shared.xml
deleted file mode 100644
index 07d23d9fce6..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterFavouriteDaoTest/shared.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<dataset>
-
- <issue_filter_favourites
- id="1"
- user_login="stephane"
- issue_filter_id="10"
- created_at="2013-06-10"/>
-
- <issue_filter_favourites
- id="2"
- user_login="stephane"
- issue_filter_id="11"
- created_at="2013-06-10"/>
-
- <issue_filter_favourites
- id="3"
- user_login="arthur"
- issue_filter_id="10"
- created_at="2013-06-10"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterFavouriteDaoTest/should_delete-result.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterFavouriteDaoTest/should_delete-result.xml
deleted file mode 100644
index b3f03e6724e..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterFavouriteDaoTest/should_delete-result.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<dataset>
-
- <issue_filter_favourites
- id="1"
- user_login="stephane"
- issue_filter_id="10"
- created_at="2013-06-10"/>
-
- <issue_filter_favourites
- id="2"
- user_login="stephane"
- issue_filter_id="11"
- created_at="2013-06-10"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterFavouriteDaoTest/should_delete_by_issue_filter_id-result.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterFavouriteDaoTest/should_delete_by_issue_filter_id-result.xml
deleted file mode 100644
index c2a7f43e9e4..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterFavouriteDaoTest/should_delete_by_issue_filter_id-result.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<dataset>
-
- <issue_filter_favourites
- id="2"
- user_login="stephane"
- issue_filter_id="11"
- created_at="2013-06-10"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterFavouriteDaoTest/should_insert-result.xml b/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterFavouriteDaoTest/should_insert-result.xml
deleted file mode 100644
index f9b8e27974d..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/issue/IssueFilterFavouriteDaoTest/should_insert-result.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<dataset>
-
- <issue_filter_favourites
- id="1"
- user_login="stephane"
- issue_filter_id="10"
- created_at="2013-06-10"/>
-
- <issue_filter_favourites
- id="2"
- user_login="stephane"
- issue_filter_id="11"
- created_at="2013-06-10"/>
-
- <issue_filter_favourites
- id="3"
- user_login="arthur"
- issue_filter_id="10"
- created_at="2013-06-10"/>
-
- <issue_filter_favourites
- id="4"
- user_login="arthur"
- issue_filter_id="11"
- created_at="2013-06-18"/>
-
-</dataset>