*/
package org.sonar.core.persistence;
+import com.google.common.base.Objects;
import com.google.common.collect.Maps;
import com.google.common.io.Closeables;
import org.apache.commons.io.FileUtils;
private static Database database;
private static DatabaseCommands databaseCommands;
private static MyBatis myBatis;
+ private static String login;
private IDatabaseTester databaseTester;
if (settings.hasKey("orchestrator.configUrl")) {
loadOrchestratorSettings(settings);
}
+ login = settings.getString("sonar.jdbc.username");
for (String key : settings.getKeysStartingWith("sonar.jdbc")) {
LOG.info(key + ": " + settings.getString(key));
}
@Before
public void startDbUnit() throws Exception {
databaseCommands.truncateDatabase(database.getDataSource());
- databaseTester = new DataSourceDatabaseTester(database.getDataSource());
+ databaseTester = new DataSourceDatabaseTester(database.getDataSource(), login);
}
/**
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URISyntaxException;
-import java.sql.*;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import java.util.Properties;
if (settings.hasKey("orchestrator.configUrl")) {
loadOrchestratorSettings(settings);
}
+ String login = settings.getString("sonar.jdbc.username");
for (String key : settings.getKeysStartingWith("sonar.jdbc")) {
LOG.info(key + ": " + settings.getString(key));
}
LOG.info("Test Database: " + db);
commands = DatabaseCommands.forDialect(db.getDialect());
- tester = new DataSourceDatabaseTester(db.getDataSource());
+ tester = new DataSourceDatabaseTester(db.getDataSource(), login);
myBatis = new MyBatis(db, new Logback(), new NullQueue());
myBatis.start();
/**
* Heavily duplicates AbstractDaoTestCase as long as Hibernate is in use.
+ * @deprecated this class does not support non-H2 databases
*/
+@Deprecated
public abstract class AbstractDbUnitTestCase {
private static Database database;
private static MyBatis myBatis;