Examples of preparePost()


Examples of com.ning.http.client.AsyncHttpClient.preparePost()

        try {
            // Suspend
            c.preparePost(urlTarget).addParameter("message", "cacheme").execute().get();

            // Broadcast
            c.preparePost(urlTarget).addParameter("message", "cachememe").execute().get();

            //Suspend
            Response r = c.prepareGet(urlTarget + "/subscribeAndResume").addHeader("X-Cache-Date", String.valueOf(t1)).execute(new AsyncCompletionHandler<Response>() {

                @Override
View Full Code Here

Examples of com.ning.http.client.AsyncHttpClient.preparePost()

                }
            });

            // Let Atmosphere suspend the connections.
            Thread.sleep(2500);
            c.preparePost(urlTarget + "/programmaticDelayBroadcast").addParameter("message", "foo").execute().get();
            c.preparePost(urlTarget + "/publishAndResume").addParameter("message", "bar").execute().get();

            try {
                latch.await(20, TimeUnit.SECONDS);
            } catch (InterruptedException e) {
View Full Code Here

Examples of com.ning.http.client.AsyncHttpClient.preparePost()

            });

            // Let Atmosphere suspend the connections.
            Thread.sleep(2500);
            c.preparePost(urlTarget + "/programmaticDelayBroadcast").addParameter("message", "foo").execute().get();
            c.preparePost(urlTarget + "/publishAndResume").addParameter("message", "bar").execute().get();

            try {
                latch.await(20, TimeUnit.SECONDS);
            } catch (InterruptedException e) {
                fail(e.getMessage());
View Full Code Here

Examples of com.ning.http.client.AsyncHttpClient.preparePost()

                }
            });

            // Let Atmosphere suspend the connections.
            Thread.sleep(2500);
            c.preparePost(urlTarget + "/scheduleAndResume").addParameter("message", "foo").execute().get();

            try {
                latch.await(20, TimeUnit.SECONDS);
            } catch (InterruptedException e) {
                fail(e.getMessage());
View Full Code Here

Examples of com.ning.http.client.AsyncHttpClient.preparePost()

                }
            });

            // Let Atmosphere suspend the connections.
            Thread.sleep(4000);
            c.preparePost(urlTarget + "/filter").addParameter("message", "<script>foo</script>").execute().get();

            try {
                latch.await(20, TimeUnit.SECONDS);
            } catch (InterruptedException e) {
                fail(e.getMessage());
View Full Code Here

Examples of com.ning.http.client.AsyncHttpClient.preparePost()

            });

            // Let Atmosphere suspend the connections.
            Thread.sleep(2500);
            for (int i = 0; i < 10; i++) {
                c.preparePost(urlTarget + "/aggregate").addParameter("message",
                        "==================================================").execute().get(5, TimeUnit.SECONDS);
            }


            try {
View Full Code Here

Examples of com.ning.http.client.AsyncHttpClient.preparePost()

                }
            });

            // Let Atmosphere suspend the connections.
            Thread.sleep(2500);
            Response r = c.preparePost(urlTarget + "/programmaticDelayBroadcast").addParameter("message", "foo").execute().get();
            assertEquals(r.getStatusCode(), 200);
            r = c.preparePost(urlTarget + "/publishAndResume").addParameter("message", "bar").execute().get();
            assertEquals(r.getStatusCode(), 200);

            try {
View Full Code Here

Examples of com.ning.http.client.AsyncHttpClient.preparePost()

            // Let Atmosphere suspend the connections.
            Thread.sleep(2500);
            Response r = c.preparePost(urlTarget + "/programmaticDelayBroadcast").addParameter("message", "foo").execute().get();
            assertEquals(r.getStatusCode(), 200);
            r = c.preparePost(urlTarget + "/publishAndResume").addParameter("message", "bar").execute().get();
            assertEquals(r.getStatusCode(), 200);

            try {
                latch.await(20, TimeUnit.SECONDS);
            } catch (InterruptedException e) {
View Full Code Here

Examples of com.ning.http.client.AsyncHttpClient.preparePost()

        for (int i=0; i < 10000; i++) {
            b.append("======");
        }
        b.append("message");

        Response r = c.preparePost(targetUrl + "/suspend").setContentLength(b.toString().length()).setBody(b.toString()).execute().get();
        assertEquals(r.getStatusCode(), 200);

        l.await(5, TimeUnit.SECONDS);

        assertEquals(response.get().getStatusCode(), 200);
View Full Code Here

Examples of com.ning.http.client.AsyncHttpClient.preparePost()

        for (int i=0; i < 10000; i++) {
            b.append("======");
        }
        b.append("message");

        Response r = c.preparePost(targetUrl + "/suspend").setContentLength(b.toString().length()).setBody(b.toString()).execute().get();
        assertEquals(r.getStatusCode(), 200);

        l.await(5, TimeUnit.SECONDS);

        assertEquals(response.get().getStatusCode(), 200);
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.