#include <TransportStub.h> [code]
Inherits Protocols::Generics::Transport.
Inheritance diagram for Protocols::Generics::Testing::TransportStub:


This class can be used to perform state-based test verification. You can set and get the stub's state by accessing the public member variables readBuffer and writeBuffer. All read functions will read bytes from the start of readBuffer and will then purge the read bytes. All peek functions will only read the start of the readBuffer without purging anything from it. The write function will append the write bytes to the beginning of writeBuffer. You should call writeBuffer.reserve(count) to set the maximum size of the write buffer, so that canWrite() functions correctly.
Definition at line 51 of file TransportStub.h.
Public Member Functions | |
| TransportStub () | |
| Default constructor. | |
| void | connectToNode (const Uri &) |
| Tries to establish a connection to node. | |
| void | disconnectFromNode () |
| Disconnects from the remote node. | |
| void | abort () |
| Aborts the connection with the remote node. | |
| bool | canRead (int count) const |
| QByteArray | peek (int count) const |
| QByteArray | peekAtMost (int count) const |
| QByteArray | peekTo (const QByteArray &delimiter) const |
| QByteArray | peekAll () const |
| QByteArray | read (int count) |
| QByteArray | readAtMost (int count) |
| QByteArray | readTo (const QByteArray &delimiter) |
| QByteArray | readAll () |
| bool | canWrite (int count) const |
| bool | write (const QByteArray &bytes, bool flush) |
| void | setTransportStatus (TransportStatus *) |
| operator Transport * () | |
Public Attributes | |
| QByteArray | readBuffer |
| QByteArray | writeBuffer |
| TransportStatus * | status |
|
|
Default constructor.
Definition at line 28 of file TransportStub.cpp. |
|
|
Aborts the connection with the remote node.
Implements Protocols::Generics::Connection. Definition at line 44 of file TransportStub.cpp. |
|
|
Implements Protocols::Generics::Buffer. Definition at line 48 of file TransportStub.cpp. |
|
|
Implements Protocols::Generics::Buffer. Definition at line 107 of file TransportStub.cpp. |
|
|
Tries to establish a connection to node.
Implements Protocols::Generics::Connection. Definition at line 34 of file TransportStub.cpp. |
|
|
Disconnects from the remote node.
Implements Protocols::Generics::Connection. Definition at line 39 of file TransportStub.cpp. |
|
|
Definition at line 133 of file TransportStub.cpp. |
|
|
Implements Protocols::Generics::Buffer. Definition at line 53 of file TransportStub.cpp. |
|
|
Implements Protocols::Generics::Buffer. Definition at line 73 of file TransportStub.cpp. |
|
|
Implements Protocols::Generics::Buffer. Definition at line 59 of file TransportStub.cpp. |
|
|
Implements Protocols::Generics::Buffer. Definition at line 66 of file TransportStub.cpp. |
|
|
Implements Protocols::Generics::Buffer. Definition at line 79 of file TransportStub.cpp. |
|
|
Implements Protocols::Generics::Buffer. Definition at line 100 of file TransportStub.cpp. |
|
|
Implements Protocols::Generics::Buffer. Definition at line 86 of file TransportStub.cpp. |
|
|
Implements Protocols::Generics::Buffer. Definition at line 93 of file TransportStub.cpp. |
|
|
Implements Protocols::Generics::Transport. Definition at line 128 of file TransportStub.cpp. |
|
||||||||||||
|
Implements Protocols::Generics::Buffer. Definition at line 112 of file TransportStub.cpp. |
|
|
Definition at line 88 of file TransportStub.h. |
|
|
Definition at line 90 of file TransportStub.h. |
|
|
Definition at line 89 of file TransportStub.h. |