summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2014-01-10 08:20:30 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2014-01-10 08:20:30 +0100
commit48250940c4ad53bf04538deda83669f53cc367a3 (patch)
tree3bc00ee784748d0169241bd648abc4a47a85cf8f
parent8217f4cc87256585c6db01e1d10b5a914a471cb6 (diff)
downloadsonarqube-48250940c4ad53bf04538deda83669f53cc367a3.tar.gz
sonarqube-48250940c4ad53bf04538deda83669f53cc367a3.zip
SONAR-4923 Remove no more used code
-rw-r--r--sonar-server/src/main/java/org/sonar/server/configuration/ProfilesManager.java13
-rw-r--r--sonar-server/src/test/java/org/sonar/server/configuration/InheritedProfilesTest.java21
2 files changed, 0 insertions, 34 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/configuration/ProfilesManager.java b/sonar-server/src/main/java/org/sonar/server/configuration/ProfilesManager.java
index ae5854e39d5..534967f0203 100644
--- a/sonar-server/src/main/java/org/sonar/server/configuration/ProfilesManager.java
+++ b/sonar-server/src/main/java/org/sonar/server/configuration/ProfilesManager.java
@@ -196,19 +196,6 @@ public class ProfilesManager extends BaseDao {
return actions;
}
- /**
- * @return true, if setting <code>childProfile</code> as a child of <code>parentProfile</code> adds cycle
- */
- boolean isCycle(RulesProfile childProfile, RulesProfile parentProfile) {
- while (parentProfile != null) {
- if (childProfile.equals(parentProfile)) {
- return true;
- }
- parentProfile = getParentProfile(parentProfile);
- }
- return false;
- }
-
public void revert(int profileId, int activeRuleId, String userName) {
RulesProfile profile = getSession().getEntity(RulesProfile.class, profileId);
ActiveRule oldActiveRule = getSession().getEntity(ActiveRule.class, activeRuleId);
diff --git a/sonar-server/src/test/java/org/sonar/server/configuration/InheritedProfilesTest.java b/sonar-server/src/test/java/org/sonar/server/configuration/InheritedProfilesTest.java
index a235e50ce0a..2659e347493 100644
--- a/sonar-server/src/test/java/org/sonar/server/configuration/InheritedProfilesTest.java
+++ b/sonar-server/src/test/java/org/sonar/server/configuration/InheritedProfilesTest.java
@@ -21,15 +21,11 @@ package org.sonar.server.configuration;
import org.junit.Before;
import org.junit.Test;
-import org.sonar.api.profiles.RulesProfile;
import org.sonar.core.preview.PreviewCache;
import org.sonar.jpa.test.AbstractDbUnitTestCase;
import org.sonar.server.qualityprofile.RuleInheritanceActions;
import static org.fest.assertions.Assertions.assertThat;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.nullValue;
-import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
public class InheritedProfilesTest extends AbstractDbUnitTestCase {
@@ -41,23 +37,6 @@ public class InheritedProfilesTest extends AbstractDbUnitTestCase {
}
@Test
- public void shouldCheckCycles() {
- setupData("shouldCheckCycles");
- RulesProfile level1 = profilesManager.getProfile("java", "level1");
- RulesProfile level2 = profilesManager.getProfile("java", "level2");
- RulesProfile level3 = profilesManager.getProfile("java", "level3");
-
- assertThat(profilesManager.getParentProfile(level1), nullValue());
- assertThat(profilesManager.getParentProfile(level2), is(level1));
- assertThat(profilesManager.getParentProfile(level3), is(level2));
-
- assertThat(profilesManager.isCycle(level1, level1), is(true));
- assertThat(profilesManager.isCycle(level1, level3), is(true));
- assertThat(profilesManager.isCycle(level1, level2), is(true));
- assertThat(profilesManager.isCycle(level2, level3), is(true));
- }
-
- @Test
public void shouldSetParent() {
setupData("shouldSetParent");
profilesManager.profileParentChanged(2, "parent", "admin");