()
| 775 | } |
| 776 | |
| 777 | @Test |
| 778 | public void handleRootZnode91Resolve() throws Exception { |
| 779 | final InetAddress addr = mock(InetAddress.class); |
| 780 | when(addr.getHostAddress()).thenReturn("192.168.1.1"); |
| 781 | mockStatic(InetAddress.class); |
| 782 | PowerMockito.when(InetAddress.getByName("myzkhost")).thenReturn(addr); |
| 783 | |
| 784 | final ZKCallback cb = zk_client.new ZKCallback(); |
| 785 | final byte[] data = "myzkhost,50511,1388534400000".getBytes(CHARSET); |
| 786 | final RegionClient rc = cb.handleRootZnode(data); |
| 787 | assertNotNull(rc); |
| 788 | assertEquals("192.168.1.1:50511", rc.getRemoteAddress()); |
| 789 | verifyPrivate(client).invoke("newClient", "192.168.1.1", 50511); |
| 790 | } |
| 791 | |
| 792 | @Test (expected = NumberFormatException.class) |
| 793 | public void handleRootZnode91NoPort() throws Exception { |
nothing calls this directly
no test coverage detected