summaryrefslogtreecommitdiffstats
path: root/tests/maildirresourcetest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/maildirresourcetest.cpp')
-rw-r--r--tests/maildirresourcetest.cpp27
1 files changed, 23 insertions, 4 deletions
diff --git a/tests/maildirresourcetest.cpp b/tests/maildirresourcetest.cpp
index b16f883..51ea278 100644
--- a/tests/maildirresourcetest.cpp
+++ b/tests/maildirresourcetest.cpp
@@ -142,7 +142,7 @@ private Q_SLOTS:
142 142
143 Akonadi2::Query query; 143 Akonadi2::Query query;
144 query.resources << "org.kde.maildir.instance1"; 144 query.resources << "org.kde.maildir.instance1";
145 query.requestedProperties << "folder" << "summary"; 145 query.requestedProperties << "folder" << "subject";
146 query.propertyFilter.insert("folder", folderIdentifier); 146 query.propertyFilter.insert("folder", folderIdentifier);
147 auto mailModel = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Mail>(query); 147 auto mailModel = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Mail>(query);
148 QTRY_VERIFY(mailModel->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); 148 QTRY_VERIFY(mailModel->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool());
@@ -194,18 +194,37 @@ private Q_SLOTS:
194 QCOMPARE(model->match(model->index(0, 0, QModelIndex()), Qt::DisplayRole, QStringLiteral("newbox"), 1).size(), 1); 194 QCOMPARE(model->match(model->index(0, 0, QModelIndex()), Qt::DisplayRole, QStringLiteral("newbox"), 1).size(), 1);
195 } 195 }
196 196
197 void testSyncMailMove() 197 void testReSyncMail()
198 { 198 {
199 Akonadi2::Query query; 199 Akonadi2::Query query;
200 query.resources << "org.kde.maildir.instance1"; 200 query.resources << "org.kde.maildir.instance1";
201 query.syncOnDemand = true; 201 query.syncOnDemand = true;
202 query.processAll = true; 202 query.processAll = true;
203 query.requestedProperties << "folder" << "summary"; 203 query.requestedProperties << "folder" << "subject";
204 204
205 //Ensure all local data is processed 205 //Ensure all local data is processed
206 Akonadi2::Store::synchronize(query).exec().waitForFinished(); 206 Akonadi2::Store::synchronize(query).exec().waitForFinished();
207 207
208 auto targetPath = tempDir.path() + QDir::separator() + "maildir1/cur/1365777830.R28.localhost.localdomain:2,S"; 208 //Ensure all local data is processed
209 Akonadi2::Store::synchronize(query).exec().waitForFinished();
210
211 auto mailModel = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Mail>(query);
212 QTRY_VERIFY(mailModel->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool());
213 QCOMPARE(mailModel->rowCount(QModelIndex()), 2);
214 }
215
216 void testSyncMailRemoval()
217 {
218 Akonadi2::Query query;
219 query.resources << "org.kde.maildir.instance1";
220 query.syncOnDemand = true;
221 query.processAll = true;
222 query.requestedProperties << "folder" << "subject";
223
224 //Ensure all local data is processed
225 Akonadi2::Store::synchronize(query).exec().waitForFinished();
226
227 auto targetPath = tempDir.path() + "/maildir1/cur/1365777830.R28.localhost.localdomain:2,S";
209 QFile file(targetPath); 228 QFile file(targetPath);
210 QVERIFY(file.remove()); 229 QVERIFY(file.remove());
211 230