diff options
author | David Gageot <david@gageot.net> | 2012-10-29 09:44:06 +0100 |
---|---|---|
committer | David Gageot <david@gageot.net> | 2012-10-29 09:44:14 +0100 |
commit | fe0bd12eec0ef48e11f79aacb0de3439663f16a6 (patch) | |
tree | 4d7f7e1ca04d07c3e7c4e9e87e30321045ce74ab /sonar-core | |
parent | 987551107bbc3036473153b7dfd687f739a6dc88 (diff) | |
download | sonarqube-fe0bd12eec0ef48e11f79aacb0de3439663f16a6.tar.gz sonarqube-fe0bd12eec0ef48e11f79aacb0de3439663f16a6.zip |
SONAR-3895 Tests
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/persistence/DryRunDatabaseFactory.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/DryRunDatabaseFactory.java b/sonar-core/src/main/java/org/sonar/core/persistence/DryRunDatabaseFactory.java index 156db8ab830..b226869cdf7 100644 --- a/sonar-core/src/main/java/org/sonar/core/persistence/DryRunDatabaseFactory.java +++ b/sonar-core/src/main/java/org/sonar/core/persistence/DryRunDatabaseFactory.java @@ -50,8 +50,10 @@ public class DryRunDatabaseFactory implements ServerComponent { String name = serverFileSystem.getTempDir().getAbsolutePath() + "db-" + System.nanoTime(); try { + DataSource source = database.getDataSource(); BasicDataSource destination = create(DIALECT, DRIVER, USER, PASSWORD, URL + name); - copy(database.getDataSource(), destination, resourceId); + + copy(source, destination, resourceId); close(destination); return dbFileContent(name); @@ -83,8 +85,8 @@ public class DryRunDatabaseFactory implements ServerComponent { return dataSource; } - private void close(BasicDataSource dest) throws SQLException { - dest.close(); + private void close(BasicDataSource destination) throws SQLException { + destination.close(); } private byte[] dbFileContent(String name) { |