()
| 665 | } |
| 666 | |
| 667 | @Test |
| 668 | public void processResultRootCallWaiters() throws Exception { |
| 669 | final Deferred<Object> root = zk_client.getDeferredRoot(); |
| 670 | final Deferred<Object> root2 = zk_client.getDeferredRoot(); |
| 671 | assertNotNull(root); |
| 672 | assertNotNull(root2); |
| 673 | assertTrue(root != root2); |
| 674 | final ZKCallback cb = zk_client.new ZKCallback(); |
| 675 | final byte[] data = "127.0.0.1:50511".getBytes(CHARSET); |
| 676 | cb.processResult(Code.OK.intValue(), "/hbase/root-region-server", null, |
| 677 | data, stat); |
| 678 | verifyPrivate(client).invoke("newClient", "127.0.0.1", 50511); |
| 679 | verifyPrivate(zk_client, times(2)).invoke("connectZK"); |
| 680 | verifyPrivate(zk_client).invoke("disconnectZK"); |
| 681 | verifyPrivate(zk_client, never()).invoke("retryGetRootRegionLater"); |
| 682 | assertEquals(Byte.valueOf("1"), |
| 683 | (Byte)Whitebox.getInternalState(cb, "found_root")); |
| 684 | assertEquals(Byte.valueOf("0"), |
| 685 | (Byte)Whitebox.getInternalState(cb, "found_meta")); |
| 686 | assertNotNull(root.joinUninterruptibly()); |
| 687 | assertNotNull(root2.joinUninterruptibly()); |
| 688 | } |
| 689 | |
| 690 | @Test |
| 691 | public void handleRootZnode90() throws Exception { |
nothing calls this directly
no test coverage detected