Search in sources :

Example 1 with InvalidConnectionInfoException

use of org.apache.drill.exec.client.InvalidConnectionInfoException in project drill by axbaretto.

the class JdbcConnectTriesTestEmbeddedBits method testDirectConnectionInvalidConnectTries.

@Test
public void testDirectConnectionInvalidConnectTries() throws SQLException {
    Connection connection = null;
    try {
        connection = testDrillDriver.connect("jdbc:drill:drillbit=127.0.0.1:5000,127.0.0.1:5001;tries=abc", getDefaultProperties());
        fail();
    } catch (SQLException ex) {
        assertNull(connection);
        assertTrue(ex.getCause() instanceof InvalidConnectionInfoException);
    }
}
Also used : SQLException(java.sql.SQLException) Connection(java.sql.Connection) InvalidConnectionInfoException(org.apache.drill.exec.client.InvalidConnectionInfoException) Test(org.junit.Test) JdbcTest(org.apache.drill.categories.JdbcTest)

Example 2 with InvalidConnectionInfoException

use of org.apache.drill.exec.client.InvalidConnectionInfoException in project drill by apache.

the class JdbcConnectTriesTestEmbeddedBits method testDirectConnectionInvalidConnectTries.

@Test
public void testDirectConnectionInvalidConnectTries() throws SQLException {
    Connection connection = null;
    try {
        connection = testDrillDriver.connect("jdbc:drill:drillbit=127.0.0.1:5000,127.0.0.1:5001;tries=abc", getDefaultProperties());
        fail();
    } catch (SQLException ex) {
        assertNull(connection);
        assertTrue(ex.getCause() instanceof InvalidConnectionInfoException);
    }
}
Also used : SQLException(java.sql.SQLException) Connection(java.sql.Connection) InvalidConnectionInfoException(org.apache.drill.exec.client.InvalidConnectionInfoException) Test(org.junit.Test) JdbcTest(org.apache.drill.categories.JdbcTest)

Example 3 with InvalidConnectionInfoException

use of org.apache.drill.exec.client.InvalidConnectionInfoException in project drill by apache.

the class JdbcConnectTriesTestEmbeddedBits method testZKConnectionInvalidConnectTries.

@Test
public void testZKConnectionInvalidConnectTries() throws SQLException {
    Connection connection = null;
    try {
        connection = testDrillDriver.connect("jdbc:drill:zk=local;tries=abc", getDefaultProperties());
        fail();
    } catch (SQLException ex) {
        assertNull(connection);
        assertTrue(ex.getCause() instanceof InvalidConnectionInfoException);
    }
}
Also used : SQLException(java.sql.SQLException) Connection(java.sql.Connection) InvalidConnectionInfoException(org.apache.drill.exec.client.InvalidConnectionInfoException) Test(org.junit.Test) JdbcTest(org.apache.drill.categories.JdbcTest)

Example 4 with InvalidConnectionInfoException

use of org.apache.drill.exec.client.InvalidConnectionInfoException in project drill by axbaretto.

the class JdbcConnectTriesTestEmbeddedBits method testZKConnectionInvalidConnectTries.

@Test
public void testZKConnectionInvalidConnectTries() throws SQLException {
    Connection connection = null;
    try {
        connection = testDrillDriver.connect("jdbc:drill:zk=local;tries=abc", getDefaultProperties());
        fail();
    } catch (SQLException ex) {
        assertNull(connection);
        assertTrue(ex.getCause() instanceof InvalidConnectionInfoException);
    }
}
Also used : SQLException(java.sql.SQLException) Connection(java.sql.Connection) InvalidConnectionInfoException(org.apache.drill.exec.client.InvalidConnectionInfoException) Test(org.junit.Test) JdbcTest(org.apache.drill.categories.JdbcTest)

Aggregations

Connection (java.sql.Connection)4 SQLException (java.sql.SQLException)4 JdbcTest (org.apache.drill.categories.JdbcTest)4 InvalidConnectionInfoException (org.apache.drill.exec.client.InvalidConnectionInfoException)4 Test (org.junit.Test)4