A dispatcher using queue policy. More...
#include <QueueDispatcher.h>
Public Member Functions | |
| virtual MockResponse | dispatch (const RecordedRequest &request) |
| Serve incoming request with next response in queue. More... | |
| virtual MockResponse | peek () |
| Head response in queue if queue is not empty. Otherwise the fail-fast response is returned if set. If both are empty, Dispatcher::peek() is returned. More... | |
| void | enqueueResponse (const MockResponse &response) |
| Enqueue given response. More... | |
| void | setFailFast (bool failFast) |
| Set if we should dispatch a immediate fail response when the queue is empty. More... | |
| void | setFailFast (MockResponse *failFastResponse) |
| Set the fail-fast response which will be used when the queue is empty. More... | |
Protected Attributes | |
| QQueue< MockResponse > | m_responseQueue |
A dispatcher using queue policy.
|
virtual |
Serve incoming request with next response in queue.
| request | The incoming request. |
Implements Dispatcher.
| void QueueDispatcher::enqueueResponse | ( | const MockResponse & | response | ) |
Enqueue given response.
| response | A mock response. |
|
virtual |
Head response in queue if queue is not empty. Otherwise the fail-fast response is returned if set. If both are empty, Dispatcher::peek() is returned.
Reimplemented from Dispatcher.
| void QueueDispatcher::setFailFast | ( | bool | failFast | ) |
Set if we should dispatch a immediate fail response when the queue is empty.
| failFast | True if should fail fast. |
| void QueueDispatcher::setFailFast | ( | MockResponse * | failFastResponse | ) |
Set the fail-fast response which will be used when the queue is empty.
| failFastResponse |
1.8.7