Search in sources :

Example 1 with EzyCloseSessionImpl

use of com.tvd12.ezyfoxserver.command.impl.EzyCloseSessionImpl in project ezyfox-server by youngmonkeys.

the class EzyCloseSessionImplTest method test.

@Test
public void test() {
    EzyServerContext serverContext = mock(EzyServerContext.class);
    EzyCloseSessionImpl cmd = new EzyCloseSessionImpl(serverContext);
    EzyAbstractSession session = spy(EzyAbstractSession.class);
    EzyChannel channel = mock(EzyChannel.class);
    session.setChannel(channel);
    cmd.close(session, EzyDisconnectReason.ADMIN_BAN);
}
Also used : EzyAbstractSession(com.tvd12.ezyfoxserver.entity.EzyAbstractSession) EzyChannel(com.tvd12.ezyfoxserver.socket.EzyChannel) EzyServerContext(com.tvd12.ezyfoxserver.context.EzyServerContext) EzyCloseSessionImpl(com.tvd12.ezyfoxserver.command.impl.EzyCloseSessionImpl) BaseTest(com.tvd12.test.base.BaseTest) Test(org.testng.annotations.Test)

Example 2 with EzyCloseSessionImpl

use of com.tvd12.ezyfoxserver.command.impl.EzyCloseSessionImpl in project ezyfox-server by youngmonkeys.

the class EzyCloseSessionImplTest method noSendToClient.

@Test
public void noSendToClient() {
    EzyServerContext serverContext = mock(EzyServerContext.class);
    EzyCloseSessionImpl cmd = new EzyCloseSessionImpl(serverContext);
    EzyAbstractSession session = spy(EzyAbstractSession.class);
    EzyChannel channel = mock(EzyChannel.class);
    session.setChannel(channel);
    cmd.close(session, EzyDisconnectReason.UNKNOWN);
}
Also used : EzyAbstractSession(com.tvd12.ezyfoxserver.entity.EzyAbstractSession) EzyChannel(com.tvd12.ezyfoxserver.socket.EzyChannel) EzyServerContext(com.tvd12.ezyfoxserver.context.EzyServerContext) EzyCloseSessionImpl(com.tvd12.ezyfoxserver.command.impl.EzyCloseSessionImpl) BaseTest(com.tvd12.test.base.BaseTest) Test(org.testng.annotations.Test)

Aggregations

EzyCloseSessionImpl (com.tvd12.ezyfoxserver.command.impl.EzyCloseSessionImpl)2 EzyServerContext (com.tvd12.ezyfoxserver.context.EzyServerContext)2 EzyAbstractSession (com.tvd12.ezyfoxserver.entity.EzyAbstractSession)2 EzyChannel (com.tvd12.ezyfoxserver.socket.EzyChannel)2 BaseTest (com.tvd12.test.base.BaseTest)2 Test (org.testng.annotations.Test)2