]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2602 remove the unused column RULES_PROFILES.ENABLED
authorSimon Brandhof <simon.brandhof@gmail.com>
Thu, 27 Sep 2012 14:02:36 +0000 (16:02 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Thu, 27 Sep 2012 14:02:59 +0000 (16:02 +0200)
43 files changed:
sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java
sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql
sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl
sonar-core/src/test/resources/org/sonar/jpa/dao/ProfilesDaoTest/shouldGetProfiles.xml
sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter-result.xml
sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRuleParametersFromARuleParameter.xml
sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules-result.xml
sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldDeleteActiveRules.xml
sonar-core/src/test/resources/org/sonar/jpa/dao/RulesDaoTest/shouldGetActiveRules.xml
sonar-plugin-api/src/main/java/org/sonar/api/profiles/RulesProfile.java
sonar-server/src/main/java/org/sonar/server/configuration/ProfilesBackup.java
sonar-server/src/main/java/org/sonar/server/configuration/ProfilesManager.java
sonar-server/src/main/java/org/sonar/server/platform/Platform.java
sonar-server/src/main/java/org/sonar/server/startup/EnableProfiles.java [deleted file]
sonar-server/src/main/webapp/WEB-INF/app/controllers/api/profiles_controller.rb
sonar-server/src/main/webapp/WEB-INF/db/migrate/332_remove_profiles_enabled_column.rb [new file with mode: 0644]
sonar-server/src/test/java/org/sonar/server/configuration/ProfilesBackupTest.java
sonar-server/src/test/java/org/sonar/server/startup/EnableProfilesTest.java [deleted file]
sonar-server/src/test/resources/org/sonar/server/configuration/BackupTest/backup-valid.xml
sonar-server/src/test/resources/org/sonar/server/configuration/InheritedProfilesTest/shouldActivateInChildren-result.xml
sonar-server/src/test/resources/org/sonar/server/configuration/InheritedProfilesTest/shouldActivateInChildren.xml
sonar-server/src/test/resources/org/sonar/server/configuration/InheritedProfilesTest/shouldChangeParent-result.xml
sonar-server/src/test/resources/org/sonar/server/configuration/InheritedProfilesTest/shouldChangeParent.xml
sonar-server/src/test/resources/org/sonar/server/configuration/InheritedProfilesTest/shouldCheckCycles.xml
sonar-server/src/test/resources/org/sonar/server/configuration/InheritedProfilesTest/shouldDeactivateInChildren-result.xml
sonar-server/src/test/resources/org/sonar/server/configuration/InheritedProfilesTest/shouldDeactivateInChildren.xml
sonar-server/src/test/resources/org/sonar/server/configuration/InheritedProfilesTest/shouldRemoveParent-result.xml
sonar-server/src/test/resources/org/sonar/server/configuration/InheritedProfilesTest/shouldRemoveParent.xml
sonar-server/src/test/resources/org/sonar/server/configuration/InheritedProfilesTest/shouldSetParent-result.xml
sonar-server/src/test/resources/org/sonar/server/configuration/InheritedProfilesTest/shouldSetParent.xml
sonar-server/src/test/resources/org/sonar/server/configuration/RuleChangeTest/changeParentProfile.xml
sonar-server/src/test/resources/org/sonar/server/configuration/RuleChangeTest/initialData.xml
sonar-server/src/test/resources/org/sonar/server/configuration/RuleChangeTest/ruleReverted.xml
sonar-server/src/test/resources/org/sonar/server/configuration/RuleChangeTest/versionIncreaseIfUsed-result.xml
sonar-server/src/test/resources/org/sonar/server/configuration/RuleChangeTest/versionIncreaseIfUsedAndInChildren-result.xml
sonar-server/src/test/resources/org/sonar/server/startup/EnableProfilesTest/shouldDisableProfilesWithMissingLanguages-result.xml [deleted file]
sonar-server/src/test/resources/org/sonar/server/startup/EnableProfilesTest/shouldDisableProfilesWithMissingLanguages.xml [deleted file]
sonar-server/src/test/resources/org/sonar/server/startup/EnableProfilesTest/shouldEnableProfilesWithKnownLanguages-result.xml [deleted file]
sonar-server/src/test/resources/org/sonar/server/startup/EnableProfilesTest/shouldEnableProfilesWithKnownLanguages.xml [deleted file]
sonar-server/src/test/resources/org/sonar/server/startup/RegisterMetricsTest/cleanAlerts-result.xml
sonar-server/src/test/resources/org/sonar/server/startup/RegisterMetricsTest/cleanAlerts.xml
sonar-server/src/test/resources/org/sonar/server/startup/RegisterRulesTest/disableDeprecatedActiveRuleParameters.xml
sonar-server/src/test/resources/org/sonar/server/startup/RegisterRulesTest/disableDeprecatedActiveRules.xml

index 754d5e973b67bf5901a79186cdd81be4aa7d4cf1..8d7f02e6d088a5ee1d8692f32a95d83711f1dde8 100644 (file)
@@ -35,7 +35,7 @@ import java.util.List;
  */
 public class DatabaseVersion implements BatchComponent, ServerComponent {
 
-  public static final int LAST_VERSION = 331;
+  public static final int LAST_VERSION = 332;
 
   public static enum Status {
     UP_TO_DATE, REQUIRES_UPGRADE, REQUIRES_DOWNGRADE, FRESH_INSTALL
index 05b077452b23061e48cc448cc119903751e24263..f96ebf5ccc868b56cb83e3814c019f68adc2c291 100644 (file)
@@ -173,6 +173,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('320');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('321');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('330');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('331');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('332');
 
 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;
index 53e322fc4494e586059f56f751e9019340ca7434..6b469747ce3ce0eb9156ed706ee259294c1d22e9 100644 (file)
@@ -71,7 +71,6 @@ CREATE TABLE "RULES_PROFILES" (
   "PROVIDED" BOOLEAN NOT NULL DEFAULT FALSE,
   "LANGUAGE" VARCHAR(16),
   "PARENT_NAME" VARCHAR(100),
-  "ENABLED" BOOLEAN NOT NULL DEFAULT TRUE,
   "VERSION" INTEGER DEFAULT 1,
   "USED_PROFILE" BOOLEAN DEFAULT FALSE
 );
index ca00e8cb5c411ce6eeb01a0e2c4995ca0410100c..ed2f97ee294612bb4099407858b8931d9a4eed2d 100644 (file)
@@ -1,7 +1,7 @@
 <dataset>
 
-  <rules_profiles id="1" provided="true" name="profile one" default_profile="0" language="java" enabled="true"/>
-  <rules_profiles id="2" provided="true" name="profile two" default_profile="0" language="java" enabled="true"/>
-  <rules_profiles id="3" provided="true" name="profile three" default_profile="0" language="plsql" enabled="true"/>
+  <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"/>
 
 </dataset>
\ No newline at end of file
index 0d8e296a25a277b1912e40b0cd0f2c8444375188..98922f49cc0a5f0d064247fb0e1e01284eccc773 100644 (file)
@@ -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" enabled="true"/>
-  <rules_profiles id="2" provided="true" name="profile2" default_profile="1" language="OTHER" enabled="true"/>
+  <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"/>
 
   <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"/>
index 0a6b2ee0e2c9e11cdb2b07ba21eaddc361a1828f..8bedbeca82bfd36bd3bc22bdd7aadc5b021b0944 100644 (file)
@@ -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" enabled="true"/>
-  <rules_profiles id="2" provided="true" name="profile2" default_profile="1" language="OTHER" enabled="true"/>
+  <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"/>
 
   <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"/>
index 394b84a737406177bacc0b7378cf013406be41eb..489fca92c1ba56e714acda19cf832dfd4b49994b 100644 (file)
@@ -1,7 +1,7 @@
 <dataset>
 
-  <rules_profiles id="1" provided="true" name="profile one" default_profile="1" language="java" enabled="true"/>
-  <rules_profiles id="2" provided="true" name="profile two" default_profile="0" language="java" enabled="true"/>
+  <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 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]"/>
index 107805b86f2eb1b0ae3c94d207a4c0de9ad9a5ca..00226391488cce8f823b9ccdf557be4a640a0be7 100644 (file)
@@ -1,7 +1,7 @@
 <dataset>
 
-  <rules_profiles id="1" provided="true" name="profile one" default_profile="1" language="java" enabled="true"/>
-  <rules_profiles id="2" provided="true" name="profile two" default_profile="0" language="java" enabled="true"/>
+  <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 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]"/>
index 394b84a737406177bacc0b7378cf013406be41eb..d0334e987f0ce21cbc05aefdf01a34c7a9f3cd4f 100644 (file)
@@ -1,7 +1,7 @@
 <dataset>
 
-  <rules_profiles id="1" provided="true" name="profile one" default_profile="1" language="java" enabled="true"/>
-  <rules_profiles id="2" provided="true" name="profile two" default_profile="0" language="java" enabled="true"/>
+  <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 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]"/>
index 171f2e922193a9e511734dc80bccbfe72085e004..26409d1742b86775dea3a2d2449aa76c88ec1ca1 100644 (file)
@@ -73,9 +73,6 @@ public class RulesProfile implements Cloneable {
   @Column(name = "provided", updatable = true, nullable = false)
   private Boolean provided = Boolean.FALSE;
 
-  @Column(name = "enabled", updatable = true, nullable = false)
-  private Boolean enabled = Boolean.TRUE;
-
   @Column(name = "used_profile", updatable = true, nullable = false)
   private Boolean used = Boolean.FALSE;
 
@@ -226,17 +223,31 @@ public class RulesProfile implements Cloneable {
     this.provided = b;
   }
 
+  /**
+   * @deprecated since 3.3. Always return true.
+   * @return
+   */
+  @Deprecated
   public Boolean getEnabled() {
-    return enabled;
+    return Boolean.TRUE;
   }
 
+  /**
+   * @deprecated since 3.3. Always return true.
+   * @return
+   */
+@Deprecated
   public boolean isEnabled() {
-    return enabled == Boolean.TRUE;
+    return true;
   }
 
+  /**
+   * @deprecated since 3.3.
+   * @return
+   */
+  @Deprecated
   public RulesProfile setEnabled(Boolean b) {
-    this.enabled = b;
-    return this;
+    throw new UnsupportedOperationException("The field RulesProfile#enabled is not supported since 3.3.");
   }
 
   /**
index 221f71c7264743dce25c1f6f5ea3e2b99527f637..b0cf4abc6dd91b469bdecf3c01fa8fad88734b7e 100644 (file)
@@ -90,10 +90,6 @@ public class ProfilesBackup implements Backupable {
   }
 
   public void importProfile(RulesDao rulesDao, RulesProfile toImport) {
-    if (toImport.getEnabled() == null) {
-      // backward-compatibility with versions < 2.6. The field "enabled" did not exist. Default value is true.
-      toImport.setEnabled(true);
-    }
     if (toImport.getVersion() == 0) {
       // backward-compatibility with versions < 2.9. The field "version" did not exist. Default value is 1.
       toImport.setVersion(1);
index 54fbae8b53807cd003bdb05e59e236122d47ec5f..f2187326fcf914a59694a840931599def7a0801a 100644 (file)
@@ -345,8 +345,7 @@ public class ProfilesManager extends BaseDao {
     return getSession().getResults(RulesProfile.class,
         "language", parent.getLanguage(),
         "parentName", parent.getName(),
-        "provided", false,
-        "enabled", true);
+        "provided", false);
   }
 
   private void removeActiveRule(RulesProfile profile, ActiveRule activeRule) {
@@ -357,8 +356,7 @@ public class ProfilesManager extends BaseDao {
   RulesProfile getProfile(String language, String name) {
     return getSession().getSingleResult(RulesProfile.class,
         "language", language,
-        "name", name,
-        "enabled", true);
+        "name", name);
   }
 
   RulesProfile getParentProfile(RulesProfile profile) {
index e5fa53e77e2cf656017e67bab517119aab2e5362..e6b41748b0860f6cc4aa270564d1f46f226c2a54 100644 (file)
@@ -235,7 +235,6 @@ public final class Platform {
     startupContainer.addSingleton(RegisterMetrics.class);
     startupContainer.addSingleton(RegisterRules.class);
     startupContainer.addSingleton(RegisterProvidedProfiles.class);
-    startupContainer.addSingleton(EnableProfiles.class);
     startupContainer.addSingleton(ActivateDefaultProfiles.class);
     startupContainer.addSingleton(JdbcDriverDeployer.class);
     startupContainer.addSingleton(ServerMetadataPersister.class);
diff --git a/sonar-server/src/main/java/org/sonar/server/startup/EnableProfiles.java b/sonar-server/src/main/java/org/sonar/server/startup/EnableProfiles.java
deleted file mode 100644 (file)
index e13cb13..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2012 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package org.sonar.server.startup;
-
-import com.google.common.collect.Sets;
-import org.sonar.api.database.DatabaseSession;
-import org.sonar.api.profiles.RulesProfile;
-import org.sonar.api.resources.Language;
-import org.sonar.api.utils.TimeProfiler;
-import org.sonar.jpa.session.DatabaseSessionFactory;
-
-import javax.persistence.Query;
-import java.util.Set;
-
-/**
- * @since 2.6
- */
-public final class EnableProfiles {
-
-  private Language[] languages;
-  private DatabaseSessionFactory sessionFactory;
-
-
-  public EnableProfiles(Language[] languages, DatabaseSessionFactory sessionFactory, RegisterProvidedProfiles registerProfilesBefore) {// NOSONAR the parameter registerProfilesBefore is used to define the execution order of startup components
-    this.languages = languages;
-    this.sessionFactory = sessionFactory;
-  }
-
-  public void start() {
-    TimeProfiler profiler = new TimeProfiler().start("Enable profiles");
-    DatabaseSession session = sessionFactory.getSession();
-    Set<String> languages = getLanguageKeys();
-
-    enableProfilesOnKnownLanguages(languages, session);
-    disableProfilesOnMissingLanguages(languages, session);
-    
-    session.commit();
-    profiler.stop();
-  }
-
-  private void enableProfilesOnKnownLanguages(Set<String> languages, DatabaseSession session) {
-    Query query = session.createQuery("update " + RulesProfile.class.getSimpleName() + " set enabled=:enabled where language in (:languages)");
-    query.setParameter("enabled", Boolean.TRUE);
-    query.setParameter("languages", languages);
-    query.executeUpdate();
-  }
-
-  private void disableProfilesOnMissingLanguages(Set<String> languages, DatabaseSession session) {
-    Query query = session.createQuery("update " + RulesProfile.class.getSimpleName() + " set enabled=:enabled where language not in (:languages)");
-    query.setParameter("enabled", Boolean.FALSE);
-    query.setParameter("languages", languages);
-    query.executeUpdate();
-  }
-
-  private Set<String> getLanguageKeys() {
-    Set<String> keys = Sets.newLinkedHashSet();
-    for (Language language : languages) {
-      keys.add(language.getKey());
-    }
-    return keys;
-  }
-}
index b180bc3b79e38ffe80e0812bd0d8bc09324c8198..3cb66a8cc76f1bd79bda5fdc1e7930abd7cc0271 100644 (file)
@@ -30,9 +30,9 @@ class Api::ProfilesController < Api::ApiController
 
       name=params[:name]
       if name.blank?
-        @profile=Profile.find(:first, :conditions => ['language=? and default_profile=? and enabled=?', language, true, true])
+        @profile=Profile.find(:first, :conditions => ['language=? and default_profile=?', language, true])
       else
-        @profile=Profile.find(:first, :conditions => ['language=? and name=? and enabled=?', language, name, true])
+        @profile=Profile.find(:first, :conditions => ['language=? and name=?', language, name])
       end
       raise ApiException.new(404, "Profile not found") if @profile.nil?
 
@@ -60,9 +60,9 @@ class Api::ProfilesController < Api::ApiController
     bad_request('Missing parameter: language') if params[:language].blank?
 
     if params[:name].blank?
-      profile=Profile.find(:first, :conditions => ['language=? and default_profile=? and enabled=?', params[:language], true, true])
+      profile=Profile.find(:first, :conditions => ['language=? and default_profile=?', params[:language], true])
     else
-      profile=Profile.find(:first, :conditions => ['language=? and name=? and enabled=?', params[:language], params[:name], true])
+      profile=Profile.find(:first, :conditions => ['language=? and name=?', params[:language], params[:name]])
     end
     not_found('Profile not found') unless profile
 
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/332_remove_profiles_enabled_column.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/332_remove_profiles_enabled_column.rb
new file mode 100644 (file)
index 0000000..4446805
--- /dev/null
@@ -0,0 +1,43 @@
+#
+# Sonar, entreprise quality control tool.
+# Copyright (C) 2008-2012 SonarSource
+# mailto:contact AT sonarsource DOT com
+#
+# Sonar 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.
+#
+# Sonar 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 Sonar; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
+#
+
+#
+# Sonar 3.3
+#
+class RemoveProfilesEnabledColumn < ActiveRecord::Migration
+
+  class Profile < ActiveRecord::Base
+    set_table_name 'rules_profiles'
+  end
+
+  class ActiveRule < ActiveRecord::Base
+  end
+
+  def self.up
+    disabled_profiles = Profile.find(:all, :conditions => {:enabled => false})
+    disabled_profiles.each do |profile|
+      ActiveRule.delete_all ['profile_id=?', profile.id]
+      Profile.delete(profile.id)
+    end
+    
+    remove_column('rules_profiles', 'enabled')
+  end
+
+end
index a762d9bcc14935fbdef4b6aef8367bddbff7cfa5..4d0501332410739ef80633061f72167ff3634301 100644 (file)
@@ -19,7 +19,6 @@
  */
 package org.sonar.server.configuration;
 
-import org.apache.commons.io.FileUtils;
 import org.junit.Before;
 import org.junit.Test;
 import org.sonar.api.measures.Metric;
@@ -31,21 +30,16 @@ import org.sonar.api.rules.Rule;
 import org.sonar.api.rules.RuleParam;
 import org.sonar.api.rules.RulePriority;
 import org.sonar.jpa.test.AbstractDbUnitTestCase;
-import org.sonar.server.platform.PersistentSettings;
-import org.sonar.test.TestUtils;
 
-import java.io.IOException;
 import java.util.Arrays;
 
 import static org.fest.assertions.Assertions.assertThat;
 import static org.hamcrest.Matchers.equalTo;
 import static org.hamcrest.collection.IsCollectionContaining.hasItem;
-import static org.hamcrest.core.Is.is;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.mock;
 
 public class ProfilesBackupTest extends AbstractDbUnitTestCase {
 
@@ -152,29 +146,4 @@ public class ProfilesBackupTest extends AbstractDbUnitTestCase {
     assertEquals(1, newProfile.getActiveRules(RulePriority.MAJOR).get(0).getActiveRuleParams().size());
     assertEquals(2, newProfile.getAlerts().size());
   }
-
-  /**
-   * The field <profile><enabled> has been added in version 2.6. Profiles imported from backup of previous releases must
-   * be considered as enabled.
-   */
-  @Test
-  public void shouldSupportMissingEnabledField() throws IOException {
-    Backup backup = new Backup(getSession(), mock(PersistentSettings.class));
-    backup.doImportXml(FileUtils.readFileToString(TestUtils.getResource(getClass(), "shouldSupportMissingEnabledField.xml")));
-
-    RulesProfile profile = getSession().getSingleResult(RulesProfile.class, "name", "Missing enabled field");
-    assertThat(profile.getEnabled(), is(Boolean.TRUE));
-  }
-
-  @Test
-  public void shouldSupportEnabledField() throws IOException {
-    Backup backup = new Backup(getSession(), mock(PersistentSettings.class));
-    backup.doImportXml(FileUtils.readFileToString(TestUtils.getResource(getClass(), "shouldSupportEnabledField.xml")));
-
-    RulesProfile enabledProfile = getSession().getSingleResult(RulesProfile.class, "name", "Enabled");
-    assertThat(enabledProfile.getEnabled(), is(Boolean.TRUE));
-
-    RulesProfile disabledProfile = getSession().getSingleResult(RulesProfile.class, "name", "Disabled");
-    assertThat(disabledProfile.getEnabled(), is(Boolean.FALSE));
-  }
 }
diff --git a/sonar-server/src/test/java/org/sonar/server/startup/EnableProfilesTest.java b/sonar-server/src/test/java/org/sonar/server/startup/EnableProfilesTest.java
deleted file mode 100644 (file)
index 5aa0568..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2012 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
- */
-package org.sonar.server.startup;
-
-import org.junit.Test;
-import org.sonar.api.resources.AbstractLanguage;
-import org.sonar.api.resources.Java;
-import org.sonar.api.resources.Language;
-import org.sonar.jpa.test.AbstractDbUnitTestCase;
-
-public class EnableProfilesTest extends AbstractDbUnitTestCase {
-
-  @Test
-  public void shouldDisableProfilesWithMissingLanguages() {
-    setupData("shouldDisableProfilesWithMissingLanguages");
-
-    Language[] languages = new Language[]{Java.INSTANCE, new Php()};
-    EnableProfiles task = new EnableProfiles(languages, getSessionFactory(), null);
-    task.start();
-
-    checkTables("shouldDisableProfilesWithMissingLanguages", "rules_profiles");
-  }
-
-  @Test
-  public void shouldEnableProfilesWithKnownLanguages() {
-    setupData("shouldEnableProfilesWithKnownLanguages");
-
-    Language[] languages = new Language[]{Java.INSTANCE, new Php()};
-    EnableProfiles task = new EnableProfiles(languages, getSessionFactory(), null);
-    task.start();
-
-    checkTables("shouldEnableProfilesWithKnownLanguages", "rules_profiles");
-  }
-
-  private static class Php extends AbstractLanguage {
-
-    public Php() {
-      super("php");
-    }
-
-    public String[] getFileSuffixes() {
-      return new String[0];
-    }
-  }
-}
-
index b5df287f5ce06b0feb03f75957b6807f5dc48b18..5cc0ed901657d30bf025113de069c05d9557f21e 100644 (file)
@@ -41,7 +41,6 @@
       <provided><![CDATA[true]]></provided>
       <used><![CDATA[false]]></used>
       <language><![CDATA[test language]]></language>
-      <enabled><![CDATA[true]]></enabled>
       <active-rules>
         <active-rule>
           <key><![CDATA[test key]]></key>
@@ -70,7 +69,6 @@
       <default-profile><![CDATA[false]]></default-profile>
       <provided><![CDATA[false]]></provided>
       <language><![CDATA[test language]]></language>
-      <enabled><![CDATA[true]]></enabled>
       <used><![CDATA[false]]></used>
       <parentName><![CDATA[test name]]></parentName>
       <active-rules>
index cc9d18694784574a9f5f4ba19fc267fefebf47e3..c2d5e12d877d9d5b155889424921d6c48668d5c2 100644 (file)
@@ -5,9 +5,9 @@
   
   <rules_parameters id="1" rule_id="1" name="param1" description="[null]" param_type="REGULAR_EXPRESSION"/>
 
-  <rules_profiles id="1" version="2" used_profile="false" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" enabled="true"/>
+  <rules_profiles id="1" version="2" used_profile="false" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" />
   
-  <rules_profiles id="2" version="2" used_profile="false" provided="false" name="child" default_profile="0" language="java" parent_name="parent" enabled="true"/>
+  <rules_profiles id="2" version="2" used_profile="false" provided="false" name="child" default_profile="0" language="java" parent_name="parent" />
 
   <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
   <active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" value="30"/>
index 75c3d712a0f5e75a57cf0171f1496c6c3c0553c6..3c70971f6dd25033564ec66da675be7111b626ff 100644 (file)
@@ -5,9 +5,9 @@
 
   <rules_parameters id="1" rule_id="1" name="param1" description="[null]" param_type="REGULAR_EXPRESSION"/>
 
-  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" enabled="true"/>
+  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" />
   
-  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="child" default_profile="0" language="java" parent_name="parent" enabled="true"/>
+  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="child" default_profile="0" language="java" parent_name="parent" />
 
   <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
   <active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" value="30"/>
index 84ca4c97e9d61800fbee55cd648750048cc9f3e5..73070213618982042680de8766a6ca844f843e76 100644 (file)
@@ -6,11 +6,11 @@
   <rules id="2" name="bar" description="test" plugin_config_key="checker/bar"
          plugin_rule_key="checkstyle.rule2" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
 
-  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" enabled="true"/>
+  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" />
   
-  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="new_parent" default_profile="0" language="java" parent_name="[null]" enabled="true"/>
+  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="new_parent" default_profile="0" language="java" parent_name="[null]" />
   
-  <rules_profiles id="3" version="2" used_profile="false" provided="false" name="child" default_profile="0" language="java" parent_name="new_parent" enabled="true"/>
+  <rules_profiles id="3" version="2" used_profile="false" provided="false" name="child" default_profile="0" language="java" parent_name="new_parent" />
 
   <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
 
index b2daef7a8ebe3b526bafb54d13c861d658e2bb92..e2ffc6c1b5d4cda46498840f899b9713eeae2b5b 100644 (file)
@@ -6,11 +6,11 @@
   <rules id="2" name="bar" description="test" plugin_config_key="checker/bar"
          plugin_rule_key="checkstyle.rule2" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
 
-  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" enabled="true"/>
+  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" />
   
-  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="new_parent" default_profile="0" language="java" parent_name="[null]" enabled="true"/>
+  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="new_parent" default_profile="0" language="java" parent_name="[null]" />
   
-  <rules_profiles id="3" version="1" used_profile="true" provided="false" name="child" default_profile="0" language="java" parent_name="parent" enabled="true"/>
+  <rules_profiles id="3" version="1" used_profile="true" provided="false" name="child" default_profile="0" language="java" parent_name="parent" />
 
   <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
 
index 5200875be2149a9a5397dedbfbb4d33c561bf83d..d70a004f6459a6173336eda00cb0c041252f239e 100644 (file)
@@ -3,10 +3,10 @@
   <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]"/>
 
-  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="level1" default_profile="0" language="java" parent_name="[null]" enabled="true"/>
-  
-  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="level2" default_profile="0" language="java" parent_name="level1" enabled="true"/>
-  
-  <rules_profiles id="3" version="1" used_profile="true" provided="false" name="level3" default_profile="0" language="java" parent_name="level2" enabled="true"/>
+  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="level1" default_profile="0" language="java" parent_name="[null]" />
+
+  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="level2" default_profile="0" language="java" parent_name="level1" />
+
+  <rules_profiles id="3" version="1" used_profile="true" provided="false" name="level3" default_profile="0" language="java" parent_name="level2" />
 
 </dataset>
index 3371d019f580f00319e1cb458b0a38db52b61ee9..69f2414ab4426e2e3941ab0425320fb64b7e6292 100644 (file)
@@ -3,9 +3,9 @@
   <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]"/>
 
-  <rules_profiles id="1" version="2" used_profile="false" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" enabled="true"/>
-  
-  <rules_profiles id="2" version="2" used_profile="false" provided="false" name="child" default_profile="0" language="java" parent_name="parent" enabled="true"/>
+  <rules_profiles id="1" version="2" used_profile="false" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]"/>
+
+  <rules_profiles id="2" version="2" used_profile="false" provided="false" name="child" default_profile="0" language="java" parent_name="parent" />
 
   <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
 
index 8d4e2c9072c505cd8da5d9d607f407b36e60cffb..675733841eeac9a73b2110a6b7bb6bd689f96b29 100644 (file)
@@ -3,9 +3,9 @@
   <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]"/>
 
-  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" enabled="true"/>
+  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" />
   
-  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="child" default_profile="0" language="java" parent_name="parent" enabled="true"/>
+  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="child" default_profile="0" language="java" parent_name="parent" />
 
   <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
 
index a27f357b5565c441affb5c1136c222f9253b8a32..99aa8e2f72c75d9b3b0dc28ffb72499c01a43575 100644 (file)
@@ -3,9 +3,9 @@
   <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]"/>
 
-  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" enabled="true"/>
+  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" />
   
-  <rules_profiles id="2" version="2" used_profile="false" provided="false" name="child" default_profile="0" language="java" parent_name="[null]" enabled="true"/>
+  <rules_profiles id="2" version="2" used_profile="false" provided="false" name="child" default_profile="0" language="java" parent_name="[null]" />
 
   <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
 
index 8d4e2c9072c505cd8da5d9d607f407b36e60cffb..675733841eeac9a73b2110a6b7bb6bd689f96b29 100644 (file)
@@ -3,9 +3,9 @@
   <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]"/>
 
-  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" enabled="true"/>
+  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" />
   
-  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="child" default_profile="0" language="java" parent_name="parent" enabled="true"/>
+  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="child" default_profile="0" language="java" parent_name="parent" />
 
   <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
 
index 5d9be47123bda687950fb852c6c163915868adb1..2965514fe6304bd0e74772464a90bedc77f351f5 100644 (file)
@@ -3,9 +3,9 @@
   <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]"/>
 
-  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" enabled="true"/>
+  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" />
   
-  <rules_profiles id="2" version="2" used_profile="false" provided="false" name="child" default_profile="0" language="java" parent_name="parent" enabled="true"/>
+  <rules_profiles id="2" version="2" used_profile="false" provided="false" name="child" default_profile="0" language="java" parent_name="parent" />
 
   <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
 
index 253e69aac65dab209aaea1f811844d173bea2ae3..be9735173d3198cd6a384cf83187c35b99c15d78 100644 (file)
@@ -3,9 +3,9 @@
   <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]"/>
 
-  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" enabled="true"/>
+  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" />
   
-  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="child" default_profile="0" language="java" parent_name="[null]" enabled="true"/>
+  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="child" default_profile="0" language="java" parent_name="[null]" />
 
   <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
 
index b5d2d18e4540a7b3fb8a8be765650cc5fa8fc166..21b280dbf5a3260a2b9d65fb33e9f4d21753cd38 100644 (file)
@@ -7,9 +7,9 @@
          plugin_rule_key="checkstyle.rule2" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
   <rules_parameters id="13" rule_id="2" name="param1" description="[null]" param_type="REGULAR_EXPRESSION"/>
 
-  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" enabled="true"/>
+  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" />
   
-  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="child" default_profile="0" language="java" parent_name="[null]" enabled="true"/>
+  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="child" default_profile="0" language="java" parent_name="[null]" />
 
   <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
 
index 7aeb11f9b99326eeedfbfa3fe4710529c28331e1..74e92695bf898840c93589ccc5fa5d287bd0d986 100644 (file)
@@ -7,9 +7,9 @@
          plugin_rule_key="checkstyle.rule2" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
   <rules_parameters id="13" rule_id="2" name="param1" description="[null]" param_type="REGULAR_EXPRESSION"/>
 
-  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" enabled="true"/>
+  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" />
   
-  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="child" default_profile="0" language="java" parent_name="parent" enabled="true"/>
+  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="child" default_profile="0" language="java" parent_name="parent" />
 
   <active_rules id="1" profile_id="1" rule_id="1" failure_level="2" inheritance="[null]"/>
 
index e682eb176a880ddcea6b55d20a0275b9a5ece3f6..003a84d8649a653979082620c253f417d9c9c6ad 100644 (file)
@@ -5,9 +5,9 @@
   <rules_parameters id="13" rule_id="2" name="param1" description="[null]" param_type="REGULAR_EXPRESSION"/>
   <rules_parameters id="14" rule_id="2" name="param2" description="[null]" param_type="REGULAR_EXPRESSION"/>
 
-  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" enabled="true"/>
+  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" />
   
-  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="child" default_profile="0" language="java" parent_name="parent" enabled="true"/>
+  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="child" default_profile="0" language="java" parent_name="parent" />
 
   <active_rules id="2" profile_id="1" rule_id="2" failure_level="2" inheritance="[null]"/>
   <active_rule_parameters id="3" active_rule_id="2" rules_parameter_id="14" value="50"/>
index b5be9280b9af2d6c6bbd671a31d7cf1a56ca79ac..5091ab1bb76fd0ee7bee54b3737f9029c69e0d5d 100644 (file)
@@ -1,7 +1,7 @@
 <dataset>
 
-  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" enabled="true"/>
+  <rules_profiles id="1" version="1" used_profile="true" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" />
   
-  <rules_profiles id="2" version="2" used_profile="false" provided="false" name="child" default_profile="0" language="java" parent_name="parent" enabled="true"/>
+  <rules_profiles id="2" version="2" used_profile="false" provided="false" name="child" default_profile="0" language="java" parent_name="parent" />
 
 </dataset>
index 8c3d85e7418ecd87fcfa4f3925698be94429c7aa..fa61bed30b6fc86ea7535d849d2ce959b6867716 100644 (file)
@@ -1,7 +1,7 @@
 <dataset>
 
-  <rules_profiles id="1" version="2" used_profile="false" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" enabled="true"/>
+  <rules_profiles id="1" version="2" used_profile="false" provided="false" name="parent" default_profile="0" language="java" parent_name="[null]" />
   
-  <rules_profiles id="2" version="2" used_profile="false" provided="false" name="child" default_profile="0" language="java" parent_name="parent" enabled="true"/>
+  <rules_profiles id="2" version="2" used_profile="false" provided="false" name="child" default_profile="0" language="java" parent_name="parent" />
 
 </dataset>
diff --git a/sonar-server/src/test/resources/org/sonar/server/startup/EnableProfilesTest/shouldDisableProfilesWithMissingLanguages-result.xml b/sonar-server/src/test/resources/org/sonar/server/startup/EnableProfilesTest/shouldDisableProfilesWithMissingLanguages-result.xml
deleted file mode 100644 (file)
index 23de3e4..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<dataset>
-  <rules_profiles id="1" version="1" used_profile="true" provided="true" name="Java 1" default_profile="0" language="java" enabled="true" PARENT_NAME="[null]"/>
-  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="Java 2" default_profile="1" language="java" enabled="true" PARENT_NAME="[null]"/>
-  <rules_profiles id="3" version="1" used_profile="true" provided="true" name="Php" default_profile="0" language="php" enabled="true" PARENT_NAME="[null]"/>
-
-  <!-- disabled -->
-  <rules_profiles id="4" version="1" used_profile="true" provided="true" name="Cobol 1" default_profile="1" language="cobol" enabled="false" PARENT_NAME="[null]"/>
-  <rules_profiles id="5" version="1" used_profile="true" provided="false" name="Cobol 2" default_profile="0" language="cobol" enabled="false" PARENT_NAME="[null]"/>
-</dataset>
\ No newline at end of file
diff --git a/sonar-server/src/test/resources/org/sonar/server/startup/EnableProfilesTest/shouldDisableProfilesWithMissingLanguages.xml b/sonar-server/src/test/resources/org/sonar/server/startup/EnableProfilesTest/shouldDisableProfilesWithMissingLanguages.xml
deleted file mode 100644 (file)
index 082f878..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<dataset>
-  <rules_profiles id="1" version="1" used_profile="true" provided="true" name="Java 1" default_profile="0" language="java" enabled="true" PARENT_NAME="[null]"/>
-  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="Java 2" default_profile="1" language="java" enabled="true" PARENT_NAME="[null]"/>
-  <rules_profiles id="3" version="1" used_profile="true" provided="true" name="Php" default_profile="0" language="php" enabled="true" PARENT_NAME="[null]"/>
-  <rules_profiles id="4" version="1" used_profile="true" provided="true" name="Cobol 1" default_profile="1" language="cobol" enabled="true" PARENT_NAME="[null]"/>
-  <rules_profiles id="5" version="1" used_profile="true" provided="false" name="Cobol 2" default_profile="0" language="cobol" enabled="true" PARENT_NAME="[null]"/>
-</dataset>
\ No newline at end of file
diff --git a/sonar-server/src/test/resources/org/sonar/server/startup/EnableProfilesTest/shouldEnableProfilesWithKnownLanguages-result.xml b/sonar-server/src/test/resources/org/sonar/server/startup/EnableProfilesTest/shouldEnableProfilesWithKnownLanguages-result.xml
deleted file mode 100644 (file)
index 505d4bc..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<dataset>
-  <rules_profiles id="1" version="1" used_profile="true" provided="true" name="Java 1" default_profile="0" language="java" enabled="true" PARENT_NAME="[null]"/>
-  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="Java 2" default_profile="1" language="java" enabled="true" PARENT_NAME="[null]"/>
-
-  <!-- enabled -->
-  <rules_profiles id="3" version="1" used_profile="true" provided="true" name="Disabled Php 1" default_profile="0" language="php" enabled="true" PARENT_NAME="[null]"/>
-  <rules_profiles id="4" version="1" used_profile="true" provided="false" name="Disabled Php 2" default_profile="1" language="php" enabled="true" PARENT_NAME="[null]"/>
-
-  <!-- keep disabled -->
-  <rules_profiles id="5" version="1" used_profile="true" provided="true" name="Disabled Cobol" default_profile="1" language="cobol" enabled="false" PARENT_NAME="[null]"/>
-</dataset>
\ No newline at end of file
diff --git a/sonar-server/src/test/resources/org/sonar/server/startup/EnableProfilesTest/shouldEnableProfilesWithKnownLanguages.xml b/sonar-server/src/test/resources/org/sonar/server/startup/EnableProfilesTest/shouldEnableProfilesWithKnownLanguages.xml
deleted file mode 100644 (file)
index 7d26e51..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<dataset>
-  <rules_profiles id="1" version="1" used_profile="true" provided="true" name="Java 1" default_profile="0" language="java" enabled="true" PARENT_NAME="[null]"/>
-  <rules_profiles id="2" version="1" used_profile="true" provided="false" name="Java 2" default_profile="1" language="java" enabled="true" PARENT_NAME="[null]"/>
-  <rules_profiles id="3" version="1" used_profile="true" provided="true" name="Disabled Php 1" default_profile="0" language="php" enabled="false" PARENT_NAME="[null]"/>
-  <rules_profiles id="4" version="1" used_profile="true" provided="false" name="Disabled Php 2" default_profile="1" language="php" enabled="false" PARENT_NAME="[null]"/>
-  <rules_profiles id="5" version="1" used_profile="true" provided="true" name="Disabled Cobol" default_profile="1" language="cobol" enabled="false" PARENT_NAME="[null]"/>
-</dataset>
\ No newline at end of file
index abb38157dc4b6e1dd132dc0c565b7ac2efae6698..58d69d0ea816f25c1ea59d74d9dc398102fc67b0 100644 (file)
@@ -6,8 +6,8 @@
   <metrics delete_historical_data="[null]" id="2" name="disabledkey2" val_type="INT" description="description"  domain="domain"
            short_name="name2" qualitative="false" user_managed="false" enabled="false" origin="JAV" worst_value="[null]" optimized_best_value="[null]" best_value="[null]" direction="1" hidden="false"/>
 
-  <rules_profiles id="1" version="1" used_profile="true" name="profile1" default_profile="true" provided="true" language="JAV" enabled="true"/>
-  <rules_profiles id="2" version="1" used_profile="true" name="profile2" default_profile="false" provided="false" language="JAV" enabled="true"/>
+  <rules_profiles id="1" version="1" used_profile="true" name="profile1" default_profile="true" provided="true" language="JAV" />
+  <rules_profiles id="2" version="1" used_profile="true" name="profile2" default_profile="false" provided="false" language="JAV" />
 
   <!-- ok -->
   <alerts id="1" profile_id="1" metric_id="1" operator=">" value_error="30" value_warning="[null]"/>
index aeeb3db7a57ce13aa93221d2392b953843d2bc35..2c54a96af461fda4fe084d14a4587f911797a106 100644 (file)
@@ -7,8 +7,8 @@
            short_name="name2" qualitative="false" user_managed="false" enabled="false" origin="JAV" worst_value="[null]" optimized_best_value="[null]" best_value="[null]" direction="1" hidden="false"/>
 
 
-  <rules_profiles id="1" version="1" used_profile="true" name="profile1" default_profile="true" provided="true" language="JAV" enabled="true"/>
-  <rules_profiles id="2" version="1" used_profile="true" name="profile2" default_profile="false" provided="false" language="JAV" enabled="true"/>
+  <rules_profiles id="1" version="1" used_profile="true" name="profile1" default_profile="true" provided="true" language="JAV" />
+  <rules_profiles id="2" version="1" used_profile="true" name="profile2" default_profile="false" provided="false" language="JAV" />
 
   <!-- ok -->
   <alerts id="1" profile_id="1" metric_id="1" operator=">" value_error="30" value_warning="[null]"/>
index f4e777801543ad6c759410e9e012b959a84e0dee..39306b610eed8c7831fbdabe9e5e4c785cc9a82e 100644 (file)
@@ -10,7 +10,7 @@
   <rules_parameters id="3" rule_id="1" name="param3" description="[null]" param_type="STRING"/>
 
 
-  <rules_profiles id="1" version="1" used_profile="true" name="profile name" language="java" default_profile="false" provided="false"  enabled="true"/>
+  <rules_profiles id="1" version="1" used_profile="true" name="profile name" language="java" default_profile="false" provided="false" />
   <active_rules id="1" rule_id="1" profile_id="1" failure_level="4" />
   <active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" value="one" />
   <active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" value="two" />
index 801d00ec9feaaf73588bbd25b07db97307d1594e..c76fd4c6aa0d8f0bf7bb2b2b9521f62651f556c5 100644 (file)
@@ -8,7 +8,7 @@
 
   <rules_parameters id="1" rule_id="1" name="deprecated-prop" description="[null]" param_type="STRING"/>
 
-  <rules_profiles id="1" version="1" used_profile="true" name="sonar way" language="java" default_profile="false" provided="true"  enabled="true"/>
+  <rules_profiles id="1" version="1" used_profile="true" name="sonar way" language="java" default_profile="false" provided="true" />
   <active_rules id="1" rule_id="1" profile_id="1" failure_level="4" />
   <active_rules id="2" rule_id="2" profile_id="1" failure_level="0" />