Search in sources :

Example 1 with DatabaseConfiguration

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

the class ConnectCommandTest method beforeTest.

// private String testTable;
@BeforeTest
@Parameters({ "mySqlDbName", "mySqlDbHost", "mySqlDbPort", "mySqlDbUser", "mySqlDbPassword", "mySqlTestTable" })
public void beforeTest(@Optional(DEFAULT_MYSQL_DB_NAME) String mySqlDbName, @Optional(DEFAULT_MYSQL_HOST) String mySqlDbHost, @Optional(DEFAULT_MYSQL_PORT) String mySqlDbPort, @Optional(DEFAULT_MYSQL_USER) String mySqlDbUser, @Optional(DEFAULT_MYSQL_PASSWORD) String mySqlDbPassword, @Optional(DEFAULT_TEST_TABLE) String mySqlTestTable) {
    MockitoAnnotations.initMocks(this);
    testDbConfig = new DatabaseConfiguration();
    testDbConfig.setDatabaseHost(mySqlDbHost);
    testDbConfig.setDatabaseName(mySqlDbName);
    testDbConfig.setDatabasePassword(mySqlDbPassword);
    testDbConfig.setDatabasePort(Integer.parseInt(mySqlDbPort));
    testDbConfig.setDatabaseType(MySQLDatabaseService.DB_NAME);
    testDbConfig.setDatabaseUser(mySqlDbUser);
    testDbConfig.setUseSSL(false);
    // testTable = mySqlTestTable;
    // DBExtensionTestUtils.initTestData(testDbConfig);
    DatabaseService.DBType.registerDatabase(MySQLDatabaseService.DB_NAME, MySQLDatabaseService.getInstance());
}
Also used : DatabaseConfiguration(com.google.refine.extension.database.DatabaseConfiguration) Parameters(org.testng.annotations.Parameters) BeforeTest(org.testng.annotations.BeforeTest)

Example 2 with DatabaseConfiguration

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

the class SavedConnectionCommandTest method beforeTest.

@BeforeTest
@Parameters({ "mySqlDbName", "mySqlDbHost", "mySqlDbPort", "mySqlDbUser", "mySqlDbPassword", "mySqlTestTable" })
public void beforeTest(@Optional(DEFAULT_MYSQL_DB_NAME) String mySqlDbName, @Optional(DEFAULT_MYSQL_HOST) String mySqlDbHost, @Optional(DEFAULT_MYSQL_PORT) String mySqlDbPort, @Optional(DEFAULT_MYSQL_USER) String mySqlDbUser, @Optional(DEFAULT_MYSQL_PASSWORD) String mySqlDbPassword, @Optional(DEFAULT_TEST_TABLE) String mySqlTestTable) {
    // MockitoAnnotations.initMocks(this);
    testDbConfig = new DatabaseConfiguration();
    testDbConfig.setDatabaseHost(mySqlDbHost);
    testDbConfig.setDatabaseName(mySqlDbName);
    testDbConfig.setDatabasePassword(mySqlDbPassword);
    testDbConfig.setDatabasePort(Integer.parseInt(mySqlDbPort));
    testDbConfig.setDatabaseType(MySQLDatabaseService.DB_NAME);
    testDbConfig.setDatabaseUser(mySqlDbUser);
    testDbConfig.setUseSSL(false);
    DatabaseService.DBType.registerDatabase(MySQLDatabaseService.DB_NAME, MySQLDatabaseService.getInstance());
}
Also used : DatabaseConfiguration(com.google.refine.extension.database.DatabaseConfiguration) Parameters(org.testng.annotations.Parameters) BeforeTest(org.testng.annotations.BeforeTest)

Example 3 with DatabaseConfiguration

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

the class TestConnectCommandTest method beforeTest.

// private String testTable;
@BeforeTest
@Parameters({ "mySqlDbName", "mySqlDbHost", "mySqlDbPort", "mySqlDbUser", "mySqlDbPassword", "mySqlTestTable" })
public void beforeTest(@Optional(DEFAULT_MYSQL_DB_NAME) String mySqlDbName, @Optional(DEFAULT_MYSQL_HOST) String mySqlDbHost, @Optional(DEFAULT_MYSQL_PORT) String mySqlDbPort, @Optional(DEFAULT_MYSQL_USER) String mySqlDbUser, @Optional(DEFAULT_MYSQL_PASSWORD) String mySqlDbPassword, @Optional(DEFAULT_TEST_TABLE) String mySqlTestTable) {
    MockitoAnnotations.initMocks(this);
    testDbConfig = new DatabaseConfiguration();
    testDbConfig.setDatabaseHost(mySqlDbHost);
    testDbConfig.setDatabaseName(mySqlDbName);
    testDbConfig.setDatabasePassword(mySqlDbPassword);
    testDbConfig.setDatabasePort(Integer.parseInt(mySqlDbPort));
    testDbConfig.setDatabaseType(MySQLDatabaseService.DB_NAME);
    testDbConfig.setDatabaseUser(mySqlDbUser);
    testDbConfig.setUseSSL(false);
    // testTable = mySqlTestTable;
    // DBExtensionTestUtils.initTestData(testDbConfig);
    DatabaseService.DBType.registerDatabase(MySQLDatabaseService.DB_NAME, MySQLDatabaseService.getInstance());
}
Also used : DatabaseConfiguration(com.google.refine.extension.database.DatabaseConfiguration) Parameters(org.testng.annotations.Parameters) BeforeTest(org.testng.annotations.BeforeTest)

Example 4 with DatabaseConfiguration

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

the class TestQueryCommandTest method beforeTest.

@BeforeTest
@Parameters({ "mySqlDbName", "mySqlDbHost", "mySqlDbPort", "mySqlDbUser", "mySqlDbPassword", "mySqlTestTable" })
public void beforeTest(@Optional(DEFAULT_MYSQL_DB_NAME) String mySqlDbName, @Optional(DEFAULT_MYSQL_HOST) String mySqlDbHost, @Optional(DEFAULT_MYSQL_PORT) String mySqlDbPort, @Optional(DEFAULT_MYSQL_USER) String mySqlDbUser, @Optional(DEFAULT_MYSQL_PASSWORD) String mySqlDbPassword, @Optional(DEFAULT_TEST_TABLE) String mySqlTestTable) {
    MockitoAnnotations.initMocks(this);
    testDbConfig = new DatabaseConfiguration();
    testDbConfig.setDatabaseHost(mySqlDbHost);
    testDbConfig.setDatabaseName(mySqlDbName);
    testDbConfig.setDatabasePassword(mySqlDbPassword);
    testDbConfig.setDatabasePort(Integer.parseInt(mySqlDbPort));
    testDbConfig.setDatabaseType(MySQLDatabaseService.DB_NAME);
    testDbConfig.setDatabaseUser(mySqlDbUser);
    testDbConfig.setUseSSL(false);
    testTable = mySqlTestTable;
    // DBExtensionTestUtils.initTestData(testDbConfig);
    DatabaseService.DBType.registerDatabase(MySQLDatabaseService.DB_NAME, MySQLDatabaseService.getInstance());
}
Also used : DatabaseConfiguration(com.google.refine.extension.database.DatabaseConfiguration) Parameters(org.testng.annotations.Parameters) BeforeTest(org.testng.annotations.BeforeTest)

Example 5 with DatabaseConfiguration

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

the class MySQLDatabaseServiceTest method beforeTest.

@BeforeTest
@Parameters({ "mySqlDbName", "mySqlDbHost", "mySqlDbPort", "mySqlDbUser", "mySqlDbPassword", "mySqlTestTable" })
public void beforeTest(@Optional(DEFAULT_MYSQL_DB_NAME) String mySqlDbName, @Optional(DEFAULT_MYSQL_HOST) String mySqlDbHost, @Optional(DEFAULT_MYSQL_PORT) String mySqlDbPort, @Optional(DEFAULT_MYSQL_USER) String mySqlDbUser, @Optional(DEFAULT_MYSQL_PASSWORD) String mySqlDbPassword, @Optional(DEFAULT_TEST_TABLE) String mySqlTestTable) {
    MockitoAnnotations.initMocks(this);
    testDbConfig = new DatabaseConfiguration();
    testDbConfig.setDatabaseHost(mySqlDbHost);
    testDbConfig.setDatabaseName(mySqlDbName);
    testDbConfig.setDatabasePassword(mySqlDbPassword);
    testDbConfig.setDatabasePort(Integer.parseInt(mySqlDbPort));
    testDbConfig.setDatabaseType(MySQLDatabaseService.DB_NAME);
    testDbConfig.setDatabaseUser(mySqlDbUser);
    testDbConfig.setUseSSL(false);
    testTable = mySqlTestTable;
    // DBExtensionTestUtils.initTestData(testDbConfig);
    DatabaseService.DBType.registerDatabase(MySQLDatabaseService.DB_NAME, MySQLDatabaseService.getInstance());
}
Also used : DatabaseConfiguration(com.google.refine.extension.database.DatabaseConfiguration) Parameters(org.testng.annotations.Parameters) BeforeTest(org.testng.annotations.BeforeTest)

Aggregations

DatabaseConfiguration (com.google.refine.extension.database.DatabaseConfiguration)22 BeforeTest (org.testng.annotations.BeforeTest)11 Parameters (org.testng.annotations.Parameters)11 IOException (java.io.IOException)8 ServletException (javax.servlet.ServletException)8 JsonGenerator (com.fasterxml.jackson.core.JsonGenerator)5 Writer (java.io.Writer)5 DatabaseServiceException (com.google.refine.extension.database.DatabaseServiceException)4 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 DatabaseInfo (com.google.refine.extension.database.model.DatabaseInfo)3