@Test public void testSessionsAreClosedOnlyAfterOutstandingRequestsAreServed() { final IoSession ioSession = newSession(V2); ExecutionVenueServerHandler serverHandler = mock(ExecutionVenueServerHandler.class); when(serverHandler.getOutstandingRequests()).thenReturn(2l, 1l, 0l); sessionManager.shutdownSessions(singleton(ioSession), cougarProtocol, serverHandler); final InOrder inOrder = inOrder(ioSession, serverHandler); inOrder.verify(ioSession).write(isA(SuspendMessage.class)); inOrder.verify(serverHandler, times(3)).getOutstandingRequests(); inOrder.verify(ioSession).write(isA(DisconnectMessage.class)); }
public void shutdownSessions(Set<IoSession> ioSessions, CougarProtocol cougarProtocol, ExecutionVenueServerHandler handler) { shutdownSessions(ioSessions, cougarProtocol, handler, false); }
IoSessionManager { public void shutdownSessions(Set<IoSession> ioSessions, CougarProtocol cougarProtocol, ExecutionVenueServerHandler handler) { shutdownSessions(ioSessions, cougarProtocol, handler, false); } }
IoSessionManager { public void shutdownSessions(Set<IoSession> ioSessions, CougarProtocol cougarProtocol, ExecutionVenueServerHandler handler) { shutdownSessions(ioSessions, cougarProtocol, handler, false); }  }
IoSessionManager { public void shutdownSessions(Set<IoSession> ioSessions, CougarProtocol cougarProtocol, ExecutionVenueServerHandler handler) { shutdownSessions(ioSessions, cougarProtocol, handler, false); }  void shutdownSessions(Set<IoSession> ioSessions, CougarProtocol cougarProtocol, ExecutionVenueServerHandler handler); void shutdownSessions(Set<IoSession> ioSessions, CougarProtocol cougarProtocol, ExecutionVenueServerHandler handler, boolean blockUntilComplete); void setMaxTimeToWaitForRequestCompletion(long maxTimeToWaitForRequestCompletion); void setNioLogger(NioLogger nioLogger); void waitForOutstandingRequestsToComplete(final ExecutionVenueServerHandler handler); }
IoSessionManager { public void shutdownSessions(Set<IoSession> ioSessions, CougarProtocol cougarProtocol, ExecutionVenueServerHandler handler) { shutdownSessions(ioSessions, cougarProtocol, handler, false); }  void shutdownSessions(Set<IoSession> ioSessions, CougarProtocol cougarProtocol, ExecutionVenueServerHandler handler); void shutdownSessions(Set<IoSession> ioSessions, CougarProtocol cougarProtocol, ExecutionVenueServerHandler handler, boolean blockUntilComplete); void setMaxTimeToWaitForRequestCompletion(long maxTimeToWaitForRequestCompletion); void setNioLogger(NioLogger nioLogger); void waitForOutstandingRequestsToComplete(final ExecutionVenueServerHandler handler);  }