From 660ee77c9875ad71d4189e8643f679f574687528 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 10 Feb 2016 08:51:25 +0100 Subject: Renamed Resources to ResourceControl --- tests/maildirresourcetest.cpp | 54 +++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'tests/maildirresourcetest.cpp') diff --git a/tests/maildirresourcetest.cpp b/tests/maildirresourcetest.cpp index c5c9348..176ab9f 100644 --- a/tests/maildirresourcetest.cpp +++ b/tests/maildirresourcetest.cpp @@ -68,7 +68,7 @@ private Q_SLOTS: void cleanup() { - Sink::Resources::shutdown(QByteArray("org.kde.maildir.instance1")).exec().waitForFinished(); + Sink::ResourceControl::shutdown(QByteArray("org.kde.maildir.instance1")).exec().waitForFinished(); MaildirResource::removeFromDisk("org.kde.maildir.instance1"); QDir dir(targetPath); dir.removeRecursively(); @@ -80,7 +80,7 @@ private Q_SLOTS: qDebug() << "-----------------------------------------"; qDebug(); copyRecursively(TESTDATAPATH "/maildir1", targetPath); - Sink::Resources::start(QByteArray("org.kde.maildir.instance1")).exec().waitForFinished(); + Sink::ResourceControl::start(QByteArray("org.kde.maildir.instance1")).exec().waitForFinished(); } void testListFolders() @@ -90,7 +90,7 @@ private Q_SLOTS: //Ensure all local data is processed Sink::Store::synchronize(query).exec().waitForFinished(); - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); auto model = Sink::Store::loadModel(query); QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); @@ -105,7 +105,7 @@ private Q_SLOTS: //Ensure all local data is processed Sink::Store::synchronize(query).exec().waitForFinished(); - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); auto model = Sink::Store::loadModel(query); QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); @@ -123,7 +123,7 @@ private Q_SLOTS: //Ensure all local data is processed auto query = Query::ResourceFilter("org.kde.maildir.instance1"); Store::synchronize(query).exec().waitForFinished(); - Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); auto result = Store::fetchOne( Query::ResourceFilter("org.kde.maildir.instance1") + Query::RequestedProperties(QByteArrayList() << "name") ) @@ -149,7 +149,7 @@ private Q_SLOTS: //Ensure all local data is processed Sink::Store::synchronize(query).exec().waitForFinished(); - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); auto mailModel = Sink::Store::loadModel(query); QTRY_VERIFY(mailModel->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); @@ -172,7 +172,7 @@ private Q_SLOTS: //Ensure all local data is processed Sink::Store::synchronize(query).exec().waitForFinished(); - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); auto targetPath = tempDir.path() + "/maildir1/"; QDir dir(targetPath); @@ -180,7 +180,7 @@ private Q_SLOTS: //Ensure all local data is processed Sink::Store::synchronize(query).exec().waitForFinished(); - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); auto model = Sink::Store::loadModel(query); QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); @@ -196,11 +196,11 @@ private Q_SLOTS: //Ensure all local data is processed Sink::Store::synchronize(query).exec().waitForFinished(); - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); //Ensure all local data is processed Sink::Store::synchronize(query).exec().waitForFinished(); - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); auto mailModel = Sink::Store::loadModel(query); QTRY_VERIFY(mailModel->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); @@ -215,7 +215,7 @@ private Q_SLOTS: //Ensure all local data is processed Sink::Store::synchronize(query).exec().waitForFinished(); - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); auto targetPath = tempDir.path() + "/maildir1/cur/1365777830.R28.localhost.localdomain:2,S"; QFile file(targetPath); @@ -223,7 +223,7 @@ private Q_SLOTS: //Ensure all local data is processed Sink::Store::synchronize(query).exec().waitForFinished(); - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); auto mailModel = Sink::Store::loadModel(query); QTRY_VERIFY(mailModel->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); @@ -236,7 +236,7 @@ private Q_SLOTS: query.resources << "org.kde.maildir.instance1"; //Ensure all local data is processed - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); Sink::ApplicationDomain::Folder folder("org.kde.maildir.instance1"); folder.setProperty("name", "testCreateFolder"); @@ -244,7 +244,7 @@ private Q_SLOTS: Sink::Store::create(folder).exec().waitForFinished(); //Ensure all local data is processed - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); auto targetPath = tempDir.path() + "/maildir1/testCreateFolder"; QFileInfo file(targetPath); @@ -262,7 +262,7 @@ private Q_SLOTS: Sink::ApplicationDomain::Folder folder("org.kde.maildir.instance1"); folder.setProperty("name", "testCreateFolder"); Sink::Store::create(folder).exec().waitForFinished(); - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); QTRY_VERIFY(QFileInfo(targetPath).exists()); Sink::Query folderQuery; @@ -274,7 +274,7 @@ private Q_SLOTS: auto createdFolder = model->index(0, 0, QModelIndex()).data(Sink::Store::DomainObjectRole).value(); Sink::Store::remove(*createdFolder).exec().waitForFinished(); - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); QTRY_VERIFY(!QFileInfo(targetPath).exists()); } @@ -284,7 +284,7 @@ private Q_SLOTS: query.resources << "org.kde.maildir.instance1"; //Ensure all local data is processed - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); Sink::ApplicationDomain::Mail mail("org.kde.maildir.instance1"); mail.setProperty("name", "testCreateMail"); @@ -293,7 +293,7 @@ private Q_SLOTS: Sink::Store::create(mail).exec().waitForFinished(); //Ensure all local data is processed - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); auto targetPath = tempDir.path() + "/maildir1/new"; QDir dir(targetPath); @@ -308,7 +308,7 @@ private Q_SLOTS: auto query = Query::ResourceFilter("org.kde.maildir.instance1"); Store::synchronize(query).exec().waitForFinished(); - Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); auto result = Store::fetchOne( Query::ResourceFilter("org.kde.maildir.instance1") + Query::PropertyFilter("name", "maildir1") + Query::RequestedProperties(QByteArrayList() << "name") @@ -325,10 +325,10 @@ private Q_SLOTS: auto mail = mails.first(); return Store::remove(*mail) - .then(Resources::flushReplayQueue(query.resources)) //The change needs to be replayed already - .then(Resources::inspect(Resources::Inspection::ExistenceInspection(*mail, false))); - }) - .then([](){}); + .then(ResourceControl::flushReplayQueue(query.resources)) //The change needs to be replayed already + .then(ResourceControl::inspect(ResourceControl::Inspection::ExistenceInspection(*mail, false))); + }); + // .then([](){}); }) .exec(); result.waitForFinished(); @@ -342,7 +342,7 @@ private Q_SLOTS: auto query = Query::ResourceFilter("org.kde.maildir.instance1"); Store::synchronize(query).exec().waitForFinished(); - Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); Folder f; @@ -362,9 +362,9 @@ private Q_SLOTS: auto mail = mails.first(); mail->setProperty("unread", true); return Store::modify(*mail) - .then(Resources::flushReplayQueue(query.resources)) //The change needs to be replayed already - .then(Resources::inspect(Resources::Inspection::PropertyInspection(*mail, "unread", true))) - .then(Resources::inspect(Resources::Inspection::PropertyInspection(*mail, "subject", mail->getProperty("subject")))); + .then(ResourceControl::flushReplayQueue(query.resources)) //The change needs to be replayed already + .then(ResourceControl::inspect(ResourceControl::Inspection::PropertyInspection(*mail, "unread", true))) + .then(ResourceControl::inspect(ResourceControl::Inspection::PropertyInspection(*mail, "subject", mail->getProperty("subject")))); }) .then([](){}); }) -- cgit v1.2.3