Search in sources :

Example 86 with EzyServerContext

use of com.tvd12.ezyfoxserver.context.EzyServerContext in project ezyfox-server by youngmonkeys.

the class EzyWebSocketServerBootstrapTest method newSocketServerCreatorWithSSL.

@Test
public void newSocketServerCreatorWithSSL() {
    // given
    SSLContext sslContext = mock(SSLContext.class);
    EzyServerContext serverContext = mock(EzyServerContext.class);
    EzySimpleServer server = new EzySimpleServer();
    when(serverContext.getServer()).thenReturn(server);
    EzySimpleSettings settings = new EzySimpleSettings();
    settings.getWebsocket().setSslActive(true);
    server.setSettings(settings);
    EzyWebSocketServerBootstrap sut = EzyWebSocketServerBootstrap.builder().sslContext(sslContext).serverContext(serverContext).build();
    // when
    EzyWebSocketServerCreator creator = MethodUtil.invokeMethod("newSocketServerCreator", sut);
    // then
    Asserts.assertNotNull(creator);
}
Also used : EzySimpleServer(com.tvd12.ezyfoxserver.EzySimpleServer) EzyWebSocketServerBootstrap(com.tvd12.ezyfoxserver.nio.EzyWebSocketServerBootstrap) EzyServerContext(com.tvd12.ezyfoxserver.context.EzyServerContext) SSLContext(javax.net.ssl.SSLContext) EzySimpleSettings(com.tvd12.ezyfoxserver.setting.EzySimpleSettings) EzyWebSocketServerCreator(com.tvd12.ezyfoxserver.nio.builder.impl.EzyWebSocketServerCreator) Test(org.testng.annotations.Test)

Aggregations

EzyServerContext (com.tvd12.ezyfoxserver.context.EzyServerContext)72 Test (org.testng.annotations.Test)67 EzyZoneContext (com.tvd12.ezyfoxserver.context.EzyZoneContext)46 EzyAbstractSession (com.tvd12.ezyfoxserver.entity.EzyAbstractSession)25 EzySession (com.tvd12.ezyfoxserver.entity.EzySession)25 BaseTest (com.tvd12.test.base.BaseTest)23 EzySessionManager (com.tvd12.ezyfoxserver.wrapper.EzySessionManager)22 EzyZoneUserManager (com.tvd12.ezyfoxserver.wrapper.EzyZoneUserManager)21 EzySimpleServer (com.tvd12.ezyfoxserver.EzySimpleServer)20 EzyServer (com.tvd12.ezyfoxserver.EzyServer)17 EzySettings (com.tvd12.ezyfoxserver.setting.EzySettings)16 EzyArray (com.tvd12.ezyfox.entity.EzyArray)14 EzyAppContext (com.tvd12.ezyfoxserver.context.EzyAppContext)14 EzyResponse (com.tvd12.ezyfoxserver.response.EzyResponse)13 BaseCoreTest (com.tvd12.ezyfoxserver.testing.BaseCoreTest)13 EzySimpleZone (com.tvd12.ezyfoxserver.EzySimpleZone)12 EzyChannel (com.tvd12.ezyfoxserver.socket.EzyChannel)12 EzyZone (com.tvd12.ezyfoxserver.EzyZone)11 EzyController (com.tvd12.ezyfoxserver.controller.EzyController)11 EzyLoggerSetting (com.tvd12.ezyfoxserver.setting.EzyLoggerSetting)11