net.javacrumbs.mocksocket.connection
Class UniversalMockConnection
java.lang.Object
net.javacrumbs.mocksocket.connection.UniversalMockConnection
- All Implemented Interfaces:
- Connection, MockConnection, UniversalMockRecorder
public class UniversalMockConnection
- extends Object
- implements UniversalMockRecorder, MockConnection
Mock connection that creates and wraps either SequentialMockConnection or MatcherBasedMockConnection.
- Author:
- Lukas Krecan
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UniversalMockConnection
public UniversalMockConnection(String address)
andReturn
public SequentialMockRecorder andReturn(byte[] data)
- Specified by:
andReturn in interface UniversalMockRecorder
andWhenPayload
public MatcherBasedMockResultRecorder andWhenPayload(org.hamcrest.Matcher<byte[]> matcher)
- Specified by:
andWhenPayload in interface UniversalMockRecorder
onCreate
public void onCreate()
- Specified by:
onCreate in interface MockConnection
getInputStream
public InputStream getInputStream()
throws IOException
- Specified by:
getInputStream in interface Connection
- Throws:
IOException
getOutputStream
public OutputStream getOutputStream()
throws IOException
- Specified by:
getOutputStream in interface Connection
- Throws:
IOException
requestData
public byte[] requestData(int i)
- Specified by:
requestData in interface MockConnection
numberOfRequests
public int numberOfRequests()
- Specified by:
numberOfRequests in interface MockConnection
containsRequestThat
public boolean containsRequestThat(org.hamcrest.Matcher<byte[]> matcher)
- Specified by:
containsRequestThat in interface MockConnection
Copyright © 2011. All Rights Reserved.