diff options
author | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-01-23 14:54:34 +0100 |
---|---|---|
committer | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-01-23 16:39:01 +0100 |
commit | 45d303431198988fdde0c32e3c5c861bb792cba4 (patch) | |
tree | 26092750bb3c16bcb37cd3bf24cf43cbb49711b2 | |
parent | 373d5ace92e788aa379d136af61eb5a06b1b428a (diff) | |
download | sonarqube-45d303431198988fdde0c32e3c5c861bb792cba4.tar.gz sonarqube-45d303431198988fdde0c32e3c5c861bb792cba4.zip |
SONAR-4326 Continue separating .rule from .qualityprofile
12 files changed, 26 insertions, 26 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/platform/Platform.java b/sonar-server/src/main/java/org/sonar/server/platform/Platform.java index 7555aeec380..1a1eb76af72 100644 --- a/sonar-server/src/main/java/org/sonar/server/platform/Platform.java +++ b/sonar-server/src/main/java/org/sonar/server/platform/Platform.java @@ -19,8 +19,9 @@ */ package org.sonar.server.platform; -import org.sonar.server.qualityprofile.QProfileRuleLookup; +import org.sonar.server.rule.RuleOperations; +import org.sonar.server.qualityprofile.QProfileRuleLookup; import org.apache.commons.configuration.BaseConfiguration; import org.slf4j.LoggerFactory; import org.sonar.api.config.EmailSettings; @@ -282,7 +283,7 @@ public final class Platform { servicesContainer.addSingleton(QProfileLookup.class); servicesContainer.addSingleton(QProfileOperations.class); servicesContainer.addSingleton(QProfileActiveRuleOperations.class); - servicesContainer.addSingleton(QProfileRuleOperations.class); + servicesContainer.addSingleton(RuleOperations.class); servicesContainer.addSingleton(QProfileProjectOperations.class); servicesContainer.addSingleton(QProfileProjectLookup.class); servicesContainer.addSingleton(QProfileBackup.class); diff --git a/sonar-server/src/main/java/org/sonar/server/rule/ActiveRuleDocument.java b/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleDocument.java index 523a4249ae6..4450b0bc309 100644 --- a/sonar-server/src/main/java/org/sonar/server/rule/ActiveRuleDocument.java +++ b/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleDocument.java @@ -17,7 +17,7 @@ * 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.server.rule; +package org.sonar.server.qualityprofile; public class ActiveRuleDocument { diff --git a/sonar-server/src/main/java/org/sonar/server/qualityprofile/ESActiveRule.java b/sonar-server/src/main/java/org/sonar/server/qualityprofile/ESActiveRule.java index eafacdd4748..f57aafbd232 100644 --- a/sonar-server/src/main/java/org/sonar/server/qualityprofile/ESActiveRule.java +++ b/sonar-server/src/main/java/org/sonar/server/qualityprofile/ESActiveRule.java @@ -24,7 +24,6 @@ import org.elasticsearch.index.query.FilterBuilders; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; -import org.sonar.server.rule.ActiveRuleDocument; import org.sonar.server.rule.RuleDocument; import com.google.common.base.Function; import com.google.common.collect.Iterables; diff --git a/sonar-server/src/main/java/org/sonar/server/rule/ProfileRuleQuery.java b/sonar-server/src/main/java/org/sonar/server/qualityprofile/ProfileRuleQuery.java index 463959bc1a0..e8003d1b52c 100644 --- a/sonar-server/src/main/java/org/sonar/server/rule/ProfileRuleQuery.java +++ b/sonar-server/src/main/java/org/sonar/server/qualityprofile/ProfileRuleQuery.java @@ -18,13 +18,12 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.server.rule; +package org.sonar.server.qualityprofile; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import org.sonar.server.exceptions.BadRequestException; -import org.sonar.server.qualityprofile.QProfileRule; import org.sonar.server.util.RubyUtils; import javax.annotation.CheckForNull; diff --git a/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileRule.java b/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileRule.java index 1b22e99c01f..4679f150795 100644 --- a/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileRule.java +++ b/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileRule.java @@ -25,7 +25,6 @@ import org.elasticsearch.common.collect.Maps; import org.elasticsearch.common.joda.time.format.ISODateTimeFormat; import org.sonar.api.server.rule.RuleParamType; import org.sonar.check.Cardinality; -import org.sonar.server.rule.ActiveRuleDocument; import org.sonar.server.rule.RuleDocument; import javax.annotation.CheckForNull; diff --git a/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileRuleLookup.java b/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileRuleLookup.java index 4f0b3c3bca5..8a7677d64e7 100644 --- a/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileRuleLookup.java +++ b/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileRuleLookup.java @@ -35,8 +35,6 @@ import org.elasticsearch.search.sort.SortOrder; import org.sonar.api.ServerExtension; import org.sonar.api.rules.Rule; import org.sonar.server.es.ESIndex; -import org.sonar.server.rule.ActiveRuleDocument; -import org.sonar.server.rule.ProfileRuleQuery; import org.sonar.server.rule.RuleDocument; import javax.annotation.CheckForNull; diff --git a/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfiles.java b/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfiles.java index a1b95bdd985..15399d5ab61 100644 --- a/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfiles.java +++ b/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfiles.java @@ -20,6 +20,7 @@ package org.sonar.server.qualityprofile; +import org.sonar.server.rule.RuleOperations; import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; import org.sonar.api.ServerComponent; @@ -36,7 +37,6 @@ import org.sonar.core.rule.RuleDao; import org.sonar.core.rule.RuleDto; import org.sonar.server.exceptions.BadRequestException; import org.sonar.server.exceptions.NotFoundException; -import org.sonar.server.rule.ProfileRuleQuery; import org.sonar.server.user.UserSession; import org.sonar.server.util.RubyUtils; import org.sonar.server.util.Validation; @@ -68,12 +68,12 @@ public class QProfiles implements ServerComponent { private final QProfileLookup profileLookup; private final QProfileOperations operations; private final QProfileActiveRuleOperations activeRuleOperations; - private final QProfileRuleOperations ruleOperations; + private final RuleOperations ruleOperations; private final QProfileRuleLookup rules; public QProfiles(QualityProfileDao qualityProfileDao, ActiveRuleDao activeRuleDao, RuleDao ruleDao, ResourceDao resourceDao, QProfileProjectOperations projectOperations, QProfileProjectLookup projectLookup, QProfileBackup backup, QProfilePluginExporter exporter, - QProfileLookup profileLookup, QProfileOperations operations, QProfileActiveRuleOperations activeRuleOperations, QProfileRuleOperations ruleOperations, + QProfileLookup profileLookup, QProfileOperations operations, QProfileActiveRuleOperations activeRuleOperations, RuleOperations ruleOperations, QProfileRuleLookup rules) { this.qualityProfileDao = qualityProfileDao; this.activeRuleDao = activeRuleDao; diff --git a/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileRuleOperations.java b/sonar-server/src/main/java/org/sonar/server/rule/RuleOperations.java index 75e2fa7c068..68299d5db0c 100644 --- a/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileRuleOperations.java +++ b/sonar-server/src/main/java/org/sonar/server/rule/RuleOperations.java @@ -18,7 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.server.qualityprofile; +package org.sonar.server.rule; + +import org.sonar.server.qualityprofile.ESActiveRule; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Function; @@ -44,8 +46,6 @@ import org.sonar.core.rule.RuleTagDao; import org.sonar.core.rule.RuleTagType; import org.sonar.server.exceptions.BadRequestException; import org.sonar.server.exceptions.NotFoundException; -import org.sonar.server.rule.RuleRegistry; -import org.sonar.server.rule.RuleTagOperations; import org.sonar.server.user.UserSession; import java.util.Date; @@ -55,7 +55,7 @@ import java.util.Set; import static com.google.common.collect.Lists.newArrayList; -public class QProfileRuleOperations implements ServerComponent { +public class RuleOperations implements ServerComponent { private final MyBatis myBatis; private final ActiveRuleDao activeRuleDao; @@ -67,13 +67,13 @@ public class QProfileRuleOperations implements ServerComponent { private final System2 system; - public QProfileRuleOperations(MyBatis myBatis, ActiveRuleDao activeRuleDao, RuleDao ruleDao, RuleTagDao ruleTagDao, RuleTagOperations ruleTagOperations, + public RuleOperations(MyBatis myBatis, ActiveRuleDao activeRuleDao, RuleDao ruleDao, RuleTagDao ruleTagDao, RuleTagOperations ruleTagOperations, ESActiveRule esActiveRule, RuleRegistry ruleRegistry) { this(myBatis, activeRuleDao, ruleDao, ruleTagDao, ruleTagOperations, esActiveRule, ruleRegistry, System2.INSTANCE); } @VisibleForTesting - QProfileRuleOperations(MyBatis myBatis, ActiveRuleDao activeRuleDao, RuleDao ruleDao, RuleTagDao ruleTagDao, RuleTagOperations ruleTagOperations, ESActiveRule esActiveRule, + RuleOperations(MyBatis myBatis, ActiveRuleDao activeRuleDao, RuleDao ruleDao, RuleTagDao ruleTagDao, RuleTagOperations ruleTagOperations, ESActiveRule esActiveRule, RuleRegistry ruleRegistry, System2 system) { this.myBatis = myBatis; this.activeRuleDao = activeRuleDao; diff --git a/sonar-server/src/test/java/org/sonar/server/rule/ProfileRuleQueryTest.java b/sonar-server/src/test/java/org/sonar/server/qualityprofile/ProfileRuleQueryTest.java index 439026df1c8..62650676bb7 100644 --- a/sonar-server/src/test/java/org/sonar/server/rule/ProfileRuleQueryTest.java +++ b/sonar-server/src/test/java/org/sonar/server/qualityprofile/ProfileRuleQueryTest.java @@ -18,7 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.server.rule; +package org.sonar.server.qualityprofile; + +import org.sonar.server.qualityprofile.ProfileRuleQuery; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; diff --git a/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileRuleLookupTest.java b/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileRuleLookupTest.java index 8194cd8a0fa..1a7c7a1c873 100644 --- a/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileRuleLookupTest.java +++ b/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileRuleLookupTest.java @@ -31,7 +31,6 @@ import org.sonar.api.rule.Severity; import org.sonar.core.profiling.Profiling; import org.sonar.server.es.ESIndex; import org.sonar.server.es.ESNode; -import org.sonar.server.rule.ProfileRuleQuery; import org.sonar.server.rule.RuleRegistry; import org.sonar.test.TestUtils; diff --git a/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfilesTest.java b/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfilesTest.java index b45436fffad..e41d7c961c7 100644 --- a/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfilesTest.java +++ b/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfilesTest.java @@ -20,6 +20,7 @@ package org.sonar.server.qualityprofile; +import org.sonar.server.rule.RuleOperations; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; @@ -39,7 +40,6 @@ import org.sonar.core.rule.RuleDao; import org.sonar.core.rule.RuleDto; import org.sonar.server.exceptions.BadRequestException; import org.sonar.server.exceptions.NotFoundException; -import org.sonar.server.rule.ProfileRuleQuery; import org.sonar.server.user.UserSession; import java.util.List; @@ -83,7 +83,7 @@ public class QProfilesTest { QProfileActiveRuleOperations activeRuleOperations; @Mock - QProfileRuleOperations ruleOperations; + RuleOperations ruleOperations; @Mock QProfileBackup backup; diff --git a/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileRuleOperationsTest.java b/sonar-server/src/test/java/org/sonar/server/rule/RuleOperationsTest.java index 9bc796d2f4e..088c8a39d0a 100644 --- a/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileRuleOperationsTest.java +++ b/sonar-server/src/test/java/org/sonar/server/rule/RuleOperationsTest.java @@ -18,8 +18,11 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.server.qualityprofile; +package org.sonar.server.rule; +import org.sonar.server.qualityprofile.ESActiveRule; + +import org.sonar.server.rule.RuleOperations; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.apache.ibatis.session.SqlSession; @@ -73,7 +76,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) -public class QProfileRuleOperationsTest { +public class RuleOperationsTest { @Mock MyBatis myBatis; @@ -107,7 +110,7 @@ public class QProfileRuleOperationsTest { UserSession authorizedUserSession = MockUserSession.create().setLogin("nicolas").setName("Nicolas").setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN); UserSession unauthorizedUserSession = MockUserSession.create().setLogin("nicolas").setName("Nicolas"); - QProfileRuleOperations operations; + RuleOperations operations; @Before public void setUp() throws Exception { @@ -123,7 +126,7 @@ public class QProfileRuleOperationsTest { } }).when(activeRuleDao).insert(any(ActiveRuleDto.class), any(SqlSession.class)); - operations = new QProfileRuleOperations(myBatis, activeRuleDao, ruleDao, ruleTagDao, ruleTagOperations, esActiveRule, ruleRegistry, system); + operations = new RuleOperations(myBatis, activeRuleDao, ruleDao, ruleTagDao, ruleTagOperations, esActiveRule, ruleRegistry, system); } @Test |