diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-27 02:26:47 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-09-15 16:14:19 +0200 |
commit | 26816c21f60450e461a5b6ef4ef740f6070ce278 (patch) | |
tree | 55e8aee03e094abf702438e6cd26233047345e70 /tests/mailsynctest.cpp | |
parent | 9a9bb39f7641a818434cafa0dae0c8aa47124c0b (diff) | |
download | sink-26816c21f60450e461a5b6ef4ef740f6070ce278.tar.gz sink-26816c21f60450e461a5b6ef4ef740f6070ce278.zip |
Ported to the kasync revamp
Diffstat (limited to 'tests/mailsynctest.cpp')
-rw-r--r-- | tests/mailsynctest.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/mailsynctest.cpp b/tests/mailsynctest.cpp index 4b797c8..9c57f0a 100644 --- a/tests/mailsynctest.cpp +++ b/tests/mailsynctest.cpp | |||
@@ -69,7 +69,7 @@ void MailSyncTest::testListFolders() | |||
69 | //First figure out how many folders we have by default | 69 | //First figure out how many folders we have by default |
70 | { | 70 | { |
71 | auto job = Store::fetchAll<Folder>(Query()) | 71 | auto job = Store::fetchAll<Folder>(Query()) |
72 | .then<void, QList<Folder::Ptr>>([&](const QList<Folder::Ptr> &folders) { | 72 | .syncThen<void, QList<Folder::Ptr>>([&](const QList<Folder::Ptr> &folders) { |
73 | QStringList names; | 73 | QStringList names; |
74 | for (const auto &folder : folders) { | 74 | for (const auto &folder : folders) { |
75 | names << folder->getName(); | 75 | names << folder->getName(); |
@@ -88,7 +88,7 @@ void MailSyncTest::testListFolders() | |||
88 | VERIFYEXEC(Store::synchronize(query)); | 88 | VERIFYEXEC(Store::synchronize(query)); |
89 | ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 89 | ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
90 | 90 | ||
91 | auto job = Store::fetchAll<Folder>(query).then<void, QList<Folder::Ptr>>([=](const QList<Folder::Ptr> &folders) { | 91 | auto job = Store::fetchAll<Folder>(query).syncThen<void, QList<Folder::Ptr>>([=](const QList<Folder::Ptr> &folders) { |
92 | QStringList names; | 92 | QStringList names; |
93 | QHash<QByteArray, QByteArray> specialPurposeFolders; | 93 | QHash<QByteArray, QByteArray> specialPurposeFolders; |
94 | for (const auto &folder : folders) { | 94 | for (const auto &folder : folders) { |
@@ -130,7 +130,7 @@ void MailSyncTest::testListNewFolder() | |||
130 | VERIFYEXEC(Store::synchronize(query)); | 130 | VERIFYEXEC(Store::synchronize(query)); |
131 | ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 131 | ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
132 | 132 | ||
133 | auto job = Store::fetchAll<Folder>(query).then<void, QList<Folder::Ptr>>([](const QList<Folder::Ptr> &folders) { | 133 | auto job = Store::fetchAll<Folder>(query).syncThen<void, QList<Folder::Ptr>>([](const QList<Folder::Ptr> &folders) { |
134 | QStringList names; | 134 | QStringList names; |
135 | for (const auto &folder : folders) { | 135 | for (const auto &folder : folders) { |
136 | names << folder->getName(); | 136 | names << folder->getName(); |
@@ -155,7 +155,7 @@ void MailSyncTest::testListRemovedFolder() | |||
155 | VERIFYEXEC(Store::synchronize(query)); | 155 | VERIFYEXEC(Store::synchronize(query)); |
156 | ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 156 | ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
157 | 157 | ||
158 | auto job = Store::fetchAll<Folder>(query).then<void, QList<Folder::Ptr>>([](const QList<Folder::Ptr> &folders) { | 158 | auto job = Store::fetchAll<Folder>(query).syncThen<void, QList<Folder::Ptr>>([](const QList<Folder::Ptr> &folders) { |
159 | QStringList names; | 159 | QStringList names; |
160 | for (const auto &folder : folders) { | 160 | for (const auto &folder : folders) { |
161 | names << folder->getName(); | 161 | names << folder->getName(); |
@@ -180,7 +180,7 @@ void MailSyncTest::testListFolderHierarchy() | |||
180 | VERIFYEXEC(Store::synchronize(query)); | 180 | VERIFYEXEC(Store::synchronize(query)); |
181 | ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 181 | ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
182 | 182 | ||
183 | auto job = Store::fetchAll<Folder>(query).then<void, QList<Folder::Ptr>>([=](const QList<Folder::Ptr> &folders) { | 183 | auto job = Store::fetchAll<Folder>(query).syncThen<void, QList<Folder::Ptr>>([=](const QList<Folder::Ptr> &folders) { |
184 | QHash<QString, Folder::Ptr> map; | 184 | QHash<QString, Folder::Ptr> map; |
185 | for (const auto &folder : folders) { | 185 | for (const auto &folder : folders) { |
186 | map.insert(folder->getName(), folder); | 186 | map.insert(folder->getName(), folder); |
@@ -223,7 +223,7 @@ void MailSyncTest::testListNewSubFolder() | |||
223 | VERIFYEXEC(Store::synchronize(query)); | 223 | VERIFYEXEC(Store::synchronize(query)); |
224 | ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 224 | ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
225 | 225 | ||
226 | auto job = Store::fetchAll<Folder>(query).then<void, QList<Folder::Ptr>>([](const QList<Folder::Ptr> &folders) { | 226 | auto job = Store::fetchAll<Folder>(query).syncThen<void, QList<Folder::Ptr>>([](const QList<Folder::Ptr> &folders) { |
227 | QStringList names; | 227 | QStringList names; |
228 | for (const auto &folder : folders) { | 228 | for (const auto &folder : folders) { |
229 | names << folder->getName(); | 229 | names << folder->getName(); |
@@ -251,7 +251,7 @@ void MailSyncTest::testListRemovedSubFolder() | |||
251 | VERIFYEXEC(Store::synchronize(query)); | 251 | VERIFYEXEC(Store::synchronize(query)); |
252 | ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 252 | ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
253 | 253 | ||
254 | auto job = Store::fetchAll<Folder>(query).then<void, QList<Folder::Ptr>>([](const QList<Folder::Ptr> &folders) { | 254 | auto job = Store::fetchAll<Folder>(query).syncThen<void, QList<Folder::Ptr>>([](const QList<Folder::Ptr> &folders) { |
255 | QStringList names; | 255 | QStringList names; |
256 | for (const auto &folder : folders) { | 256 | for (const auto &folder : folders) { |
257 | names << folder->getName(); | 257 | names << folder->getName(); |
@@ -271,7 +271,7 @@ void MailSyncTest::testListMails() | |||
271 | VERIFYEXEC(Store::synchronize(query)); | 271 | VERIFYEXEC(Store::synchronize(query)); |
272 | ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 272 | ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
273 | 273 | ||
274 | auto job = Store::fetchAll<Mail>(query).then<void, QList<Mail::Ptr>>([](const QList<Mail::Ptr> &mails) { | 274 | auto job = Store::fetchAll<Mail>(query).syncThen<void, QList<Mail::Ptr>>([](const QList<Mail::Ptr> &mails) { |
275 | QCOMPARE(mails.size(), 1); | 275 | QCOMPARE(mails.size(), 1); |
276 | QVERIFY(mails.first()->getSubject().startsWith(QString("[Nepomuk] Jenkins build is still unstable"))); | 276 | QVERIFY(mails.first()->getSubject().startsWith(QString("[Nepomuk] Jenkins build is still unstable"))); |
277 | const auto data = mails.first()->getMimeMessage(); | 277 | const auto data = mails.first()->getMimeMessage(); |
@@ -300,7 +300,7 @@ void MailSyncTest::testResyncMails() | |||
300 | VERIFYEXEC(Store::synchronize(query)); | 300 | VERIFYEXEC(Store::synchronize(query)); |
301 | ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 301 | ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
302 | 302 | ||
303 | auto job = Store::fetchAll<Mail>(query).then<void, QList<Mail::Ptr>>([](const QList<Mail::Ptr> &mails) { | 303 | auto job = Store::fetchAll<Mail>(query).syncThen<void, QList<Mail::Ptr>>([](const QList<Mail::Ptr> &mails) { |
304 | QCOMPARE(mails.size(), 1); | 304 | QCOMPARE(mails.size(), 1); |
305 | }); | 305 | }); |
306 | VERIFYEXEC(job); | 306 | VERIFYEXEC(job); |
@@ -325,7 +325,7 @@ void MailSyncTest::testFetchNewRemovedMessages() | |||
325 | ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 325 | ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
326 | 326 | ||
327 | { | 327 | { |
328 | auto job = Store::fetchAll<Mail>(query).then<void, QList<Mail::Ptr>>([](const QList<Mail::Ptr> &mails) { | 328 | auto job = Store::fetchAll<Mail>(query).syncThen<void, QList<Mail::Ptr>>([](const QList<Mail::Ptr> &mails) { |
329 | QCOMPARE(mails.size(), 2); | 329 | QCOMPARE(mails.size(), 2); |
330 | }); | 330 | }); |
331 | VERIFYEXEC(job); | 331 | VERIFYEXEC(job); |
@@ -337,7 +337,7 @@ void MailSyncTest::testFetchNewRemovedMessages() | |||
337 | ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 337 | ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
338 | 338 | ||
339 | { | 339 | { |
340 | auto job = Store::fetchAll<Mail>(query).then<void, QList<Mail::Ptr>>([](const QList<Mail::Ptr> &mails) { | 340 | auto job = Store::fetchAll<Mail>(query).syncThen<void, QList<Mail::Ptr>>([](const QList<Mail::Ptr> &mails) { |
341 | QCOMPARE(mails.size(), 1); | 341 | QCOMPARE(mails.size(), 1); |
342 | }); | 342 | }); |
343 | VERIFYEXEC(job); | 343 | VERIFYEXEC(job); |