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 void
close()
java.net.InetAddress
getInetAddress()
java.io.InputStream
getInputStream()
boolean
getKeepAlive()
java.net.InetAddress
getLocalAddress()
int
getLocalPort()
java.io.OutputStream
getOutputStream()
int
getPort()
int
getReceiveBufferSize()
int
getSendBufferSize()
int
getSoLinger()
int
getSoTimeout()
boolean
getTcpNoDelay()
void
setExpectedCloseCalls(int aCount)
void
setExpectedSoTimeout(int aSoTimeout)
void
setKeepAlive(boolean on)
void
setReceiveBufferSize(int size)
void
setSendBufferSize(int size)
void
setSoLinger(boolean on, int linger)
void
setSoTimeout(int aSoTimeout)
void
setTcpNoDelay(boolean on)
void
setupGetInputStream(java.io.InputStream anInputStream)
void
setupGetOutputStream(java.io.OutputStream anOutputStream)
void
shutdownInput()
void
shutdownOutput()
-
Methods inherited from class com.mockobjects.MockObject
notImplemented, notYetImplemented, verify
-
-
-
-
Method Detail
-
getInetAddress
public java.net.InetAddress getInetAddress()
- Specified by:
getInetAddress
in interfaceSocket
-
getLocalAddress
public java.net.InetAddress getLocalAddress()
- Specified by:
getLocalAddress
in interfaceSocket
-
getLocalPort
public int getLocalPort()
- Specified by:
getLocalPort
in interfaceSocket
-
setupGetInputStream
public void setupGetInputStream(java.io.InputStream anInputStream)
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException
- Specified by:
getInputStream
in 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:
getOutputStream
in interfaceSocket
- Throws:
java.io.IOException
-
setTcpNoDelay
public void setTcpNoDelay(boolean on) throws java.net.SocketException
- Specified by:
setTcpNoDelay
in interfaceSocket
- Throws:
java.net.SocketException
-
getTcpNoDelay
public boolean getTcpNoDelay() throws java.net.SocketException
- Specified by:
getTcpNoDelay
in interfaceSocket
- Throws:
java.net.SocketException
-
setSoLinger
public void setSoLinger(boolean on, int linger) throws java.net.SocketException
- Specified by:
setSoLinger
in interfaceSocket
- Throws:
java.net.SocketException
-
getSoLinger
public int getSoLinger() throws java.net.SocketException
- Specified by:
getSoLinger
in interfaceSocket
- Throws:
java.net.SocketException
-
setExpectedSoTimeout
public void setExpectedSoTimeout(int aSoTimeout)
-
setSoTimeout
public void setSoTimeout(int aSoTimeout) throws java.net.SocketException
- Specified by:
setSoTimeout
in interfaceSocket
- Throws:
java.net.SocketException
-
getSoTimeout
public int getSoTimeout() throws java.net.SocketException
- Specified by:
getSoTimeout
in interfaceSocket
- Throws:
java.net.SocketException
-
setSendBufferSize
public void setSendBufferSize(int size) throws java.net.SocketException
- Specified by:
setSendBufferSize
in interfaceSocket
- Throws:
java.net.SocketException
-
getSendBufferSize
public int getSendBufferSize() throws java.net.SocketException
- Specified by:
getSendBufferSize
in interfaceSocket
- Throws:
java.net.SocketException
-
setReceiveBufferSize
public void setReceiveBufferSize(int size) throws java.net.SocketException
- Specified by:
setReceiveBufferSize
in interfaceSocket
- Throws:
java.net.SocketException
-
getReceiveBufferSize
public int getReceiveBufferSize() throws java.net.SocketException
- Specified by:
getReceiveBufferSize
in interfaceSocket
- Throws:
java.net.SocketException
-
setKeepAlive
public void setKeepAlive(boolean on) throws java.net.SocketException
- Specified by:
setKeepAlive
in interfaceSocket
- Throws:
java.net.SocketException
-
getKeepAlive
public boolean getKeepAlive() throws java.net.SocketException
- Specified by:
getKeepAlive
in 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:
shutdownInput
in interfaceSocket
- Throws:
java.io.IOException
-
shutdownOutput
public void shutdownOutput() throws java.io.IOException
- Specified by:
shutdownOutput
in interfaceSocket
- Throws:
java.io.IOException
-
-