aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
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();
}
}