aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorStephane Gamard <stephane.gamard@searchbox.com>2014-08-13 13:57:26 +0200
committerStephane Gamard <stephane.gamard@searchbox.com>2014-08-13 13:57:26 +0200
commitc31f7f2abf3e622b88e557ba8bf6a425082cd2b8 (patch)
tree497342ab2fa44806c6bfbfb93ee18eeb705b54b9 /sonar-core
parent13e34d150e7bef921c1a2374517731de542680e7 (diff)
downloadsonarqube-c31f7f2abf3e622b88e557ba8bf6a425082cd2b8.tar.gz
sonarqube-c31f7f2abf3e622b88e557ba8bf6a425082cd2b8.zip
improved test performances for sq #3 (use MetaDataHandler for MySQL)
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/test/java/org/sonar/core/persistence/AbstractDaoTestCase.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/sonar-core/src/test/java/org/sonar/core/persistence/AbstractDaoTestCase.java b/sonar-core/src/test/java/org/sonar/core/persistence/AbstractDaoTestCase.java
index 9b17e6e1d33..507077e4ce6 100644
--- a/sonar-core/src/test/java/org/sonar/core/persistence/AbstractDaoTestCase.java
+++ b/sonar-core/src/test/java/org/sonar/core/persistence/AbstractDaoTestCase.java
@@ -123,7 +123,7 @@ public abstract class AbstractDaoTestCase {
}
- if (connection == null) {
+ if (connection == null || connection.getConnection().isClosed()) {
connection = databaseTester.getConnection();
connection.getConfig().setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, databaseCommands.getDbUnitFactory());
if (MySql.ID.equals(database.getDialect().getId())) {
@@ -292,6 +292,6 @@ public abstract class AbstractDaoTestCase {
}
protected Connection getConnection() throws SQLException {
- return connection.getConnection();
+ return database.getDataSource().getConnection();
}
}