Package org.atmosphere.cpr

Examples of org.atmosphere.cpr.AtmosphereRequest.header()


    @Test
    public void testSuspend() throws IOException, ServletException {

        AtmosphereRequest request = new AtmosphereRequest.Builder().pathInfo("/j").method("GET").build();
        request.header(X_ATMOSPHERE_TRANSPORT, LONG_POLLING_TRANSPORT);
        framework.doCometSupport(request, AtmosphereResponse.newInstance());
        assertNotNull(r.get());
    }

    public final static class I extends AtmosphereInterceptorAdapter {
View Full Code Here


    @Test
    public void testPriority() throws IOException, ServletException {

        AtmosphereRequest request = new AtmosphereRequest.Builder().pathInfo("/priority").method("GET").build();
        request.header(X_ATMOSPHERE_TRANSPORT, LONG_POLLING_TRANSPORT);
        framework.doCometSupport(request, AtmosphereResponse.newInstance());
        assertEquals(framework.getAtmosphereHandlers().get("/priority").interceptors.getFirst().toString(), "XXX");

        assertNotNull(r.get());
    }
View Full Code Here

    @Test
    public void testOverrideBroadcaster() throws IOException, ServletException {
        framework.setDefaultBroadcasterClassName(SimpleBroadcaster.class.getName());

        AtmosphereRequest request = new AtmosphereRequest.Builder().pathInfo("/override").method("GET").build();
        request.header(X_ATMOSPHERE_TRANSPORT, LONG_POLLING_TRANSPORT);
        framework.doCometSupport(request, AtmosphereResponse.newInstance());

        assertNotNull(r.get());
        assertEquals(r.get().getBroadcaster().getClass().getName(), SimpleBroadcaster.class.getName());
View Full Code Here

        AtmosphereRequest request = new AtmosphereRequest.Builder()
                .pathInfo("/heartbeat")
                .method("GET")
                .build();

        request.header(X_ATMOSPHERE_TRANSPORT, WEBSOCKET_TRANSPORT);
        framework.doCometSupport(request, AtmosphereResponse.newInstance());

        // Check suspend
        final AtmosphereResource res = r.get();
        assertNotNull(res);
View Full Code Here

        request = new AtmosphereRequest.Builder()
                .pathInfo("/heartbeat")
                .method("GET")
                .body(Heartbeat.paddingData)
                .build();
        request.header(X_ATMOSPHERE_TRANSPORT, WEBSOCKET_TRANSPORT);
        request.setAttribute(HeartbeatInterceptor.INTERCEPTOR_ADDED, "");
        res.initialize(res.getAtmosphereConfig(), res.getBroadcaster(), request, AtmosphereResponse.newInstance(), framework.getAsyncSupport(), res.getAtmosphereHandler());
        request.setAttribute(FrameworkConfig.INJECTED_ATMOSPHERE_RESOURCE, res);
        framework.doCometSupport(request, AtmosphereResponse.newInstance());
        assertNotNull(message.get());
View Full Code Here

                    }
                    return Action.CANCELLED;
                }
            }

            request.header(HeaderConfig.X_ATMO_PROTOCOL, null);

            // Extract heartbeat data
            int heartbeatInterval = 0;
            String heartbeatData = "";
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.