#392 Start integration test for SQLite

This commit is contained in:
ljacqu
2016-02-21 10:46:13 +01:00
parent dfa3921740
commit e8d627c0e1
7 changed files with 324 additions and 59 deletions
@@ -1,5 +1,6 @@
package fr.xephi.authme.datasource;
import com.google.common.annotations.VisibleForTesting;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.security.crypts.HashedPassword;
@@ -46,6 +47,21 @@ public class SQLite implements DataSource {
}
}
@VisibleForTesting
SQLite(NewSetting settings, Connection connection, boolean executeSetup) {
this.database = settings.getProperty(DatabaseSettings.MYSQL_DATABASE);
this.tableName = settings.getProperty(DatabaseSettings.MYSQL_TABLE);
this.col = new Columns(settings);
this.con = connection;
if (executeSetup) {
try {
setup();
} catch (SQLException e) {
throw new IllegalStateException(e);
}
}
}
private synchronized void connect() throws ClassNotFoundException, SQLException {
Class.forName("org.sqlite.JDBC");
ConsoleLogger.info("SQLite driver loaded");