Examples of ZSession


Examples of org.apache.zookeeper.server.jersey.jaxb.ZSession

                    Response.Status.INTERNAL_SERVER_ERROR).build());
        }

        URI uri = ui.getAbsolutePathBuilder().path(uuid).build();
        return Response.created(uri).entity(
                new JSONWithPadding(new ZSession(uuid, uri.toString())))
                .build();
    }
View Full Code Here

Examples of org.apache.zookeeper.server.jersey.jaxb.ZSession

        return cr.getEntity(ZSession.class);
    }

    @Test
    public void testCreateNewSession() throws JSONException {
        ZSession session = createSession();
        assertEquals(session.id.length(), 36);

        // use out-of-band method to verify
        assertTrue(ZooKeeperService.isConnected(CONTEXT_PATH, session.id));
    }
View Full Code Here

Examples of org.apache.zookeeper.server.jersey.jaxb.ZSession

        assertTrue(ZooKeeperService.isConnected(CONTEXT_PATH, session.id));
    }

    @Test
    public void testSessionExpires() throws InterruptedException {
        ZSession session = createSession("1");

        // use out-of-band method to verify
        assertTrue(ZooKeeperService.isConnected(CONTEXT_PATH, session.id));

        // wait for the session to be closed
View Full Code Here

Examples of org.apache.zookeeper.server.jersey.jaxb.ZSession

        assertFalse(ZooKeeperService.isConnected(CONTEXT_PATH, session.id));
    }

    @Test
    public void testDeleteSession() {
        ZSession session = createSession("30");

        WebResource wr = sessionsr.path(session.id);
        Builder b = wr.accept(MediaType.APPLICATION_JSON);

        assertTrue(ZooKeeperService.isConnected(CONTEXT_PATH, session.id));
View Full Code Here

Examples of org.apache.zookeeper.server.jersey.jaxb.ZSession

        assertFalse(ZooKeeperService.isConnected(CONTEXT_PATH, session.id));
    }
   
    @Test
    public void testSendHeartbeat() throws InterruptedException {
        ZSession session = createSession("2");
       
        Thread.sleep(1000);
        WebResource wr = sessionsr.path(session.id);
        Builder b = wr.accept(MediaType.APPLICATION_JSON);
       
View Full Code Here

Examples of org.apache.zookeeper.server.jersey.jaxb.ZSession

    }
   
    @Test
    public void testCreateEphemeralZNode()
    throws KeeperException, InterruptedException, IOException {
        ZSession session = createSession("30");
       
        WebResource wr = znodesr.path("/")
            .queryParam("op", "create")
            .queryParam("name", "ephemeral-test")
            .queryParam("ephemeral", "true")
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.