summaryrefslogtreecommitdiffstats
path: root/tests/mailthreadtest.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-09-20 17:18:21 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-09-20 17:18:21 +0200
commitebc5c48c03b6145e604da7c313b35321d0a71142 (patch)
tree1cee00a9fa4faa4995c0a50f01703ac5672c8797 /tests/mailthreadtest.h
parent4a14a6fade947aa830d3f21598a4a6ba7316b933 (diff)
downloadsink-ebc5c48c03b6145e604da7c313b35321d0a71142.tar.gz
sink-ebc5c48c03b6145e604da7c313b35321d0a71142.zip
A first draft of the threading algorithm.
Diffstat (limited to 'tests/mailthreadtest.h')
-rw-r--r--tests/mailthreadtest.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/mailthreadtest.h b/tests/mailthreadtest.h
new file mode 100644
index 0000000..d6b9c24
--- /dev/null
+++ b/tests/mailthreadtest.h
@@ -0,0 +1,57 @@
1/*
2 * Copyright (C) 2016 Christian Mollekopf <chrigi_1@fastmail.fm>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19#pragma once
20
21#include <QObject>
22#include <QByteArray>
23
24#include <applicationdomaintype.h>
25#include "testutils.h"
26
27namespace Sink {
28
29/**
30 * Tests if the resource can thread emails.
31 */
32class MailThreadTest : public QObject
33{
34 Q_OBJECT
35
36protected:
37 QByteArray mResourceInstanceIdentifier;
38 QByteArrayList mCapabilities;
39
40 virtual bool isBackendAvailable() { return true; }
41 virtual void resetTestEnvironment() = 0;
42 virtual Sink::ApplicationDomain::SinkResource createResource() = 0;
43 virtual Sink::ApplicationDomain::SinkResource createFaultyResource() = 0;
44 virtual void removeResourceFromDisk(const QByteArray &mResourceInstanceIdentifier) = 0;
45 virtual QByteArray createMessage(const QStringList &folderPath, const QByteArray &message) = 0;
46 virtual void removeMessage(const QStringList &folderPath, const QByteArray &messageIdentifier) = 0;
47
48private slots:
49 void initTestCase();
50 void init();
51 void cleanup();
52
53 void testListThreadLeader();
54};
55
56}
57