diff options
Diffstat (limited to 'sonar-core')
25 files changed, 118 insertions, 174 deletions
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 0a449c778c4..e873c66cd80 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 = 551; + public static final int LAST_VERSION = 553; public static enum Status { UP_TO_DATE, REQUIRES_UPGRADE, REQUIRES_DOWNGRADE, FRESH_INSTALL diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/migration/v44/Migration44Mapper.java b/sonar-core/src/main/java/org/sonar/core/persistence/migration/v44/Migration44Mapper.java index 2a514ff2d54..d27b8c95c4e 100644 --- a/sonar-core/src/main/java/org/sonar/core/persistence/migration/v44/Migration44Mapper.java +++ b/sonar-core/src/main/java/org/sonar/core/persistence/migration/v44/Migration44Mapper.java @@ -30,12 +30,13 @@ public interface Migration44Mapper { // migration of measures "profile" and "profile_version" List<ProfileMeasure> selectProfileMeasures(); int selectProfileVersion(long snapshotId); - @CheckForNull Date selectProfileVersionDate(@Param("profileId") long profileId, @Param("profileVersion") int profileVersion); + @CheckForNull Date selectProfileVersionDate(@Param("profileId") int profileId, @Param("profileVersion") int profileVersion); void updateProfileMeasure(@Param("measureId") long measureId, @Param("json") String json); // creation of columns RULES_PROFILES.CREATED_AT and UPDATED_AT - @CheckForNull Date selectProfileCreatedAt(long profileId); - @CheckForNull Date selectProfileUpdatedAt(long profileId); + @CheckForNull Date selectProfileCreatedAt(int profileId); + @CheckForNull Date selectProfileUpdatedAt(int profileId); + void updateProfileDates(@Param("profileId") int profileId, @Param("createdAt") Date createdAt, @Param("updatedAt") Date updatedAt); // migrate changeLog to Activities List<ChangeLog> selectActiveRuleChange(@Param("enabled") Boolean enabled); diff --git a/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileDto.java b/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileDto.java index 992b8a7f57a..bc7224a5fc3 100644 --- a/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileDto.java +++ b/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileDto.java @@ -24,6 +24,7 @@ import org.sonar.core.persistence.Dto; import javax.annotation.CheckForNull; import javax.annotation.Nullable; +import java.util.Date; public class QualityProfileDto extends Dto<String> { @@ -32,6 +33,7 @@ public class QualityProfileDto extends Dto<String> { private String name; private String language; private String parentKee; + private Date createdAt, updatedAt, rulesUpdatedAt; /** * @deprecated use {@link #createFor(String)} @@ -96,6 +98,22 @@ public class QualityProfileDto extends Dto<String> { return this; } + public Date getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + + public Date getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(Date updatedAt) { + this.updatedAt = updatedAt; + } + public static QualityProfileDto createFor(String key) { return new QualityProfileDto().setKee(key); } diff --git a/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileMapper.java b/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileMapper.java index 3acfe871727..cef07f9a24a 100644 --- a/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileMapper.java +++ b/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileMapper.java @@ -33,7 +33,7 @@ public interface QualityProfileMapper { void update(QualityProfileDto dto); - void delete(Integer id); + void delete(int id); List<QualityProfileDto> selectAll(); diff --git a/sonar-core/src/main/resources/org/sonar/core/persistence/migration/v44/Migration44Mapper.xml b/sonar-core/src/main/resources/org/sonar/core/persistence/migration/v44/Migration44Mapper.xml index 150df88078d..4484a1111e6 100644 --- a/sonar-core/src/main/resources/org/sonar/core/persistence/migration/v44/Migration44Mapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/persistence/migration/v44/Migration44Mapper.xml @@ -29,16 +29,22 @@ where id=#{measureId} </update> - <select id="selectProfileUpdateAt" resultType="date" parameterType="long"> + <select id="selectProfileUpdatedAt" resultType="date" parameterType="int"> select max(change_date) from active_rule_changes where profile_id=#{id} </select> - <select id="selectProfileCreatedAt" resultType="date" parameterType="long"> + <select id="selectProfileCreatedAt" resultType="date" parameterType="int"> select min(change_date) from active_rule_changes where profile_id=#{id} </select> + <update id="updateProfileDates" parameterType="map"> + update rules_profiles + set created_at=#{createdAt}, updated_at=#{updatedAt}, rules_updated_at=#{updatedAt} + where id=#{profileId} + </update> + <select id="selectActiveRuleChange" parameterType="Boolean" resultType="org.sonar.core.persistence.migration.v44.ChangeLog"> select 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 8b36b94db46..0485e75a976 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 @@ -244,6 +244,8 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('547'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('548'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('549'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('551'); +INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('552'); +INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('553'); 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 3d5c02849c5..bea3a332c62 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 @@ -50,7 +50,10 @@ CREATE TABLE "RULES_PROFILES" ( "NAME" VARCHAR(100) NOT NULL, "LANGUAGE" VARCHAR(20), "KEE" VARCHAR(1000) NOT NULL, - "PARENT_KEE" VARCHAR(1000) + "PARENT_KEE" VARCHAR(1000), + "RULES_UPDATED_AT" TIMESTAMP, + "CREATED_AT" TIMESTAMP, + "UPDATED_AT" TIMESTAMP ); CREATE TABLE "WIDGETS" ( diff --git a/sonar-core/src/test/java/org/sonar/core/persistence/migration/v44/ProfileMeasureTest.java b/sonar-core/src/test/java/org/sonar/core/persistence/migration/v44/ProfileMeasureTest.java new file mode 100644 index 00000000000..9e315051569 --- /dev/null +++ b/sonar-core/src/test/java/org/sonar/core/persistence/migration/v44/ProfileMeasureTest.java @@ -0,0 +1,37 @@ +/* + * 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. + */ +package org.sonar.core.persistence.migration.v44; + +import org.junit.Test; + +import static com.google.code.beanmatchers.BeanMatchers.*; +import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.MatcherAssert.assertThat; + +public class ProfileMeasureTest { + + @Test + public void getId() throws Exception { + assertThat(ProfileMeasure.class, allOf( + hasValidBeanConstructor(), + hasValidGettersAndSetters() + )); + } +} diff --git a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/delete-result.xml b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/delete-result.xml index fb2afaf6b07..f8ed2f0f6fb 100644 --- a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/delete-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/delete-result.xml @@ -1,5 +1,6 @@ <dataset> - <rules_profiles id="2" name="Sonar Way" language="js" parent_kee="[null]" kee="js_sonar_way"/> + <rules_profiles id="2" name="Sonar Way" language="js" parent_kee="[null]" kee="js_sonar_way" + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/inheritance.xml b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/inheritance.xml index 6936254ea4b..85979c32a29 100644 --- a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/inheritance.xml +++ b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/inheritance.xml @@ -1,17 +1,23 @@ <dataset> - <rules_profiles id="1" name="Child1" language="java" parent_kee="java_parent" kee="java_child1"/> + <rules_profiles id="1" name="Child1" language="java" parent_kee="java_parent" kee="java_child1" + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> - <rules_profiles id="2" name="Child2" language="java" parent_kee="java_parent" kee="java_child2"/> + <rules_profiles id="2" name="Child2" language="java" parent_kee="java_parent" kee="java_child2" + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> - <rules_profiles id="3" name="Parent" language="java" parent_kee="[null]" kee="java_parent"/> + <rules_profiles id="3" name="Parent" language="java" parent_kee="[null]" kee="java_parent" + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> <!-- Same profile for another language --> - <rules_profiles id="4" name="Child1" language="js" parent_kee="js_parent" kee="js_child1"/> + <rules_profiles id="4" name="Child1" language="js" parent_kee="js_parent" kee="js_child1" + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> - <rules_profiles id="5" name="Child2" language="js" parent_kee="js_parent" kee="js_child2"/> + <rules_profiles id="5" name="Child2" language="js" parent_kee="js_parent" kee="js_child2" + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> - <rules_profiles id="6" name="Parent" language="js" parent_kee="[null]" kee="js_parent"/> + <rules_profiles id="6" name="Parent" language="js" parent_kee="[null]" kee="js_parent" + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/insert-result.xml b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/insert-result.xml index 2e66e8d4e86..ee041878cd8 100644 --- a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/insert-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/insert-result.xml @@ -1,10 +1,13 @@ <dataset> - <rules_profiles id="1" name="Sonar Way" language="java" parent_kee="[null]" kee="java_sonar_way"/> + <rules_profiles id="1" name="Sonar Way" language="java" parent_kee="[null]" kee="java_sonar_way" + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> - <rules_profiles id="2" name="Sonar Way" language="js" parent_kee="[null]" kee="js_sonar_way"/> + <rules_profiles id="2" name="Sonar Way" language="js" parent_kee="[null]" kee="js_sonar_way" + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> - <rules_profiles id="3" name="ABCDE" language="xoo" parent_kee="[null]" kee="abcde"/> + <rules_profiles id="3" name="ABCDE" language="xoo" parent_kee="[null]" kee="abcde" + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/projects.xml b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/projects.xml index 9cda0691474..a380d4288a7 100644 --- a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/projects.xml +++ b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/projects.xml @@ -1,7 +1,9 @@ <dataset> - <rules_profiles id="1" name="Sonar Way" language="java" parent_kee="[null]" kee="java_sonar_way"/> - <rules_profiles id="2" name="Sonar Way" language="js" parent_kee="[null]" kee="js_sonar_way"/> + <rules_profiles id="1" name="Sonar Way" language="java" parent_kee="[null]" kee="java_sonar_way" + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> + <rules_profiles id="2" name="Sonar Way" language="js" parent_kee="[null]" kee="js_sonar_way" + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> <projects id="1" kee="org.codehaus.sonar:sonar" name="SonarQube"/> <projects id="2" kee="org.codehaus.sonar-plugins.java:java" name="SonarQube Java"/> diff --git a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/select_all_is_sorted_by_profile_name.xml b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/select_all_is_sorted_by_profile_name.xml index d43fbf5aa4d..eb5e56d0517 100644 --- a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/select_all_is_sorted_by_profile_name.xml +++ b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/select_all_is_sorted_by_profile_name.xml @@ -1,10 +1,13 @@ <dataset> - <rules_profiles id="3" name="Third" language="js" parent_kee="[null]" kee="js_third"/> + <rules_profiles id="3" name="Third" language="js" parent_kee="[null]" kee="js_third" + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> - <rules_profiles id="1" name="First" language="js" parent_kee="[null]" kee="js_first"/> + <rules_profiles id="1" name="First" language="js" parent_kee="[null]" kee="js_first" + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> - <rules_profiles id="2" name="Second" language="js" parent_kee="[null]" kee="js_second"/> + <rules_profiles id="2" name="Second" language="js" parent_kee="[null]" kee="js_second" + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/select_by_language.xml b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/select_by_language.xml index 552995b1dfb..b3313d41784 100644 --- a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/select_by_language.xml +++ b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/select_by_language.xml @@ -1,10 +1,12 @@ <dataset> - <rules_profiles id="1" name="Sonar Way 1" language="java" parent_kee="[null]" kee="java_sonar_way"/> + <rules_profiles id="1" name="Sonar Way 1" language="java" parent_kee="[null]" kee="java_sonar_way" + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> <rules_profiles id="2" name="Sonar Way" language="js" parent_kee="[null]" kee="js_sonar_way" - used_profile="[false]"/> + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> - <rules_profiles id="3" name="Sonar Way 2" language="java" parent_kee="[null]" kee="java_sonar_way2"/> + <rules_profiles id="3" name="Sonar Way 2" language="java" parent_kee="[null]" kee="java_sonar_way2" + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/shared.xml b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/shared.xml index bfa61fc45bc..9cb3d667d5f 100644 --- a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/shared.xml +++ b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/shared.xml @@ -1,8 +1,10 @@ <dataset> - <rules_profiles id="1" name="Sonar Way" language="java" parent_kee="[null]" kee="java_sonar_way"/> + <rules_profiles id="1" name="Sonar Way" language="java" parent_kee="[null]" kee="java_sonar_way" + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> - <rules_profiles id="2" name="Sonar Way" language="js" parent_kee="[null]" kee="js_sonar_way"/> + <rules_profiles id="2" name="Sonar Way" language="js" parent_kee="[null]" kee="js_sonar_way" + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> <properties id="1" prop_key="sonar.profile.java" text_value="Sonar Way" resource_id="[null]"/> <properties id="2" prop_key="sonar.profile.java" text_value="Sonar Way" resource_id="1"/> diff --git a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/update-result.xml b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/update-result.xml index e2455348891..9ec70d75713 100644 --- a/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/update-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/qualityprofile/db/QualityProfileDaoTest/update-result.xml @@ -1,8 +1,10 @@ <dataset> - <rules_profiles id="1" name="New Name" language="js" parent_kee="fghij" kee="java_sonar_way"/> + <rules_profiles id="1" name="New Name" language="js" parent_kee="fghij" kee="java_sonar_way" + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> - <rules_profiles id="2" name="Sonar Way" language="js" parent_kee="[null]" kee="js_sonar_way"/> + <rules_profiles id="2" name="Sonar Way" language="js" parent_kee="[null]" kee="js_sonar_way" + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> </dataset> 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 deleted file mode 100644 index 43f9ba1217a..00000000000 --- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldCountNumberOfRulesOfACategoryForGivenPlugins.xml +++ /dev/null @@ -1,14 +0,0 @@ -<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" is_template="[false]" 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" is_template="[false]" 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" is_template="[false]" 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" is_template="[false]" 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 deleted file mode 100644 index c9466ae8605..00000000000 --- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter-result.xml +++ /dev/null @@ -1,20 +0,0 @@ -<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" is_template="[false]" 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"/> - - <rules_profiles id="1" name="profile1" language="java"/> - <rules_profiles id="2" name="profile2" language="OTHER"/> - - <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="2" rule_id="1" failure_level="2"/> - - <!-- deleted --> - <!--<active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" value="20"/>--> - <!--<active_rule_parameters id="2" active_rule_id="2" rules_parameter_id="1" value="15"/>--> - <active_rule_parameters id="3" active_rule_id="2" rules_parameter_id="2" value="15"/> - -</dataset> 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 deleted file mode 100644 index 09b9dc73691..00000000000 --- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter.xml +++ /dev/null @@ -1,19 +0,0 @@ -<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" is_template="[false]" 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"/> - - <rules_profiles id="1" name="profile1" language="java"/> - <rules_profiles id="2" name="profile2" language="OTHER"/> - - <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="2" rule_id="1" failure_level="2"/> - - <active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" value="20"/> - <active_rule_parameters id="2" active_rule_id="2" rules_parameter_id="1" value="15"/> - <active_rule_parameters id="3" active_rule_id="2" rules_parameter_id="2" value="15"/> - -</dataset> 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 deleted file mode 100644 index 8beeb398505..00000000000 --- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules-result.xml +++ /dev/null @@ -1,17 +0,0 @@ -<dataset> - - <rules_profiles id="1" name="profile one" language="java"/> - <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" is_template="[false]" 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" is_template="[false]" 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" is_template="[false]" 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"/> - <active_rules created_at="[null]" updated_at="[null]" id="3" profile_id="1" rule_id="3" failure_level="2"/> - -</dataset> 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 deleted file mode 100644 index 8174c814f69..00000000000 --- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules.xml +++ /dev/null @@ -1,21 +0,0 @@ -<dataset> - - <rules_profiles id="1" name="profile one" language="java" /> - <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" is_template="[false]" 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" is_template="[false]" 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" is_template="[false]" 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"/> - <active_rules created_at="[null]" updated_at="[null]" id="3" profile_id="1" rule_id="3" failure_level="2"/> - - <active_rules created_at="[null]" updated_at="[null]" id="4" profile_id="2" rule_id="1" failure_level="2"/> - <active_rules created_at="[null]" updated_at="[null]" id="5" profile_id="2" rule_id="2" failure_level="2"/> - <active_rules created_at="[null]" updated_at="[null]" id="6" profile_id="2" rule_id="3" failure_level="2"/> - -</dataset> 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 deleted file mode 100644 index db8f5e55045..00000000000 --- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetActiveRules.xml +++ /dev/null @@ -1,17 +0,0 @@ -<dataset> - - <rules_profiles id="1" name="profile one" language="java" /> - <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" is_template="[false]" 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" is_template="[false]" 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" is_template="[false]" 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"/> - <active_rules created_at="[null]" updated_at="[null]" id="3" profile_id="1" rule_id="3" failure_level="2"/> - -</dataset> 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 deleted file mode 100644 index 320cd40bc85..00000000000 --- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleParams.xml +++ /dev/null @@ -1,17 +0,0 @@ -<dataset> - - <!-- 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" is_template="[false]" 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" is_template="[false]" template_id="[null]"/> - - <!-- Rules parameters --> - <rules_parameters id="1" rule_id="1" name="rule1_param1" description="rule1_desc1" param_type="REGULAR_EXPRESSION" - /> - <rules_parameters id="2" rule_id="1" name="rule1_param2" description="rule1_desc2" param_type="REGULAR_EXPRESSION" - /> - <rules_parameters id="3" rule_id="2" name="rule2_param1" description="rule2_desc1" param_type="REGULAR_EXPRESSION" - /> - -</dataset> 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 deleted file mode 100644 index 5aa92b98b74..00000000000 --- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRuleWithRuleKeyAndPluginKey.xml +++ /dev/null @@ -1,6 +0,0 @@ -<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" is_template="[false]" 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 deleted file mode 100644 index e1fc3119b24..00000000000 --- a/sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetRules.xml +++ /dev/null @@ -1,13 +0,0 @@ -<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" is_template="[false]" 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" is_template="[false]" template_id="[null]"/> - - <rules_parameters id="1" rule_id="1" name="rule1_param1" description="rule1_desc1" param_type="REGULAR_EXPRESSION" - /> - <rules_parameters id="2" rule_id="2" name="rule2_param1" description="rule2_desc1" param_type="REGULAR_EXPRESSION" - /> - -</dataset> |