use of nl.topicus.jdbc.test.integration.ddl.TableDDLTester in project spanner-jdbc by olavloite.
the class CloudSpannerIT method performJdbcTests.
private void performJdbcTests() throws Exception {
// Get a JDBC connection
try (Connection connection = createConnection()) {
connection.setAutoCommit(false);
// Test connection validity
assertTrue(connection.isValid(0));
assertTrue(connection.isValid(1));
assertTrue(connection.isValid(1000));
// Check node count
assertEquals(1, ((CloudSpannerConnection) connection).getNodeCount());
// Test connection pooling
ConnectionPoolingTester poolingTester = new ConnectionPoolingTester();
poolingTester.testPooling((CloudSpannerConnection) connection);
// Test Table DDL statements
TableDDLTester tableDDLTester = new TableDDLTester(connection);
tableDDLTester.runCreateTests();
// Test DML statements
DMLTester dmlTester = new DMLTester(connection);
dmlTester.runDMLTests();
// Test meta data functions
MetaDataTester metaDataTester = new MetaDataTester((CloudSpannerConnection) connection);
metaDataTester.runMetaDataTests();
// Test transaction functions
TransactionTester txTester = new TransactionTester(connection);
txTester.runTransactionTests();
// Test select statements
SelectStatementsTester selectTester = new SelectStatementsTester(connection);
selectTester.runSelectTests();
// Test XA transactions
XATester xaTester = new XATester();
xaTester.testXA(getProject(), instanceId, DATABASE_ID, credentialsPath);
// Test drop statements
tableDDLTester.runDropTests();
} catch (SQLException | PropertyVetoException | AssertionError e) {
log.log(Level.WARNING, "Error during JDBC tests", e);
throw e;
}
}
Aggregations