public class JdbcTestBase extends ExecTest
Modifier and Type | Class and Description |
---|---|
static class |
JdbcTestBase.ModelAndSchema |
static class |
JdbcTestBase.TestDataConnection |
DrillTest.MemWatcher
Modifier and Type | Field and Description |
---|---|
org.junit.rules.TestRule |
watcher |
c, dirTestWatcher, optionManager
logOutcome, objectMapper, REPEAT_RULE, thrownException, TIMEOUT
Constructor and Description |
---|
JdbcTestBase() |
Modifier and Type | Method and Description |
---|---|
protected static void |
changeSchema(Connection conn,
String schema) |
protected static void |
changeSchemaIfSupplied(Connection conn,
Properties info)
Changes schema of the given connection if the field "schema" is present in
info . |
protected static Connection |
connect() |
protected static Connection |
connect(String url)
Creates a
connection using default parameters. |
protected static Connection |
connect(String url,
Properties info)
Creates a
connection using the given parameters. |
static Properties |
getDefaultProperties()
Returns default bag of properties that is passed to JDBC connection.
|
protected static void |
reset()
Resets the factory closing all of the active connections.
|
static void |
setUpTestCase() |
static void |
tearDownTestCase() |
void |
testJdbcTestConnectionResettingCompatibility()
Test of whether tests that get connection from JdbcTest.connect(...)
work with resetting of connections.
|
static String |
toString(ResultSet resultSet) |
static String |
toString(ResultSet resultSet,
int expectedRecordCount) |
static JdbcTestBase.ModelAndSchema |
withFull(String schema) |
static JdbcTestBase.ModelAndSchema |
withModel(String model,
String schema) |
static JdbcTestBase.ModelAndSchema |
withNoDefaultSchema() |
clear, getLocalFileSystem, mockDrillbitContext, mockUsDateFormatSymbols, mockUtcDateTimeZone, parseExpr, setupOptionManager
escapeJsonString, finishDrillTest, initDrillTest
public static void setUpTestCase()
protected static Connection connect(String url) throws SQLException
connection
using default parameters.url
- connection URLSQLException
- if connection failsprotected static Connection connect() throws SQLException
SQLException
protected static Connection connect(String url, Properties info) throws SQLException
connection
using the given parameters.url
- connection URLinfo
- connection infoSQLException
- if connection failsprotected static void changeSchemaIfSupplied(Connection conn, Properties info)
info
.
Does nothing otherwise.protected static void changeSchema(Connection conn, String schema)
protected static void reset()
public static Properties getDefaultProperties()
public static JdbcTestBase.ModelAndSchema withModel(String model, String schema)
public static JdbcTestBase.ModelAndSchema withFull(String schema)
public static JdbcTestBase.ModelAndSchema withNoDefaultSchema()
public static String toString(ResultSet resultSet, int expectedRecordCount) throws SQLException
SQLException
public static String toString(ResultSet resultSet) throws SQLException
SQLException
public void testJdbcTestConnectionResettingCompatibility()
Copyright © 2021 The Apache Software Foundation. All rights reserved.