diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2012-12-05 08:38:50 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2012-12-05 08:38:50 +0100 |
commit | 404437827385fa720792e9661552b5be6a7e5567 (patch) | |
tree | 0a7bd025f45775fb19ae3601963ed7a7b0baa007 /sonar-core | |
parent | f8c1e6e7e7f7aeb5edf325bb819fd33e432f3153 (diff) | |
download | sonarqube-404437827385fa720792e9661552b5be6a7e5567.tar.gz sonarqube-404437827385fa720792e9661552b5be6a7e5567.zip |
Fix quality flaws
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/persistence/DryRunDatabaseFactory.java | 6 | ||||
-rw-r--r-- | sonar-core/src/test/java/org/sonar/core/persistence/DryRunDatabaseFactoryTest.java | 2 |
2 files changed, 4 insertions, 4 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 6530140510d..91ebe74f100 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 @@ -46,14 +46,14 @@ public class DryRunDatabaseFactory implements ServerComponent { this.serverFileSystem = serverFileSystem; } - public byte[] createDatabaseForDryRun(Integer resourceId) { + public byte[] createDatabaseForDryRun() { String name = serverFileSystem.getTempDir().getAbsolutePath() + "db-" + System.nanoTime(); try { DataSource source = database.getDataSource(); BasicDataSource destination = create(DIALECT, DRIVER, USER, PASSWORD, URL + name); - copy(source, destination, resourceId); + copy(source, destination); close(destination); return dbFileContent(name); @@ -62,7 +62,7 @@ public class DryRunDatabaseFactory implements ServerComponent { } } - private void copy(DataSource source, DataSource dest, Integer resourceId) { + private void copy(DataSource source, DataSource dest) { new DbTemplate() .copyTable(source, dest, "active_rules") .copyTable(source, dest, "active_rule_parameters") diff --git a/sonar-core/src/test/java/org/sonar/core/persistence/DryRunDatabaseFactoryTest.java b/sonar-core/src/test/java/org/sonar/core/persistence/DryRunDatabaseFactoryTest.java index aa284c22e13..2832446ae53 100644 --- a/sonar-core/src/test/java/org/sonar/core/persistence/DryRunDatabaseFactoryTest.java +++ b/sonar-core/src/test/java/org/sonar/core/persistence/DryRunDatabaseFactoryTest.java @@ -63,7 +63,7 @@ public class DryRunDatabaseFactoryTest extends AbstractDaoTestCase { when(serverFileSystem.getTempDir()).thenReturn(temporaryFolder.getRoot()); - byte[] database = localDatabaseFactory.createDatabaseForDryRun(1); + byte[] database = localDatabaseFactory.createDatabaseForDryRun(); dataSource = createDatabase(database); assertThat(rowCount("metrics")).isEqualTo(2); |