summaryrefslogtreecommitdiff
path: root/kimap/tests/kimaptest/fakeserver.h
diff options
context:
space:
mode:
authorSandro Knauß <knauss@kolabsys.com>2014-05-30 15:43:04 (GMT)
committerSandro Knauß <knauss@kolabsys.com>2014-05-30 15:43:04 (GMT)
commitbb731504eac98d378c7677b9ca9aa697b3cad735 (patch)
treefb0b1ba2dee27c7157f42604c975dcda6a4ea396 /kimap/tests/kimaptest/fakeserver.h
parente180af6d57394557281a0c8b3b503199c0220954 (diff)
downloadlibcalendaring-bb731504eac98d378c7677b9ca9aa697b3cad735.tar.gz
Add support for subclassing Fakeserver.
This patch is only moving a new version of fakeserver from: kdepimlibs d04fcaa1 [master] from 29 May 2014.
Diffstat (limited to 'kimap/tests/kimaptest/fakeserver.h')
-rw-r--r--kimap/tests/kimaptest/fakeserver.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/kimap/tests/kimaptest/fakeserver.h b/kimap/tests/kimaptest/fakeserver.h
index 22b970c..add3626 100644
--- a/kimap/tests/kimaptest/fakeserver.h
+++ b/kimap/tests/kimaptest/fakeserver.h
@@ -19,7 +19,6 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
#ifndef FAKESERVER_H
#define FAKESERVER_H
@@ -28,6 +27,7 @@
#include <QTcpServer>
#include <QThread>
#include <QMutex>
+#include <QSsl>
namespace KIMAP
{
@@ -130,6 +130,11 @@ public:
~FakeServer();
/**
+ * Sets the encryption mode used by the server socket.
+ */
+ void setEncrypted( QSsl::SslProtocol protocol );
+
+ /**
* Starts the server and waits for it to be ready
*
* You should use this instead of start() to avoid race conditions.
@@ -202,6 +207,13 @@ public:
*/
bool isAllScenarioDone() const;
+protected:
+ /**
+ * Whether the received content is the same as the expected.
+ * Use QCOMPARE, if creating subclasses.
+ */
+ virtual void compareReceived(const QByteArray& received, const QByteArray& expected) const;
+
private Q_SLOTS:
void newConnection();
void dataAvailable();
@@ -216,7 +228,9 @@ private:
mutable QMutex m_mutex;
QList<QTcpSocket*> m_clientSockets;
QList<KIMAP::ImapStreamParser*> m_clientParsers;
+ bool m_encrypted;
+ bool m_starttls;
+ QSsl::SslProtocol m_sslProtocol;
};
#endif
-