diff options
99 files changed, 334 insertions, 290 deletions
diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shared.xml b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shared.xml index 4b0310365c9..57203056802 100644 --- a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shared.xml +++ b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shared.xml @@ -2,11 +2,11 @@ <rules tags="[null]" system_tags="[null]" id="30" name="Check Header" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck" plugin_config_key="Checker/Treewalker/HeaderCheck" plugin_name="checkstyle" description="[null]" priority="4" status="READY" - cardinality="SINGLE" parent_id="[null]"/> + cardinality="SINGLE" template_id="[null]"/> <rules tags="[null]" system_tags="[null]" id="31" name="Equals Avoid Null" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.coding.EqualsAvoidNullCheck" plugin_config_key="Checker/TreeWalker/EqualsAvoidNull" plugin_name="checkstyle" description="[null]" priority="4" status="READY" - cardinality="SINGLE" parent_id="[null]"/> + cardinality="SINGLE" template_id="[null]"/> <projects id="200" scope="FIL" qualifier="CLA" kee="project:org.foo.Bar" root_id="[null]" name="Bar" long_name="org.foo.Bar" description="[null]" diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldCopyPermanentIdFromReferenceViolation-result.xml b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldCopyPermanentIdFromReferenceViolation-result.xml index 79d1887ae65..5f5bc4b4f71 100644 --- a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldCopyPermanentIdFromReferenceViolation-result.xml +++ b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldCopyPermanentIdFromReferenceViolation-result.xml @@ -2,11 +2,11 @@ <rules tags="[null]" system_tags="[null]" id="30" name="Check Header" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck" plugin_config_key="Checker/Treewalker/HeaderCheck" plugin_name="checkstyle" description="[null]" priority="4" status="READY" - cardinality="SINGLE" parent_id="[null]"/> + cardinality="SINGLE" template_id="[null]"/> <rules tags="[null]" system_tags="[null]" id="31" name="Equals Avoid Null" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.coding.EqualsAvoidNullCheck" plugin_config_key="Checker/TreeWalker/EqualsAvoidNull" plugin_name="checkstyle" description="[null]" priority="4" status="READY" - cardinality="SINGLE" parent_id="[null]"/> + cardinality="SINGLE" template_id="[null]"/> <projects id="200" scope="FIL" qualifier="CLA" kee="project:org.foo.Bar" root_id="[null]" name="Bar" long_name="org.foo.Bar" description="[null]" diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldSaveViolations-result.xml b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldSaveViolations-result.xml index 4d57dd5f12b..2180e5a7bfe 100644 --- a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldSaveViolations-result.xml +++ b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/timemachine/ViolationPersisterDecoratorTest/shouldSaveViolations-result.xml @@ -1,11 +1,11 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="30" name="Check Header" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck" plugin_config_key="Checker/Treewalker/HeaderCheck" plugin_name="checkstyle" description="[null]" priority="4" status="READY" - cardinality="SINGLE" parent_id="[null]"/> + cardinality="SINGLE" template_id="[null]"/> <rules tags="[null]" system_tags="[null]" id="31" name="Equals Avoid Null" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.coding.EqualsAvoidNullCheck" plugin_config_key="Checker/TreeWalker/EqualsAvoidNull" plugin_name="checkstyle" description="[null]" priority="4" status="READY" - cardinality="SINGLE" parent_id="[null]"/> + cardinality="SINGLE" template_id="[null]"/> <projects id="200" scope="FIL" qualifier="CLA" kee="project:org.foo.Bar" root_id="[null]" name="Bar" long_name="org.foo.Bar" description="[null]" diff --git a/sonar-batch/src/main/java/org/sonar/batch/rule/ActiveRulesProvider.java b/sonar-batch/src/main/java/org/sonar/batch/rule/ActiveRulesProvider.java index 75f58e07e26..95762afd79d 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/rule/ActiveRulesProvider.java +++ b/sonar-batch/src/main/java/org/sonar/batch/rule/ActiveRulesProvider.java @@ -61,8 +61,9 @@ public class ActiveRulesProvider extends ProviderAdapter { NewActiveRule newActiveRule = builder.activate(rule.ruleKey()); newActiveRule.setSeverity(activeDto.getSeverityString()); newActiveRule.setLanguage(rule.getLanguage()); - if (rule.getParent() != null) { - newActiveRule.setInternalKey(rule.getParent().getConfigKey()); + Rule template = rule.getTemplate(); + if (template != null) { + newActiveRule.setInternalKey(template.getConfigKey()); } else { newActiveRule.setInternalKey(rule.getConfigKey()); } diff --git a/sonar-batch/src/test/resources/org/sonar/batch/components/PastMeasuresLoaderTest/shared.xml b/sonar-batch/src/test/resources/org/sonar/batch/components/PastMeasuresLoaderTest/shared.xml index 4e8910eff80..cc8a95653fc 100644 --- a/sonar-batch/src/test/resources/org/sonar/batch/components/PastMeasuresLoaderTest/shared.xml +++ b/sonar-batch/src/test/resources/org/sonar/batch/components/PastMeasuresLoaderTest/shared.xml @@ -8,11 +8,11 @@ <rules tags="[null]" system_tags="[null]" id="30" name="Check Header" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck" plugin_config_key="Checker/Treewalker/HeaderCheck" plugin_name="checkstyle" description="[null]" priority="4" status="READY" - cardinality="SINGLE" parent_id="[null]"/> + cardinality="SINGLE" template_id="[null]"/> <rules tags="[null]" system_tags="[null]" id="31" name="Equals Avoid Null" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.coding.EqualsAvoidNullCheck" plugin_config_key="Checker/TreeWalker/EqualsAvoidNull" plugin_name="checkstyle" description="[null]" priority="4" status="READY" - cardinality="SINGLE" parent_id="[null]"/> + cardinality="SINGLE" template_id="[null]"/> <!-- project --> <projects long_name="[null]" id="1" scope="PRJ" qualifier="TRK" kee="project" name="project" diff --git a/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/sharedFixture.xml b/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/sharedFixture.xml index 1b5ba6a8e92..d0b7b281116 100644 --- a/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/sharedFixture.xml +++ b/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/sharedFixture.xml @@ -1,6 +1,6 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" name="foo" plugin_config_key="checker/foo" plugin_rule_key="checkstyle.rule1" - plugin_name="maven-checkstyle-plugin" description="description" cardinality="SINGLE" parent_id="[null]"/> + plugin_name="maven-checkstyle-plugin" description="description" cardinality="SINGLE" template_id="[null]"/> <metrics delete_historical_data="[null]" id="1" name="ncloc" val_type="INT" description="[null]" domain="[null]" short_name="" qualitative="false" user_managed="false" enabled="true" worst_value="[null]" optimized_best_value="[null]" best_value="[null]" direction="0" hidden="false"/> 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 4d7aec0aa5c..bd3d49c5391 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 = 543; + public static final int LAST_VERSION = 544; public static enum Status { UP_TO_DATE, REQUIRES_UPGRADE, REQUIRES_DOWNGRADE, FRESH_INSTALL diff --git a/sonar-core/src/main/java/org/sonar/core/rule/RuleDto.java b/sonar-core/src/main/java/org/sonar/core/rule/RuleDto.java index 35bd45560b1..e0c9c75dda3 100644 --- a/sonar-core/src/main/java/org/sonar/core/rule/RuleDto.java +++ b/sonar-core/src/main/java/org/sonar/core/rule/RuleDto.java @@ -48,7 +48,7 @@ public final class RuleDto extends Dto<RuleKey> { private Integer severity; private Cardinality cardinality; private String language; - private Integer parentId; + private Integer templateId; private String noteData; private String noteUserLogin; private Date noteCreatedAt; @@ -176,12 +176,12 @@ public final class RuleDto extends Dto<RuleKey> { } @CheckForNull - public Integer getParentId() { - return parentId; + public Integer getTemplateId() { + return templateId; } - public RuleDto setParentId(@Nullable Integer parentId) { - this.parentId = parentId; + public RuleDto setTemplateId(@Nullable Integer templateId) { + this.templateId = templateId; return this; } 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 60b4042217b..5574aa55a94 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 @@ -238,6 +238,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('540'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('541'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('542'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('543'); +INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('544'); 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 111378341b2..ddd8a236ec8 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 @@ -135,7 +135,7 @@ CREATE TABLE "RULES" ( "DESCRIPTION" VARCHAR(16777215), "PRIORITY" INTEGER, "CARDINALITY" VARCHAR(10), - "PARENT_ID" INTEGER, + "TEMPLATE_ID" INTEGER, "PLUGIN_CONFIG_KEY" VARCHAR(500), "NAME" VARCHAR(200), "STATUS" VARCHAR(40), diff --git a/sonar-core/src/main/resources/org/sonar/core/rule/RuleMapper.xml b/sonar-core/src/main/resources/org/sonar/core/rule/RuleMapper.xml index 9775d15e944..dbd8278ea31 100644 --- a/sonar-core/src/main/resources/org/sonar/core/rule/RuleMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/rule/RuleMapper.xml @@ -14,7 +14,7 @@ r.priority as "severity", r.cardinality, r.language as "language", - r.parent_id as "parentId", + r.template_id as "templateId", r.note_data as "noteData", r.note_user_login as "noteUserLogin", r.note_created_at as "noteCreatedAt", @@ -81,7 +81,7 @@ priority=#{severity}, cardinality=#{cardinality}, language=#{language}, - parent_id=#{parentId}, + template_id=#{templateId}, note_data=#{noteData}, note_user_login=#{noteUserLogin}, note_created_at=#{noteCreatedAt}, @@ -102,7 +102,7 @@ </update> <sql id="insertColumns"> - (plugin_rule_key, plugin_name, description, status, name, plugin_config_key, priority, cardinality, language, parent_id, + (plugin_rule_key, plugin_name, description, status, name, plugin_config_key, priority, cardinality, language, template_id, characteristic_id, default_characteristic_id, remediation_function, default_remediation_function, remediation_coeff, default_remediation_coeff, remediation_offset, default_remediation_offset, effort_to_fix_description, tags, system_tags, note_data, note_user_login, note_created_at, note_updated_at, @@ -112,7 +112,7 @@ <insert id="insert" parameterType="Rule" keyColumn="id" useGeneratedKeys="true" keyProperty="id"> insert into rules <include refid="insertColumns"/> values (#{ruleKey}, #{repositoryKey}, #{description}, #{status}, #{name}, #{configKey}, - #{severity}, #{cardinality}, #{language}, #{parentId}, + #{severity}, #{cardinality}, #{language}, #{templateId}, #{subCharacteristicId}, #{defaultSubCharacteristicId}, #{remediationFunction}, #{defaultRemediationFunction}, #{remediationCoefficient}, #{defaultRemediationCoefficient}, #{remediationOffset}, #{defaultRemediationOffset}, #{effortToFixDescription}, #{tagsField}, #{systemTagsField}, #{noteData}, #{noteUserLogin}, #{noteCreatedAt}, @@ -122,7 +122,7 @@ <insert id="batchInsert" parameterType="Rule" useGeneratedKeys="false"> insert into rules <include refid="insertColumns"/> values (#{ruleKey}, #{repositoryKey}, #{description}, #{status}, #{name}, #{configKey}, - #{severity}, #{cardinality}, #{language}, #{parentId}, + #{severity}, #{cardinality}, #{language}, #{templateId}, #{subCharacteristicId}, #{defaultSubCharacteristicId}, #{remediationFunction}, #{defaultRemediationFunction}, #{remediationCoefficient}, #{defaultRemediationCoefficient}, #{remediationOffset}, #{defaultRemediationOffset}, #{effortToFixDescription}, #{tagsField}, #{systemTagsField}, #{noteData}, #{noteUserLogin}, #{noteCreatedAt}, diff --git a/sonar-core/src/test/resources/org/sonar/core/rule/CacheRuleFinderTest/shared.xml b/sonar-core/src/test/resources/org/sonar/core/rule/CacheRuleFinderTest/shared.xml index f2c16456745..7a2f0f1dd4e 100644 --- a/sonar-core/src/test/resources/org/sonar/core/rule/CacheRuleFinderTest/shared.xml +++ b/sonar-core/src/test/resources/org/sonar/core/rule/CacheRuleFinderTest/shared.xml @@ -2,17 +2,17 @@ <!-- CHECKSTYLE --> <rules tags="[null]" system_tags="[null]" id="1" name="Check Header" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck" - plugin_config_key="Checker/Treewalker/HeaderCheck" plugin_name="checkstyle" description="[null]" priority="4" status="READY" cardinality="SINGLE" parent_id="[null]"/> + plugin_config_key="Checker/Treewalker/HeaderCheck" plugin_name="checkstyle" description="[null]" priority="4" status="READY" cardinality="SINGLE" template_id="[null]"/> <!-- disabled rule --> <rules tags="[null]" system_tags="[null]" id="2" name="Disabled checked" plugin_rule_key="DisabledCheck" - plugin_config_key="Checker/Treewalker/DisabledCheck" plugin_name="checkstyle" description="[null]" priority="4" status="REMOVED" cardinality="SINGLE" parent_id="[null]" /> + plugin_config_key="Checker/Treewalker/DisabledCheck" plugin_name="checkstyle" description="[null]" priority="4" status="REMOVED" cardinality="SINGLE" template_id="[null]" /> <rules tags="[null]" system_tags="[null]" id="3" name="Check Annotation" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck" - plugin_config_key="Checker/Treewalker/AnnotationUseStyleCheck" plugin_name="checkstyle" description="[null]" priority="4" status="READY" cardinality="SINGLE" parent_id="[null]" /> + plugin_config_key="Checker/Treewalker/AnnotationUseStyleCheck" plugin_name="checkstyle" description="[null]" priority="4" status="READY" cardinality="SINGLE" template_id="[null]" /> <!-- PMD --> <rules tags="[null]" system_tags="[null]" id="4" name="Call Super First" plugin_rule_key="CallSuperFirst" - plugin_config_key="rulesets/android.xml/CallSuperFirst" plugin_name="pmd" description="[null]" priority="2" status="READY" cardinality="SINGLE" parent_id="[null]" /> + plugin_config_key="rulesets/android.xml/CallSuperFirst" plugin_name="pmd" description="[null]" priority="2" status="READY" cardinality="SINGLE" template_id="[null]" /> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/rule/DefaultRuleFinderTest/shared.xml b/sonar-core/src/test/resources/org/sonar/core/rule/DefaultRuleFinderTest/shared.xml index f2c16456745..7a2f0f1dd4e 100644 --- a/sonar-core/src/test/resources/org/sonar/core/rule/DefaultRuleFinderTest/shared.xml +++ b/sonar-core/src/test/resources/org/sonar/core/rule/DefaultRuleFinderTest/shared.xml @@ -2,17 +2,17 @@ <!-- CHECKSTYLE --> <rules tags="[null]" system_tags="[null]" id="1" name="Check Header" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck" - plugin_config_key="Checker/Treewalker/HeaderCheck" plugin_name="checkstyle" description="[null]" priority="4" status="READY" cardinality="SINGLE" parent_id="[null]"/> + plugin_config_key="Checker/Treewalker/HeaderCheck" plugin_name="checkstyle" description="[null]" priority="4" status="READY" cardinality="SINGLE" template_id="[null]"/> <!-- disabled rule --> <rules tags="[null]" system_tags="[null]" id="2" name="Disabled checked" plugin_rule_key="DisabledCheck" - plugin_config_key="Checker/Treewalker/DisabledCheck" plugin_name="checkstyle" description="[null]" priority="4" status="REMOVED" cardinality="SINGLE" parent_id="[null]" /> + plugin_config_key="Checker/Treewalker/DisabledCheck" plugin_name="checkstyle" description="[null]" priority="4" status="REMOVED" cardinality="SINGLE" template_id="[null]" /> <rules tags="[null]" system_tags="[null]" id="3" name="Check Annotation" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck" - plugin_config_key="Checker/Treewalker/AnnotationUseStyleCheck" plugin_name="checkstyle" description="[null]" priority="4" status="READY" cardinality="SINGLE" parent_id="[null]" /> + plugin_config_key="Checker/Treewalker/AnnotationUseStyleCheck" plugin_name="checkstyle" description="[null]" priority="4" status="READY" cardinality="SINGLE" template_id="[null]" /> <!-- PMD --> <rules tags="[null]" system_tags="[null]" id="4" name="Call Super First" plugin_rule_key="CallSuperFirst" - plugin_config_key="rulesets/android.xml/CallSuperFirst" plugin_name="pmd" description="[null]" priority="2" status="READY" cardinality="SINGLE" parent_id="[null]" /> + plugin_config_key="rulesets/android.xml/CallSuperFirst" plugin_name="pmd" description="[null]" priority="2" status="READY" cardinality="SINGLE" template_id="[null]" /> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/insert-result.xml b/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/insert-result.xml index f9b97c6bbc0..37acd6276dc 100644 --- a/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/insert-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/insert-result.xml @@ -21,7 +21,7 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="NewRuleKey" plugin_name="plugin" name="new name" description="new description" status="DEPRECATED" - plugin_config_key="NewConfigKey" priority="0" cardinality="MULTIPLE" language="dart" created_at="2013-12-16" updated_at="2013-12-17" parent_id="3" + plugin_config_key="NewConfigKey" priority="0" cardinality="MULTIPLE" language="dart" created_at="2013-12-16" updated_at="2013-12-17" template_id="3" note_data="[null]" note_user_login="[null]" note_created_at="[null]" note_updated_at="[null]" characteristic_id="100" default_characteristic_id="101" remediation_function="linear" default_remediation_function="linear_offset" diff --git a/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/insert_all-result.xml b/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/insert_all-result.xml index 0a7c5c43e93..065d4ce0755 100644 --- a/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/insert_all-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/insert_all-result.xml @@ -21,7 +21,7 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="NewRuleKey" plugin_name="plugin" name="new name" description="new description" status="DEPRECATED" - plugin_config_key="NewConfigKey" priority="0" cardinality="MULTIPLE" language="dart" created_at="2013-12-16" updated_at="2013-12-17" parent_id="3" + plugin_config_key="NewConfigKey" priority="0" cardinality="MULTIPLE" language="dart" created_at="2013-12-16" updated_at="2013-12-17" template_id="3" note_data="[null]" note_user_login="[null]" note_created_at="[null]" note_updated_at="[null]" characteristic_id="100" default_characteristic_id="101" remediation_function="linear" default_remediation_function="linear_offset" @@ -31,7 +31,7 @@ /> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="NewRuleKey2" plugin_name="plugin2" name="new name2" description="new description2" status="BETA" - plugin_config_key="NewConfigKey2" priority="2" cardinality="SINGLE" language="js" created_at="2013-12-14" updated_at="2013-12-15" parent_id="[null]" + plugin_config_key="NewConfigKey2" priority="2" cardinality="SINGLE" language="js" created_at="2013-12-14" updated_at="2013-12-15" template_id="[null]" note_data="[null]" note_user_login="[null]" note_created_at="[null]" note_updated_at="[null]" characteristic_id="102" default_characteristic_id="103" remediation_function="linear_offset" default_remediation_function="linear" diff --git a/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/update-result.xml b/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/update-result.xml index f42a13b2fb6..0ebcdfb5da6 100644 --- a/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/update-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/update-result.xml @@ -1,7 +1,7 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="NewRuleKey" plugin_name="plugin" name="new name" description="new description" status="DEPRECATED" - plugin_config_key="NewConfigKey" priority="0" cardinality="MULTIPLE" language="dart" created_at="2011-04-25 01:05:00" updated_at="2013-12-17" parent_id="3" + plugin_config_key="NewConfigKey" priority="0" cardinality="MULTIPLE" language="dart" created_at="2011-04-25 01:05:00" updated_at="2013-12-17" template_id="3" note_data="My note" note_user_login="admin" note_created_at="2013-12-19" note_updated_at="2013-12-20" characteristic_id="100" default_characteristic_id="101" remediation_function="linear" default_remediation_function="linear_offset" @@ -11,11 +11,11 @@ /> <rules tags="[null]" system_tags="[null]" id="2" 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" updated_at="[null]" parent_id="[null]" + plugin_config_key="Parent1" priority="2" cardinality="SINGLE" language="golo" created_at="1981-10-24 15:20:00" updated_at="[null]" template_id="[null]" note_created_at="[null]" note_data="[null]" note_updated_at="[null]" note_user_login="[null]"/> <rules tags="[null]" system_tags="[null]" id="3" plugin_rule_key="Parent2" plugin_name="checkstyle" name="Parent Rule 2" description="Parent Rule 2" status="READY" - plugin_config_key="Parent2" priority="2" cardinality="SINGLE" language="dart" created_at="1982-12-14 03:15:00" updated_at="[null]" parent_id="[null]" + plugin_config_key="Parent2" priority="2" cardinality="SINGLE" language="dart" created_at="1982-12-14 03:15:00" updated_at="[null]" template_id="[null]" note_created_at="[null]" note_data="[null]" note_updated_at="[null]" note_user_login="[null]"/> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/update.xml b/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/update.xml index f7f20504f15..ff2d0c693f4 100644 --- a/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/update.xml +++ b/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/update.xml @@ -1,7 +1,7 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="AvoidNull" plugin_name="checkstyle" name="Avoid Null" description="Should avoid NULL" status="READY" - plugin_config_key="AvoidNull" priority="2" cardinality="SINGLE" language="golo" created_at="2011-04-25 01:05:00" parent_id="2"/> + plugin_config_key="AvoidNull" priority="2" cardinality="SINGLE" language="golo" created_at="2011-04-25 01:05:00" template_id="2"/> <rules tags="[null]" system_tags="[null]" id="2" 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-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldCountNumberOfRulesOfACategoryForGivenPlugins.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldCountNumberOfRulesOfACategoryForGivenPlugins.xml index 80eca772f66..bf45c5a92c1 100644 --- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldCountNumberOfRulesOfACategoryForGivenPlugins.xml +++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldCountNumberOfRulesOfACategoryForGivenPlugins.xml @@ -1,14 +1,14 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" name="rule one" description="desc" plugin_config_key="config" - plugin_rule_key="rule_one" plugin_name="plugin1" status="READY" cardinality="SINGLE" parent_id="[null]"/> + plugin_rule_key="rule_one" plugin_name="plugin1" status="READY" cardinality="SINGLE" template_id="[null]"/> <rules tags="[null]" system_tags="[null]" id="2" name="rule two" description="desc" plugin_config_key="config" - plugin_rule_key="rule_two" plugin_name="plugin2" status="READY" cardinality="SINGLE" parent_id="[null]"/> + plugin_rule_key="rule_two" plugin_name="plugin2" status="READY" cardinality="SINGLE" template_id="[null]"/> <rules tags="[null]" system_tags="[null]" id="3" name="rule three" description="desc" plugin_config_key="config" - plugin_rule_key="rule_three" plugin_name="plugin2" status="READY" cardinality="SINGLE" parent_id="[null]"/> + plugin_rule_key="rule_three" plugin_name="plugin2" status="READY" cardinality="SINGLE" template_id="[null]"/> <rules tags="[null]" system_tags="[null]" id="4" name="rule 4" description="desc" plugin_config_key="config" - plugin_rule_key="rule_4" plugin_name="plugin2" status="READY" cardinality="SINGLE" parent_id="[null]"/> + plugin_rule_key="rule_4" plugin_name="plugin2" status="READY" cardinality="SINGLE" template_id="[null]"/> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter-result.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter-result.xml index b385ab5bb8c..32fc897bb07 100644 --- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter-result.xml +++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter-result.xml @@ -1,7 +1,7 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" name="rule1" description="desc" plugin_config_key="config" - plugin_rule_key="key1" plugin_name="plugin" status="READY" cardinality="SINGLE" parent_id="[null]"/> + plugin_rule_key="key1" plugin_name="plugin" status="READY" cardinality="SINGLE" template_id="[null]"/> <rules_parameters id="1" rule_id="1" name="param1" description="[null]" param_type="REGULAR_EXPRESSION"/> <rules_parameters id="2" rule_id="1" name="param2" description="[null]" param_type="REGULAR_EXPRESSION"/> diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter.xml index 2f124ad6ff5..b132f040e0e 100644 --- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter.xml +++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter.xml @@ -1,7 +1,7 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" name="rule1" description="desc" plugin_config_key="config" - plugin_rule_key="key1" plugin_name="plugin" status="READY" cardinality="SINGLE" parent_id="[null]"/> + plugin_rule_key="key1" plugin_name="plugin" status="READY" cardinality="SINGLE" template_id="[null]"/> <rules_parameters id="1" rule_id="1" name="param1" description="foo" param_type="REGULAR_EXPRESSION"/> <rules_parameters id="2" rule_id="1" name="param2" description="foo" param_type="REGULAR_EXPRESSION"/> diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules-result.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules-result.xml index ea216ae75ab..1ec9a6dc34c 100644 --- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules-result.xml +++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules-result.xml @@ -4,11 +4,11 @@ <rules_profiles id="2" name="profile two" language="java"/> <rules tags="[null]" system_tags="[null]" id="1" name="foo" description="test" plugin_config_key="checker/foo" - plugin_rule_key="checkstyle.rule1" plugin_name="plugin" status="READY" cardinality="SINGLE" parent_id="[null]"/> + plugin_rule_key="checkstyle.rule1" plugin_name="plugin" status="READY" cardinality="SINGLE" template_id="[null]"/> <rules tags="[null]" system_tags="[null]" id="2" name="bar" description="test" plugin_config_key="checker/bar" - plugin_rule_key="checkstyle.rule2" plugin_name="plugin" status="READY" cardinality="SINGLE" parent_id="[null]"/> + plugin_rule_key="checkstyle.rule2" plugin_name="plugin" status="READY" cardinality="SINGLE" template_id="[null]"/> <rules tags="[null]" system_tags="[null]" id="3" name="baz" description="test" plugin_config_key="checker/baz" - plugin_rule_key="checkstyle.rule3" plugin_name="plugin" status="READY" cardinality="SINGLE" parent_id="[null]"/> + plugin_rule_key="checkstyle.rule3" plugin_name="plugin" status="READY" cardinality="SINGLE" template_id="[null]"/> <active_rules created_at="[null]" updated_at="[null]" id="1" profile_id="1" rule_id="1" failure_level="2"/> <active_rules created_at="[null]" updated_at="[null]" id="2" profile_id="1" rule_id="2" failure_level="2"/> diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules.xml index a4c3245e38a..6ac597e4d68 100644 --- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules.xml +++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules.xml @@ -4,11 +4,11 @@ <rules_profiles id="2" name="profile two" language="java" /> <rules tags="[null]" system_tags="[null]" id="1" name="foo" description="test" plugin_config_key="checker/foo" - plugin_rule_key="checkstyle.rule1" plugin_name="plugin" status="READY" cardinality="SINGLE" parent_id="[null]"/> + plugin_rule_key="checkstyle.rule1" plugin_name="plugin" status="READY" cardinality="SINGLE" template_id="[null]"/> <rules tags="[null]" system_tags="[null]" id="2" name="bar" description="test" plugin_config_key="checker/bar" - plugin_rule_key="checkstyle.rule2" plugin_name="plugin" status="READY" cardinality="SINGLE" parent_id="[null]"/> + plugin_rule_key="checkstyle.rule2" plugin_name="plugin" status="READY" cardinality="SINGLE" template_id="[null]"/> <rules tags="[null]" system_tags="[null]" id="3" name="baz" description="test" plugin_config_key="checker/baz" - plugin_rule_key="checkstyle.rule3" plugin_name="plugin" status="READY" cardinality="SINGLE" parent_id="[null]"/> + plugin_rule_key="checkstyle.rule3" plugin_name="plugin" status="READY" cardinality="SINGLE" template_id="[null]"/> <active_rules created_at="[null]" updated_at="[null]" id="1" profile_id="1" rule_id="1" failure_level="2"/> <active_rules created_at="[null]" updated_at="[null]" id="2" profile_id="1" rule_id="2" failure_level="2"/> diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetActiveRules.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetActiveRules.xml index f77d45e47ff..313eca0af89 100644 --- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetActiveRules.xml +++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetActiveRules.xml @@ -4,11 +4,11 @@ <rules_profiles id="2" name="profile two" language="java" /> <rules tags="[null]" system_tags="[null]" id="1" name="foo" description="test" plugin_config_key="checker/foo" - plugin_rule_key="checkstyle.rule1" plugin_name="plugin" status="READY" cardinality="SINGLE" parent_id="[null]"/> + plugin_rule_key="checkstyle.rule1" plugin_name="plugin" status="READY" cardinality="SINGLE" template_id="[null]"/> <rules tags="[null]" system_tags="[null]" id="2" name="bar" description="test" plugin_config_key="checker/bar" - plugin_rule_key="checkstyle.rule2" plugin_name="plugin" status="READY" cardinality="SINGLE" parent_id="[null]"/> + plugin_rule_key="checkstyle.rule2" plugin_name="plugin" status="READY" cardinality="SINGLE" template_id="[null]"/> <rules tags="[null]" system_tags="[null]" id="3" name="baz" description="test" plugin_config_key="checker/baz" - plugin_rule_key="checkstyle.rule3" plugin_name="plugin" status="READY" cardinality="SINGLE" parent_id="[null]"/> + plugin_rule_key="checkstyle.rule3" plugin_name="plugin" status="READY" cardinality="SINGLE" template_id="[null]"/> <active_rules created_at="[null]" updated_at="[null]" id="1" profile_id="1" rule_id="1" failure_level="2"/> <active_rules created_at="[null]" updated_at="[null]" id="2" profile_id="1" rule_id="2" failure_level="2"/> diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleParams.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleParams.xml index c432e2f26aa..60e1ebdffee 100644 --- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleParams.xml +++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleParams.xml @@ -2,9 +2,9 @@ <!-- Rules --> <rules tags="[null]" system_tags="[null]" id="1" name="new1" description="test1" plugin_config_key="checker/new1" - plugin_rule_key="checkstyle.new1" plugin_name="PLUGIN_KEY" status="READY" cardinality="SINGLE" parent_id="[null]"/> + plugin_rule_key="checkstyle.new1" plugin_name="PLUGIN_KEY" status="READY" cardinality="SINGLE" template_id="[null]"/> <rules tags="[null]" system_tags="[null]" id="2" name="new2" description="test2" plugin_config_key="checker/new2" - plugin_rule_key="checkstyle.new2" plugin_name="PLUGIN_KEY" status="READY" cardinality="SINGLE" parent_id="[null]"/> + plugin_rule_key="checkstyle.new2" plugin_name="PLUGIN_KEY" status="READY" cardinality="SINGLE" template_id="[null]"/> <!-- Rules parameters --> <rules_parameters id="1" rule_id="1" name="rule1_param1" description="rule1_desc1" param_type="REGULAR_EXPRESSION" diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleWithRuleKeyAndPluginKey.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleWithRuleKeyAndPluginKey.xml index 547bd111a77..433c39c0a1a 100644 --- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleWithRuleKeyAndPluginKey.xml +++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleWithRuleKeyAndPluginKey.xml @@ -1,6 +1,6 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" name="foo" description="test" plugin_config_key="checker/foo" - plugin_rule_key="checkstyle.rule1" plugin_name="plugin" status="READY" cardinality="SINGLE" parent_id="[null]"/> + plugin_rule_key="checkstyle.rule1" plugin_name="plugin" status="READY" cardinality="SINGLE" template_id="[null]"/> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRules.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRules.xml index f5856156dbd..38f56f74b4e 100644 --- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRules.xml +++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRules.xml @@ -1,9 +1,9 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" name="rule one" description="desc" plugin_config_key="other config" - plugin_rule_key="rule_one" plugin_name="plugin" status="READY" cardinality="SINGLE" parent_id="[null]"/> + plugin_rule_key="rule_one" plugin_name="plugin" status="READY" cardinality="SINGLE" template_id="[null]"/> <rules tags="[null]" system_tags="[null]" id="2" name="rule two" description="desc" plugin_config_key="config" - plugin_rule_key="rule_two" plugin_name="other plugin" status="READY" cardinality="SINGLE" parent_id="[null]"/> + plugin_rule_key="rule_two" plugin_name="other plugin" status="READY" cardinality="SINGLE" template_id="[null]"/> <rules_parameters id="1" rule_id="1" name="rule1_param1" description="rule1_desc1" param_type="REGULAR_EXPRESSION" /> diff --git a/sonar-deprecated/src/test/java/org/sonar/api/checks/AnnotationCheckFactoryTest.java b/sonar-deprecated/src/test/java/org/sonar/api/checks/AnnotationCheckFactoryTest.java index 7a12a023ea7..eb4ac6354ae 100644 --- a/sonar-deprecated/src/test/java/org/sonar/api/checks/AnnotationCheckFactoryTest.java +++ b/sonar-deprecated/src/test/java/org/sonar/api/checks/AnnotationCheckFactoryTest.java @@ -30,9 +30,7 @@ import java.util.Arrays; import static org.fest.assertions.Assertions.assertThat; import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertThat; +import static org.junit.Assert.*; public class AnnotationCheckFactoryTest { @@ -158,7 +156,7 @@ public class AnnotationCheckFactoryTest { public void shouldWorkWithClonedRules() { RulesProfile profile = RulesProfile.create("repo", "java"); Rule rule = Rule.create("repo", "CheckWithKey", ""); - Rule clonedRule = Rule.create("repo", "CheckWithKey_2", "").setConfigKey("CheckWithKey").setParent(rule); + Rule clonedRule = Rule.create("repo", "CheckWithKey_2", "").setConfigKey("CheckWithKey").setTemplate(rule); profile.activateRule(rule, null); profile.activateRule(clonedRule, null); diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java index 402a5ec9f9d..a8592b81a22 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java @@ -34,19 +34,7 @@ import org.sonar.check.Cardinality; import javax.annotation.CheckForNull; import javax.annotation.Nullable; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; +import javax.persistence.*; import java.util.ArrayList; import java.util.Date; @@ -129,8 +117,8 @@ public class Rule { private String language; @ManyToOne(fetch = FetchType.EAGER) - @JoinColumn(name = "parent_id", updatable = true, nullable = true) - private Rule parent = null; + @JoinColumn(name = "template_id", updatable = true, nullable = true) + private Rule template = null; @Column(name = "characteristic_id", updatable = true, nullable = true) private Integer characteristicId; @@ -372,12 +360,35 @@ public class Rule { return this; } + /** + * @deprecated since 4.4, use {@link #getTemplate()} + */ + @Deprecated public Rule getParent() { - return parent; + return template; } + /** + * @deprecated since 4.4, use {@link #setTemplate(Rule)}} + */ + @Deprecated public Rule setParent(Rule parent) { - this.parent = parent; + this.template = parent; + return this; + } + + /** + * @since 4.4 + */ + public Rule getTemplate() { + return template; + } + + /** + * @since 4.4 + */ + public Rule setTemplate(Rule template) { + this.template = template; return this; } @@ -536,7 +547,7 @@ public class Rule { .append("cardinality", cardinality) .append("status", status) .append("language", language) - .append("parent", parent) + .append("template", template) .toString(); } diff --git a/sonar-server/src/main/java/org/sonar/server/debt/DebtModelBackup.java b/sonar-server/src/main/java/org/sonar/server/debt/DebtModelBackup.java index 38d6154f236..c277aa13f08 100644 --- a/sonar-server/src/main/java/org/sonar/server/debt/DebtModelBackup.java +++ b/sonar-server/src/main/java/org/sonar/server/debt/DebtModelBackup.java @@ -49,6 +49,7 @@ import org.sonar.server.user.UserSession; import javax.annotation.CheckForNull; import javax.annotation.Nullable; + import java.io.Reader; import java.util.Date; import java.util.List; @@ -167,8 +168,8 @@ public class DebtModelBackup implements ServerComponent { // Restore default debt definitions RulesDefinition.Rule ruleDef; - if (rule.getParentId() != null) { - RuleDto templateRule = rule(rule.getParentId(), ruleDtos); + if (rule.getTemplateId() != null) { + RuleDto templateRule = rule(rule.getTemplateId(), ruleDtos); ruleDef = ruleDef(templateRule.getRepositoryKey(), templateRule.getRuleKey(), rules); } else { ruleDef = ruleDef(rule.getRepositoryKey(), rule.getRuleKey(), rules); diff --git a/sonar-server/src/main/java/org/sonar/server/qualityprofile/RuleActivator.java b/sonar-server/src/main/java/org/sonar/server/qualityprofile/RuleActivator.java index 3cdc6e4e98f..a74a955230f 100644 --- a/sonar-server/src/main/java/org/sonar/server/qualityprofile/RuleActivator.java +++ b/sonar-server/src/main/java/org/sonar/server/qualityprofile/RuleActivator.java @@ -30,11 +30,7 @@ import org.sonar.api.server.rule.RuleParamType; import org.sonar.core.log.Log; import org.sonar.core.persistence.DbSession; import org.sonar.core.preview.PreviewCache; -import org.sonar.core.qualityprofile.db.ActiveRuleDto; -import org.sonar.core.qualityprofile.db.ActiveRuleKey; -import org.sonar.core.qualityprofile.db.ActiveRuleParamDto; -import org.sonar.core.qualityprofile.db.QualityProfileDto; -import org.sonar.core.qualityprofile.db.QualityProfileKey; +import org.sonar.core.qualityprofile.db.*; import org.sonar.core.rule.RuleDto; import org.sonar.core.rule.RuleParamDto; import org.sonar.server.db.DbClient; @@ -51,6 +47,7 @@ import org.sonar.server.search.QueryOptions; import org.sonar.server.util.TypeValidations; import javax.annotation.Nullable; + import java.util.Iterator; import java.util.List; import java.util.Map; @@ -462,7 +459,7 @@ public class RuleActivator implements ServerComponent { } private void verifyParametersAreNotSetOnCustomRule(RuleActivatorContext context, RuleActivation activation, ActiveRuleChange change){ - if (!activation.getParameters().isEmpty() && context.rule().getParentId() != null) { + if (!activation.getParameters().isEmpty() && context.rule().getTemplateId() != null) { throw new IllegalStateException(String.format("Parameters cannot be set when activating the custom rule '%s'", activation.getKey().ruleKey())); } } diff --git a/sonar-server/src/main/java/org/sonar/server/rule/RegisterRules.java b/sonar-server/src/main/java/org/sonar/server/rule/RegisterRules.java index d0d69ea2349..393408613b6 100644 --- a/sonar-server/src/main/java/org/sonar/server/rule/RegisterRules.java +++ b/sonar-server/src/main/java/org/sonar/server/rule/RegisterRules.java @@ -48,12 +48,8 @@ import org.sonar.server.search.action.IndexAction; import org.sonar.server.search.action.KeyIndexAction; import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; + +import java.util.*; import static com.google.common.collect.Lists.newArrayList; @@ -339,16 +335,16 @@ public class RegisterRules implements Startable { for (RuleDto ruleDto : ruleDtos) { boolean toBeRemoved = true; // Update custom rules from template - if (ruleDto.getParentId() != null) { - RuleDto parent = dbClient.ruleDao().getParent(ruleDto, session); - if (parent != null && RuleStatus.REMOVED != parent.getStatus()) { - ruleDto.setLanguage(parent.getLanguage()); - ruleDto.setStatus(parent.getStatus()); - ruleDto.setDefaultSubCharacteristicId(parent.getDefaultSubCharacteristicId()); - ruleDto.setDefaultRemediationFunction(parent.getDefaultRemediationFunction()); - ruleDto.setDefaultRemediationCoefficient(parent.getDefaultRemediationCoefficient()); - ruleDto.setDefaultRemediationOffset(parent.getDefaultRemediationOffset()); - ruleDto.setEffortToFixDescription(parent.getEffortToFixDescription()); + if (ruleDto.getTemplateId() != null) { + RuleDto template = dbClient.ruleDao().getTemplate(ruleDto, session); + if (template != null && RuleStatus.REMOVED != template.getStatus()) { + ruleDto.setLanguage(template.getLanguage()); + ruleDto.setStatus(template.getStatus()); + ruleDto.setDefaultSubCharacteristicId(template.getDefaultSubCharacteristicId()); + ruleDto.setDefaultRemediationFunction(template.getDefaultRemediationFunction()); + ruleDto.setDefaultRemediationCoefficient(template.getDefaultRemediationCoefficient()); + ruleDto.setDefaultRemediationOffset(template.getDefaultRemediationOffset()); + ruleDto.setEffortToFixDescription(template.getEffortToFixDescription()); dbClient.ruleDao().update(session, ruleDto); toBeRemoved = false; } diff --git a/sonar-server/src/main/java/org/sonar/server/rule/RuleCreator.java b/sonar-server/src/main/java/org/sonar/server/rule/RuleCreator.java index a2bd1f5733a..72cff038f8f 100644 --- a/sonar-server/src/main/java/org/sonar/server/rule/RuleCreator.java +++ b/sonar-server/src/main/java/org/sonar/server/rule/RuleCreator.java @@ -98,7 +98,7 @@ public class RuleCreator implements ServerComponent { private RuleKey createCustomRule(RuleKey ruleKey, NewRule newRule, RuleDto templateRuleDto, DbSession dbSession){ RuleDto ruleDto = RuleDto.createFor(ruleKey) - .setParentId(templateRuleDto.getId()) + .setTemplateId(templateRuleDto.getId()) .setConfigKey(templateRuleDto.getConfigKey()) .setName(newRule.name()) .setDescription(newRule.htmlDescription()) diff --git a/sonar-server/src/main/java/org/sonar/server/rule/RuleDeleter.java b/sonar-server/src/main/java/org/sonar/server/rule/RuleDeleter.java index 398ad66e6df..60860b3e114 100644 --- a/sonar-server/src/main/java/org/sonar/server/rule/RuleDeleter.java +++ b/sonar-server/src/main/java/org/sonar/server/rule/RuleDeleter.java @@ -42,7 +42,7 @@ public class RuleDeleter implements ServerComponent { DbSession dbSession = dbClient.openSession(false); try { RuleDto rule = dbClient.ruleDao().getByKey(dbSession, ruleKey); - if (rule.getParentId() == null) { + if (rule.getTemplateId() == null) { throw new IllegalStateException("Only custom rules can be deleted"); } ruleActivator.deactivate(dbSession, rule); diff --git a/sonar-server/src/main/java/org/sonar/server/rule/db/RuleDao.java b/sonar-server/src/main/java/org/sonar/server/rule/db/RuleDao.java index 329ddf606f1..6bf900ac9d8 100644 --- a/sonar-server/src/main/java/org/sonar/server/rule/db/RuleDao.java +++ b/sonar-server/src/main/java/org/sonar/server/rule/db/RuleDao.java @@ -35,6 +35,7 @@ import org.sonar.server.search.action.IndexAction; import org.sonar.server.search.action.KeyIndexAction; import javax.annotation.CheckForNull; + import java.sql.Timestamp; import java.util.List; import java.util.Map; @@ -86,9 +87,9 @@ public class RuleDao extends BaseDao<RuleMapper, RuleDto, RuleKey> { } @CheckForNull - public RuleDto getParent(RuleDto rule, DbSession session) { - Preconditions.checkNotNull(rule.getParentId(), "Rule has no persisted parent!"); - return mapper(session).selectById(rule.getParentId()); + public RuleDto getTemplate(RuleDto rule, DbSession session) { + Preconditions.checkNotNull(rule.getTemplateId(), "Rule has no persisted template!"); + return mapper(session).selectById(rule.getTemplateId()); } diff --git a/sonar-server/src/main/java/org/sonar/server/rule/index/RuleNormalizer.java b/sonar-server/src/main/java/org/sonar/server/rule/index/RuleNormalizer.java index 0f598099cb5..fd34a6af5cf 100644 --- a/sonar-server/src/main/java/org/sonar/server/rule/index/RuleNormalizer.java +++ b/sonar-server/src/main/java/org/sonar/server/rule/index/RuleNormalizer.java @@ -37,12 +37,7 @@ import org.sonar.server.search.Indexable; import org.sonar.server.search.es.ListUpdate; import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; public class RuleNormalizer extends BaseNormalizer<RuleDto, RuleKey> { @@ -183,9 +178,9 @@ public class RuleNormalizer extends BaseNormalizer<RuleDto, RuleKey> { update.put(RuleField.NOTE_UPDATED_AT.field(), rule.getNoteUpdatedAt()); //TODO Legacy PARENT_ID in DTO should be parent_key - Integer parentId = rule.getParentId(); - if (parentId != null) { - RuleDto templateRule = db.ruleDao().getById(session, parentId); + Integer templateId = rule.getTemplateId(); + if (templateId != null) { + RuleDto templateRule = db.ruleDao().getById(session, templateId); update.put(RuleField.TEMPLATE_KEY.field(), templateRule.getKey().toString()); } else { update.put(RuleField.TEMPLATE_KEY.field(), null); diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/538_add_dates_to_active_rules_table.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/538_add_dates_to_active_rules_table.rb index df05fdc7ce9..c0786311243 100644 --- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/538_add_dates_to_active_rules_table.rb +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/538_add_dates_to_active_rules_table.rb @@ -20,6 +20,7 @@ # # SonarQube 4.4 +# SONAR-5007 # class AddDatesToActiveRulesTable < ActiveRecord::Migration diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/539_insert_active_rule_dates.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/539_insert_active_rule_dates.rb index cbb36a2ecf9..0c2e5c8fe30 100644 --- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/539_insert_active_rule_dates.rb +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/539_insert_active_rule_dates.rb @@ -20,6 +20,7 @@ # # SonarQube 4.4 +# SONAR-5007 # class InsertActiveRuleDates < ActiveRecord::Migration diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/540_create_log_table.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/540_create_log_table.rb index a36ede25806..02f466f35db 100644 --- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/540_create_log_table.rb +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/540_create_log_table.rb @@ -17,6 +17,11 @@ # 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-5329 +# class CreateLogTable < ActiveRecord::Migration def self.up diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/541_add_unique_index_on_active_rule_key.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/541_add_unique_index_on_active_rule_key.rb index e2c508a0c69..f1b1741cb01 100644 --- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/541_add_unique_index_on_active_rule_key.rb +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/541_add_unique_index_on_active_rule_key.rb @@ -17,6 +17,11 @@ # 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-5384 +# class AddUniqueIndexOnActiveRuleKey < ActiveRecord::Migration diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/542_add_index_on_snapshot_data_resource_id.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/542_add_index_on_snapshot_data_resource_id.rb index 289123751d0..38baa204326 100644 --- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/542_add_index_on_snapshot_data_resource_id.rb +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/542_add_index_on_snapshot_data_resource_id.rb @@ -17,6 +17,11 @@ # 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-5384 +# class AddIndexOnSnapshotDataResourceId < ActiveRecord::Migration def self.up diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/543_add_type_to_log_table.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/543_add_type_to_log_table.rb index ec9fb01f39f..ed139ac8bb1 100644 --- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/543_add_type_to_log_table.rb +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/543_add_type_to_log_table.rb @@ -17,6 +17,11 @@ # 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-5329 +# class AddTypeToLogTable < ActiveRecord::Migration def self.up diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/544_rename_rules_parent_id_to_template_id.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/544_rename_rules_parent_id_to_template_id.rb new file mode 100644 index 00000000000..c53eeeb1996 --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/544_rename_rules_parent_id_to_template_id.rb @@ -0,0 +1,33 @@ +# +# 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-5351 +# +class RenameRulesParentIdToTemplateId < ActiveRecord::Migration + + def self.up + begin + rename_column 'rules', 'parent_id', 'template_id' + end + end + +end diff --git a/sonar-server/src/test/java/org/sonar/server/debt/DebtModelBackupTest.java b/sonar-server/src/test/java/org/sonar/server/debt/DebtModelBackupTest.java index 2448f5119f7..bba0951dd7d 100644 --- a/sonar-server/src/test/java/org/sonar/server/debt/DebtModelBackupTest.java +++ b/sonar-server/src/test/java/org/sonar/server/debt/DebtModelBackupTest.java @@ -63,14 +63,7 @@ import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; import static org.mockito.Matchers.isNull; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyNoMoreInteractions; -import static org.mockito.Mockito.verifyZeroInteractions; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.*; @RunWith(MockitoJUnitRunner.class) public class DebtModelBackupTest { @@ -545,7 +538,7 @@ public class DebtModelBackupTest { .setRemediationCoefficient("2h") .setRemediationOffset("15min"), // Custom rule - new RuleDto().setId(6).setRepositoryKey("squid").setRuleKey("XPath_1369910135").setParentId(5) + new RuleDto().setId(6).setRepositoryKey("squid").setRuleKey("XPath_1369910135").setTemplateId(5) .setSubCharacteristicId(2) .setRemediationFunction(DebtRemediationFunction.Type.LINEAR_OFFSET.toString()) .setRemediationCoefficient("2h") diff --git a/sonar-server/src/test/java/org/sonar/server/rule/RuleCreatorMediumTest.java b/sonar-server/src/test/java/org/sonar/server/rule/RuleCreatorMediumTest.java index 8f02e61607b..48695e5bb83 100644 --- a/sonar-server/src/test/java/org/sonar/server/rule/RuleCreatorMediumTest.java +++ b/sonar-server/src/test/java/org/sonar/server/rule/RuleCreatorMediumTest.java @@ -85,7 +85,7 @@ public class RuleCreatorMediumTest { RuleDto rule = db.ruleDao().getNullableByKey(dbSession, customRuleKey); assertThat(rule).isNotNull(); assertThat(rule.getKey()).isEqualTo(RuleKey.of("java", "CUSTOM_RULE")); - assertThat(rule.getParentId()).isEqualTo(templateRule.getId()); + assertThat(rule.getTemplateId()).isEqualTo(templateRule.getId()); assertThat(rule.getName()).isEqualTo("My custom"); assertThat(rule.getDescription()).isEqualTo("Some description"); assertThat(rule.getSeverityString()).isEqualTo("MAJOR"); diff --git a/sonar-server/src/test/java/org/sonar/server/rule/RuleTesting.java b/sonar-server/src/test/java/org/sonar/server/rule/RuleTesting.java index 392e52b1c4c..455440bf3c7 100644 --- a/sonar-server/src/test/java/org/sonar/server/rule/RuleTesting.java +++ b/sonar-server/src/test/java/org/sonar/server/rule/RuleTesting.java @@ -73,7 +73,7 @@ public class RuleTesting { public static RuleDto newCustomRule(RuleDto templateRule){ return newDto(RuleKey.of(templateRule.getRepositoryKey(), templateRule.getRuleKey() + "_" + new Date().getTime())) .setCardinality(Cardinality.SINGLE) - .setParentId(templateRule.getId()); + .setTemplateId(templateRule.getId()); } } diff --git a/sonar-server/src/test/java/org/sonar/server/rule/db/RuleDaoTest.java b/sonar-server/src/test/java/org/sonar/server/rule/db/RuleDaoTest.java index 8eb82580510..a922e6cd721 100644 --- a/sonar-server/src/test/java/org/sonar/server/rule/db/RuleDaoTest.java +++ b/sonar-server/src/test/java/org/sonar/server/rule/db/RuleDaoTest.java @@ -176,7 +176,7 @@ public class RuleDaoTest extends AbstractDaoTestCase { .setSeverity(Severity.INFO) .setCardinality(Cardinality.MULTIPLE) .setLanguage("dart") - .setParentId(3) + .setTemplateId(3) .setNoteData("My note") .setNoteUserLogin("admin") .setNoteCreatedAt(DateUtils.parseDate("2013-12-19")) @@ -216,7 +216,7 @@ public class RuleDaoTest extends AbstractDaoTestCase { .setSeverity(Severity.INFO) .setCardinality(Cardinality.MULTIPLE) .setLanguage("dart") - .setParentId(3) + .setTemplateId(3) .setSubCharacteristicId(100) .setDefaultSubCharacteristicId(101) .setRemediationFunction(DebtRemediationFunction.Type.LINEAR.toString()) @@ -250,7 +250,7 @@ public class RuleDaoTest extends AbstractDaoTestCase { .setSeverity(Severity.INFO) .setCardinality(Cardinality.MULTIPLE) .setLanguage("dart") - .setParentId(3) + .setTemplateId(3) .setSubCharacteristicId(100) .setDefaultSubCharacteristicId(101) .setRemediationFunction(DebtRemediationFunction.Type.LINEAR.toString()) @@ -272,7 +272,7 @@ public class RuleDaoTest extends AbstractDaoTestCase { .setSeverity(Severity.MAJOR) .setCardinality(Cardinality.SINGLE) .setLanguage("js") - .setParentId(null) + .setTemplateId(null) .setSubCharacteristicId(102) .setDefaultSubCharacteristicId(103) .setRemediationFunction(DebtRemediationFunction.Type.LINEAR_OFFSET.toString()) diff --git a/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexMediumTest.java b/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexMediumTest.java index b61ca00400e..426a7190580 100644 --- a/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexMediumTest.java +++ b/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexMediumTest.java @@ -48,12 +48,7 @@ import org.sonar.server.search.QueryOptions; import org.sonar.server.search.Result; import org.sonar.server.tester.ServerTester; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.Iterator; -import java.util.List; +import java.util.*; import static org.fest.assertions.Assertions.assertThat; import static org.fest.assertions.Fail.fail; @@ -748,7 +743,7 @@ public class RuleIndexMediumTest { public void search_by_template_key() throws InterruptedException { RuleDto templateRule = newRuleDto(RuleKey.of("java", "S001")).setCardinality(Cardinality.MULTIPLE); dao.insert(dbSession, templateRule); - dao.insert(dbSession, newRuleDto(RuleKey.of("java", "S001_MY_CUSTOM")).setParentId(templateRule.getId())); + dao.insert(dbSession, newRuleDto(RuleKey.of("java", "S001_MY_CUSTOM")).setTemplateId(templateRule.getId())); dbSession.commit(); // find all @@ -775,7 +770,7 @@ public class RuleIndexMediumTest { dao.insert(dbSession, templateRule); dao.addRuleParam(dbSession, templateRule, ruleParamDto); - RuleDto customRule = newRuleDto(RuleKey.of("java", "S001_MY_CUSTOM")).setParentId(templateRule.getId()); + RuleDto customRule = newRuleDto(RuleKey.of("java", "S001_MY_CUSTOM")).setTemplateId(templateRule.getId()); RuleParamDto customRuleParam = RuleParamDto.createFor(customRule).setName("regex").setType("STRING").setDescription("Reg ex").setDefaultValue("a.*"); dao.insert(dbSession, customRule); dao.addRuleParam(dbSession, customRule, customRuleParam); @@ -795,7 +790,7 @@ public class RuleIndexMediumTest { public void show_custom_rule() throws InterruptedException { RuleDto templateRule = newRuleDto(RuleKey.of("java", "S001")).setCardinality(Cardinality.MULTIPLE); dao.insert(dbSession, templateRule); - dao.insert(dbSession, newRuleDto(RuleKey.of("java", "S001_MY_CUSTOM")).setParentId(templateRule.getId())); + dao.insert(dbSession, newRuleDto(RuleKey.of("java", "S001_MY_CUSTOM")).setTemplateId(templateRule.getId())); dbSession.commit(); // find all diff --git a/sonar-server/src/test/java/org/sonar/server/rule/ws/RulesWebServiceTest.java b/sonar-server/src/test/java/org/sonar/server/rule/ws/RulesWebServiceTest.java index 3e59379a90f..f8e16570838 100644 --- a/sonar-server/src/test/java/org/sonar/server/rule/ws/RulesWebServiceTest.java +++ b/sonar-server/src/test/java/org/sonar/server/rule/ws/RulesWebServiceTest.java @@ -193,7 +193,7 @@ public class RulesWebServiceTest { public void search_template_rules() throws Exception { RuleDto templateRule = newRuleDto(RuleKey.of("java", "S001")).setCardinality(Cardinality.MULTIPLE); ruleDao.insert(session, templateRule); - ruleDao.insert(session, newRuleDto(RuleKey.of("java", "S001_MY_CUSTOM")).setParentId(templateRule.getId())); + ruleDao.insert(session, newRuleDto(RuleKey.of("java", "S001_MY_CUSTOM")).setTemplateId(templateRule.getId())); session.commit(); MockUserSession.set(); @@ -208,7 +208,7 @@ public class RulesWebServiceTest { public void search_custom_rules_from_template_key() throws Exception { RuleDto templateRule = newRuleDto(RuleKey.of("java", "S001")).setCardinality(Cardinality.MULTIPLE); ruleDao.insert(session, templateRule); - ruleDao.insert(session, newRuleDto(RuleKey.of("java", "S001_MY_CUSTOM")).setParentId(templateRule.getId())); + ruleDao.insert(session, newRuleDto(RuleKey.of("java", "S001_MY_CUSTOM")).setTemplateId(templateRule.getId())); session.commit(); MockUserSession.set(); diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rule_params-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rule_params-result.xml index 0e2f96d5e55..acce83dc56f 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rule_params-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rule_params-result.xml @@ -1,10 +1,10 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="READY" priority="4" cardinality="SINGLE" template_id="[null]" language="java"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two" - status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="DEPRECATED" priority="0" cardinality="SINGLE" template_id="[null]" language="java"/> <rules_parameters id="1" rule_id="1" default_value="default value one" description="parameter one" name="param1" param_type="STRING"/> <rules_parameters id="2" rule_id="1" default_value="default value two" description="parameter two" name="param2" param_type="STRING"/> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rule_params.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rule_params.xml index 8ffb87c578c..83c96760f2c 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rule_params.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rule_params.xml @@ -1,7 +1,7 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="old_config_key" name="old name" description="old description" - status="READY" priority="2" cardinality="SINGLE" parent_id="[null]" /> + status="READY" priority="2" cardinality="SINGLE" template_id="[null]" /> <rules_parameters id="1" rule_id="1" name="param1" description="[null]" param_type="STRING"/> <rules_parameters id="2" rule_id="1" name="param2" description="[null]" param_type="STRING"/> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rules-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rules-result.xml index 931499501cc..5543cb5d637 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rules-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rules-result.xml @@ -1,15 +1,15 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]" - status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="[null]"/> + status="REMOVED" priority="4" cardinality="SINGLE" template_id="[null]" language="[null]"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="deprecated" plugin_name="fake" plugin_config_key="[null]" name="Deprecated fake" description="[null]" - status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="[null]"/> + status="REMOVED" priority="4" cardinality="SINGLE" template_id="[null]" language="[null]"/> <rules tags="[null]" system_tags="[null]" id="3" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="READY" priority="4" cardinality="SINGLE" template_id="[null]" language="java"/> <rules tags="[null]" system_tags="[null]" id="4" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two" - status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="DEPRECATED" priority="0" cardinality="SINGLE" template_id="[null]" language="java"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rules.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rules.xml index ba2812d280f..1bc82135c5d 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rules.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_active_rules.xml @@ -1,10 +1,10 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]"/> + status="READY" priority="4" cardinality="SINGLE" template_id="[null]"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="deprecated" plugin_name="fake" plugin_config_key="[null]" name="Deprecated fake" description="[null]" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]"/> + status="READY" priority="4" cardinality="SINGLE" template_id="[null]"/> <rules_parameters id="1" rule_id="1" name="deprecated-prop" description="[null]" param_type="STRING"/> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_repositories-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_repositories-result.xml index 0c0534a73ab..7fcf4aa8402 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_repositories-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_repositories-result.xml @@ -1,14 +1,14 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]" - status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="[null]"/> + status="REMOVED" priority="4" cardinality="SINGLE" template_id="[null]" language="[null]"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="READY" priority="4" cardinality="SINGLE" template_id="[null]" language="java"/> <rules_parameters id="1" rule_id="2" default_value="default value one" description="parameter one" name="param1" param_type="STRING"/> <rules_parameters id="2" rule_id="2" default_value="default value two" description="parameter two" name="param2" param_type="STRING"/> <rules tags="[null]" system_tags="[null]" id="3" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="rule2" name="Two" description="Description of Two" - status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="DEPRECATED" priority="0" cardinality="SINGLE" template_id="[null]" language="java"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_rules-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_rules-result.xml index 2b80f2f4466..087452bdcde 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_rules-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_rules-result.xml @@ -1,20 +1,20 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]" - status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="[null]"/> + status="REMOVED" priority="4" cardinality="SINGLE" template_id="[null]" language="[null]"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="deprecated" plugin_name="fake" plugin_config_key="[null]" name="Deprecated fake" description="[null]" - status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="[null]"/> + status="REMOVED" priority="4" cardinality="SINGLE" template_id="[null]" language="[null]"/> <rules_parameters id="1" rule_id="1" name="deprecated-prop" description="[null]" param_type="STRING" default_value="[null]"/> <rules tags="[null]" system_tags="[null]" id="3" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="READY" priority="4" cardinality="SINGLE" template_id="[null]" language="java"/> <rules_parameters id="2" rule_id="3" default_value="default value one" description="parameter one" name="param1" param_type="STRING"/> <rules_parameters id="3" rule_id="3" default_value="default value two" description="parameter two" name="param2" param_type="STRING"/> <rules tags="[null]" system_tags="[null]" id="4" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two" - status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="DEPRECATED" priority="0" cardinality="SINGLE" template_id="[null]" language="java"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_rules.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_rules.xml index c894e0097fd..af0ddfeb01f 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_rules.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_deprecated_rules.xml @@ -1,10 +1,10 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]"/> + status="READY" priority="4" cardinality="SINGLE" template_id="[null]"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="deprecated" plugin_name="fake" plugin_config_key="[null]" name="Deprecated fake" description="[null]" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]"/> + status="READY" priority="4" cardinality="SINGLE" template_id="[null]"/> <rules_parameters id="1" rule_id="1" name="deprecated-prop" description="[null]" param_type="STRING"/> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_template_rules_if_parent_is_disabled-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_template_rules_if_parent_is_disabled-result.xml index 81682535971..09aa9705234 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_template_rules_if_parent_is_disabled-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_template_rules_if_parent_is_disabled-result.xml @@ -1,21 +1,21 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="disabled_rule" plugin_name="fake" plugin_config_key="[null]" name="Disabled rule" description="[null]" - status="REMOVED" priority="4" cardinality="MULTIPLE" parent_id="[null]" language="[null]"/> + status="REMOVED" priority="4" cardinality="MULTIPLE" template_id="[null]" language="[null]"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="user_rule" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]" - status="REMOVED" priority="4" cardinality="SINGLE" parent_id="1" language="[null]"/> + status="REMOVED" priority="4" cardinality="SINGLE" template_id="1" language="[null]"/> <rules tags="[null]" system_tags="[null]" id="3" plugin_rule_key="disabled_rule2" plugin_name="fake" plugin_config_key="old_config_key2" name="old name2" description="old description2" - status="REMOVED" priority="1" cardinality="SINGLE" parent_id="[null]" language="[null]"/> + status="REMOVED" priority="1" cardinality="SINGLE" template_id="[null]" language="[null]"/> <rules tags="[null]" system_tags="[null]" id="4" plugin_rule_key="template_rule2" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]" - status="REMOVED" priority="4" cardinality="SINGLE" parent_id="3" language="[null]"/> + status="REMOVED" priority="4" cardinality="SINGLE" template_id="3" language="[null]"/> <rules tags="[null]" system_tags="[null]" id="5" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="READY" priority="4" cardinality="SINGLE" template_id="[null]" language="java"/> <rules tags="[null]" system_tags="[null]" id="6" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two" - status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="DEPRECATED" priority="0" cardinality="SINGLE" template_id="[null]" language="java"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_template_rules_if_parent_is_disabled.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_template_rules_if_parent_is_disabled.xml index d3e61274471..90d1de6d1a9 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_template_rules_if_parent_is_disabled.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/disable_template_rules_if_parent_is_disabled.xml @@ -2,18 +2,18 @@ <!-- Rule as been removed --> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="disabled_rule" plugin_name="fake" plugin_config_key="[null]" name="Disabled rule" description="[null]" - status="REMOVED" priority="4" cardinality="MULTIPLE" parent_id="[null]"/> + status="REMOVED" priority="4" cardinality="MULTIPLE" template_id="[null]"/> <!-- user rule duplicated from rule 1. It is currently enabled. --> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="user_rule" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]" - status="READY" priority="4" cardinality="SINGLE" parent_id="1"/> + status="READY" priority="4" cardinality="SINGLE" template_id="1"/> <!-- This rule will be removed... --> <rules tags="[null]" system_tags="[null]" id="3" plugin_rule_key="disabled_rule2" plugin_name="fake" plugin_config_key="old_config_key2" name="old name2" description="old description2" - status="READY" priority="1" cardinality="SINGLE" parent_id="[null]" /> + status="READY" priority="1" cardinality="SINGLE" template_id="[null]" /> <!-- ...so this template will be removed too --> <rules tags="[null]" system_tags="[null]" id="4" plugin_rule_key="template_rule2" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]" - status="READY" priority="4" cardinality="SINGLE" parent_id="3"/> + status="READY" priority="4" cardinality="SINGLE" template_id="3"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/ignore_rule_debt_definitions_if_rule_is_linked_on_root_characteristic.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/ignore_rule_debt_definitions_if_rule_is_linked_on_root_characteristic.xml index d5dfe74dd1c..5bd5d56dbb1 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/ignore_rule_debt_definitions_if_rule_is_linked_on_root_characteristic.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/ignore_rule_debt_definitions_if_rule_is_linked_on_root_characteristic.xml @@ -3,7 +3,7 @@ <characteristics id="2" kee="MEMORY_EFFICIENCY" name="Efficiency" parent_id="[null]" characteristic_order="[null]" enabled="[true]"/> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="old_config_key" name="old name" description="old description" - status="READY" priority="2" cardinality="SINGLE" parent_id="[null]" + status="READY" priority="2" cardinality="SINGLE" template_id="[null]" characteristic_id="[null]" default_characteristic_id="200" remediation_function="[null]" default_remediation_function="LINEAR" remediation_coeff="[null]" default_remediation_coeff="14min" @@ -11,7 +11,7 @@ effort_to_fix_description="squid.S1115.effortTotFix"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="old_config_key2" name="old name2" description="old description2" - status="READY" priority="1" cardinality="SINGLE" parent_id="[null]"/> + status="READY" priority="1" cardinality="SINGLE" template_id="[null]"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/insert_extended_repositories-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/insert_extended_repositories-result.xml index 5ad7d6d57d1..09691908bcd 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/insert_extended_repositories-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/insert_extended_repositories-result.xml @@ -1,9 +1,9 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="rule1" plugin_name="findbugs" plugin_config_key="[null]" name="Rule One" description="Description of Rule One" - status="READY" priority="2" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="READY" priority="2" cardinality="SINGLE" template_id="[null]" language="java"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="rule2" plugin_name="findbugs" plugin_config_key="[null]" name="Rule Two" description="Description of Rule Two" - status="READY" priority="2" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="READY" priority="2" cardinality="SINGLE" template_id="[null]" language="java"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/insert_new_rules-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/insert_new_rules-result.xml index 24c65625e65..0a4ff8b8b99 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/insert_new_rules-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/insert_new_rules-result.xml @@ -1,7 +1,7 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]" - status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="[null]" + status="REMOVED" priority="4" cardinality="SINGLE" template_id="[null]" language="[null]" characteristic_id="[null]" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" remediation_coeff="[null]" default_remediation_coeff="[null]" @@ -9,7 +9,7 @@ effort_to_fix_description="[null]"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java" + status="READY" priority="4" cardinality="SINGLE" template_id="[null]" language="java" characteristic_id="[null]" default_characteristic_id="2" remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" remediation_coeff="[null]" default_remediation_coeff="5d" @@ -20,7 +20,7 @@ <rules_parameters id="2" rule_id="2" default_value="default value two" description="parameter two" name="param2" param_type="STRING"/> <rules tags="[null]" system_tags="[null]" id="3" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two" - status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java" + status="DEPRECATED" priority="0" cardinality="SINGLE" template_id="[null]" language="java" characteristic_id="[null]" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" remediation_coeff="[null]" default_remediation_coeff="[null]" diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_already_disabled_rules-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_already_disabled_rules-result.xml index c798a6a0c7a..e4c051c4fbc 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_already_disabled_rules-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_already_disabled_rules-result.xml @@ -1,7 +1,7 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]" - status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="[null]" + status="REMOVED" priority="4" cardinality="SINGLE" template_id="[null]" language="[null]" characteristic_id="[null]" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" remediation_coeff="[null]" default_remediation_coeff="[null]" @@ -10,7 +10,7 @@ updated_at="2014-03-16"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="deprecated" plugin_name="fake" plugin_config_key="[null]" name="Deprecated fake" description="[null]" - status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="[null]" + status="REMOVED" priority="4" cardinality="SINGLE" template_id="[null]" language="[null]" characteristic_id="[null]" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" remediation_coeff="[null]" default_remediation_coeff="[null]" @@ -20,7 +20,7 @@ <!-- New rules --> <rules tags="[null]" system_tags="[null]" id="3" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java" + status="READY" priority="4" cardinality="SINGLE" template_id="[null]" language="java" characteristic_id="[null]" default_characteristic_id="2" remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" remediation_coeff="[null]" default_remediation_coeff="5d" @@ -29,7 +29,7 @@ updated_at="2014-03-17 19:10:03.0"/> <rules tags="[null]" system_tags="[null]" id="4" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two" - status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java" + status="DEPRECATED" priority="0" cardinality="SINGLE" template_id="[null]" language="java" characteristic_id="[null]" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" remediation_coeff="[null]" default_remediation_coeff="[null]" diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_already_disabled_rules.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_already_disabled_rules.xml index 13907539477..f5a605951f7 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_already_disabled_rules.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_already_disabled_rules.xml @@ -3,7 +3,7 @@ <characteristics id="2" kee="MEMORY_EFFICIENCY" name="Memory Efficiency" parent_id="1" characteristic_order="1" enabled="[true]"/> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]" - status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" + status="REMOVED" priority="4" cardinality="SINGLE" template_id="[null]" characteristic_id="[null]" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" remediation_coeff="[null]" default_remediation_coeff="[null]" @@ -12,7 +12,7 @@ updated_at="2014-03-16"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="deprecated" plugin_name="fake" plugin_config_key="[null]" name="Deprecated fake" description="[null]" - status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" + status="REMOVED" priority="4" cardinality="SINGLE" template_id="[null]" characteristic_id="[null]" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" remediation_coeff="[null]" default_remediation_coeff="[null]" diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_manual_rules-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_manual_rules-result.xml index 0f73b04c525..6399c16e74f 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_manual_rules-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_manual_rules-result.xml @@ -1,15 +1,15 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="PerformanceIssue" plugin_name="manual" plugin_config_key="[null]" name="Performance Issue" description="[null]" - status="READY" priority="[null]" cardinality="SINGLE" parent_id="[null]" language="[null]"/> + status="READY" priority="[null]" cardinality="SINGLE" template_id="[null]" language="[null]"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="IllegalExceptionCheck" plugin_name="checkstyle" plugin_config_key="[null]" name="Illegal Exception" description="[null]" - status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="[null]"/> + status="REMOVED" priority="4" cardinality="SINGLE" template_id="[null]" language="[null]"/> <rules tags="[null]" system_tags="[null]" id="3" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="READY" priority="4" cardinality="SINGLE" template_id="[null]" language="java"/> <rules tags="[null]" system_tags="[null]" id="4" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two" - status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="DEPRECATED" priority="0" cardinality="SINGLE" template_id="[null]" language="java"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_manual_rules.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_manual_rules.xml index 7f175d92749..c3592559fbd 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_manual_rules.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_manual_rules.xml @@ -1,9 +1,9 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="PerformanceIssue" plugin_name="manual" plugin_config_key="[null]" name="Performance Issue" description="[null]" - status="READY" priority="[null]" cardinality="SINGLE" parent_id="[null]"/> + status="READY" priority="[null]" cardinality="SINGLE" template_id="[null]"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="IllegalExceptionCheck" plugin_name="checkstyle" plugin_config_key="[null]" name="Illegal Exception" description="[null]" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]"/> + status="READY" priority="4" cardinality="SINGLE" template_id="[null]"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_template_rules_if_parent_is_enabled-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_template_rules_if_parent_is_enabled-result.xml index e4a4196bcce..cd33c09cd2a 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_template_rules_if_parent_is_enabled-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_template_rules_if_parent_is_enabled-result.xml @@ -1,12 +1,12 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="READY" priority="4" cardinality="SINGLE" template_id="[null]" language="java"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="user_rule" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]" - status="READY" priority="4" cardinality="SINGLE" parent_id="1" language="java"/> + status="READY" priority="4" cardinality="SINGLE" template_id="1" language="java"/> <rules tags="[null]" system_tags="[null]" id="3" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two" - status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="DEPRECATED" priority="0" cardinality="SINGLE" template_id="[null]" language="java"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_template_rules_if_parent_is_enabled.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_template_rules_if_parent_is_enabled.xml index 8e3bcfb804d..964e8e11c24 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_template_rules_if_parent_is_enabled.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_template_rules_if_parent_is_enabled.xml @@ -1,9 +1,9 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="[null]" name="Rule one" description="[null]" - status="READY" priority="4" cardinality="MULTIPLE" parent_id="[null]"/> + status="READY" priority="4" cardinality="MULTIPLE" template_id="[null]"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="user_rule" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]" - status="READY" priority="4" cardinality="SINGLE" parent_id="1"/> + status="READY" priority="4" cardinality="SINGLE" template_id="1"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_update_already_disabled_rules-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_update_already_disabled_rules-result.xml index 91f0b991742..6cd647db95d 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_update_already_disabled_rules-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_update_already_disabled_rules-result.xml @@ -1,9 +1,9 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]" - status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="REMOVED" priority="4" cardinality="SINGLE" template_id="[null]" language="java"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="rule2" name="Two" description="Description of Two" - status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="DEPRECATED" priority="0" cardinality="SINGLE" template_id="[null]" language="java"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_update_already_disabled_rules.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_update_already_disabled_rules.xml index 45e3706d700..50fdcfd3acd 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_update_already_disabled_rules.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_update_already_disabled_rules.xml @@ -1,6 +1,6 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]" - status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]"/> + status="REMOVED" priority="4" cardinality="SINGLE" template_id="[null]"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/notify_for_removed_rules_when_repository_is_still_existing.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/notify_for_removed_rules_when_repository_is_still_existing.xml index f4e73c9239b..a0ed38c97ad 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/notify_for_removed_rules_when_repository_is_still_existing.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/notify_for_removed_rules_when_repository_is_still_existing.xml @@ -1,6 +1,6 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="deprecated-key" plugin_name="fake" plugin_config_key="[null]" name="Deprecated" description="[null]" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]"/> + status="READY" priority="4" cardinality="SINGLE" template_id="[null]"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/reactivate_disabled_rules-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/reactivate_disabled_rules-result.xml index 57d8e33ed85..fcbfa824728 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/reactivate_disabled_rules-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/reactivate_disabled_rules-result.xml @@ -1,9 +1,9 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="READY" priority="4" cardinality="SINGLE" template_id="[null]" language="java"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two" - status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="DEPRECATED" priority="0" cardinality="SINGLE" template_id="[null]" language="java"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/reactivate_disabled_rules.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/reactivate_disabled_rules.xml index d5b82972127..0bf6ba212ee 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/reactivate_disabled_rules.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/reactivate_disabled_rules.xml @@ -1,6 +1,6 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="[null]" name="Old name" description="Old description" - status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]"/> + status="REMOVED" priority="4" cardinality="SINGLE" template_id="[null]"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/reactivate_disabled_template_rules-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/reactivate_disabled_template_rules-result.xml index 7e0166ec64c..5f05090ced8 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/reactivate_disabled_template_rules-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/reactivate_disabled_template_rules-result.xml @@ -1,12 +1,12 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="READY" priority="4" cardinality="SINGLE" template_id="[null]" language="java"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="user_rule" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]" - status="READY" priority="4" cardinality="SINGLE" parent_id="1" language="java"/> + status="READY" priority="4" cardinality="SINGLE" template_id="1" language="java"/> <rules tags="[null]" system_tags="[null]" id="3" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two" - status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="DEPRECATED" priority="0" cardinality="SINGLE" template_id="[null]" language="java"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/reactivate_disabled_template_rules.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/reactivate_disabled_template_rules.xml index 3982ccb7ca7..dc99296bc5a 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/reactivate_disabled_template_rules.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/reactivate_disabled_template_rules.xml @@ -1,9 +1,9 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One" - status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="REMOVED" priority="4" cardinality="SINGLE" template_id="[null]" language="java"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="user_rule" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]" - status="REMOVED" priority="4" cardinality="SINGLE" parent_id="1" language="java"/> + status="REMOVED" priority="4" cardinality="SINGLE" template_id="1" language="java"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_characteristic_not_found-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_characteristic_not_found-result.xml index 681ce324eaf..059f6155947 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_characteristic_not_found-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_characteristic_not_found-result.xml @@ -1,7 +1,7 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java" + status="READY" priority="4" cardinality="SINGLE" template_id="[null]" language="java" characteristic_id="[null]" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" remediation_coeff="[null]" default_remediation_coeff="[null]" @@ -9,7 +9,7 @@ effort_to_fix_description="[null]"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two" - status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java" + status="DEPRECATED" priority="0" cardinality="SINGLE" template_id="[null]" language="java" characteristic_id="[null]" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" remediation_coeff="[null]" default_remediation_coeff="[null]" diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_characteristic_not_found.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_characteristic_not_found.xml index 36041f853cb..265c3cf9e19 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_characteristic_not_found.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_characteristic_not_found.xml @@ -3,7 +3,7 @@ <characteristics id="999" kee="NEW" name="New" parent_id="1" characteristic_order="1" enabled="[true]"/> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="old_config_key" name="old name" description="old description" - status="READY" priority="2" cardinality="SINGLE" parent_id="[null]" + status="READY" priority="2" cardinality="SINGLE" template_id="[null]" characteristic_id="[null]" default_characteristic_id="200" remediation_function="[null]" default_remediation_function="LINEAR" remediation_coeff="[null]" default_remediation_coeff="14min" @@ -11,7 +11,7 @@ effort_to_fix_description="[null]"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="old_config_key2" name="old name2" description="old description2" - status="READY" priority="1" cardinality="SINGLE" parent_id="[null]"/> + status="READY" priority="1" cardinality="SINGLE" template_id="[null]"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_default_characteristic_not_found_and_overriding_characteristic_disabled-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_default_characteristic_not_found_and_overriding_characteristic_disabled-result.xml index 7da79185196..7fed56bec39 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_default_characteristic_not_found_and_overriding_characteristic_disabled-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_default_characteristic_not_found_and_overriding_characteristic_disabled-result.xml @@ -1,7 +1,7 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java" + status="READY" priority="4" cardinality="SINGLE" template_id="[null]" language="java" characteristic_id="-1" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" remediation_coeff="[null]" default_remediation_coeff="[null]" @@ -9,7 +9,7 @@ effort_to_fix_description="[null]"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two" - status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java" + status="DEPRECATED" priority="0" cardinality="SINGLE" template_id="[null]" language="java" characteristic_id="[null]" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" remediation_coeff="[null]" default_remediation_coeff="[null]" diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_default_characteristic_not_found_and_overriding_characteristic_disabled.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_default_characteristic_not_found_and_overriding_characteristic_disabled.xml index 0c99aac7390..26ec9838778 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_default_characteristic_not_found_and_overriding_characteristic_disabled.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_default_characteristic_not_found_and_overriding_characteristic_disabled.xml @@ -3,7 +3,7 @@ <characteristics id="999" kee="NEW" name="New" parent_id="1" characteristic_order="1" enabled="[true]"/> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="old_config_key" name="old name" description="old description" - status="READY" priority="2" cardinality="SINGLE" parent_id="[null]" + status="READY" priority="2" cardinality="SINGLE" template_id="[null]" characteristic_id="-1" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" remediation_coeff="[null]" default_remediation_coeff="[null]" @@ -11,7 +11,7 @@ effort_to_fix_description="[null]"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="old_config_key2" name="old name2" description="old description2" - status="READY" priority="1" cardinality="SINGLE" parent_id="[null]" + status="READY" priority="1" cardinality="SINGLE" template_id="[null]" characteristic_id="[null]" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" remediation_coeff="[null]" default_remediation_coeff="[null]" diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_default_characteristic_when_default_characteristic_not_found_but_characteristic_has_been_overridden-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_default_characteristic_when_default_characteristic_not_found_but_characteristic_has_been_overridden-result.xml index d4f6269c2a9..aa13804b225 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_default_characteristic_when_default_characteristic_not_found_but_characteristic_has_been_overridden-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_default_characteristic_when_default_characteristic_not_found_but_characteristic_has_been_overridden-result.xml @@ -1,7 +1,7 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java" + status="READY" priority="4" cardinality="SINGLE" template_id="[null]" language="java" characteristic_id="3" default_characteristic_id="[null]" remediation_function="LINEAR_OFFSET" default_remediation_function="[null]" remediation_coeff="5d" default_remediation_coeff="[null]" @@ -9,7 +9,7 @@ effort_to_fix_description="[null]"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two" - status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java" + status="DEPRECATED" priority="0" cardinality="SINGLE" template_id="[null]" language="java" characteristic_id="[null]" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" remediation_coeff="[null]" default_remediation_coeff="[null]" diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_default_characteristic_when_default_characteristic_not_found_but_characteristic_has_been_overridden.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_default_characteristic_when_default_characteristic_not_found_but_characteristic_has_been_overridden.xml index 8439879859b..0b48ae8706a 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_default_characteristic_when_default_characteristic_not_found_but_characteristic_has_been_overridden.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_default_characteristic_when_default_characteristic_not_found_but_characteristic_has_been_overridden.xml @@ -5,7 +5,7 @@ <characteristics id="3" kee="COMPILER" name="Compiler" parent_id="1" characteristic_order="1" enabled="[true]"/> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="old_config_key" name="old name" description="old description" - status="READY" priority="2" cardinality="SINGLE" parent_id="[null]" + status="READY" priority="2" cardinality="SINGLE" template_id="[null]" characteristic_id="3" default_characteristic_id="[null]" remediation_function="LINEAR_OFFSET" default_remediation_function="[null]" remediation_coeff="5d" default_remediation_coeff="[null]" @@ -13,7 +13,7 @@ effort_to_fix_description="[null]"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="old_config_key2" name="old name2" description="old description2" - status="READY" priority="1" cardinality="SINGLE" parent_id="[null]" + status="READY" priority="1" cardinality="SINGLE" template_id="[null]" characteristic_id="[null]" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" remediation_coeff="[null]" default_remediation_coeff="[null]" diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/shared.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/shared.xml index c1c3fb31ab4..959dbed9d99 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/shared.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/shared.xml @@ -3,6 +3,6 @@ <characteristics id="2" kee="MEMORY_EFFICIENCY" name="Memory Efficiency" parent_id="1" characteristic_order="1" enabled="[true]"/> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]"/> + status="READY" priority="4" cardinality="SINGLE" template_id="[null]"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/store_bundle_name_and_description_in_database-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/store_bundle_name_and_description_in_database-result.xml index 1cfe02dd4ab..c4f598054c3 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/store_bundle_name_and_description_in_database-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/store_bundle_name_and_description_in_database-result.xml @@ -1,9 +1,9 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="The One" description="The Description of One" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="READY" priority="4" cardinality="SINGLE" template_id="[null]" language="java"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="rule2" name="Two" description="Description of Two" - status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="DEPRECATED" priority="0" cardinality="SINGLE" template_id="[null]" language="java"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_fields-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_fields-result.xml index 733251902b6..5a9f52126ea 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_fields-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_fields-result.xml @@ -1,7 +1,7 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java" + status="READY" priority="4" cardinality="SINGLE" template_id="[null]" language="java" characteristic_id="[null]" default_characteristic_id="200" remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" remediation_coeff="[null]" default_remediation_coeff="5d" @@ -12,7 +12,7 @@ <rules_parameters id="2" rule_id="1" default_value="default value two" description="parameter two" name="param2" param_type="STRING"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two" - status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java" + status="DEPRECATED" priority="0" cardinality="SINGLE" template_id="[null]" language="java" characteristic_id="[null]" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" remediation_coeff="[null]" default_remediation_coeff="[null]" diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_fields.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_fields.xml index 7f35c78b072..7b60459392d 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_fields.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_fields.xml @@ -3,7 +3,7 @@ <characteristics id="200" kee="MEMORY_EFFICIENCY" name="Memory Efficiency" parent_id="1" characteristic_order="1" enabled="[true]"/> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="old_config_key" name="old name" description="old description" - status="READY" priority="2" cardinality="SINGLE" parent_id="[null]" + status="READY" priority="2" cardinality="SINGLE" template_id="[null]" characteristic_id="[null]" default_characteristic_id="200" remediation_function="[null]" default_remediation_function="LINEAR" remediation_coeff="[null]" default_remediation_coeff="14min" @@ -13,7 +13,7 @@ <rules_parameters id="1" rule_id="1" name="param1" description="[null]" param_type="STRING"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="old_config_key2" name="old name2" description="old description2" - status="READY" priority="1" cardinality="SINGLE" parent_id="[null]"/> + status="READY" priority="1" cardinality="SINGLE" template_id="[null]"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_parameters-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_parameters-result.xml index e4eb07ec541..4e36cb745d6 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_parameters-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_parameters-result.xml @@ -1,11 +1,11 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="READY" priority="4" cardinality="SINGLE" template_id="[null]" language="java"/> <rules_parameters id="1" rule_id="1" default_value="default value one" description="parameter one" name="param1" param_type="STRING"/> <rules_parameters id="3" rule_id="1" default_value="default value two" description="parameter two" name="param2" param_type="STRING"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two" - status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/> + status="DEPRECATED" priority="0" cardinality="SINGLE" template_id="[null]" language="java"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_parameters.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_parameters.xml index f1037dcb3f5..c990f615639 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_parameters.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_parameters.xml @@ -1,10 +1,10 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="old_config_key" name="old name" description="old description" - status="READY" priority="2" cardinality="SINGLE" parent_id="[null]"/> + status="READY" priority="2" cardinality="SINGLE" template_id="[null]"/> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="old_config_key2" name="old name2" description="old description2" - status="READY" priority="1" cardinality="SINGLE" parent_id="[null]"/> + status="READY" priority="1" cardinality="SINGLE" template_id="[null]"/> <rules_parameters id="1" rule_id="1" name="param1" description="old description" param_type="STRING"/> <rules_parameters id="2" rule_id="1" name="deprecated_param" description="deprecated param to be removed" param_type="STRING"/> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_template_rule_language-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_template_rule_language-result.xml index 0e038147bec..d79778b1570 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_template_rule_language-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_template_rule_language-result.xml @@ -1,7 +1,7 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One" - status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java" + status="READY" priority="4" cardinality="SINGLE" template_id="[null]" language="java" characteristic_id="[null]" default_characteristic_id="100" remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" remediation_coeff="[null]" default_remediation_coeff="5d" @@ -10,7 +10,7 @@ <!-- Instance of old rule 1 :/ --> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="template_rule1" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]" - status="READY" priority="4" cardinality="SINGLE" parent_id="1" language="java" + status="READY" priority="4" cardinality="SINGLE" template_id="1" language="java" characteristic_id="[null]" default_characteristic_id="100" remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" remediation_coeff="[null]" default_remediation_coeff="5d" @@ -18,7 +18,7 @@ effort_to_fix_description="squid.S115.effortToFix" /> <rules tags="[null]" system_tags="[null]" id="3" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two" - status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java" + status="DEPRECATED" priority="0" cardinality="SINGLE" template_id="[null]" language="java" characteristic_id="[null]" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" remediation_coeff="[null]" default_remediation_coeff="[null]" @@ -27,7 +27,7 @@ <!-- Template of old rule 3 :/ --> <rules tags="[null]" system_tags="[null]" id="4" plugin_rule_key="template_rule2" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]" - status="DEPRECATED" priority="4" cardinality="SINGLE" parent_id="3" language="java" + status="DEPRECATED" priority="4" cardinality="SINGLE" template_id="3" language="java" characteristic_id="[null]" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" remediation_coeff="[null]" default_remediation_coeff="[null]" diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_template_rule_language.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_template_rule_language.xml index ef467594087..83933f37e2f 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_template_rule_language.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_template_rule_language.xml @@ -3,7 +3,7 @@ <characteristics id="100" kee="MEMORY_EFFICIENCY" name="Memory Efficiency" parent_id="1" characteristic_order="1" enabled="[true]"/> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="[null]" name="Rule one" description="[null]" - status="READY" priority="4" cardinality="MULTIPLE" parent_id="[null]" language="[null]" + status="READY" priority="4" cardinality="MULTIPLE" template_id="[null]" language="[null]" characteristic_id="[null]" default_characteristic_id="100" remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" remediation_coeff="[null]" default_remediation_coeff="5d" @@ -12,7 +12,7 @@ <!-- Instance of rule 1 --> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="template_rule1" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]" - status="READY" priority="4" cardinality="SINGLE" parent_id="1" language="[null]" + status="READY" priority="4" cardinality="SINGLE" template_id="1" language="[null]" characteristic_id="[null]" default_characteristic_id="200" remediation_function="[null]" default_remediation_function="LINEAR" remediation_coeff="[null]" default_remediation_coeff="1h" @@ -20,7 +20,7 @@ effort_to_fix_description="squid.S115.effortToFix2" /> <rules tags="[null]" system_tags="[null]" id="3" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="old_config_key2" name="old name2" description="old description2" - status="DEPRECATED" priority="1" cardinality="MULTIPLE" parent_id="[null]" + status="DEPRECATED" priority="1" cardinality="MULTIPLE" template_id="[null]" characteristic_id="[null]" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" remediation_coeff="[null]" default_remediation_coeff="[null]" @@ -29,7 +29,7 @@ <!-- Instance of rule 3 --> <rules tags="[null]" system_tags="[null]" id="4" plugin_rule_key="template_rule2" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]" - status="READY" priority="4" cardinality="SINGLE" parent_id="3" + status="READY" priority="4" cardinality="SINGLE" template_id="3" characteristic_id="[null]" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" remediation_coeff="[null]" default_remediation_coeff="[null]" diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/insert-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/insert-result.xml index 0831c35492d..c11e881f027 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/insert-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/insert-result.xml @@ -21,7 +21,7 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="NewRuleKey" plugin_name="plugin" name="new name" description="new description" status="DEPRECATED" - plugin_config_key="NewConfigKey" priority="0" cardinality="MULTIPLE" language="dart" created_at="2013-12-16" updated_at="2013-12-16" parent_id="3" + plugin_config_key="NewConfigKey" priority="0" cardinality="MULTIPLE" language="dart" created_at="2013-12-16" updated_at="2013-12-16" template_id="3" note_data="[null]" note_user_login="[null]" note_created_at="[null]" note_updated_at="[null]" characteristic_id="100" default_characteristic_id="101" remediation_function="LINEAR" default_remediation_function="LINEAR_OFFSET" diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/insert_all-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/insert_all-result.xml index 7001c17804c..c2ecf0d74b2 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/insert_all-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/insert_all-result.xml @@ -21,7 +21,7 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="NewRuleKey" plugin_name="plugin" name="new name" description="new description" status="DEPRECATED" - plugin_config_key="NewConfigKey" priority="0" cardinality="MULTIPLE" language="dart" created_at="2013-12-16" updated_at="2013-12-16" parent_id="3" + plugin_config_key="NewConfigKey" priority="0" cardinality="MULTIPLE" language="dart" created_at="2013-12-16" updated_at="2013-12-16" template_id="3" note_data="[null]" note_user_login="[null]" note_created_at="[null]" note_updated_at="[null]" characteristic_id="100" default_characteristic_id="101" remediation_function="LINEAR" default_remediation_function="LINEAR_OFFSET" @@ -31,7 +31,7 @@ /> <rules tags="[null]" system_tags="[null]" id="2" plugin_rule_key="NewRuleKey2" plugin_name="plugin2" name="new name2" description="new description2" status="BETA" - plugin_config_key="NewConfigKey2" priority="2" cardinality="SINGLE" language="js" created_at="2013-12-16" updated_at="2013-12-16" parent_id="[null]" + plugin_config_key="NewConfigKey2" priority="2" cardinality="SINGLE" language="js" created_at="2013-12-16" updated_at="2013-12-16" template_id="[null]" note_data="[null]" note_user_login="[null]" note_created_at="[null]" note_updated_at="[null]" characteristic_id="102" default_characteristic_id="103" remediation_function="LINEAR_OFFSET" default_remediation_function="LINEAR" diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/insert_parameter-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/insert_parameter-result.xml index 8be83caf941..7a0aaaddef1 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/insert_parameter-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/insert_parameter-result.xml @@ -1,6 +1,6 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="NewRuleKey" plugin_name="plugin" name="new name" description="new description" status="DEPRECATED" - plugin_config_key="NewConfigKey" priority="0" cardinality="MULTIPLE" language="dart" created_at="2013-12-16" updated_at="2013-12-17" parent_id="3" + plugin_config_key="NewConfigKey" priority="0" cardinality="MULTIPLE" language="dart" created_at="2013-12-16" updated_at="2013-12-17" template_id="3" note_data="[null]" note_user_login="[null]" note_created_at="[null]" note_updated_at="[null]" characteristic_id="100" default_characteristic_id="101" remediation_function="linear" default_remediation_function="linear_offset" diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/insert_parameter.xml b/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/insert_parameter.xml index d7ad7e33792..0fb0739a1e5 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/insert_parameter.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/insert_parameter.xml @@ -1,6 +1,6 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="NewRuleKey" plugin_name="plugin" name="new name" description="new description" status="DEPRECATED" - plugin_config_key="NewConfigKey" priority="0" cardinality="MULTIPLE" language="dart" created_at="2013-12-16" updated_at="2013-12-17" parent_id="3" + plugin_config_key="NewConfigKey" priority="0" cardinality="MULTIPLE" language="dart" created_at="2013-12-16" updated_at="2013-12-17" template_id="3" note_data="[null]" note_user_login="[null]" note_created_at="[null]" note_updated_at="[null]" characteristic_id="100" default_characteristic_id="101" remediation_function="linear" default_remediation_function="linear_offset" diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/update-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/update-result.xml index 0c71afe4b9b..53a8892d45e 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/update-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/update-result.xml @@ -1,7 +1,7 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="NewRuleKey" plugin_name="plugin" name="new name" description="new description" status="DEPRECATED" - plugin_config_key="NewConfigKey" priority="0" cardinality="MULTIPLE" language="dart" created_at="2011-04-25 01:05:00" updated_at="2014-01-01" parent_id="3" + plugin_config_key="NewConfigKey" priority="0" cardinality="MULTIPLE" language="dart" created_at="2011-04-25 01:05:00" updated_at="2014-01-01" template_id="3" note_data="My note" note_user_login="admin" note_created_at="2013-12-19" note_updated_at="2013-12-20" characteristic_id="100" default_characteristic_id="101" remediation_function="LINEAR" default_remediation_function="LINEAR_OFFSET" @@ -11,11 +11,11 @@ /> <rules tags="[null]" system_tags="[null]" id="2" 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" updated_at="[null]" parent_id="[null]" + plugin_config_key="Parent1" priority="2" cardinality="SINGLE" language="golo" created_at="1981-10-24 15:20:00" updated_at="[null]" template_id="[null]" note_created_at="[null]" note_data="[null]" note_updated_at="[null]" note_user_login="[null]"/> <rules tags="[null]" system_tags="[null]" id="3" plugin_rule_key="Parent2" plugin_name="checkstyle" name="Parent Rule 2" description="Parent Rule 2" status="READY" - plugin_config_key="Parent2" priority="2" cardinality="SINGLE" language="dart" created_at="1982-12-14 03:15:00" updated_at="[null]" parent_id="[null]" + plugin_config_key="Parent2" priority="2" cardinality="SINGLE" language="dart" created_at="1982-12-14 03:15:00" updated_at="[null]" template_id="[null]" note_created_at="[null]" note_data="[null]" note_updated_at="[null]" note_user_login="[null]"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/update.xml b/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/update.xml index f7f20504f15..ff2d0c693f4 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/update.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/db/RuleDaoTest/update.xml @@ -1,7 +1,7 @@ <dataset> <rules tags="[null]" system_tags="[null]" id="1" plugin_rule_key="AvoidNull" plugin_name="checkstyle" name="Avoid Null" description="Should avoid NULL" status="READY" - plugin_config_key="AvoidNull" priority="2" cardinality="SINGLE" language="golo" created_at="2011-04-25 01:05:00" parent_id="2"/> + plugin_config_key="AvoidNull" priority="2" cardinality="SINGLE" language="golo" created_at="2011-04-25 01:05:00" template_id="2"/> <rules tags="[null]" system_tags="[null]" id="2" 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/startup/CopyRequirementsFromCharacteristicsToRulesTest/convert_constant_issue_with_coeff_to_constant_issue_with_offset.xml b/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/convert_constant_issue_with_coeff_to_constant_issue_with_offset.xml index 8e2d790f22a..82f1cc1c115 100644 --- a/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/convert_constant_issue_with_coeff_to_constant_issue_with_offset.xml +++ b/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/convert_constant_issue_with_coeff_to_constant_issue_with_offset.xml @@ -8,7 +8,7 @@ remediation_offset="[null]" default_remediation_offset="[null]" updated_at="2014-02-19" tags="[null]" system_tags="[null]" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]" /> @@ -20,7 +20,7 @@ remediation_offset="[null]" default_remediation_offset="[null]" updated_at="2014-02-19" tags="[null]" system_tags="[null]" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]" /> @@ -32,7 +32,7 @@ remediation_offset="[null]" default_remediation_offset="5min" updated_at="2014-02-19" tags="[null]" system_tags="[null]" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]" /> diff --git a/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/convert_constant_issue_with_coeff_to_constant_issue_with_offset_result.xml b/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/convert_constant_issue_with_coeff_to_constant_issue_with_offset_result.xml index 6a3fe70ac4e..a5515cbf26c 100644 --- a/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/convert_constant_issue_with_coeff_to_constant_issue_with_offset_result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/convert_constant_issue_with_coeff_to_constant_issue_with_offset_result.xml @@ -8,7 +8,7 @@ remediation_offset="20min" default_remediation_offset="[null]" updated_at="2014-03-13" tags="[null]" system_tags="[null]" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]" /> @@ -20,7 +20,7 @@ remediation_offset="30min" default_remediation_offset="[null]" updated_at="2014-03-13" tags="[null]" system_tags="[null]" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]" /> @@ -32,7 +32,7 @@ remediation_offset="[null]" default_remediation_offset="5min" updated_at="2014-02-19" tags="[null]" system_tags="[null]" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]" /> diff --git a/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/copy_requirements_from_characteristics_to_rules.xml b/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/copy_requirements_from_characteristics_to_rules.xml index 594b202c4a4..8e6279e1b0e 100644 --- a/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/copy_requirements_from_characteristics_to_rules.xml +++ b/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/copy_requirements_from_characteristics_to_rules.xml @@ -6,7 +6,7 @@ remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to a disabled requirement -> Update rule to disable characteristic --> @@ -15,7 +15,7 @@ remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Removed rule linked to a disabled requirement -> Do nothing --> <rules tags="[null]" system_tags="[null]" id="3" plugin_rule_key="CallToFileDeleteOnExitMethod" plugin_name="squid" name="CallToFileDeleteOnExitMethod" description="CallToFileDeleteOnExitMethod" status="REMOVED" @@ -23,7 +23,7 @@ remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement="[null]" with same value of debt -> Nothing to do --> <rules tags="[null]" system_tags="[null]" id="4" plugin_rule_key="ObjectFinalizeOverridenCallsSuperFinalizeCheck" plugin_name="squid" name="ObjectFinalizeOverridenCallsSuperFinalizeCheck" description="super.finalize() should be called at the end of Object.finalize() implementations" status="READY" @@ -31,7 +31,7 @@ remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" remediation_coeff="[null]" default_remediation_coeff="5min" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement="[null]" with different value of debt -> Update rule --> <rules tags="[null]" system_tags="[null]" id="5" plugin_rule_key="RightCurlyBraceStartLineCheck" plugin_name="squid" name="RightCurlyBraceStartLineCheck" description="Right curly braces should be located at the beginning of lines of code" status="READY" @@ -39,7 +39,7 @@ remediation_function="[null]" default_remediation_function="LINEAR" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="[null]" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement on Constant per issue function (with a coefficient of 0d -> to be replaced by null)="[null]" with different value of debt -> Update rule --> <rules tags="[null]" system_tags="[null]" id="6" plugin_rule_key="HiddenFieldCheck" plugin_name="squid" name="HiddenFieldCheck" description="HiddenFieldCheck" status="READY" @@ -47,7 +47,7 @@ remediation_function="[null]" default_remediation_function="LINEAR" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="[null]" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement on Linear function (with a coefficient of 0min -> to be replaced by null)="[null]" with different value of debt -> Update rule --> <rules tags="[null]" system_tags="[null]" id="7" plugin_rule_key="ForLoopCounterChangedCheck" plugin_name="squid" name="ForLoopCounterChangedCheck" description="ForLoopCounterChangedCheck" status="READY" @@ -55,7 +55,7 @@ remediation_function="[null]" default_remediation_function="LINEAR" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="[null]" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement on Linear with offset function (with a offset of 0h -> should be replaced by 0d)="[null]" with different value of debt -> Update rule --> <rules tags="[null]" system_tags="[null]" id="8" plugin_rule_key="ClassVariableVisibilityCheck" plugin_name="squid" name="ClassVariableVisibilityCheck" description="ClassVariableVisibilityCheck" status="READY" @@ -63,7 +63,7 @@ remediation_function="[null]" default_remediation_function="LINEAR" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="[null" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement on Linear function (with a coefficient of 0d -> should keep 0d)="[null]" with different value of debt -> Update rule --> <rules tags="[null]" system_tags="[null]" id="9" plugin_rule_key="SwitchLastCaseIsDefaultCheck" plugin_name="squid" name="SwitchLastCaseIsDefaultCheck" description="SwitchLastCaseIsDefaultCheck" status="READY" @@ -71,7 +71,7 @@ remediation_function="[null]" default_remediation_function="LINEAR" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="[null]" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- No requirement for rule 1 --> diff --git a/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/copy_requirements_from_characteristics_to_rules_result.xml b/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/copy_requirements_from_characteristics_to_rules_result.xml index bc8c7c6d925..db6603d525b 100644 --- a/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/copy_requirements_from_characteristics_to_rules_result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/copy_requirements_from_characteristics_to_rules_result.xml @@ -6,7 +6,7 @@ remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to a disabled requirements -> Update rule to disable characteristic --> @@ -15,7 +15,7 @@ remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-03-13" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Removed rule linked to a disabled requirement -> Do nothing --> <rules tags="[null]" system_tags="[null]" id="3" plugin_rule_key="CallToFileDeleteOnExitMethod" plugin_name="squid" name="CallToFileDeleteOnExitMethod" description="CallToFileDeleteOnExitMethod" status="REMOVED" @@ -23,7 +23,7 @@ remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement, with same value of debt -> Nothing to do --> <rules tags="[null]" system_tags="[null]" id="4" plugin_rule_key="ObjectFinalizeOverridenCallsSuperFinalizeCheck" plugin_name="squid" name="ObjectFinalizeOverridenCallsSuperFinalizeCheck" description="super.finalize() should be called at the end of Object.finalize() implementations" status="READY" @@ -31,7 +31,7 @@ remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" remediation_coeff="[null]" default_remediation_coeff="5min" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement, with different value of debt -> Update rule --> <rules tags="[null]" system_tags="[null]" id="5" plugin_rule_key="RightCurlyBraceStartLineCheck" plugin_name="squid" name="RightCurlyBraceStartLineCheck" description="Right curly braces should be located at the beginning of lines of code" status="READY" @@ -39,7 +39,7 @@ remediation_function="LINEAR_OFFSET" default_remediation_function="LINEAR" remediation_coeff="20min" default_remediation_coeff="5d" remediation_offset="30h" default_remediation_offset="[null]" updated_at="2014-03-13" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement on Constant per issue function (with a coefficient of 0d -> to be replaced by null), with different value of debt -> Update rule --> <rules tags="[null]" system_tags="[null]" id="6" plugin_rule_key="HiddenFieldCheck" plugin_name="squid" name="HiddenFieldCheck" description="HiddenFieldCheck" status="READY" @@ -47,7 +47,7 @@ remediation_function="CONSTANT_ISSUE" default_remediation_function="LINEAR" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="15min" default_remediation_offset="[null]" updated_at="2014-03-13" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement on Linear function (with a coefficient of 0min -> to be replaced by null), with different value of debt -> Update rule --> <rules tags="[null]" system_tags="[null]" id="7" plugin_rule_key="ForLoopCounterChangedCheck" plugin_name="squid" name="ForLoopCounterChangedCheck" description="ForLoopCounterChangedCheck" status="READY" @@ -55,7 +55,7 @@ remediation_function="LINEAR" default_remediation_function="LINEAR" remediation_coeff="0min" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="[null]" updated_at="2014-03-13" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement on Linear with offset function (with a offset of 0h -> should keep 0h), with different value of debt -> Update rule --> <rules tags="[null]" system_tags="[null]" id="8" plugin_rule_key="ClassVariableVisibilityCheck" plugin_name="squid" name="ClassVariableVisibilityCheck" description="ClassVariableVisibilityCheck" status="READY" @@ -63,7 +63,7 @@ remediation_function="LINEAR_OFFSET" default_remediation_function="LINEAR" remediation_coeff="5d" default_remediation_coeff="5d" remediation_offset="0h" default_remediation_offset="[null" updated_at="2014-03-13" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement on Linear function (with a coefficient of 0d -> should keep 0d), with different value of debt -> Update rule --> <rules tags="[null]" system_tags="[null]" id="9" plugin_rule_key="SwitchLastCaseIsDefaultCheck" plugin_name="squid" name="SwitchLastCaseIsDefaultCheck" description="SwitchLastCaseIsDefaultCheck" status="READY" @@ -71,7 +71,7 @@ remediation_function="LINEAR" default_remediation_function="LINEAR" remediation_coeff="0d" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="[null]" updated_at="2014-03-13" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <loaded_templates id="1" kee="CopyRequirementsFromCharacteristicsToRules" template_type="ONE_SHOT_TASK"/> diff --git a/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/do_nothing_when_already_executed.xml b/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/do_nothing_when_already_executed.xml index ec71824d7b8..461157ade19 100644 --- a/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/do_nothing_when_already_executed.xml +++ b/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/do_nothing_when_already_executed.xml @@ -9,7 +9,7 @@ remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to a disabled requirement -> Update rule to disable characteristic --> @@ -18,7 +18,7 @@ remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Removed rule linked to a disabled requirement -> Do nothing --> <rules tags="[null]" system_tags="[null]" id="3" plugin_rule_key="CallToFileDeleteOnExitMethod" plugin_name="squid" name="CallToFileDeleteOnExitMethod" description="CallToFileDeleteOnExitMethod" status="REMOVED" @@ -26,7 +26,7 @@ remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement="[null]" with same value of debt -> Nothing to do --> <rules tags="[null]" system_tags="[null]" id="4" plugin_rule_key="ObjectFinalizeOverridenCallsSuperFinalizeCheck" plugin_name="squid" name="ObjectFinalizeOverridenCallsSuperFinalizeCheck" description="super.finalize() should be called at the end of Object.finalize() implementations" status="READY" @@ -34,7 +34,7 @@ remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" remediation_coeff="[null]" default_remediation_coeff="5min" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement="[null]" with different value of debt -> Update rule --> <rules tags="[null]" system_tags="[null]" id="5" plugin_rule_key="RightCurlyBraceStartLineCheck" plugin_name="squid" name="RightCurlyBraceStartLineCheck" description="Right curly braces should be located at the beginning of lines of code" status="READY" @@ -42,7 +42,7 @@ remediation_function="[null]" default_remediation_function="LINEAR" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="[null]" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement on Constant per issue function (with a coefficient of 0d -> to be replaced by null)="[null]" with different value of debt -> Update rule --> <rules tags="[null]" system_tags="[null]" id="6" plugin_rule_key="HiddenFieldCheck" plugin_name="squid" name="HiddenFieldCheck" description="HiddenFieldCheck" status="READY" @@ -50,7 +50,7 @@ remediation_function="[null]" default_remediation_function="LINEAR" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="[null]" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement on Linear function (with a coefficient of 0min -> to be replaced by null)="[null]" with different value of debt -> Update rule --> <rules tags="[null]" system_tags="[null]" id="7" plugin_rule_key="ForLoopCounterChangedCheck" plugin_name="squid" name="ForLoopCounterChangedCheck" description="ForLoopCounterChangedCheck" status="READY" @@ -58,7 +58,7 @@ remediation_function="[null]" default_remediation_function="LINEAR" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="[null]" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement on Linear with offset function (with a offset of 0h -> should be replaced by 0d)="[null]" with different value of debt -> Update rule --> <rules tags="[null]" system_tags="[null]" id="8" plugin_rule_key="ClassVariableVisibilityCheck" plugin_name="squid" name="ClassVariableVisibilityCheck" description="ClassVariableVisibilityCheck" status="READY" @@ -66,7 +66,7 @@ remediation_function="[null]" default_remediation_function="LINEAR" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="[null" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement on Linear function (with a coefficient of 0d -> should keep 0d)="[null]" with different value of debt -> Update rule --> <rules tags="[null]" system_tags="[null]" id="9" plugin_rule_key="SwitchLastCaseIsDefaultCheck" plugin_name="squid" name="SwitchLastCaseIsDefaultCheck" description="SwitchLastCaseIsDefaultCheck" status="READY" @@ -74,7 +74,7 @@ remediation_function="[null]" default_remediation_function="LINEAR" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="[null]" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- No requirement for rule 1 --> diff --git a/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/do_nothing_when_already_executed_result.xml b/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/do_nothing_when_already_executed_result.xml index 594b202c4a4..8e6279e1b0e 100644 --- a/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/do_nothing_when_already_executed_result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/do_nothing_when_already_executed_result.xml @@ -6,7 +6,7 @@ remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to a disabled requirement -> Update rule to disable characteristic --> @@ -15,7 +15,7 @@ remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Removed rule linked to a disabled requirement -> Do nothing --> <rules tags="[null]" system_tags="[null]" id="3" plugin_rule_key="CallToFileDeleteOnExitMethod" plugin_name="squid" name="CallToFileDeleteOnExitMethod" description="CallToFileDeleteOnExitMethod" status="REMOVED" @@ -23,7 +23,7 @@ remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement="[null]" with same value of debt -> Nothing to do --> <rules tags="[null]" system_tags="[null]" id="4" plugin_rule_key="ObjectFinalizeOverridenCallsSuperFinalizeCheck" plugin_name="squid" name="ObjectFinalizeOverridenCallsSuperFinalizeCheck" description="super.finalize() should be called at the end of Object.finalize() implementations" status="READY" @@ -31,7 +31,7 @@ remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" remediation_coeff="[null]" default_remediation_coeff="5min" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement="[null]" with different value of debt -> Update rule --> <rules tags="[null]" system_tags="[null]" id="5" plugin_rule_key="RightCurlyBraceStartLineCheck" plugin_name="squid" name="RightCurlyBraceStartLineCheck" description="Right curly braces should be located at the beginning of lines of code" status="READY" @@ -39,7 +39,7 @@ remediation_function="[null]" default_remediation_function="LINEAR" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="[null]" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement on Constant per issue function (with a coefficient of 0d -> to be replaced by null)="[null]" with different value of debt -> Update rule --> <rules tags="[null]" system_tags="[null]" id="6" plugin_rule_key="HiddenFieldCheck" plugin_name="squid" name="HiddenFieldCheck" description="HiddenFieldCheck" status="READY" @@ -47,7 +47,7 @@ remediation_function="[null]" default_remediation_function="LINEAR" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="[null]" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement on Linear function (with a coefficient of 0min -> to be replaced by null)="[null]" with different value of debt -> Update rule --> <rules tags="[null]" system_tags="[null]" id="7" plugin_rule_key="ForLoopCounterChangedCheck" plugin_name="squid" name="ForLoopCounterChangedCheck" description="ForLoopCounterChangedCheck" status="READY" @@ -55,7 +55,7 @@ remediation_function="[null]" default_remediation_function="LINEAR" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="[null]" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement on Linear with offset function (with a offset of 0h -> should be replaced by 0d)="[null]" with different value of debt -> Update rule --> <rules tags="[null]" system_tags="[null]" id="8" plugin_rule_key="ClassVariableVisibilityCheck" plugin_name="squid" name="ClassVariableVisibilityCheck" description="ClassVariableVisibilityCheck" status="READY" @@ -63,7 +63,7 @@ remediation_function="[null]" default_remediation_function="LINEAR" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="[null" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- Rule linked to one enable requirement on Linear function (with a coefficient of 0d -> should keep 0d)="[null]" with different value of debt -> Update rule --> <rules tags="[null]" system_tags="[null]" id="9" plugin_rule_key="SwitchLastCaseIsDefaultCheck" plugin_name="squid" name="SwitchLastCaseIsDefaultCheck" description="SwitchLastCaseIsDefaultCheck" status="READY" @@ -71,7 +71,7 @@ remediation_function="[null]" default_remediation_function="LINEAR" remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="[null]" updated_at="2014-02-19" - NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" PARENT_ID="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> + NOTE_CREATED_AT="[null]" NOTE_DATA="[null]" NOTE_UPDATED_AT="[null]" NOTE_USER_LOGIN="[null]" template_id="[null]" PLUGIN_CONFIG_KEY="[null]" PRIORITY="[null]" cardinality="[null]" created_at="[null]" language="[null]" effort_to_fix_description="[null]"/> <!-- No requirement for rule 1 --> |