use of com.tvd12.ezyfoxserver.socket.EzySocketDisconnection in project ezyfox-server by youngmonkeys.
the class EzySocketDisconnectionHandlerTest method hasNoHandlerGroupCaseTest.
@Test
public void hasNoHandlerGroupCaseTest() {
EzySocketDisconnectionHandler handler = new EzySocketDisconnectionHandler();
EzySocketDisconnectionQueue disconnectionQueue = new EzyBlockingSocketDisconnectionQueue();
EzySocketDataHandlerGroupRemover dataHandlerGroupRemover = mock(EzySocketDataHandlerGroupRemover.class);
when(dataHandlerGroupRemover.removeHandlerGroup(any(EzySession.class))).thenReturn(null);
EzySession session = spy(EzyAbstractSession.class);
EzySocketDisconnection disconnection = new EzySimpleSocketDisconnection(session);
disconnectionQueue.add(disconnection);
handler.setDisconnectionQueue(disconnectionQueue);
handler.setDataHandlerGroupRemover(dataHandlerGroupRemover);
handler.handleEvent();
}
use of com.tvd12.ezyfoxserver.socket.EzySocketDisconnection in project ezyfox-server by youngmonkeys.
the class EzyBlockingSocketDisconnectionQueueTest method test.
@Test
public void test() {
EzyBlockingSocketDisconnectionQueue queue = new EzyBlockingSocketDisconnectionQueue();
assert queue.isEmpty();
assert queue.size() == 0;
EzySocketDisconnection disconnection = mock(EzySocketDisconnection.class);
queue.add(disconnection);
assert queue.size() == 1;
queue.remove(disconnection);
assert queue.size() == 0;
}
Aggregations