Package org.apache.zookeeper

Examples of org.apache.zookeeper.TestableZooKeeper


     * @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) {
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.zookeeper.TestableZooKeeper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.