()
| 347 | } |
| 348 | |
| 349 | @Test |
| 350 | public void multiAction() throws Exception { |
| 351 | final Counter counter = new Counter(); |
| 352 | Whitebox.setInternalState(hbase_client, "num_multi_rpcs", counter); |
| 353 | final MultiAction ma = new MultiAction(); |
| 354 | final PutRequest put1 = new PutRequest(TABLE, KEY, FAMILY, QUALIFIER, VALUE); |
| 355 | put1.setRegion(region); |
| 356 | ma.add(put1); |
| 357 | final PutRequest put2 = new PutRequest(TABLE, KEY, FAMILY, QUALIFIER, VALUE); |
| 358 | put2.setRegion(region); |
| 359 | ma.add(put2); |
| 360 | final Deferred<Object> deferred = ma.getDeferred(); |
| 361 | |
| 362 | region_client.sendRpc(ma); |
| 363 | |
| 364 | Exception ex = null; |
| 365 | try { |
| 366 | deferred.join(1); |
| 367 | } catch (Exception e) { |
| 368 | ex = e; |
| 369 | } |
| 370 | assertTrue(ex instanceof TimeoutException); |
| 371 | PowerMockito.verifyStatic(times(1)); |
| 372 | Channels.write((Channel)any(), (ChannelBuffer)any()); |
| 373 | verify(hbase_client, never()).sendRpcToRegion(ma); |
| 374 | assertEquals(1, region_client.stats().rpcsSent()); |
| 375 | assertEquals(0, region_client.stats().pendingBatchedRPCs()); |
| 376 | assertEquals(0, region_client.stats().pendingRPCs()); |
| 377 | assertEquals(1, counter.get()); |
| 378 | } |
| 379 | |
| 380 | @Test |
| 381 | public void multiActionToSingle() throws Exception { |
nothing calls this directly
no test coverage detected