@Test public void testSetOption() throws Exception { int optId = 1; Object option = new Object(); sniffySocket.setOption(optId, option); verifyPrivate(delegate).invoke("setOption", optId, option); verifyNoMoreInteractions(delegate); }
@Override public void setOption(int optID, Object value) throws SocketException { copyToDelegate(); long start = System.currentTimeMillis(); try { delegate.setOption(optID, value); if (SocketOptions.SO_RCVBUF == optID) { try { receiveBufferSize = ((Number) value).intValue(); } catch (Exception e) { } } else if (SocketOptions.SO_SNDBUF == optID) { try { sendBufferSize = ((Number) value).intValue(); } catch (Exception e) { } } } finally { logSocket(System.currentTimeMillis() - start); copyFromDelegate(); } }
SnifferSocketImpl extends SocketImpl implements SniffySocket { @Override public void setOption(int optID, Object value) throws SocketException { copyToDelegate(); long start = System.currentTimeMillis(); try { delegate.setOption(optID, value); if (SocketOptions.SO_RCVBUF == optID) { try { receiveBufferSize = ((Number) value).intValue(); } catch (Exception e) { } } else if (SocketOptions.SO_SNDBUF == optID) { try { sendBufferSize = ((Number) value).intValue(); } catch (Exception e) { } } } finally { logSocket(System.currentTimeMillis() - start); copyFromDelegate(); } } }
SnifferSocketImpl extends SocketImpl implements SniffySocket { @Override public void setOption(int optID, Object value) throws SocketException { copyToDelegate(); long start = System.currentTimeMillis(); try { delegate.setOption(optID, value); if (SocketOptions.SO_RCVBUF == optID) { try { receiveBufferSize = ((Number) value).intValue(); } catch (Exception e) { } } else if (SocketOptions.SO_SNDBUF == optID) { try { sendBufferSize = ((Number) value).intValue(); } catch (Exception e) { } } } finally { logSocket(System.currentTimeMillis() - start); copyFromDelegate(); } } protected  SnifferSocketImpl(SocketImpl delegate); }
SnifferSocketImpl extends SocketImpl implements SniffySocket { @Override public void setOption(int optID, Object value) throws SocketException { copyToDelegate(); long start = System.currentTimeMillis(); try { delegate.setOption(optID, value); if (SocketOptions.SO_RCVBUF == optID) { try { receiveBufferSize = ((Number) value).intValue(); } catch (Exception e) { } } else if (SocketOptions.SO_SNDBUF == optID) { try { sendBufferSize = ((Number) value).intValue(); } catch (Exception e) { } } } finally { logSocket(System.currentTimeMillis() - start); copyFromDelegate(); } } protected  SnifferSocketImpl(SocketImpl delegate); @Override void setConnectionStatus(Integer connectionStatus); @Override String toString(); @Override void setOption(int optID, Object value); @Override Object getOption(int optID); @Override InetSocketAddress getInetSocketAddress(); }
SnifferSocketImpl extends SocketImpl implements SniffySocket { @Override public void setOption(int optID, Object value) throws SocketException { copyToDelegate(); long start = System.currentTimeMillis(); try { delegate.setOption(optID, value); if (SocketOptions.SO_RCVBUF == optID) { try { receiveBufferSize = ((Number) value).intValue(); } catch (Exception e) { } } else if (SocketOptions.SO_SNDBUF == optID) { try { sendBufferSize = ((Number) value).intValue(); } catch (Exception e) { } } } finally { logSocket(System.currentTimeMillis() - start); copyFromDelegate(); } } protected  SnifferSocketImpl(SocketImpl delegate); @Override void setConnectionStatus(Integer connectionStatus); @Override String toString(); @Override void setOption(int optID, Object value); @Override Object getOption(int optID); @Override InetSocketAddress getInetSocketAddress();  }