diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-07-28 21:37:21 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-07-28 21:37:21 +0200 |
commit | 4bee8f9892ddda7497187edc97c08d1935069a98 (patch) | |
tree | a5865251a8bf2c8c71efce26c222244c42357c48 /sonar-core | |
parent | 78cd89b41c20f6ae5793f8b0b110882daccb15dc (diff) | |
download | sonarqube-4bee8f9892ddda7497187edc97c08d1935069a98.tar.gz sonarqube-4bee8f9892ddda7497187edc97c08d1935069a98.zip |
SONAR-5492 Remove ability to configure JDBC driver class name
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/persistence/DefaultDatabase.java | 7 | ||||
-rw-r--r-- | sonar-core/src/test/java/org/sonar/core/persistence/DefaultDatabaseTest.java | 4 |
2 files changed, 2 insertions, 9 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/DefaultDatabase.java b/sonar-core/src/main/java/org/sonar/core/persistence/DefaultDatabase.java index caa1f9453ef..e6cb4c5e426 100644 --- a/sonar-core/src/main/java/org/sonar/core/persistence/DefaultDatabase.java +++ b/sonar-core/src/main/java/org/sonar/core/persistence/DefaultDatabase.java @@ -36,7 +36,6 @@ import org.sonar.core.persistence.profiling.PersistenceProfiling; import org.sonar.jpa.session.CustomHibernateConnectionProvider; import javax.sql.DataSource; - import java.sql.Connection; import java.sql.SQLException; import java.util.List; @@ -55,7 +54,6 @@ public class DefaultDatabase implements Database { private static final String SONAR_HIBERNATE = "sonar.hibernate."; private static final String SONAR_JDBC_DIALECT = "sonar.jdbc.dialect"; private static final String SONAR_JDBC_URL = "sonar.jdbc.url"; - private static final String SONAR_JDBC_DRIVER_CLASS_NAME = "sonar.jdbc.driverClassName"; private static final String VALIDATE = "validate"; private Settings settings; @@ -107,9 +105,7 @@ public class DefaultDatabase implements Database { throw new IllegalStateException("Can not guess the JDBC dialect. Please check the property " + SONAR_JDBC_URL + "."); } checkH2Database(); - if (!properties.containsKey(SONAR_JDBC_DRIVER_CLASS_NAME)) { - properties.setProperty(SONAR_JDBC_DRIVER_CLASS_NAME, dialect.getDefaultDriverClassName()); - } + properties.setProperty(DatabaseProperties.PROP_DRIVER, dialect.getDefaultDriverClassName()); } protected void checkH2Database() { @@ -205,7 +201,6 @@ public class DefaultDatabase implements Database { } private static void completeDefaultProperties(Properties props) { - completeDefaultProperty(props, DatabaseProperties.PROP_DRIVER, props.getProperty(DatabaseProperties.PROP_DRIVER_DEPRECATED)); completeDefaultProperty(props, DatabaseProperties.PROP_URL, DEFAULT_URL); completeDefaultProperty(props, DatabaseProperties.PROP_USER, props.getProperty(DatabaseProperties.PROP_USER_DEPRECATED, DatabaseProperties.PROP_USER_DEFAULT_VALUE)); completeDefaultProperty(props, DatabaseProperties.PROP_PASSWORD, DatabaseProperties.PROP_PASSWORD_DEFAULT_VALUE); diff --git a/sonar-core/src/test/java/org/sonar/core/persistence/DefaultDatabaseTest.java b/sonar-core/src/test/java/org/sonar/core/persistence/DefaultDatabaseTest.java index 2bf2a1d1e6e..094c68aac59 100644 --- a/sonar-core/src/test/java/org/sonar/core/persistence/DefaultDatabaseTest.java +++ b/sonar-core/src/test/java/org/sonar/core/persistence/DefaultDatabaseTest.java @@ -45,9 +45,8 @@ public class DefaultDatabaseTest { } @Test - public void shouldSupportDeprecatedProperties() { + public void shouldSupportDeprecatedUserProperty() { Settings settings = new Settings(); - settings.setProperty("sonar.jdbc.driver", "my.Driver"); settings.setProperty("sonar.jdbc.user", "me"); DefaultDatabase db = new DefaultDatabase(settings); @@ -55,7 +54,6 @@ public class DefaultDatabaseTest { Properties props = db.getProperties(); assertThat(props.getProperty("sonar.jdbc.username")).isEqualTo("me"); - assertThat(props.getProperty("sonar.jdbc.driverClassName")).isEqualTo("my.Driver"); } @Test |