net.javacrumbs.mocksocket.connection.matcher
Class MatcherBasedMockConnection

java.lang.Object
  extended by net.javacrumbs.mocksocket.connection.AbstractMockConnection
      extended by net.javacrumbs.mocksocket.connection.matcher.MatcherBasedMockConnection
All Implemented Interfaces:
Connection, MatcherBasedMockRecorder, MatcherBasedMockResultRecorder, MockConnection

public class MatcherBasedMockConnection
extends AbstractMockConnection
implements MockConnection, MatcherBasedMockResultRecorder, MatcherBasedMockRecorder

Mock connection that is based on Matchers.

Author:
Lukas Krecan

Field Summary
 
Fields inherited from class net.javacrumbs.mocksocket.connection.AbstractMockConnection
actualConnection
 
Constructor Summary
MatcherBasedMockConnection(String address)
           
 
Method Summary
 MatcherBasedMockResultRecorder andWhenPayload(org.hamcrest.Matcher<byte[]> matcher)
           
 InputStream getInputStream()
           
 MatcherBasedMockRecorder thenReturn(byte[] data)
           
 
Methods inherited from class net.javacrumbs.mocksocket.connection.AbstractMockConnection
containsRequestThat, getActualConnection, getOutputStream, numberOfRequests, onCreate, requestData, setActualConnection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.javacrumbs.mocksocket.connection.MockConnection
containsRequestThat, numberOfRequests, onCreate, requestData
 
Methods inherited from interface net.javacrumbs.mocksocket.connection.Connection
getOutputStream
 

Constructor Detail

MatcherBasedMockConnection

public MatcherBasedMockConnection(String address)
Method Detail

getInputStream

public InputStream getInputStream()
                           throws IOException
Specified by:
getInputStream in interface Connection
Throws:
IOException

thenReturn

public MatcherBasedMockRecorder thenReturn(byte[] data)
Specified by:
thenReturn in interface MatcherBasedMockRecorder
Specified by:
thenReturn in interface MatcherBasedMockResultRecorder

andWhenPayload

public MatcherBasedMockResultRecorder andWhenPayload(org.hamcrest.Matcher<byte[]> matcher)
Specified by:
andWhenPayload in interface MatcherBasedMockRecorder


Copyright © 2011. All Rights Reserved.