diff options
Diffstat (limited to 'examples/imapresource/tests/imapmailtest.cpp')
-rw-r--r-- | examples/imapresource/tests/imapmailtest.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/examples/imapresource/tests/imapmailtest.cpp b/examples/imapresource/tests/imapmailtest.cpp new file mode 100644 index 0000000..82324af --- /dev/null +++ b/examples/imapresource/tests/imapmailtest.cpp | |||
@@ -0,0 +1,45 @@ | |||
1 | #include <QtTest> | ||
2 | |||
3 | #include <tests/mailtest.h> | ||
4 | #include "../imapresource.h" | ||
5 | |||
6 | #include "common/test.h" | ||
7 | #include "common/domain/applicationdomaintype.h" | ||
8 | |||
9 | using namespace Sink; | ||
10 | using namespace Sink::ApplicationDomain; | ||
11 | |||
12 | /** | ||
13 | * Test of complete system using the imap resource. | ||
14 | * | ||
15 | * This test requires the imap resource installed. | ||
16 | */ | ||
17 | class ImapMailTest : public Sink::MailTest | ||
18 | { | ||
19 | Q_OBJECT | ||
20 | |||
21 | protected: | ||
22 | void resetTestEnvironment() Q_DECL_OVERRIDE | ||
23 | { | ||
24 | system("resetmailbox.sh"); | ||
25 | } | ||
26 | |||
27 | Sink::ApplicationDomain::SinkResource createResource() Q_DECL_OVERRIDE | ||
28 | { | ||
29 | auto resource = ApplicationDomain::ImapResource::create("account1"); | ||
30 | resource.setProperty("server", "localhost"); | ||
31 | resource.setProperty("port", 993); | ||
32 | resource.setProperty("user", "doe"); | ||
33 | resource.setProperty("password", "doe"); | ||
34 | return resource; | ||
35 | } | ||
36 | |||
37 | void removeResourceFromDisk(const QByteArray &identifier) Q_DECL_OVERRIDE | ||
38 | { | ||
39 | ::ImapResource::removeFromDisk(identifier); | ||
40 | } | ||
41 | }; | ||
42 | |||
43 | QTEST_MAIN(ImapMailTest) | ||
44 | |||
45 | #include "imapmailtest.moc" | ||