use of org.apache.drill.exec.rpc.RpcException in project drill by apache.
the class TestCustomUserAuthenticator method negativeAuthHelper.
private static void negativeAuthHelper(final String user, final String password) throws Exception {
RpcException negativeAuthEx = null;
try {
runTest(user, password);
} catch (RpcException e) {
negativeAuthEx = e;
}
assertNotNull("Expected RpcException.", negativeAuthEx);
final String exMsg = negativeAuthEx.getMessage();
assertThat(exMsg, containsString("Authentication failed"));
assertThat(exMsg, containsString("Incorrect credentials"));
}
use of org.apache.drill.exec.rpc.RpcException in project drill by apache.
the class JdbcConnectTriesTestEmbeddedBits method testDirectConnectionConnectTriesLessThanDrillbitCount.
@Test
public void testDirectConnectionConnectTriesLessThanDrillbitCount() throws SQLException {
Connection connection = null;
try {
connection = testDrillDriver.connect("jdbc:drill:drillbit=127.0.0.1:5000,127.0.0.1:5001;tries=1", JdbcAssert.getDefaultProperties());
fail();
} catch (SQLException ex) {
assertNull(connection);
assertTrue(ex.getCause() instanceof RpcException);
assertTrue(ex.getCause().getCause() instanceof ExecutionException);
}
}
use of org.apache.drill.exec.rpc.RpcException in project drill by apache.
the class JdbcConnectTriesTestEmbeddedBits method testDirectConnectionConnectTriesGreaterThanDrillbitCount.
@Test
public void testDirectConnectionConnectTriesGreaterThanDrillbitCount() throws SQLException {
Connection connection = null;
try {
connection = testDrillDriver.connect("jdbc:drill:drillbit=127.0.0.1:5000,127.0.0.1:5001;tries=5", JdbcAssert.getDefaultProperties());
fail();
} catch (SQLException ex) {
assertNull(connection);
assertTrue(ex.getCause() instanceof RpcException);
assertTrue(ex.getCause().getCause() instanceof ExecutionException);
}
}
use of org.apache.drill.exec.rpc.RpcException in project drill by apache.
the class JdbcConnectTriesTestEmbeddedBits method testDirectConnectionZeroConnectTries.
@Test
public void testDirectConnectionZeroConnectTries() throws SQLException {
Connection connection = null;
try {
connection = testDrillDriver.connect("jdbc:drill:drillbit=127.0.0.1:5000,127.0.0.1:5001;tries=0", JdbcAssert.getDefaultProperties());
fail();
} catch (SQLException ex) {
assertNull(connection);
assertTrue(ex.getCause() instanceof RpcException);
assertTrue(ex.getCause().getCause() instanceof ExecutionException);
}
}
use of org.apache.drill.exec.rpc.RpcException in project drill by apache.
the class JdbcConnectTriesTestEmbeddedBits method testDirectConnectionNegativeConnectTries.
@Test
public void testDirectConnectionNegativeConnectTries() throws SQLException {
Connection connection = null;
try {
connection = testDrillDriver.connect("jdbc:drill:drillbit=127.0.0.1:5000,127.0.0.1:5001;tries=-5", JdbcAssert.getDefaultProperties());
fail();
} catch (SQLException ex) {
assertNull(connection);
assertTrue(ex.getCause() instanceof RpcException);
assertTrue(ex.getCause().getCause() instanceof ExecutionException);
}
}
Aggregations