()
| 1175 | |
| 1176 | // Defaults to localhost apparently |
| 1177 | @Test |
| 1178 | public void handleMetaZnodeNoHost() throws Exception { |
| 1179 | final ZKCallback cb = zk_client.new ZKCallback(); |
| 1180 | |
| 1181 | final ServerName server = ServerName.newBuilder() |
| 1182 | .setHostName("").setPort(50511).build(); |
| 1183 | final MetaRegionServer meta_server = MetaRegionServer.newBuilder() |
| 1184 | .setServer(server).build(); |
| 1185 | final byte[] data = new byte[meta_server.getSerializedSize() + 10]; |
| 1186 | data[0] = ZKCallback.MAGIC; |
| 1187 | Bytes.setInt(data, 1, 1); |
| 1188 | Bytes.setInt(data, HBaseClient.PBUF_MAGIC, 6); |
| 1189 | System.arraycopy(meta_server.toByteArray(), 0, data, 10, |
| 1190 | meta_server.getSerializedSize()); |
| 1191 | |
| 1192 | final RegionClient rc = cb.handleMetaZnode(data); |
| 1193 | assertNotNull(rc); |
| 1194 | assertEquals("127.0.0.1:50511", rc.getRemoteAddress()); |
| 1195 | verifyPrivate(client).invoke("newClient", "127.0.0.1", 50511); |
| 1196 | } |
| 1197 | |
| 1198 | // TODO - to be fixed in the source code |
| 1199 | @Test (expected = ArrayIndexOutOfBoundsException.class) |
nothing calls this directly
no test coverage detected