Search in sources :

Example 1 with SparkWebSocketCreator

use of spark.embeddedserver.jetty.websocket.WebSocketCreatorFactory.SparkWebSocketCreator in project spark by perwendel.

the class WebSocketCreatorFactoryTest method testCreateWebSocketHandler.

@Test
public void testCreateWebSocketHandler() {
    WebSocketCreator annotated = WebSocketCreatorFactory.create(new WebSocketHandlerClassWrapper(AnnotatedHandler.class));
    assertTrue(annotated instanceof SparkWebSocketCreator);
    assertTrue(SparkWebSocketCreator.class.cast(annotated).getHandler() instanceof AnnotatedHandler);
    WebSocketCreator listener = WebSocketCreatorFactory.create(new WebSocketHandlerClassWrapper(ListenerHandler.class));
    assertTrue(listener instanceof SparkWebSocketCreator);
    assertTrue(SparkWebSocketCreator.class.cast(listener).getHandler() instanceof ListenerHandler);
}
Also used : SparkWebSocketCreator(spark.embeddedserver.jetty.websocket.WebSocketCreatorFactory.SparkWebSocketCreator) WebSocketCreator(org.eclipse.jetty.websocket.servlet.WebSocketCreator) SparkWebSocketCreator(spark.embeddedserver.jetty.websocket.WebSocketCreatorFactory.SparkWebSocketCreator) Test(org.junit.Test)

Aggregations

WebSocketCreator (org.eclipse.jetty.websocket.servlet.WebSocketCreator)1 Test (org.junit.Test)1 SparkWebSocketCreator (spark.embeddedserver.jetty.websocket.WebSocketCreatorFactory.SparkWebSocketCreator)1