use of com.tvd12.ezyfoxserver.socket.EzyNonBlockingPacketQueue in project ezyfox-server by youngmonkeys.
the class EzySocketWriterTest method processSessionTicketsQueue0ExceptionCase.
@Test
public void processSessionTicketsQueue0ExceptionCase() {
EzySessionTicketsQueue sessionTicketsQueue = new EzyBlockingSessionTicketsQueue();
EzySocketWriterGroupFetcher writerGroupFetcher = mock(EzySocketWriterGroupFetcher.class);
when(writerGroupFetcher.getWriterGroup(any(EzySession.class))).thenThrow(new IllegalArgumentException());
EzySocketWriter socketWriter = new EzySocketWriter();
socketWriter.setSessionTicketsQueue(sessionTicketsQueue);
socketWriter.setWriterGroupFetcher(writerGroupFetcher);
EzyPacketQueue packetQueue = new EzyNonBlockingPacketQueue();
EzyPacket packet = new EzySimplePacket();
packetQueue.add(packet);
EzyAbstractSession session = spy(EzyAbstractSession.class);
session.setActivated(true);
session.setSessionTicketsQueue(sessionTicketsQueue);
session.setPacketQueue(packetQueue);
sessionTicketsQueue.add(session);
socketWriter.handleEvent();
}
Aggregations