blob: e6f41f4870762f085393ec0a4fb83f5751befbc6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#include <QtTest>
#include <QTcpSocket>
#include <tests/mailtest.h>
#include "common/test.h"
#include "common/domain/applicationdomaintype.h"
using namespace Sink;
using namespace Sink::ApplicationDomain;
/**
* Test of complete system using the imap resource.
*
* This test requires the imap resource installed.
*/
class ImapMailTest : public Sink::MailTest
{
Q_OBJECT
protected:
bool isBackendAvailable() Q_DECL_OVERRIDE
{
QTcpSocket socket;
socket.connectToHost("localhost", 993);
return socket.waitForConnected(200);
}
void resetTestEnvironment() Q_DECL_OVERRIDE
{
system("resetmailbox.sh");
}
Sink::ApplicationDomain::SinkResource createResource() Q_DECL_OVERRIDE
{
auto resource = ApplicationDomain::ImapResource::create("account1");
resource.setProperty("server", "localhost");
resource.setProperty("port", 993);
resource.setProperty("username", "doe");
resource.setProperty("password", "doe");
return resource;
}
};
QTEST_MAIN(ImapMailTest)
#include "imapmailtest.moc"
|