Search in sources :

Example 1 with TableDDLTester

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;
    }
}
Also used : XATester(nl.topicus.jdbc.test.integration.xa.XATester) PropertyVetoException(java.beans.PropertyVetoException) MetaDataTester(nl.topicus.jdbc.test.integration.ddl.MetaDataTester) SQLException(java.sql.SQLException) CloudSpannerSQLException(nl.topicus.jdbc.exception.CloudSpannerSQLException) Connection(java.sql.Connection) CloudSpannerConnection(nl.topicus.jdbc.CloudSpannerConnection) TableDDLTester(nl.topicus.jdbc.test.integration.ddl.TableDDLTester) DMLTester(nl.topicus.jdbc.test.integration.dml.DMLTester)

Aggregations

PropertyVetoException (java.beans.PropertyVetoException)1 Connection (java.sql.Connection)1 SQLException (java.sql.SQLException)1 CloudSpannerConnection (nl.topicus.jdbc.CloudSpannerConnection)1 CloudSpannerSQLException (nl.topicus.jdbc.exception.CloudSpannerSQLException)1 MetaDataTester (nl.topicus.jdbc.test.integration.ddl.MetaDataTester)1 TableDDLTester (nl.topicus.jdbc.test.integration.ddl.TableDDLTester)1 DMLTester (nl.topicus.jdbc.test.integration.dml.DMLTester)1 XATester (nl.topicus.jdbc.test.integration.xa.XATester)1