diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-12-29 22:00:01 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-12-29 22:00:01 +0100 |
commit | 312702b809907866c085b92b1127129aaaf7f693 (patch) | |
tree | 8ee1294324938401f52730a57c4ec33a774d7cbb /tests/maildirresourcetest.cpp | |
parent | 8355323c285584940d81157f2596855f99996977 (diff) | |
download | sink-312702b809907866c085b92b1127129aaaf7f693.tar.gz sink-312702b809907866c085b92b1127129aaaf7f693.zip |
Stub for mail change-replay.
Not usable yet.
Diffstat (limited to 'tests/maildirresourcetest.cpp')
-rw-r--r-- | tests/maildirresourcetest.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/maildirresourcetest.cpp b/tests/maildirresourcetest.cpp index 1e2d36b..b0bc30b 100644 --- a/tests/maildirresourcetest.cpp +++ b/tests/maildirresourcetest.cpp | |||
@@ -287,6 +287,30 @@ private Q_SLOTS: | |||
287 | QTRY_VERIFY(!QFileInfo(targetPath).exists()); | 287 | QTRY_VERIFY(!QFileInfo(targetPath).exists()); |
288 | } | 288 | } |
289 | 289 | ||
290 | void testCreateMail() | ||
291 | { | ||
292 | Akonadi2::Query query; | ||
293 | query.resources << "org.kde.maildir.instance1"; | ||
294 | query.syncOnDemand = false; | ||
295 | query.processAll = true; | ||
296 | |||
297 | //Ensure all local data is processed | ||
298 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | ||
299 | |||
300 | Akonadi2::ApplicationDomain::Mail mail("org.kde.maildir.instance1"); | ||
301 | mail.setProperty("name", "testCreateMail"); | ||
302 | |||
303 | Akonadi2::Store::create(mail).exec().waitForFinished(); | ||
304 | |||
305 | //Ensure all local data is processed | ||
306 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | ||
307 | |||
308 | auto targetPath = tempDir.path() + "/maildir1/new"; | ||
309 | QDir dir(targetPath); | ||
310 | dir.setFilter(QDir::Files); | ||
311 | QTRY_COMPARE(dir.count(), static_cast<unsigned int>(1)); | ||
312 | } | ||
313 | |||
290 | }; | 314 | }; |
291 | 315 | ||
292 | QTEST_MAIN(MaildirResourceTest) | 316 | QTEST_MAIN(MaildirResourceTest) |