* @return
* @throws Exception
*/
@Test
public void testNonExistingOpCode() throws Exception {
TestableZooKeeper zk = createClient();
final String path = "/m1";
RequestHeader h = new RequestHeader();
h.setType(888); // This code does not exists
ExistsRequest request = new ExistsRequest();
request.setPath(path);
request.setWatch(false);
ExistsResponse response = new ExistsResponse();
ReplyHeader r = zk.submitRequest(h, request, response, null);
Assert.assertEquals(r.getErr(), Code.UNIMPLEMENTED.intValue());
try {
zk.exists("/m1", false);
fail("The connection should have been closed");
} catch (KeeperException.ConnectionLossException expected) {
}
}