public abstract class MockConnection extends Connection
| Modifier and Type | Class and Description |
|---|---|
class |
MockConnection.MBusTestInputStream |
class |
MockConnection.MBusTestOutputStream |
Connection.State| Modifier and Type | Field and Description |
|---|---|
protected static Logger |
log |
DEFAULT_BAUDRATE, is, os| Constructor and Description |
|---|
MockConnection(int bitPerSecond,
int responseTimeoutOffset) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkNoDataLeft()
Checks if data is empty, if not throws an exception to mark the position
|
void |
close() |
protected MockConnection.MBusTestInputStream |
getMockIs() |
protected MockConnection.MBusTestOutputStream |
getMockOs() |
protected abstract void |
lastByteReading(long endWaitTime) |
protected abstract void |
lastByteWriting() |
void |
open() |
void |
replay() |
protected abstract void |
setNextData(boolean removeFirst) |
createFromJSON, fromJSON, getBitPerSecond, getConnState, getInputStream, getJsonFieldName, getLoggingStream, getName, getOutputStrteam, getResponseTimeOutOffset, setBitPerSecond, setConnState, setLoggingStream, setResponseTimeOutOffset, toJSONprotected static final Logger log
public MockConnection(int bitPerSecond,
int responseTimeoutOffset)
protected MockConnection.MBusTestInputStream getMockIs()
protected MockConnection.MBusTestOutputStream getMockOs()
public void close()
throws IOException
IOExceptionpublic void open()
throws IOException
open in class ConnectionIOExceptionprotected abstract void lastByteReading(long endWaitTime)
throws IOException
IOExceptionprotected abstract void lastByteWriting()
throws IOException
IOExceptionpublic boolean checkNoDataLeft()
throws IOException
IOException - if data is not emptypublic void replay()
protected abstract void setNextData(boolean removeFirst)
Copyright © 2009–2016 MBus4J. All rights reserved.