Search in sources :

Example 1 with DatabaseInfo

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

the class SQLiteDatabaseServiceTest method testExecuteQuery.

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

Example 2 with DatabaseInfo

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

the class SQLiteDatabaseServiceTest method testConnect.

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

Example 3 with DatabaseInfo

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

the class MariaDBDatabaseServiceTest method testConnect.

@Test
public void testConnect() throws DatabaseServiceException {
    MariaDBDatabaseService pgSqlService = (MariaDBDatabaseService) DatabaseService.get(MariaDBDatabaseService.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)

Example 4 with DatabaseInfo

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

the class MySQLDatabaseServiceTest method testConnect.

@Test
public void testConnect() throws DatabaseServiceException {
    MySQLDatabaseService pgSqlService = (MySQLDatabaseService) DatabaseService.get(MySQLDatabaseService.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)

Example 5 with DatabaseInfo

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

the class MySQLDatabaseServiceTest method testExecuteQuery.

@Test
public void testExecuteQuery() throws DatabaseServiceException {
    MySQLDatabaseService pgSqlService = (MySQLDatabaseService) DatabaseService.get(MySQLDatabaseService.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)

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