Search in sources :

Example 1 with TestingMySqlServer

use of io.airlift.testing.mysql.TestingMySqlServer in project hetu-core by openlookeng.

the class MySqlQueryRunner method createTestingMySqlServer.

public static final TestingMySqlServer createTestingMySqlServer(String userName, String password, String schemaName, String dataBase) throws Exception {
    TestingMySqlServer tempServer = null;
    final int createRetry = 3;
    for (int i = 0; i < createRetry; i++) {
        try {
            if (dataBase == null) {
                tempServer = new TestingMySqlServer(userName, password, schemaName);
            } else {
                tempServer = new TestingMySqlServer(userName, password, schemaName, dataBase);
            }
        } catch (Exception e) {
            if (i == (createRetry - 1)) {
                throw e;
            }
            continue;
        }
        break;
    }
    return tempServer;
}
Also used : TestingMySqlServer(io.airlift.testing.mysql.TestingMySqlServer)

Example 2 with TestingMySqlServer

use of io.airlift.testing.mysql.TestingMySqlServer in project hetu-core by openlookeng.

the class TestIndexRecordManager method setup.

@BeforeClass
public void setup() throws Exception {
    mysqlServer = new TestingMySqlServer("test", "mysql", "metastore1", "metastore2");
    testMetastore1 = new JdbcHetuMetastore(new JdbcMetastoreConfig().setDbUrl(mysqlServer.getJdbcUrl("metastore1")).setDbUser(mysqlServer.getUser()).setDbPassword(mysqlServer.getPassword()));
    testMetastore2 = new JdbcHetuMetastore(new JdbcMetastoreConfig().setDbUrl(mysqlServer.getJdbcUrl("metastore2")).setDbUser(mysqlServer.getUser()).setDbPassword(mysqlServer.getPassword()));
}
Also used : TestingMySqlServer(io.airlift.testing.mysql.TestingMySqlServer) JdbcHetuMetastore(io.hetu.core.metastore.jdbc.JdbcHetuMetastore) JdbcMetastoreConfig(io.hetu.core.metastore.jdbc.JdbcMetastoreConfig) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

TestingMySqlServer (io.airlift.testing.mysql.TestingMySqlServer)2 JdbcHetuMetastore (io.hetu.core.metastore.jdbc.JdbcHetuMetastore)1 JdbcMetastoreConfig (io.hetu.core.metastore.jdbc.JdbcMetastoreConfig)1 BeforeClass (org.testng.annotations.BeforeClass)1