aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2016-07-26 10:54:54 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2016-07-29 10:31:31 +0200
commit1e6c0e1a47509ca88f0cd2d9fa127dc4302a899d (patch)
treea4dbdf8e741031f7ffe12033f0dd7f3744d5912d
parentd107bfeb735e2d75bece233900a546b347774c2b (diff)
downloadsonarqube-1e6c0e1a47509ca88f0cd2d9fa127dc4302a899d.tar.gz
sonarqube-1e6c0e1a47509ca88f0cd2d9fa127dc4302a899d.zip
Minor Quality flaws
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/db/EmbeddedDatabaseFactory.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/db/EmbeddedDatabaseFactoryTest.java12
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/utils/Semaphores.java2
3 files changed, 10 insertions, 8 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/db/EmbeddedDatabaseFactory.java b/server/sonar-server/src/main/java/org/sonar/server/db/EmbeddedDatabaseFactory.java
index 25e15e503c1..5a5f4e45c15 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/db/EmbeddedDatabaseFactory.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/db/EmbeddedDatabaseFactory.java
@@ -40,7 +40,7 @@ public class EmbeddedDatabaseFactory implements Startable {
if (embeddedDatabase == null) {
String jdbcUrl = settings.getString(DatabaseProperties.PROP_URL);
if (startsWith(jdbcUrl, URL_PREFIX)) {
- embeddedDatabase = getEmbeddedDatabase(settings);
+ embeddedDatabase = createEmbeddedDatabase();
embeddedDatabase.start();
}
}
@@ -55,7 +55,7 @@ public class EmbeddedDatabaseFactory implements Startable {
}
@VisibleForTesting
- EmbeddedDatabase getEmbeddedDatabase(Settings settings) {
+ EmbeddedDatabase createEmbeddedDatabase() {
return new EmbeddedDatabase(settings);
}
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/EmbeddedDatabaseFactoryTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/EmbeddedDatabaseFactoryTest.java
index 8cbe8790346..2a780dc6812 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/db/EmbeddedDatabaseFactoryTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/db/EmbeddedDatabaseFactoryTest.java
@@ -23,7 +23,9 @@ import org.junit.Test;
import org.sonar.api.config.Settings;
import org.sonar.api.database.DatabaseProperties;
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
public class EmbeddedDatabaseFactoryTest {
@@ -33,11 +35,11 @@ public class EmbeddedDatabaseFactoryTest {
public void should_start_and_stop_tcp_h2_database() {
settings.setProperty(DatabaseProperties.PROP_URL, "jdbc:h2:tcp:localhost");
- final EmbeddedDatabase embeddedDatabase = mock(EmbeddedDatabase.class);
+ EmbeddedDatabase embeddedDatabase = mock(EmbeddedDatabase.class);
EmbeddedDatabaseFactory databaseFactory = new EmbeddedDatabaseFactory(settings) {
@Override
- EmbeddedDatabase getEmbeddedDatabase(Settings settings) {
+ EmbeddedDatabase createEmbeddedDatabase() {
return embeddedDatabase;
}
};
@@ -52,11 +54,11 @@ public class EmbeddedDatabaseFactoryTest {
public void should_not_start_mem_h2_database() {
settings.setProperty(DatabaseProperties.PROP_URL, "jdbc:h2:mem");
- final EmbeddedDatabase embeddedDatabase = mock(EmbeddedDatabase.class);
+ EmbeddedDatabase embeddedDatabase = mock(EmbeddedDatabase.class);
EmbeddedDatabaseFactory databaseFactory = new EmbeddedDatabaseFactory(settings) {
@Override
- EmbeddedDatabase getEmbeddedDatabase(Settings settings) {
+ EmbeddedDatabase createEmbeddedDatabase() {
return embeddedDatabase;
}
};
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/Semaphores.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/Semaphores.java
index 8e77894ba28..ffd503ed486 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/Semaphores.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/Semaphores.java
@@ -27,7 +27,7 @@ import org.sonar.api.server.ServerSide;
* A semaphore shared among all the processes that can connect to the central database.
*
* @since 3.4
- * @deprecated in 5.2 as batch analyzer does not connect to database anymore
+ * @deprecated in 5.2 as analyzer does not connect to database anymore
*/
@ServerSide
@Deprecated