Search in sources :

Example 1 with TomcatWebSocketTestServer

use of org.springframework.web.socket.TomcatWebSocketTestServer in project spring-framework by spring-projects.

the class WebSocketStompClientIntegrationTests method setUp.

@Before
public void setUp() throws Exception {
    logger.debug("Setting up before '" + this.testName.getMethodName() + "'");
    this.wac = new AnnotationConfigWebApplicationContext();
    this.wac.register(TestConfig.class);
    this.wac.refresh();
    this.server = new TomcatWebSocketTestServer();
    this.server.setup();
    this.server.deployConfig(this.wac);
    this.server.start();
    WebSocketClient webSocketClient = new StandardWebSocketClient();
    this.stompClient = new WebSocketStompClient(webSocketClient);
    this.stompClient.setMessageConverter(new StringMessageConverter());
}
Also used : StringMessageConverter(org.springframework.messaging.converter.StringMessageConverter) TomcatWebSocketTestServer(org.springframework.web.socket.TomcatWebSocketTestServer) StandardWebSocketClient(org.springframework.web.socket.client.standard.StandardWebSocketClient) WebSocketClient(org.springframework.web.socket.client.WebSocketClient) StandardWebSocketClient(org.springframework.web.socket.client.standard.StandardWebSocketClient) AnnotationConfigWebApplicationContext(org.springframework.web.context.support.AnnotationConfigWebApplicationContext) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 StringMessageConverter (org.springframework.messaging.converter.StringMessageConverter)1 AnnotationConfigWebApplicationContext (org.springframework.web.context.support.AnnotationConfigWebApplicationContext)1 TomcatWebSocketTestServer (org.springframework.web.socket.TomcatWebSocketTestServer)1 WebSocketClient (org.springframework.web.socket.client.WebSocketClient)1 StandardWebSocketClient (org.springframework.web.socket.client.standard.StandardWebSocketClient)1