diff options
Diffstat (limited to 'sonar-core/src')
13 files changed, 17 insertions, 50 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 3c58a5b8187..e35b9cacb74 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 @@ -35,7 +35,7 @@ import java.util.List; */ public class DatabaseVersion implements BatchComponent, ServerComponent { - public static final int LAST_VERSION = 333; + public static final int LAST_VERSION = 335; public static enum Status { UP_TO_DATE, REQUIRES_UPGRADE, REQUIRES_DOWNGRADE, FRESH_INSTALL diff --git a/sonar-core/src/main/java/org/sonar/core/template/LoadedTemplateDto.java b/sonar-core/src/main/java/org/sonar/core/template/LoadedTemplateDto.java index eb6d4ef3205..3f6ecbb1663 100644 --- a/sonar-core/src/main/java/org/sonar/core/template/LoadedTemplateDto.java +++ b/sonar-core/src/main/java/org/sonar/core/template/LoadedTemplateDto.java @@ -25,6 +25,7 @@ public final class LoadedTemplateDto { public static final String DASHBOARD_TYPE = "DASHBOARD"; public static final String FILTER_TYPE = "FILTER"; + public static final String QUALITY_PROFILE_TYPE = "QUALITY_PROFILE"; private Long id; private String key; diff --git a/sonar-core/src/main/java/org/sonar/jpa/dao/ProfilesDao.java b/sonar-core/src/main/java/org/sonar/jpa/dao/ProfilesDao.java index 40ab93b9cbe..84a1606dfc6 100644 --- a/sonar-core/src/main/java/org/sonar/jpa/dao/ProfilesDao.java +++ b/sonar-core/src/main/java/org/sonar/jpa/dao/ProfilesDao.java @@ -28,10 +28,6 @@ public class ProfilesDao extends BaseDao { super(session); } - public RulesProfile getDefaultProfile(String languageKey) { - return getSession().getSingleResult(RulesProfile.class, "defaultProfile", true, "language", languageKey); - } - public RulesProfile getProfile(String languageKey, String profileName) { return getSession().getSingleResult(RulesProfile.class, "language", languageKey, "name", profileName); } 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 cec3ca8ecf6..9b69e992007 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 @@ -175,6 +175,8 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('330'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('331'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('332'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('333'); +INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('334'); +INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('335'); 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 9bdff3635cf..05ecbdbe0a0 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 @@ -67,8 +67,6 @@ CREATE TABLE "RULES_PARAMETERS" ( CREATE TABLE "RULES_PROFILES" ( "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), "NAME" VARCHAR(100) NOT NULL, - "DEFAULT_PROFILE" BOOLEAN DEFAULT FALSE, - "PROVIDED" BOOLEAN NOT NULL DEFAULT FALSE, "LANGUAGE" VARCHAR(20), "PARENT_NAME" VARCHAR(100), "VERSION" INTEGER DEFAULT 1, diff --git a/sonar-core/src/test/java/org/sonar/jpa/dao/ProfilesDaoTest.java b/sonar-core/src/test/java/org/sonar/jpa/dao/ProfilesDaoTest.java index 01f7310fca0..10aa05db371 100644 --- a/sonar-core/src/test/java/org/sonar/jpa/dao/ProfilesDaoTest.java +++ b/sonar-core/src/test/java/org/sonar/jpa/dao/ProfilesDaoTest.java @@ -43,16 +43,4 @@ public class ProfilesDaoTest extends AbstractDbUnitTestCase { assertThat(profilesDao.getProfile("unknown language", "my profile")).isNull(); assertThat(profilesDao.getProfile("java", "my profile").getName()).isEqualTo("my profile"); } - - @Test - public void should_get_default_profile() { - RulesProfile defaultProfile = RulesProfile.create("default profile", "java"); - defaultProfile.setDefaultProfile(true); - RulesProfile otherProfile = RulesProfile.create("other profile", "java"); - otherProfile.setDefaultProfile(false); - getSession().save(defaultProfile, otherProfile); - - assertThat(profilesDao.getDefaultProfile("java").getName()).isEqualTo("default profile"); - } - } diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/ExtensionDaoTest/shared.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/ExtensionDaoTest/shared.xml deleted file mode 100644 index a369c467f68..00000000000 --- a/sonar-core/src/test/resources/org/sonar/jpa/dao/ExtensionDaoTest/shared.xml +++ /dev/null @@ -1,18 +0,0 @@ -<dataset> - - <!-- plugins --> - <extensions id="1" plugin_key="checkstyle" extension_type="PLUGIN" version="1.0" - name="Checkstyle" filename="sonar-checkstyle-plugin.jar" plugin_class="[null]" - description="Checkstyle Plugin" organization="SonarSource" organization_url="[null]" license="LGPL" installation_date="[null]" - core="true" /> - - <extensions id="2" plugin_key="pmd" extension_type="PLUGIN" version="1.1" - name="PMD" filename="sonar-pmd-plugin.jar" installation_date="[null]" plugin_class="[null]" - description="PMD Plugin" organization="SonarSource" organization_url="[null]" license="LGPL" - core="true" /> - - <!-- plugin extensions --> - <extensions id="3" plugin_key="checkstyle" extension_type="PLUGIN_EXTENSION" version="[null]" - name="my_checkstyle_rules.jar" filename="my_checkstyle_rules.jar" installation_date="[null]" plugin_class="[null]" - description="[null]" organization="[null]" organization_url="[null]" license="[null]" core="[null]" /> -</dataset>
\ No newline at end of file diff --git a/sonar-core/src/test/resources/org/sonar/jpa/dao/ProfilesDaoTest/shouldGetProfiles.xml b/sonar-core/src/test/resources/org/sonar/jpa/dao/ProfilesDaoTest/shouldGetProfiles.xml index ed2f97ee294..76d05bc4995 100644 --- a/sonar-core/src/test/resources/org/sonar/jpa/dao/ProfilesDaoTest/shouldGetProfiles.xml +++ b/sonar-core/src/test/resources/org/sonar/jpa/dao/ProfilesDaoTest/shouldGetProfiles.xml @@ -1,7 +1,7 @@ <dataset> - <rules_profiles id="1" provided="true" name="profile one" default_profile="0" language="java"/> - <rules_profiles id="2" provided="true" name="profile two" default_profile="0" language="java"/> - <rules_profiles id="3" provided="true" name="profile three" default_profile="0" language="plsql"/> + <rules_profiles id="1" name="profile one" language="java"/> + <rules_profiles id="2" name="profile two" language="java"/> + <rules_profiles id="3" name="profile three" language="plsql"/> </dataset>
\ No newline at end of file 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 98922f49cc0..ed307037a07 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 @@ -6,8 +6,8 @@ <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" provided="true" name="profile1" default_profile="1" language="java"/> - <rules_profiles id="2" provided="true" name="profile2" default_profile="1" language="OTHER"/> + <rules_profiles id="1" name="profile1" language="java"/> + <rules_profiles id="2" name="profile2" language="OTHER"/> <active_rules id="1" profile_id="1" rule_id="1" failure_level="2"/> <active_rules id="2" profile_id="2" rule_id="1" failure_level="2"/> 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 8bedbeca82b..542bb36611b 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 @@ -6,8 +6,8 @@ <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" provided="true" name="profile1" default_profile="1" language="java"/> - <rules_profiles id="2" provided="true" name="profile2" default_profile="1" language="OTHER"/> + <rules_profiles id="1" name="profile1" language="java"/> + <rules_profiles id="2" name="profile2" language="OTHER"/> <active_rules id="1" profile_id="1" rule_id="1" failure_level="2"/> <active_rules id="2" profile_id="2" rule_id="1" failure_level="2"/> 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 489fca92c1b..f96135d6b0d 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 @@ -1,7 +1,7 @@ <dataset> - <rules_profiles id="1" provided="true" name="profile one" default_profile="1" language="java"/> - <rules_profiles id="2" provided="true" name="profile two" default_profile="0" language="java"/> + <rules_profiles id="1" name="profile one" language="java"/> + <rules_profiles id="2" name="profile two" language="java"/> <rules id="1" name="foo" description="test" plugin_config_key="checker/foo" plugin_rule_key="checkstyle.rule1" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/> 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 00226391488..83b241727b8 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 @@ -1,7 +1,7 @@ <dataset> - <rules_profiles id="1" provided="true" name="profile one" default_profile="1" language="java" /> - <rules_profiles id="2" provided="true" name="profile two" default_profile="0" language="java" /> + <rules_profiles id="1" name="profile one" language="java" /> + <rules_profiles id="2" name="profile two" language="java" /> <rules id="1" name="foo" description="test" plugin_config_key="checker/foo" plugin_rule_key="checkstyle.rule1" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/> 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 d0334e987f0..3a2d467806e 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 @@ -1,7 +1,7 @@ <dataset> - <rules_profiles id="1" provided="true" name="profile one" default_profile="1" language="java" /> - <rules_profiles id="2" provided="true" name="profile two" default_profile="0" language="java" /> + <rules_profiles id="1" name="profile one" language="java" /> + <rules_profiles id="2" name="profile two" language="java" /> <rules id="1" name="foo" description="test" plugin_config_key="checker/foo" plugin_rule_key="checkstyle.rule1" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/> |