aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sonar-batch/src/test/resources/org/sonar/batch/rule/ActiveRulesProviderTest/shared.xml6
-rw-r--r--sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java2
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql1
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl6
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/ActiveRuleMapper.xml14
-rw-r--r--sonar-core/src/test/java/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest.java16
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete-result.xml7
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_from_profile-result.xml5
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_from_rule-result.xml9
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameter-result.xml6
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameters-result.xml6
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameters_from_profile_id-result.xml9
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameters_from_profile_id.xml9
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/insert-result.xml3
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/shared.xml9
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/update-result.xml9
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRule.java36
-rw-r--r--sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleDocument.java6
-rw-r--r--sonar-server/src/main/java/org/sonar/server/qualityprofile/ESActiveRule.java8
-rw-r--r--sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileActiveRuleOperations.java45
-rw-r--r--sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileRule.java19
-rw-r--r--sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfiles.java8
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb26
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_active_rule_note.html.erb70
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule.html.erb6
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/536_remove_active_rule_notes.rb34
-rw-r--r--sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileActiveRuleOperationsTest.java89
-rw-r--r--sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfilesTest.java12
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldActivateInChildren-result.xml6
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldChangeParent-result.xml9
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldDeactivateInChildren-result.xml3
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldNotDeactivateOverridingChildren-result.xml6
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldRemoveParent-result.xml3
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldSetParent-result.xml6
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/qualityprofile/RuleChangeTest/removeActivatedRules-result.xml3
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete-result.xml7
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_from_profile-result.xml5
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_from_rule-result.xml7
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameter-result.xml6
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameters-result.xml6
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameters_from_profile_id-result.xml9
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameters_from_profile_id.xml9
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/insert-result.xml3
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/insert_parameter.xml3
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/shared.xml9
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/update-result.xml9
46 files changed, 120 insertions, 465 deletions
diff --git a/sonar-batch/src/test/resources/org/sonar/batch/rule/ActiveRulesProviderTest/shared.xml b/sonar-batch/src/test/resources/org/sonar/batch/rule/ActiveRulesProviderTest/shared.xml
index 2c4953c0dc9..695222a8c53 100644
--- a/sonar-batch/src/test/resources/org/sonar/batch/rule/ActiveRulesProviderTest/shared.xml
+++ b/sonar-batch/src/test/resources/org/sonar/batch/rule/ActiveRulesProviderTest/shared.xml
@@ -13,13 +13,11 @@
used_profile="[false]"/>
<!-- java -->
- <active_rules id="1" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+ <active_rules id="1" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
<active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="max" value="20"/>
<active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" rules_parameter_key="format" value="html"/>
<!-- php -->
- <active_rules id="2" profile_id="3" rule_id="100" failure_level="4" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+ <active_rules id="2" profile_id="3" rule_id="100" failure_level="4" inheritance="[null]"/>
</dataset>
diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java b/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java
index 97b010a611e..2b125c1ff7a 100644
--- a/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java
+++ b/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java
@@ -33,7 +33,7 @@ import java.util.List;
*/
public class DatabaseVersion implements BatchComponent, ServerComponent {
- public static final int LAST_VERSION = 535;
+ public static final int LAST_VERSION = 536;
public static enum Status {
UP_TO_DATE, REQUIRES_UPGRADE, REQUIRES_DOWNGRADE, FRESH_INSTALL
diff --git a/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql b/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql
index 1851f63e3a7..e6e974e9d54 100644
--- a/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql
+++ b/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql
@@ -231,6 +231,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('532');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('533');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('534');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('535');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('536');
INSERT INTO USERS(ID, LOGIN, NAME, EMAIL, CRYPTED_PASSWORD, SALT, CREATED_AT, UPDATED_AT, REMEMBER_TOKEN, REMEMBER_TOKEN_EXPIRES_AT) VALUES (1, 'admin', 'Administrator', '', 'a373a0e667abb2604c1fd571eb4ad47fe8cc0878', '48bc4b0d93179b5103fd3885ea9119498e9d161b', '2011-09-26 22:27:48.0', '2011-09-26 22:27:48.0', null, null);
ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2;
diff --git a/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl b/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl
index c5244ccd5ff..7871f4f5e6b 100644
--- a/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl
+++ b/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl
@@ -317,11 +317,7 @@ CREATE TABLE "ACTIVE_RULES" (
"PROFILE_ID" INTEGER NOT NULL,
"RULE_ID" INTEGER NOT NULL,
"FAILURE_LEVEL" INTEGER NOT NULL,
- "INHERITANCE" VARCHAR(10),
- "NOTE_CREATED_AT" TIMESTAMP,
- "NOTE_UPDATED_AT" TIMESTAMP,
- "NOTE_USER_LOGIN" VARCHAR(40),
- "NOTE_DATA" CLOB(2147483647)
+ "INHERITANCE" VARCHAR(10)
);
CREATE TABLE "NOTIFICATIONS" (
diff --git a/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/ActiveRuleMapper.xml b/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/ActiveRuleMapper.xml
index 2a7835f9f7e..93d62d979d4 100644
--- a/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/ActiveRuleMapper.xml
+++ b/sonar-core/src/main/resources/org/sonar/core/qualityprofile/db/ActiveRuleMapper.xml
@@ -9,10 +9,6 @@
a.rule_id as ruleId,
a.failure_level as severity,
a.inheritance as inheritance,
- a.note_data as noteData,
- a.note_user_login as noteUserLogin,
- a.note_updated_at as noteUpdatedAt,
- a.note_created_at as noteCreatedAt,
active_rule_parent.id as parentId
</sql>
@@ -23,8 +19,8 @@
</sql>
<insert id="insert" parameterType="ActiveRule" keyColumn="id" useGeneratedKeys="true" keyProperty="id">
- INSERT INTO active_rules (profile_id, rule_id, failure_level, inheritance, note_created_at, note_updated_at, note_user_login, note_data)
- VALUES (#{profileId}, #{ruleId}, #{severity}, #{inheritance}, #{noteCreatedAt}, #{noteUpdatedAt}, #{noteUserLogin}, #{noteData})
+ INSERT INTO active_rules (profile_id, rule_id, failure_level, inheritance)
+ VALUES (#{profileId}, #{ruleId}, #{severity}, #{inheritance})
</insert>
<update id="update" parameterType="ActiveRule">
@@ -32,11 +28,7 @@
profile_id=#{profileId},
rule_id=#{ruleId},
failure_level=#{severity},
- inheritance=#{inheritance},
- note_created_at=#{noteCreatedAt},
- note_updated_at=#{noteUpdatedAt},
- note_user_login=#{noteUserLogin},
- note_data=#{noteData}
+ inheritance=#{inheritance}
WHERE id=#{id}
</update>
diff --git a/sonar-core/src/test/java/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest.java b/sonar-core/src/test/java/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest.java
index 6a846805aaa..86dbf2ea461 100644
--- a/sonar-core/src/test/java/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest.java
@@ -26,7 +26,6 @@ import com.google.common.collect.Iterables;
import org.junit.Before;
import org.junit.Test;
import org.sonar.api.rule.Severity;
-import org.sonar.api.utils.DateUtils;
import org.sonar.core.persistence.AbstractDaoTestCase;
import java.util.List;
@@ -66,8 +65,7 @@ public class ActiveRuleDaoTest extends AbstractDaoTestCase {
.setProfileId(1)
.setRuleId(10)
.setSeverity(Severity.BLOCKER)
- .setInheritance(null)
- .setNoteData("text");
+ .setInheritance(null);
dao.update(dto);
@@ -111,10 +109,6 @@ public class ActiveRuleDaoTest extends AbstractDaoTestCase {
assertThat(result.getRulId()).isEqualTo(10);
assertThat(result.getSeverityString()).isEqualTo(Severity.MAJOR);
assertThat(result.getInheritance()).isEqualTo("INHERITED");
- assertThat(result.getNoteData()).isEqualTo("some note");
- assertThat(result.getNoteUserLogin()).isEqualTo("henry");
- assertThat(result.getNoteCreatedAt()).isEqualTo(DateUtils.parseDate("2013-12-18"));
- assertThat(result.getNoteUpdatedAt()).isEqualTo(DateUtils.parseDate("2013-12-18"));
}
@Test
@@ -138,10 +132,6 @@ public class ActiveRuleDaoTest extends AbstractDaoTestCase {
assertThat(result.getRulId()).isEqualTo(10);
assertThat(result.getSeverityString()).isEqualTo(Severity.MAJOR);
assertThat(result.getInheritance()).isEqualTo("INHERITED");
- assertThat(result.getNoteData()).isEqualTo("some note");
- assertThat(result.getNoteUserLogin()).isEqualTo("henry");
- assertThat(result.getNoteCreatedAt()).isEqualTo(DateUtils.parseDate("2013-12-18"));
- assertThat(result.getNoteUpdatedAt()).isEqualTo(DateUtils.parseDate("2013-12-18"));
}
@Test
@@ -284,8 +274,8 @@ public class ActiveRuleDaoTest extends AbstractDaoTestCase {
assertThat(dao.selectAllParams()).hasSize(3);
}
- private ActiveRuleDto find(final Integer id, List<ActiveRuleDto> dtos){
- return Iterables.find(dtos, new Predicate<ActiveRuleDto>(){
+ private ActiveRuleDto find(final Integer id, List<ActiveRuleDto> dtos) {
+ return Iterables.find(dtos, new Predicate<ActiveRuleDto>() {
@Override
public boolean apply(ActiveRuleDto input) {
return input.getId().equals(id);
diff --git a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete-result.xml b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete-result.xml
index 39e1decb6d1..29697429a4b 100644
--- a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete-result.xml
@@ -1,12 +1,9 @@
<dataset>
<!--<active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"-->
- <!--note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>-->
- <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+ <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
- <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>
+ <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"/>
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_from_profile-result.xml b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_from_profile-result.xml
index 231e470df28..e9fbac55033 100644
--- a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_from_profile-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_from_profile-result.xml
@@ -1,12 +1,9 @@
<dataset>
- <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>
+ <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
<!--<active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"-->
- <!--note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>-->
<!--<active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"-->
- <!--note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>-->
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_from_rule-result.xml b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_from_rule-result.xml
index 4f066dfeaae..7e8d5ddfecc 100644
--- a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_from_rule-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_from_rule-result.xml
@@ -1,12 +1,9 @@
<dataset>
- <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>
+ <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
- <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+ <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
- <!--<active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"-->
- <!--note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>-->
+ <!--<active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"/>-->
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameter-result.xml b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameter-result.xml
index 66bf84129e4..3057a933a8e 100644
--- a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameter-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameter-result.xml
@@ -1,10 +1,8 @@
<dataset>
- <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]"/>
+ <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
- <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]"/>
+ <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
<!--<active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="max" value="20"/>-->
<active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" rules_parameter_key="format" value="html"/>
diff --git a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameters-result.xml b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameters-result.xml
index 4b0e2e7e0e2..d8bb5660f28 100644
--- a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameters-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameters-result.xml
@@ -1,10 +1,8 @@
<dataset>
- <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]"/>
+ <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
- <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]"/>
+ <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
<!--<active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="max" value="20"/>-->
<!--<active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" rules_parameter_key="format" value="html"/>-->
diff --git a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameters_from_profile_id-result.xml b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameters_from_profile_id-result.xml
index a77383cece4..0bd84f428ea 100644
--- a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameters_from_profile_id-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameters_from_profile_id-result.xml
@@ -1,14 +1,11 @@
<dataset>
- <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>
+ <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
<!-- Parent of Active rule 1 -->
- <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+ <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
- <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>
+ <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"/>
<active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="max" value="20"/>
<active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" rules_parameter_key="format" value="html"/>
diff --git a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameters_from_profile_id.xml b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameters_from_profile_id.xml
index 148ce414a9a..d7a92243391 100644
--- a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameters_from_profile_id.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/delete_parameters_from_profile_id.xml
@@ -1,14 +1,11 @@
<dataset>
- <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>
+ <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
<!-- Parent of Active rule 1 -->
- <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+ <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
- <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>
+ <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"/>
<active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="max" value="20"/>
<active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" rules_parameter_key="format" value="html"/>
diff --git a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/insert-result.xml b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/insert-result.xml
index ee595acf1d8..0a98d012fad 100644
--- a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/insert-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/insert-result.xml
@@ -1,6 +1,5 @@
<dataset>
- <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]"/>
+ <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/shared.xml b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/shared.xml
index 768b91b2046..55259929055 100644
--- a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/shared.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/shared.xml
@@ -1,14 +1,11 @@
<dataset>
- <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>
+ <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
<!-- Parent of Active rule 1 -->
- <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+ <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
- <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>
+ <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"/>
<active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="max" value="20"/>
<active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" rules_parameter_key="format" value="html"/>
diff --git a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/update-result.xml b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/update-result.xml
index e0c60d70e89..d30e3009c23 100644
--- a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/update-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/ActiveRuleDaoTest/update-result.xml
@@ -1,12 +1,9 @@
<dataset>
- <active_rules id="1" profile_id="1" rule_id="10" failure_level="4" inheritance="[null]"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="text"/>
+ <active_rules id="1" profile_id="1" rule_id="10" failure_level="4" inheritance="[null]"/>
- <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+ <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
- <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>
+ <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"/>
</dataset>
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRule.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRule.java
index 4bee3f81fa3..175ca5f1a13 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRule.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRule.java
@@ -25,6 +25,7 @@ import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.sonar.api.profiles.RulesProfile;
+import javax.annotation.CheckForNull;
import javax.persistence.*;
import java.util.ArrayList;
@@ -64,21 +65,6 @@ public class ActiveRule implements Cloneable {
@Column(name = "inheritance", updatable = true, nullable = true)
private String inheritance;
- @Lob
- @Column(name = "note_data", updatable = true, nullable = true)
- private String noteData;
-
- @Column(name = "note_user_login", updatable = true, nullable = true)
- private String noteUserLogin;
-
- @Temporal(TemporalType.TIMESTAMP)
- @Column(name = "note_created_at", updatable = true, nullable = true)
- private Date noteCreatedAt;
-
- @Temporal(TemporalType.TIMESTAMP)
- @Column(name = "note_updated_at", updatable = true, nullable = true)
- private Date noteUpdatedAt;
-
/**
* @deprecated visibility should be reduced to protected or package
*/
@@ -252,30 +238,42 @@ public class ActiveRule implements Cloneable {
/**
* @since 4.2
+ * @deprecated in 4.4. Feature dropped.
*/
+ @CheckForNull
+ @Deprecated
public String getNoteData() {
- return noteData;
+ return null;
}
/**
* @since 4.2
+ * @deprecated in 4.4. Feature dropped.
*/
+ @CheckForNull
+ @Deprecated
public String getNoteUserLogin() {
- return noteUserLogin;
+ return null;
}
/**
* @since 4.2
+ * @deprecated in 4.4. Feature dropped.
*/
+ @CheckForNull
+ @Deprecated
public Date getNoteCreatedAt() {
- return noteCreatedAt;
+ return null;
}
/**
* @since 4.2
+ * @deprecated in 4.4. Feature dropped.
*/
+ @CheckForNull
+ @Deprecated
public Date getNoteUpdatedAt() {
- return noteUpdatedAt;
+ return null;
}
@Override
diff --git a/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleDocument.java b/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleDocument.java
index ef4822649e4..a7aef2a9813 100644
--- a/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleDocument.java
+++ b/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleDocument.java
@@ -29,12 +29,6 @@ public class ActiveRuleDocument {
public static final String FIELD_ACTIVE_RULE_PARENT_ID = "activeRuleParentId";
public static final String FIELD_PARAMS = "params";
- public static final String FIELD_NOTE = "note";
- public static final String FIELD_NOTE_DATA = "data";
- public static final String FIELD_NOTE_USER_LOGIN = "userLogin";
- public static final String FIELD_NOTE_CREATED_AT = "createdAt";
- public static final String FIELD_NOTE_UPDATED_AT = "updatedAt";
-
public static final String FIELD_PARAM_KEY = "key";
public static final String FIELD_PARAM_VALUE = "value";
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 053facc9c25..49664923678 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
@@ -202,14 +202,6 @@ public class ESActiveRule {
.field(ActiveRuleDocument.FIELD_SEVERITY, activeRule.getSeverityString())
.field(ActiveRuleDocument.FIELD_PROFILE_ID, activeRule.getProfileId())
.field(ActiveRuleDocument.FIELD_INHERITANCE, activeRule.getInheritance());
- if (activeRule.getNoteData() != null || activeRule.getNoteUserLogin() != null) {
- document.startObject(RuleDocument.FIELD_NOTE)
- .field(ActiveRuleDocument.FIELD_NOTE_DATA, activeRule.getNoteData())
- .field(ActiveRuleDocument.FIELD_NOTE_USER_LOGIN, activeRule.getNoteUserLogin())
- .field(ActiveRuleDocument.FIELD_NOTE_CREATED_AT, activeRule.getNoteCreatedAt())
- .field(ActiveRuleDocument.FIELD_NOTE_UPDATED_AT, activeRule.getNoteUpdatedAt())
- .endObject();
- }
if (!params.isEmpty()) {
document.startArray(ActiveRuleDocument.FIELD_PARAMS);
for (ActiveRuleParamDto param : params) {
diff --git a/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileActiveRuleOperations.java b/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileActiveRuleOperations.java
index 4eb5b5f8d79..d99ae6e504a 100644
--- a/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileActiveRuleOperations.java
+++ b/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileActiveRuleOperations.java
@@ -360,51 +360,6 @@ public class QProfileActiveRuleOperations implements ServerComponent {
}
}
- public void updateActiveRuleNote(int activeRuleId, String note, UserSession userSession) {
- validatePermission(userSession);
- SqlSession session = myBatis.openSession(false);
-
- try {
- ActiveRuleDto activeRule = findActiveRuleNotNull(activeRuleId, session);
- String sanitizedNote = Strings.emptyToNull(note);
- if (sanitizedNote != null) {
- Date now = new Date(system.now());
- if (activeRule.getNoteData() == null) {
- activeRule.setNoteCreatedAt(now);
- activeRule.setNoteUserLogin(userSession.login());
- }
- activeRule.setNoteUpdatedAt(now);
- activeRule.setNoteData(note);
- activeRuleDao.update(activeRule, session);
- session.commit();
-
- reindexActiveRule(activeRule, session);
- }
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
- public void deleteActiveRuleNote(int activeRuleId, UserSession userSession) {
- validatePermission(userSession);
-
- SqlSession session = myBatis.openSession(false);
- try {
- ActiveRuleDto activeRule = findActiveRuleNotNull(activeRuleId, session);
-
- activeRule.setNoteData(null);
- activeRule.setNoteUserLogin(null);
- activeRule.setNoteCreatedAt(null);
- activeRule.setNoteUpdatedAt(null);
- activeRuleDao.update(activeRule);
- session.commit();
-
- reindexActiveRule(activeRule, session);
- } finally {
- MyBatis.closeQuietly(session);
- }
- }
-
private void notifyParamsDeleted(ActiveRuleDto activeRule, List<ActiveRuleParamDto> params, SqlSession session, UserSession userSession) {
ProfilesManager.RuleInheritanceActions actions = new ProfilesManager.RuleInheritanceActions();
for (ActiveRuleParamDto activeRuleParam : params) {
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 4b34fa8ff05..a9ecd599970 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
@@ -46,7 +46,6 @@ public class QProfileRule {
private final Integer activeRuleParentId;
private final String severity;
private final String inheritance;
- private final RuleNote activeRuleNote;
private final List<QProfileRuleParam> params;
// TODO move this in a parser class
@@ -56,25 +55,12 @@ public class QProfileRule {
activeRuleId = null;
severity = (String) ruleSource.get(ActiveRuleDocument.FIELD_SEVERITY);
inheritance = null;
- activeRuleNote = null;
activeRuleParentId = null;
} else {
activeRuleId = (Integer) activeRuleSource.get(ActiveRuleDocument.FIELD_ID);
severity = (String) activeRuleSource.get(ActiveRuleDocument.FIELD_SEVERITY);
inheritance = (String) activeRuleSource.get(ActiveRuleDocument.FIELD_INHERITANCE);
activeRuleParentId = (Integer) activeRuleSource.get(ActiveRuleDocument.FIELD_ACTIVE_RULE_PARENT_ID);
-
- if (activeRuleSource.containsKey(ActiveRuleDocument.FIELD_NOTE)) {
- Map<String, Object> ruleNoteDocument = (Map<String, Object>) activeRuleSource.get(ActiveRuleDocument.FIELD_NOTE);
- activeRuleNote = new RuleNote(
- (String) ruleNoteDocument.get(ActiveRuleDocument.FIELD_NOTE_DATA),
- (String) ruleNoteDocument.get(ActiveRuleDocument.FIELD_NOTE_USER_LOGIN),
- RuleDocumentParser.parseOptionalDate(ActiveRuleDocument.FIELD_NOTE_CREATED_AT, ruleNoteDocument),
- RuleDocumentParser.parseOptionalDate(ActiveRuleDocument.FIELD_NOTE_UPDATED_AT, ruleNoteDocument)
- );
- } else {
- activeRuleNote = null;
- }
}
params = Lists.newArrayList();
@@ -196,11 +182,6 @@ public class QProfileRule {
return params;
}
- @CheckForNull
- public RuleNote activeRuleNote() {
- return activeRuleNote;
- }
-
@Override
public String toString() {
return new ReflectionToStringBuilder(this).toString();
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 7589d21cd66..767092262dd 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
@@ -230,14 +230,6 @@ public class QProfiles implements ServerComponent {
activeRuleOperations.revertActiveRule(activeRuleId, UserSession.get());
}
- public void updateActiveRuleNote(int activeRuleId, String note) {
- activeRuleOperations.updateActiveRuleNote(activeRuleId, note, UserSession.get());
- }
-
- public void deleteActiveRuleNote(int activeRuleId) {
- activeRuleOperations.deleteActiveRuleNote(activeRuleId, UserSession.get());
- }
-
@CheckForNull
public QProfileRule parentProfileRule(QProfileRule rule) {
return rules.findParentProfileRule(rule);
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb
index 96d071981ed..ed0967e36ec 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/rules_configuration_controller.rb
@@ -320,32 +320,6 @@ class RulesConfigurationController < ApplicationController
render :partial => 'rule_note', :locals => {:rule => rule}
end
-
- def update_active_rule_note
- verify_post_request
- require_parameters :active_rule_id, :note
-
- rule = nil
- call_backend do
- Internal.quality_profiles.updateActiveRuleNote(params[:active_rule_id].to_i, params[:note])
- rule = Internal.quality_profiles.findByActiveRuleId(params[:active_rule_id].to_i)
- end
- render :partial => 'active_rule_note', :locals => {:rule => rule}
- end
-
-
- def delete_active_rule_note
- verify_post_request
- require_parameters :active_rule_id
-
- rule = nil
- call_backend do
- Internal.quality_profiles.deleteActiveRuleNote(params[:active_rule_id].to_i)
- rule = Internal.quality_profiles.findByActiveRuleId(params[:active_rule_id].to_i)
- end
- render :partial => 'active_rule_note', :locals => {:rule => rule}
- end
-
def show_select_tags
rule = Internal.quality_profiles.findByRule(params[:rule_id].to_i)
tags = tag_selection_for_rule(rule)
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_active_rule_note.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_active_rule_note.html.erb
deleted file mode 100644
index c18b5994a27..00000000000
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_active_rule_note.html.erb
+++ /dev/null
@@ -1,70 +0,0 @@
-<% #locals = rule, profile
- note = rule.activeRuleNote
- active_note_detail_div_id = "and_" + rule.activeRuleId.to_s
- add_active_note_button_id = "aanb_" + rule.activeRuleId.to_s
- edit_active_note_link_id = "eanl_" + rule.activeRuleId.to_s
- delete_active_note_link_id = "danl_" + rule.activeRuleId.to_s
- active_note_form_div_id = "anf_" + rule.activeRuleId.to_s
- active_note_textarea_id = "ant_" + rule.activeRuleId.to_s
- submit_active_note_update_button_id = "sanub_" + rule.activeRuleId.to_s
-%>
-
-<div id="<%= active_note_detail_div_id -%>">
- <% if !note.nil? %>
- <blockquote class="spacer-bottom">
- <cite>
- <b><%= User.find_active_by_login(note.userLogin).name -%></b> (<%= distance_of_time_in_words_to_now(Time.at(note.updatedAt.time/1000)) -%>)&nbsp;
- <% if profiles_administrator? %>
- | &nbsp;
- <a href="#" id="<%= edit_active_note_link_id -%>" class="link-action"
- onclick="$j('#<%= active_note_detail_div_id -%>').hide();$j('#<%= active_note_form_div_id -%>').show();$j('#<%= active_note_textarea_id -%>').focus();return false;"><%= message('edit') %></a>
- &nbsp;
- <a class="link-action"
- onclick="if(confirm('<%= escape_javascript(message('rules_configuration.confirm_delete_note')) -%>')){
- $j.ajax({
- url: '<%=ApplicationController.root_context-%>/rules_configuration/delete_active_rule_note?active_rule_id=<%=rule.activeRuleId-%>',
- type: 'post',
- success:function(response){$j('#active_rule_note_<%= rule.activeRuleId -%>').html(response);}
- });};return false;"
- href="#!"><%=message('delete')-%></a>
- <% end %>
- </cite>
- <p><%= html_text(note.data) -%></p>
- </blockquote>
- <% elsif profiles_administrator? %>
- <a href="#" onclick="$j('#<%= active_note_form_div_id -%>').show();$j('#<%= active_note_detail_div_id -%>').hide();$j('#<%= active_note_textarea_id -%>').focus(); return false;"
- class="link-action spacer-right" id="<%= add_active_note_button_id -%>"><%= message('rules_configuration.add_note') -%></a>
- <% end %>
-</div>
-
-<% if profiles_administrator? %>
- <form onsubmit="$j.ajax({
- url:'<%= ApplicationController.root_context -%>/rules_configuration/update_active_rule_note?active_rule_id=<%=rule.activeRuleId-%>',
- data: $j(this).serialize(),
- type:'post',
- success:function(response){$j('#active_rule_note_<%= rule.activeRuleId -%>').html(response);}
- });
- return false;"
- method="post"
- action="<%= ApplicationController.root_context -%>/rules_configuration//update_active_rule_note?active_rule_id=<%=rule.activeRuleId-%>">
- <table id="<%= active_note_form_div_id -%>" style="display: none" class="admin table width100">
- <tbody>
- <tr>
- <td class="width100" colspan="2">
- <textarea name="note" id="<%= active_note_textarea_id -%>" rows="10" style="width:100%"
- onkeyup="if (this.value=='') $j('#<%= submit_active_note_update_button_id -%>').prop('disabled', true); else $j('#<%= submit_active_note_update_button_id -%>').prop('disabled', false);"><%= h(plain_text(note.data)) unless note.nil? -%></textarea>
- </td>
- </tr>
- <tr>
- <td>
- <input type="submit" value="<%= note ? message('update_verb') : message('rules_configuration.add_note') -%>" name="submit-active-note" id="<%= submit_active_note_update_button_id -%>" disabled="disabled"/>
- <a href="#" onclick="$j('#<%= active_note_detail_div_id -%>').show();$j('#<%= active_note_form_div_id -%>').hide();return false;"><%= message('cancel') %></a>
- </td>
- <td align="right">
- <%= render :partial => 'markdown/tips' -%>
- </td>
- </tr>
- </tbody>
- </table>
- </form>
-<% end %>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule.html.erb
index 98cce3c05f3..028c44403a0 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/rules_configuration/_rule.html.erb
@@ -102,12 +102,6 @@
</table>
<% end %>
- <% if is_activated %>
- <div id="active_rule_note_<%= rule.activeRuleId -%>">
- <%= render :partial => 'active_rule_note', :locals => {:rule => rule} %>
- </div>
- <% end %>
-
<% if profiles_administrator? %>
<% if rule.template? %>
<%= link_to message('rules_configuration.copy_rule'), {:action => 'new', :id => profile.id, :rule_id => rule.id}, :id => "copy-#{u rule_key(rule)}", :class => 'link-action spacer-right' %>
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/536_remove_active_rule_notes.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/536_remove_active_rule_notes.rb
new file mode 100644
index 00000000000..e83a678fb96
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/536_remove_active_rule_notes.rb
@@ -0,0 +1,34 @@
+#
+# SonarQube, open source software quality management tool.
+# Copyright (C) 2008-2014 SonarSource
+# mailto:contact AT sonarsource DOT com
+#
+# SonarQube 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.
+#
+# SonarQube 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.
+#
+
+#
+# SonarQube 4.4
+# SONAR-5064
+#
+class RemoveActiveRuleNotes < ActiveRecord::Migration
+
+ def self.up
+ remove_column('active_rules', 'note_created_at')
+ remove_column('active_rules', 'note_updated_at')
+ remove_column('active_rules', 'note_user_login')
+ remove_column('active_rules', 'note_data')
+ end
+
+end
diff --git a/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileActiveRuleOperationsTest.java b/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileActiveRuleOperationsTest.java
index e1daed22d34..ad57a647b2f 100644
--- a/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileActiveRuleOperationsTest.java
+++ b/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileActiveRuleOperationsTest.java
@@ -595,93 +595,4 @@ public class QProfileActiveRuleOperationsTest {
verifyZeroInteractions(profilesManager);
verifyZeroInteractions(esActiveRule);
}
-
- @Test
- public void update_active_rule_note_when_no_existing_note() throws Exception {
- ActiveRuleDto activeRule = new ActiveRuleDto().setId(5).setProfileId(1).setRuleId(10).setSeverity(Severity.MINOR).setNoteCreatedAt(null).setNoteData(null);
- when(activeRuleDao.selectById(5, session)).thenReturn(activeRule);
-
- List<ActiveRuleParamDto> activeRuleParams = newArrayList(new ActiveRuleParamDto());
- when(activeRuleDao.selectParamsByActiveRuleId(eq(5), eq(session))).thenReturn(activeRuleParams);
-
- long now = System.currentTimeMillis();
- doReturn(now).when(system).now();
-
- operations.updateActiveRuleNote(5, "My note", authorizedUserSession);
-
- ArgumentCaptor<ActiveRuleDto> argumentCaptor = ArgumentCaptor.forClass(ActiveRuleDto.class);
- verify(activeRuleDao).update(argumentCaptor.capture(), eq(session));
- assertThat(argumentCaptor.getValue().getNoteData()).isEqualTo("My note");
- assertThat(argumentCaptor.getValue().getNoteUserLogin()).isEqualTo("nicolas");
- assertThat(argumentCaptor.getValue().getNoteCreatedAt().getTime()).isEqualTo(now);
- assertThat(argumentCaptor.getValue().getNoteUpdatedAt().getTime()).isEqualTo(now);
-
- verify(session).commit();
- verify(esActiveRule).save(eq(activeRule), eq(activeRuleParams));
- }
-
- @Test
- public void not_update_rule_note_when_empty_note() throws Exception {
- ActiveRuleDto activeRule = new ActiveRuleDto().setId(5).setProfileId(1).setRuleId(10).setSeverity(Severity.MINOR).setNoteCreatedAt(null).setNoteData(null);
- when(activeRuleDao.selectById(5, session)).thenReturn(activeRule);
-
- operations.updateActiveRuleNote(5, "", authorizedUserSession);
-
- verify(activeRuleDao, never()).update(any(ActiveRuleDto.class), eq(session));
- verify(session, never()).commit();
- verifyZeroInteractions(esActiveRule);
- }
-
- @Test
- public void update_active_rule_note_when_already_note() throws Exception {
- Date createdAt = DateUtils.parseDate("2013-12-20");
- ActiveRuleDto activeRule = new ActiveRuleDto().setId(5).setProfileId(1).setRuleId(10).setSeverity(Severity.MINOR)
- .setNoteCreatedAt(createdAt).setNoteData("My previous note").setNoteUserLogin("nicolas");
- when(activeRuleDao.selectById(5, session)).thenReturn(activeRule);
-
- List<ActiveRuleParamDto> activeRuleParams = newArrayList(new ActiveRuleParamDto());
- when(activeRuleDao.selectParamsByActiveRuleId(eq(5), eq(session))).thenReturn(activeRuleParams);
-
- long now = System.currentTimeMillis();
- doReturn(now).when(system).now();
-
- operations.updateActiveRuleNote(5, "My new note", MockUserSession.create().setLogin("guy").setName("Guy").setGlobalPermissions(GlobalPermissions.QUALITY_PROFILE_ADMIN));
-
- ArgumentCaptor<ActiveRuleDto> argumentCaptor = ArgumentCaptor.forClass(ActiveRuleDto.class);
- verify(activeRuleDao).update(argumentCaptor.capture(), eq(session));
- assertThat(argumentCaptor.getValue().getNoteData()).isEqualTo("My new note");
- assertThat(argumentCaptor.getValue().getNoteUserLogin()).isEqualTo("nicolas");
- assertThat(argumentCaptor.getValue().getNoteCreatedAt()).isEqualTo(createdAt);
- assertThat(argumentCaptor.getValue().getNoteUpdatedAt().getTime()).isEqualTo(now);
-
- verify(session).commit();
- verify(esActiveRule).save(eq(activeRule), eq(activeRuleParams));
- }
-
- @Test
- public void delete_active_rule_note() throws Exception {
- Date createdAt = DateUtils.parseDate("2013-12-20");
- ActiveRuleDto activeRule = new ActiveRuleDto().setId(5).setProfileId(1).setRuleId(10).setSeverity(Severity.MINOR)
- .setNoteData("My note").setNoteUserLogin("nicolas").setNoteCreatedAt(createdAt).setNoteUpdatedAt(createdAt);
- when(activeRuleDao.selectById(5, session)).thenReturn(activeRule);
-
- List<ActiveRuleParamDto> activeRuleParams = newArrayList(new ActiveRuleParamDto());
- when(activeRuleDao.selectParamsByActiveRuleId(eq(5), eq(session))).thenReturn(activeRuleParams);
-
- long now = System.currentTimeMillis();
- doReturn(now).when(system).now();
-
- operations.deleteActiveRuleNote(5, authorizedUserSession);
-
- ArgumentCaptor<ActiveRuleDto> argumentCaptor = ArgumentCaptor.forClass(ActiveRuleDto.class);
- verify(activeRuleDao).update(argumentCaptor.capture());
- assertThat(argumentCaptor.getValue().getNoteData()).isNull();
- assertThat(argumentCaptor.getValue().getNoteUserLogin()).isNull();
- assertThat(argumentCaptor.getValue().getNoteCreatedAt()).isNull();
- assertThat(argumentCaptor.getValue().getNoteUpdatedAt()).isNull();
-
- verify(session).commit();
- verify(esActiveRule).save(eq(activeRule), eq(activeRuleParams));
- }
-
}
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 a30ee1ceaf8..8838e37ef36 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
@@ -327,18 +327,6 @@ public class QProfilesTest {
}
@Test
- public void create_active_rule_note() throws Exception {
- qProfiles.updateActiveRuleNote(50, "My note");
- verify(activeRuleOperations).updateActiveRuleNote(eq(50), eq("My note"), any(UserSession.class));
- }
-
- @Test
- public void delete_active_rule_note() throws Exception {
- qProfiles.deleteActiveRuleNote(50);
- verify(activeRuleOperations).deleteActiveRuleNote(eq(50), any(UserSession.class));
- }
-
- @Test
public void count_active_rules() throws Exception {
qProfiles.countActiveRules(10);
verify(rules).countProfileRules(eq(10));
diff --git a/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldActivateInChildren-result.xml b/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldActivateInChildren-result.xml
index 414d5bb6324..0abf30a764d 100644
--- a/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldActivateInChildren-result.xml
+++ b/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldActivateInChildren-result.xml
@@ -9,12 +9,10 @@
<rules_profiles id="2" version="2" used_profile="false" name="child" language="java" parent_name="parent" />
- <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+ <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
<active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="param1" value="30"/>
- <active_rules id="2" profile_id="2" rule_id="1" failure_level="2" inheritance="INHERITED"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+ <active_rules id="2" profile_id="2" rule_id="1" failure_level="2" inheritance="INHERITED" />
<active_rule_parameters id="2" active_rule_id="2" rules_parameter_id="1" rules_parameter_key="param1" value="30"/>
</dataset>
diff --git a/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldChangeParent-result.xml b/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldChangeParent-result.xml
index d6989307b66..c3ae4eace67 100644
--- a/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldChangeParent-result.xml
+++ b/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldChangeParent-result.xml
@@ -12,13 +12,10 @@
<rules_profiles id="3" version="2" used_profile="false" name="child" language="java" parent_name="new_parent" />
- <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+ <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
- <active_rules id="2" profile_id="2" rule_id="2" failure_level="2" inheritance="[null]"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+ <active_rules id="2" profile_id="2" rule_id="2" failure_level="2" inheritance="[null]" />
- <active_rules id="4" profile_id="3" rule_id="2" failure_level="2" inheritance="INHERITED"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+ <active_rules id="4" profile_id="3" rule_id="2" failure_level="2" inheritance="INHERITED" />
</dataset>
diff --git a/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldDeactivateInChildren-result.xml b/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldDeactivateInChildren-result.xml
index fa429c2f63c..a8ec4a1ce2b 100644
--- a/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldDeactivateInChildren-result.xml
+++ b/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldDeactivateInChildren-result.xml
@@ -7,7 +7,6 @@
<rules_profiles id="2" version="2" used_profile="false" name="child" language="java" parent_name="parent" />
- <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+ <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
</dataset>
diff --git a/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldNotDeactivateOverridingChildren-result.xml b/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldNotDeactivateOverridingChildren-result.xml
index b5b657f7dcc..4b6b7956e78 100644
--- a/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldNotDeactivateOverridingChildren-result.xml
+++ b/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldNotDeactivateOverridingChildren-result.xml
@@ -7,10 +7,8 @@
<rules_profiles id="2" version="1" used_profile="true" name="child" language="java" parent_name="parent" />
- <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+ <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
- <active_rules id="2" profile_id="2" rule_id="1" failure_level="2" inheritance="[null]"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+ <active_rules id="2" profile_id="2" rule_id="1" failure_level="2" inheritance="[null]"/>
</dataset>
diff --git a/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldRemoveParent-result.xml b/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldRemoveParent-result.xml
index e9b31aeabab..917389cb977 100644
--- a/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldRemoveParent-result.xml
+++ b/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldRemoveParent-result.xml
@@ -7,7 +7,6 @@
<rules_profiles id="2" version="2" used_profile="false" name="child" language="java" parent_name="[null]" />
- <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+ <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
</dataset>
diff --git a/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldSetParent-result.xml b/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldSetParent-result.xml
index 2731d011132..23842c2d8f9 100644
--- a/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldSetParent-result.xml
+++ b/sonar-server/src/test/resources/org/sonar/server/qualityprofile/InheritedProfilesTest/shouldSetParent-result.xml
@@ -7,10 +7,8 @@
<rules_profiles id="2" version="2" used_profile="false" name="child" language="java" parent_name="parent" />
- <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+ <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
- <active_rules id="2" profile_id="2" rule_id="1" failure_level="2" inheritance="INHERITED"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+ <active_rules id="2" profile_id="2" rule_id="1" failure_level="2" inheritance="INHERITED"/>
</dataset>
diff --git a/sonar-server/src/test/resources/org/sonar/server/qualityprofile/RuleChangeTest/removeActivatedRules-result.xml b/sonar-server/src/test/resources/org/sonar/server/qualityprofile/RuleChangeTest/removeActivatedRules-result.xml
index 3f4e28b174d..bc09b586a0f 100644
--- a/sonar-server/src/test/resources/org/sonar/server/qualityprofile/RuleChangeTest/removeActivatedRules-result.xml
+++ b/sonar-server/src/test/resources/org/sonar/server/qualityprofile/RuleChangeTest/removeActivatedRules-result.xml
@@ -3,7 +3,6 @@
<active_rule_changes id="1" username="[null]" profile_id="1" profile_version="2" rule_id="1" enabled="false" old_severity="2" new_severity="[null]"/>
<active_rule_changes id="2" username="[null]" profile_id="2" profile_version="2" rule_id="1" enabled="false" old_severity="2" new_severity="[null]"/>
- <active_rules id="3" profile_id="2" rule_id="2" failure_level="2" inheritance="[null]"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]" />
+ <active_rules id="3" profile_id="2" rule_id="2" failure_level="2" inheritance="[null]"/>
</dataset>
diff --git a/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete-result.xml
index 39e1decb6d1..e106bb1434c 100644
--- a/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete-result.xml
+++ b/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete-result.xml
@@ -1,12 +1,9 @@
<dataset>
<!--<active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"-->
- <!--note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>-->
- <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+ <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]" />
- <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>
+ <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"/>
</dataset>
diff --git a/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_from_profile-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_from_profile-result.xml
index 231e470df28..e9fbac55033 100644
--- a/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_from_profile-result.xml
+++ b/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_from_profile-result.xml
@@ -1,12 +1,9 @@
<dataset>
- <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>
+ <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
<!--<active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"-->
- <!--note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>-->
<!--<active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"-->
- <!--note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>-->
</dataset>
diff --git a/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_from_rule-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_from_rule-result.xml
index 4f066dfeaae..fa2ce3f2fb8 100644
--- a/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_from_rule-result.xml
+++ b/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_from_rule-result.xml
@@ -1,12 +1,9 @@
<dataset>
- <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>
+ <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
- <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+ <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
<!--<active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"-->
- <!--note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>-->
</dataset>
diff --git a/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameter-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameter-result.xml
index 66bf84129e4..3057a933a8e 100644
--- a/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameter-result.xml
+++ b/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameter-result.xml
@@ -1,10 +1,8 @@
<dataset>
- <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]"/>
+ <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
- <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]"/>
+ <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
<!--<active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="max" value="20"/>-->
<active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" rules_parameter_key="format" value="html"/>
diff --git a/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameters-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameters-result.xml
index 4b0e2e7e0e2..d8bb5660f28 100644
--- a/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameters-result.xml
+++ b/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameters-result.xml
@@ -1,10 +1,8 @@
<dataset>
- <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]"/>
+ <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
- <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]"/>
+ <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
<!--<active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="max" value="20"/>-->
<!--<active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" rules_parameter_key="format" value="html"/>-->
diff --git a/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameters_from_profile_id-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameters_from_profile_id-result.xml
index a77383cece4..0bd84f428ea 100644
--- a/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameters_from_profile_id-result.xml
+++ b/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameters_from_profile_id-result.xml
@@ -1,14 +1,11 @@
<dataset>
- <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>
+ <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
<!-- Parent of Active rule 1 -->
- <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+ <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
- <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>
+ <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"/>
<active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="max" value="20"/>
<active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" rules_parameter_key="format" value="html"/>
diff --git a/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameters_from_profile_id.xml b/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameters_from_profile_id.xml
index 148ce414a9a..d7a92243391 100644
--- a/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameters_from_profile_id.xml
+++ b/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/delete_parameters_from_profile_id.xml
@@ -1,14 +1,11 @@
<dataset>
- <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>
+ <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
<!-- Parent of Active rule 1 -->
- <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+ <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
- <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>
+ <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"/>
<active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="max" value="20"/>
<active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" rules_parameter_key="format" value="html"/>
diff --git a/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/insert-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/insert-result.xml
index ee595acf1d8..0a98d012fad 100644
--- a/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/insert-result.xml
+++ b/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/insert-result.xml
@@ -1,6 +1,5 @@
<dataset>
- <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="[null]"/>
+ <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
</dataset>
diff --git a/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/insert_parameter.xml b/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/insert_parameter.xml
index 4f5c6f53de6..17c001f0fb3 100644
--- a/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/insert_parameter.xml
+++ b/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/insert_parameter.xml
@@ -1,8 +1,7 @@
<dataset>
<rules_parameters id="1" rule_id="10" name="max" param_type="INTEGER" default_value="30" description="My Parameter"/>
- <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>
+ <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
<rules tags="[null]" system_tags="[null]" id="10" plugin_rule_key="Parent1" plugin_name="checkstyle" name="Parent Rule 1" description="Parent Rule 1" status="READY"
plugin_config_key="Parent1" priority="2" cardinality="SINGLE" language="golo" created_at="1981-10-24 15:20:00" />
diff --git a/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/shared.xml b/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/shared.xml
index b62e0405864..44f40f5b46f 100644
--- a/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/shared.xml
+++ b/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/shared.xml
@@ -5,15 +5,12 @@
<rules tags="[null]" system_tags="[null]" id="11" plugin_rule_key="Parent2" plugin_name="checkstyle" name="Parent Rule 2" description="Parent Rule 2" status="READY"
plugin_config_key="Parent1" priority="2" cardinality="SINGLE" language="golo" created_at="1981-10-24 15:20:00" />
- <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="some note"/>
+ <active_rules id="1" profile_id="1" rule_id="10" failure_level="2" inheritance="INHERITED"/>
<!-- Parent of Active rule 1 -->
- <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+ <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
- <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>
+ <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"/>
<active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" rules_parameter_key="max" value="20"/>
<active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" rules_parameter_key="format" value="html"/>
diff --git a/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/update-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/update-result.xml
index e0c60d70e89..d30e3009c23 100644
--- a/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/update-result.xml
+++ b/sonar-server/src/test/resources/org/sonar/server/rule2/ActiveRuleDaoTest/update-result.xml
@@ -1,12 +1,9 @@
<dataset>
- <active_rules id="1" profile_id="1" rule_id="10" failure_level="4" inheritance="[null]"
- note_created_at="[null]" note_updated_at="[null]" note_user_login="[null]" note_data="text"/>
+ <active_rules id="1" profile_id="1" rule_id="10" failure_level="4" inheritance="[null]"/>
- <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="john" note_data="other note"/>
+ <active_rules id="2" profile_id="2" rule_id="10" failure_level="0" inheritance="[null]"/>
- <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"
- note_created_at="2013-12-18" note_updated_at="2013-12-18" note_user_login="henry" note_data="other note"/>
+ <active_rules id="3" profile_id="2" rule_id="11" failure_level="1" inheritance="[null]"/>
</dataset>