Examples of SockJsService


Examples of org.jboss.aerogear.io.netty.handler.codec.sockjs.SockJsService

    @Test
    public void webSocketCloseSession() throws Exception {
        final String serviceName = "/closesession";
        final String sessionUrl = serviceName + "/222/" + UUID.randomUUID().toString();
        final SockJsConfig config = SockJsConfig.withPrefix(serviceName).build();
        final SockJsService sockJsService = mock(SockJsService.class);
        final EmbeddedChannel ch = wsChannelForService(factoryFor(sockJsService, config));

        final FullHttpRequest request = webSocketUpgradeRequest(sessionUrl + "/websocket", V13.toHttpHeaderValue());
        ch.writeInbound(request);
View Full Code Here

Examples of org.jboss.aerogear.io.netty.handler.codec.sockjs.SockJsService

    private static FullHttpRequest httpGetRequest(final String path, final HttpVersion version) {
        return new DefaultFullHttpRequest(version, GET, path);
    }

    private static EmbeddedChannel channelForMockService(final SockJsConfig config) {
        final SockJsService service = mock(SockJsService.class);
        return channelForService(factoryFor(service, config));
    }
View Full Code Here

Examples of org.jboss.aerogear.io.netty.handler.codec.sockjs.SockJsService

public class SockJsSessionTest {

    @Test
    public void setState() throws Exception {
        final SockJsService service = mock(SockJsService.class);
        final SockJsSession session = new SockJsSession("123", service);
        session.setState(State.OPEN);
        assertThat(session.getState(), is(State.OPEN));
    }
View Full Code Here

Examples of org.jboss.aerogear.io.netty.handler.codec.sockjs.SockJsService

        assertThat(session.getState(), is(State.OPEN));
    }

    @Test
    public void onOpen() throws Exception {
        final SockJsService service = mock(SockJsService.class);
        final SockJsSession sockJSSession = new SockJsSession("123", service);
        final SockJsSessionContext session = mock(SockJsSessionContext.class);
        sockJSSession.onOpen(session);
        verify(service).onOpen(session);
        assertThat(sockJSSession.getState(), is(State.OPEN));
View Full Code Here

Examples of org.jboss.aerogear.io.netty.handler.codec.sockjs.SockJsService

        assertThat(sockJSSession.getState(), is(State.OPEN));
    }

    @Test
    public void onMessage() throws Exception {
        final SockJsService service = mock(SockJsService.class);
        final SockJsSession sockJSSession = new SockJsSession("123", service);
        sockJSSession.onMessage("testing");
        verify(service).onMessage("testing");
    }
View Full Code Here

Examples of org.jboss.aerogear.io.netty.handler.codec.sockjs.SockJsService

        verify(service).onMessage("testing");
    }

    @Test
    public void onClose() throws Exception {
        final SockJsService service = mock(SockJsService.class);
        final SockJsSession sockJSSession = new SockJsSession("123", service);
        sockJSSession.onClose();
        verify(service).onClose();
    }
View Full Code Here

Examples of org.jboss.aerogear.io.netty.handler.codec.sockjs.SockJsService

        verify(service).onClose();
    }

    @Test
    public void addMessage() throws Exception {
        final SockJsService service = mock(SockJsService.class);
        final SockJsSession sockJSSession = new SockJsSession("123", service);
        sockJSSession.addMessage("hello");
        assertThat(sockJSSession.getAllMessages().size(), is(1));
    }
View Full Code Here

Examples of org.jboss.aerogear.io.netty.handler.codec.sockjs.SockJsService

        assertThat(sockJSSession.getAllMessages().size(), is(1));
    }

    @Test
    public void addMessages() throws Exception {
        final SockJsService service = mock(SockJsService.class);
        final SockJsSession sockJSSession = new SockJsSession("123", service);
        sockJSSession.addMessages(new String[]{"hello", "world"});
        final List<String> messages = sockJSSession.getAllMessages();
        assertThat(messages.size(), is(2));
        assertThat(messages.get(0), equalTo("hello"));
View Full Code Here

Examples of org.springframework.web.socket.sockjs.SockJsService

    assertNotNull(handlerMapping);

    SockJsHttpRequestHandler testHandler = (SockJsHttpRequestHandler) handlerMapping.getUrlMap().get("/test/**");
    assertNotNull(testHandler);
    unwrapAndCheckDecoratedHandlerType(testHandler.getWebSocketHandler(), TestWebSocketHandler.class);
    SockJsService testSockJsService = testHandler.getSockJsService();

    SockJsHttpRequestHandler fooHandler = (SockJsHttpRequestHandler) handlerMapping.getUrlMap().get("/foo/**");
    assertNotNull(fooHandler);
    unwrapAndCheckDecoratedHandlerType(fooHandler.getWebSocketHandler(), FooWebSocketHandler.class);
    SockJsService sockJsService = fooHandler.getSockJsService();
    assertNotNull(sockJsService);

    assertSame(testSockJsService, sockJsService);

    assertThat(sockJsService, instanceOf(DefaultSockJsService.class));
View Full Code Here

Examples of org.springframework.web.socket.sockjs.SockJsService

    SockJsHttpRequestHandler handler = (SockJsHttpRequestHandler) handlerMapping.getUrlMap().get("/test/**");
    assertNotNull(handler);
    unwrapAndCheckDecoratedHandlerType(handler.getWebSocketHandler(), TestWebSocketHandler.class);

    SockJsService sockJsService = handler.getSockJsService();
    assertNotNull(sockJsService);
    assertThat(sockJsService, instanceOf(TransportHandlingSockJsService.class));
    TransportHandlingSockJsService transportService = (TransportHandlingSockJsService) sockJsService;
    assertThat(transportService.getTaskScheduler(), instanceOf(TestTaskScheduler.class));
    assertThat(transportService.getTransportHandlers().values(),
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.