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;
}
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()));
}
Aggregations