Search in sources :

Example 16 with DatabaseInfo

use of com.google.refine.extension.database.model.DatabaseInfo in project OpenRefine by OpenRefine.

the class PgSQLDatabaseServiceTest method testExecuteQuery.

@Test
public void testExecuteQuery() throws DatabaseServiceException {
    PgSQLDatabaseService pgSqlService = (PgSQLDatabaseService) DatabaseService.get(PgSQLDatabaseService.DB_NAME);
    DatabaseInfo databaseInfo = pgSqlService.testQuery(testDbConfig, "SELECT * FROM " + testTable);
    Assert.assertNotNull(databaseInfo);
}
Also used : DatabaseInfo(com.google.refine.extension.database.model.DatabaseInfo) Test(org.testng.annotations.Test) BeforeTest(org.testng.annotations.BeforeTest)

Example 17 with DatabaseInfo

use of com.google.refine.extension.database.model.DatabaseInfo in project OpenRefine by OpenRefine.

the class DatabaseServiceTest method testExecuteQuery.

@Test(groups = { "requiresMySQL" })
public void testExecuteQuery() throws DatabaseServiceException {
    DatabaseService dbService = DatabaseService.get(testDbConfig.getDatabaseType());
    DatabaseInfo databaseInfo = dbService.testQuery(testDbConfig, "SELECT * FROM " + testTable);
    Assert.assertNotNull(databaseInfo);
}
Also used : DatabaseInfo(com.google.refine.extension.database.model.DatabaseInfo) MariaDBDatabaseService(com.google.refine.extension.database.mariadb.MariaDBDatabaseService) MySQLDatabaseService(com.google.refine.extension.database.mysql.MySQLDatabaseService) SQLiteDatabaseService(com.google.refine.extension.database.sqlite.SQLiteDatabaseService) PgSQLDatabaseService(com.google.refine.extension.database.pgsql.PgSQLDatabaseService) Test(org.testng.annotations.Test) BeforeTest(org.testng.annotations.BeforeTest)

Example 18 with DatabaseInfo

use of com.google.refine.extension.database.model.DatabaseInfo in project OpenRefine by OpenRefine.

the class DatabaseServiceTest method testConnect.

@Test(groups = { "requiresMySQL" })
public void testConnect() throws DatabaseServiceException {
    DatabaseService dbService = DatabaseService.get(testDbConfig.getDatabaseType());
    DatabaseInfo databaseInfo = dbService.connect(testDbConfig);
    Assert.assertNotNull(databaseInfo);
}
Also used : DatabaseInfo(com.google.refine.extension.database.model.DatabaseInfo) MariaDBDatabaseService(com.google.refine.extension.database.mariadb.MariaDBDatabaseService) MySQLDatabaseService(com.google.refine.extension.database.mysql.MySQLDatabaseService) SQLiteDatabaseService(com.google.refine.extension.database.sqlite.SQLiteDatabaseService) PgSQLDatabaseService(com.google.refine.extension.database.pgsql.PgSQLDatabaseService) Test(org.testng.annotations.Test) BeforeTest(org.testng.annotations.BeforeTest)

Example 19 with DatabaseInfo

use of com.google.refine.extension.database.model.DatabaseInfo in project OpenRefine by OpenRefine.

the class MariaDBDatabaseServiceTest method testExecuteQuery.

@Test
public void testExecuteQuery() throws DatabaseServiceException {
    MariaDBDatabaseService pgSqlService = (MariaDBDatabaseService) DatabaseService.get(MariaDBDatabaseService.DB_NAME);
    DatabaseInfo databaseInfo = pgSqlService.testQuery(testDbConfig, "SELECT * FROM " + testTable);
    Assert.assertNotNull(databaseInfo);
}
Also used : DatabaseInfo(com.google.refine.extension.database.model.DatabaseInfo) Test(org.testng.annotations.Test) BeforeTest(org.testng.annotations.BeforeTest)

Example 20 with DatabaseInfo

use of com.google.refine.extension.database.model.DatabaseInfo in project OpenRefine by OpenRefine.

the class PgSQLDatabaseServiceTest method testConnect.

@Test
public void testConnect() throws DatabaseServiceException {
    PgSQLDatabaseService pgSqlService = (PgSQLDatabaseService) DatabaseService.get(PgSQLDatabaseService.DB_NAME);
    DatabaseInfo databaseInfo = pgSqlService.connect(testDbConfig);
    Assert.assertNotNull(databaseInfo);
}
Also used : DatabaseInfo(com.google.refine.extension.database.model.DatabaseInfo) Test(org.testng.annotations.Test) BeforeTest(org.testng.annotations.BeforeTest)

Aggregations

DatabaseInfo (com.google.refine.extension.database.model.DatabaseInfo)24 DatabaseServiceException (com.google.refine.extension.database.DatabaseServiceException)12 Connection (java.sql.Connection)9 SQLException (java.sql.SQLException)9 BeforeTest (org.testng.annotations.BeforeTest)8 Test (org.testng.annotations.Test)8 ResultSet (java.sql.ResultSet)6 Statement (java.sql.Statement)6 DatabaseColumn (com.google.refine.extension.database.model.DatabaseColumn)4 DatabaseRow (com.google.refine.extension.database.model.DatabaseRow)4 ArrayList (java.util.ArrayList)4 JsonGenerator (com.fasterxml.jackson.core.JsonGenerator)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 DatabaseConfiguration (com.google.refine.extension.database.DatabaseConfiguration)3 IOException (java.io.IOException)3 Writer (java.io.Writer)3 ServletException (javax.servlet.ServletException)3 MariaDBDatabaseService (com.google.refine.extension.database.mariadb.MariaDBDatabaseService)2 MySQLDatabaseService (com.google.refine.extension.database.mysql.MySQLDatabaseService)2 PgSQLDatabaseService (com.google.refine.extension.database.pgsql.PgSQLDatabaseService)2