@Test public void testOnError() { final String errorMessage = "Test Exception"; final EngineIoServer server = new EngineIoServer(); final JettyWebSocketHandler handler = Mockito.spy(new JettyWebSocketHandler(server)); handler.onWebSocketError(new Exception(errorMessage)); Mockito.verify(handler, Mockito.times(1)) .emit(Mockito.eq("error"), Mockito.eq("write error"), Mockito.eq(errorMessage)); }
@Override public void onWebSocketError(Throwable cause) { emit("error", "write error", cause.getMessage()); }
JettyWebSocketHandler extends EngineIoWebSocket implements WebSocketListener { @Override public void onWebSocketError(Throwable cause) { emit("error", "write error", cause.getMessage()); } }
JettyWebSocketHandler extends EngineIoWebSocket implements WebSocketListener { @Override public void onWebSocketError(Throwable cause) { emit("error", "write error", cause.getMessage()); } @SuppressWarnings("WeakerAccess")  JettyWebSocketHandler(EngineIoServer server); }
JettyWebSocketHandler extends EngineIoWebSocket implements WebSocketListener { @Override public void onWebSocketError(Throwable cause) { emit("error", "write error", cause.getMessage()); } @SuppressWarnings("WeakerAccess")  JettyWebSocketHandler(EngineIoServer server); @Override Map<String, String> getQuery(); @Override void write(String message); @Override void write(byte[] message); @Override void close(); @Override void onWebSocketConnect(Session session); @Override void onWebSocketClose(int statusCode, String reason); @Override void onWebSocketError(Throwable cause); @Override void onWebSocketBinary(byte[] payload, int offset, int len); @Override void onWebSocketText(String message); }
JettyWebSocketHandler extends EngineIoWebSocket implements WebSocketListener { @Override public void onWebSocketError(Throwable cause) { emit("error", "write error", cause.getMessage()); } @SuppressWarnings("WeakerAccess")  JettyWebSocketHandler(EngineIoServer server); @Override Map<String, String> getQuery(); @Override void write(String message); @Override void write(byte[] message); @Override void close(); @Override void onWebSocketConnect(Session session); @Override void onWebSocketClose(int statusCode, String reason); @Override void onWebSocketError(Throwable cause); @Override void onWebSocketBinary(byte[] payload, int offset, int len); @Override void onWebSocketText(String message);  }