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, toJSON
protected static final Logger log
public MockConnection(int bitPerSecond, int responseTimeoutOffset)
protected MockConnection.MBusTestInputStream getMockIs()
protected MockConnection.MBusTestOutputStream getMockOs()
public void close() throws IOException
IOException
public void open() throws IOException
open
in class Connection
IOException
protected abstract void lastByteReading(long endWaitTime) throws IOException
IOException
protected abstract void lastByteWriting() throws IOException
IOException
public 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.