MCPcopy Index your code
hub / github.com/OpenTSDB/asynchbase / callbackWithTimeout

Method callbackWithTimeout

test/TestHBaseRpc.java:231–246  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 3

hasDeferredMethod · 0.80
getDeferredMethod · 0.45
callbackMethod · 0.45

Tested by

no test coverage detected