aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2013-02-25 09:50:50 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2013-02-25 09:50:50 +0100
commitf179e9b1bcbc2d70c7101928b3944d1c9401110c (patch)
tree66d8ae392aa917fa04efa02b15b97f60ec4591af /sonar-core
parent0906e97d58757bd862bdfeba4aa9199067a6ba61 (diff)
downloadsonarqube-f179e9b1bcbc2d70c7101928b3944d1c9401110c.tar.gz
sonarqube-f179e9b1bcbc2d70c7101928b3944d1c9401110c.zip
Fix compatibility of the test DatabaseUtilsTest with Oracle
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/test/java/org/sonar/core/persistence/DatabaseUtilsTest.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/sonar-core/src/test/java/org/sonar/core/persistence/DatabaseUtilsTest.java b/sonar-core/src/test/java/org/sonar/core/persistence/DatabaseUtilsTest.java
index 7c0080db435..4d53e9881ba 100644
--- a/sonar-core/src/test/java/org/sonar/core/persistence/DatabaseUtilsTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/persistence/DatabaseUtilsTest.java
@@ -20,6 +20,7 @@
package org.sonar.core.persistence;
import org.junit.Test;
+import org.sonar.core.persistence.dialect.Oracle;
import java.sql.Connection;
import java.sql.PreparedStatement;
@@ -53,7 +54,11 @@ public class DatabaseUtilsTest extends AbstractDaoTestCase {
public void should_close_statement_and_resultset() throws SQLException {
Connection connection = getConnection();
try {
- PreparedStatement statement = connection.prepareStatement("SELECT 1");
+ String sql = "SELECT 1";
+ if (Oracle.ID.equals(getDatabase().getDialect().getId())) {
+ sql = "SELECT 1 FROM DUAL";
+ }
+ PreparedStatement statement = connection.prepareStatement(sql);
ResultSet rs = statement.executeQuery();
DatabaseUtils.closeQuietly(rs);