Search in sources :

Example 1 with ConnectionClosingException

use of org.apache.hadoop.hbase.exceptions.ConnectionClosingException in project hbase by apache.

the class TestIPCUtil method testWrapException.

@Test
public void testWrapException() throws Exception {
    final InetSocketAddress address = InetSocketAddress.createUnresolved("localhost", 0);
    assertTrue(wrapException(address, new ConnectException()) instanceof ConnectException);
    assertTrue(wrapException(address, new SocketTimeoutException()) instanceof SocketTimeoutException);
    assertTrue(wrapException(address, new ConnectionClosingException("Test AbstractRpcClient#wrapException")) instanceof ConnectionClosingException);
    assertTrue(wrapException(address, new CallTimeoutException("Test AbstractRpcClient#wrapException")).getCause() instanceof CallTimeoutException);
}
Also used : SocketTimeoutException(java.net.SocketTimeoutException) InetSocketAddress(java.net.InetSocketAddress) ConnectionClosingException(org.apache.hadoop.hbase.exceptions.ConnectionClosingException) ConnectException(java.net.ConnectException) Test(org.junit.Test)

Aggregations

ConnectException (java.net.ConnectException)1 InetSocketAddress (java.net.InetSocketAddress)1 SocketTimeoutException (java.net.SocketTimeoutException)1 ConnectionClosingException (org.apache.hadoop.hbase.exceptions.ConnectionClosingException)1 Test (org.junit.Test)1