Search in sources :

Example 1 with EzyWebSocketSecureServerCreator

use of com.tvd12.ezyfoxserver.nio.builder.impl.EzyWebSocketSecureServerCreator in project ezyfox-server by youngmonkeys.

the class EzyWebSocketSecureServerCreatorTest method test.

@Test
public void test() throws Exception {
    SSLContext sslContext = SSLContext.getDefault();
    EzySimpleWebSocketSetting webSocketSetting = new EzySimpleWebSocketSetting();
    EzyWebSocketSecureServerCreator creator = new EzyWebSocketSecureServerCreator(sslContext);
    creator.setting(webSocketSetting);
    creator.create();
    EzyWsHandler wsHandler = MethodInvoker.create().object(creator).method("newWsHandler").invoke(EzyWsHandler.class);
    WebSocketCreator webSocketCreator = MethodInvoker.create().object(creator).method("newWebSocketCreator").param(EzyWsHandler.class, wsHandler).invoke(WebSocketCreator.class);
    webSocketCreator.createWebSocket(null, null);
}
Also used : EzySimpleWebSocketSetting(com.tvd12.ezyfoxserver.setting.EzySimpleWebSocketSetting) EzyWsHandler(com.tvd12.ezyfoxserver.nio.websocket.EzyWsHandler) EzyWebSocketSecureServerCreator(com.tvd12.ezyfoxserver.nio.builder.impl.EzyWebSocketSecureServerCreator) SSLContext(javax.net.ssl.SSLContext) WebSocketCreator(org.eclipse.jetty.websocket.servlet.WebSocketCreator) BaseTest(com.tvd12.test.base.BaseTest) Test(org.testng.annotations.Test)

Aggregations

EzyWebSocketSecureServerCreator (com.tvd12.ezyfoxserver.nio.builder.impl.EzyWebSocketSecureServerCreator)1 EzyWsHandler (com.tvd12.ezyfoxserver.nio.websocket.EzyWsHandler)1 EzySimpleWebSocketSetting (com.tvd12.ezyfoxserver.setting.EzySimpleWebSocketSetting)1 BaseTest (com.tvd12.test.base.BaseTest)1 SSLContext (javax.net.ssl.SSLContext)1 WebSocketCreator (org.eclipse.jetty.websocket.servlet.WebSocketCreator)1 Test (org.testng.annotations.Test)1