use of voldemort.store.socket.clientrequest.ClientRequestExecutor in project voldemort by voldemort.
the class ClientRequestExecutorPoolTest method testClosingDeactivates.
@Test
public void testClosingDeactivates() throws Exception {
ClientRequestExecutor sas1 = pool.checkout(dest1);
sas1.close();
pool.checkin(dest1, sas1);
ClientRequestExecutor sas2 = pool.checkout(dest1);
assertTrue(sas1 != sas2);
}
use of voldemort.store.socket.clientrequest.ClientRequestExecutor in project voldemort by voldemort.
the class ClientRequestExecutorPoolTest method testNonBlockingCheckoutConnectionFailure.
private void testNonBlockingCheckoutConnectionFailure(ClientRequestExecutorPool execPool, SocketDestination dest, Class<?> expectedExceptionClass) throws Exception {
try {
ClientRequestExecutor resource = execPool.internalGetQueuedPool().internalNonBlockingGet(dest);
// operation and returns null most likely.
if (resource == null) {
Thread.sleep(execPool.getFactory().getTimeout() + 5);
execPool.internalGetQueuedPool().internalNonBlockingGet(dest);
}
fail("should have thrown an connection exception");
} catch (UnreachableStoreException e) {
assertEquals("inner exception should be of type connect exception", expectedExceptionClass, e.getCause().getClass());
}
}
Aggregations