()
| 229 | } |
| 230 | |
| 231 | @Test |
| 232 | public void callbackWithTimeout() throws Exception { |
| 233 | final GetRequest rpc = new GetRequest(TABLE, KEY, FAMILY); |
| 234 | rpc.attempt = 4; |
| 235 | final Timeout timeout_handle = mock(Timeout.class); |
| 236 | final Deferred<Object> deferred = rpc.getDeferred(); |
| 237 | final Object response = new Object(); |
| 238 | rpc.timeout_handle = timeout_handle; |
| 239 | assertTrue(rpc.hasDeferred()); |
| 240 | |
| 241 | rpc.callback(response); |
| 242 | assertSame(response, deferred.join()); |
| 243 | assertEquals(0, rpc.attempt); |
| 244 | assertFalse(rpc.hasDeferred()); |
| 245 | verify(timeout_handle).cancel(); |
| 246 | } |
| 247 | |
| 248 | @Test |
| 249 | public void callbackWithoutDeferred() throws Exception { |
nothing calls this directly
no test coverage detected