Package com.mockobjects.net
Class MockSocket
- java.lang.Object
-
- com.mockobjects.MockObject
-
- com.mockobjects.net.MockSocket
-
- All Implemented Interfaces:
Socket,Verifiable
public class MockSocket extends MockObject implements Socket
-
-
Constructor Summary
Constructors Constructor Description MockSocket()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()java.net.InetAddressgetInetAddress()java.io.InputStreamgetInputStream()booleangetKeepAlive()java.net.InetAddressgetLocalAddress()intgetLocalPort()java.io.OutputStreamgetOutputStream()intgetPort()intgetReceiveBufferSize()intgetSendBufferSize()intgetSoLinger()intgetSoTimeout()booleangetTcpNoDelay()voidsetExpectedCloseCalls(int aCount)voidsetExpectedSoTimeout(int aSoTimeout)voidsetKeepAlive(boolean on)voidsetReceiveBufferSize(int size)voidsetSendBufferSize(int size)voidsetSoLinger(boolean on, int linger)voidsetSoTimeout(int aSoTimeout)voidsetTcpNoDelay(boolean on)voidsetupGetInputStream(java.io.InputStream anInputStream)voidsetupGetOutputStream(java.io.OutputStream anOutputStream)voidshutdownInput()voidshutdownOutput()-
Methods inherited from class com.mockobjects.MockObject
notImplemented, notYetImplemented, verify
-
-
-
-
Method Detail
-
getInetAddress
public java.net.InetAddress getInetAddress()
- Specified by:
getInetAddressin interfaceSocket
-
getLocalAddress
public java.net.InetAddress getLocalAddress()
- Specified by:
getLocalAddressin interfaceSocket
-
getLocalPort
public int getLocalPort()
- Specified by:
getLocalPortin interfaceSocket
-
setupGetInputStream
public void setupGetInputStream(java.io.InputStream anInputStream)
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException- Specified by:
getInputStreamin interfaceSocket- Throws:
java.io.IOException
-
setupGetOutputStream
public void setupGetOutputStream(java.io.OutputStream anOutputStream)
-
getOutputStream
public java.io.OutputStream getOutputStream() throws java.io.IOException- Specified by:
getOutputStreamin interfaceSocket- Throws:
java.io.IOException
-
setTcpNoDelay
public void setTcpNoDelay(boolean on) throws java.net.SocketException- Specified by:
setTcpNoDelayin interfaceSocket- Throws:
java.net.SocketException
-
getTcpNoDelay
public boolean getTcpNoDelay() throws java.net.SocketException- Specified by:
getTcpNoDelayin interfaceSocket- Throws:
java.net.SocketException
-
setSoLinger
public void setSoLinger(boolean on, int linger) throws java.net.SocketException- Specified by:
setSoLingerin interfaceSocket- Throws:
java.net.SocketException
-
getSoLinger
public int getSoLinger() throws java.net.SocketException- Specified by:
getSoLingerin interfaceSocket- Throws:
java.net.SocketException
-
setExpectedSoTimeout
public void setExpectedSoTimeout(int aSoTimeout)
-
setSoTimeout
public void setSoTimeout(int aSoTimeout) throws java.net.SocketException- Specified by:
setSoTimeoutin interfaceSocket- Throws:
java.net.SocketException
-
getSoTimeout
public int getSoTimeout() throws java.net.SocketException- Specified by:
getSoTimeoutin interfaceSocket- Throws:
java.net.SocketException
-
setSendBufferSize
public void setSendBufferSize(int size) throws java.net.SocketException- Specified by:
setSendBufferSizein interfaceSocket- Throws:
java.net.SocketException
-
getSendBufferSize
public int getSendBufferSize() throws java.net.SocketException- Specified by:
getSendBufferSizein interfaceSocket- Throws:
java.net.SocketException
-
setReceiveBufferSize
public void setReceiveBufferSize(int size) throws java.net.SocketException- Specified by:
setReceiveBufferSizein interfaceSocket- Throws:
java.net.SocketException
-
getReceiveBufferSize
public int getReceiveBufferSize() throws java.net.SocketException- Specified by:
getReceiveBufferSizein interfaceSocket- Throws:
java.net.SocketException
-
setKeepAlive
public void setKeepAlive(boolean on) throws java.net.SocketException- Specified by:
setKeepAlivein interfaceSocket- Throws:
java.net.SocketException
-
getKeepAlive
public boolean getKeepAlive() throws java.net.SocketException- Specified by:
getKeepAlivein interfaceSocket- Throws:
java.net.SocketException
-
setExpectedCloseCalls
public void setExpectedCloseCalls(int aCount)
-
close
public void close() throws java.io.IOException
-
shutdownInput
public void shutdownInput() throws java.io.IOException- Specified by:
shutdownInputin interfaceSocket- Throws:
java.io.IOException
-
shutdownOutput
public void shutdownOutput() throws java.io.IOException- Specified by:
shutdownOutputin interfaceSocket- Throws:
java.io.IOException
-
-