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/dummyresourcebenchmark.cpp | 4 +-- tests/dummyresourcetest.cpp | 16 ++++++------ tests/inspectiontest.cpp | 4 +-- tests/maildirresourcetest.cpp | 54 ++++++++++++++++++++-------------------- tests/modelinteractivitytest.cpp | 2 +- tests/querytest.cpp | 12 ++++----- 6 files changed, 46 insertions(+), 46 deletions(-) (limited to 'tests') diff --git a/tests/dummyresourcebenchmark.cpp b/tests/dummyresourcebenchmark.cpp index 6170f49..60ebe74 100644 --- a/tests/dummyresourcebenchmark.cpp +++ b/tests/dummyresourcebenchmark.cpp @@ -102,7 +102,7 @@ private Q_SLOTS: QTRY_VERIFY(gotNotification); QVERIFY2(duration < 100, QString::fromLatin1("Processing a create command took more than 100ms: %1").arg(duration).toLatin1()); - Sink::Resources::shutdown("org.kde.dummy.instance1").exec().waitForFinished(); + Sink::ResourceControl::shutdown("org.kde.dummy.instance1").exec().waitForFinished(); qDebug() << "Single command took [ms]: " << duration; } @@ -127,7 +127,7 @@ private Q_SLOTS: { Sink::Query query; query.resources << "org.kde.dummy.instance1"; - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); } auto allProcessedTime = time.elapsed(); diff --git a/tests/dummyresourcetest.cpp b/tests/dummyresourcetest.cpp index e74fe25..1253e6c 100644 --- a/tests/dummyresourcetest.cpp +++ b/tests/dummyresourcetest.cpp @@ -65,7 +65,7 @@ private Q_SLOTS: query.resources << "org.kde.dummy.instance1"; //Ensure all local data is processed - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); query.propertyFilter.insert("uid", "testuid"); auto model = Sink::Store::loadModel(query); @@ -89,7 +89,7 @@ private Q_SLOTS: query.resources << "org.kde.dummy.instance1"; //Ensure all local data is processed - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); query.propertyFilter.insert("uid", "testuid"); @@ -117,7 +117,7 @@ private Q_SLOTS: query.resources << "org.kde.dummy.instance1"; //Ensure all local data is processed - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); query.propertyFilter.insert("summary", "summaryValue2"); @@ -151,7 +151,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->rowCount(QModelIndex()) >= 1); @@ -168,7 +168,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->rowCount(QModelIndex()) >= 1); @@ -191,7 +191,7 @@ private Q_SLOTS: query.propertyFilter.insert("uid", "testuid"); //Ensure all local data is processed - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); //Test create Sink::ApplicationDomain::Event event2; @@ -210,7 +210,7 @@ private Q_SLOTS: Sink::Store::modify(event2).exec().waitForFinished(); //Ensure all local data is processed - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); //Test modify { @@ -225,7 +225,7 @@ private Q_SLOTS: Sink::Store::remove(event2).exec().waitForFinished(); //Ensure all local data is processed - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); //Test remove { diff --git a/tests/inspectiontest.cpp b/tests/inspectiontest.cpp index 70806fa..0323225 100644 --- a/tests/inspectiontest.cpp +++ b/tests/inspectiontest.cpp @@ -41,8 +41,8 @@ private Q_SLOTS: Mail mail(QByteArray("org.kde.dummy.instance1"), QByteArray("identifier"), 0, QSharedPointer::create()); //testInspection is a magic property that the dummyresource supports - auto inspectionCommand = Resources::Inspection::PropertyInspection(mail, "testInspection", success); - auto result = Resources::inspect(inspectionCommand).exec(); + auto inspectionCommand = ResourceControl::Inspection::PropertyInspection(mail, "testInspection", success); + auto result = ResourceControl::inspect(inspectionCommand).exec(); result.waitForFinished(); if (success) { QVERIFY(!result.errorCode()); 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([](){}); }) diff --git a/tests/modelinteractivitytest.cpp b/tests/modelinteractivitytest.cpp index f180f9c..51a9cd8 100644 --- a/tests/modelinteractivitytest.cpp +++ b/tests/modelinteractivitytest.cpp @@ -73,7 +73,7 @@ private Q_SLOTS: query.resources << "org.kde.dummy.instance1"; query.liveQuery = true; - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); //Test QTime time; diff --git a/tests/querytest.cpp b/tests/querytest.cpp index 89d8693..42064c6 100644 --- a/tests/querytest.cpp +++ b/tests/querytest.cpp @@ -86,7 +86,7 @@ private Q_SLOTS: query.liveQuery = false; //Ensure all local data is processed - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); //We fetch after the data is available and don't rely on the live query mechanism to deliver the actual data auto model = Sink::Store::loadModel(query); @@ -161,7 +161,7 @@ private Q_SLOTS: query.resources << "org.kde.dummy.instance1"; //Ensure all local data is processed - 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()); @@ -181,7 +181,7 @@ private Q_SLOTS: query.parentProperty = "parent"; //Ensure all local data is processed - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); //We fetch after the data is available and don't rely on the live query mechanism to deliver the actual data auto model = Sink::Store::loadModel(query); @@ -210,7 +210,7 @@ private Q_SLOTS: query.propertyFilter.insert("uid", "test1"); //Ensure all local data is processed - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); //We fetch before the data is available and rely on the live query mechanism to deliver the actual data auto model = Sink::Store::loadModel(query); @@ -230,7 +230,7 @@ private Q_SLOTS: query.resources << "org.kde.dummy.instance1"; //Ensure all local data is processed - 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()); @@ -251,7 +251,7 @@ private Q_SLOTS: query.propertyFilter.insert("folder", folderEntity->identifier()); //Ensure all local data is processed - Sink::Resources::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); //We fetch before the data is available and rely on the live query mechanism to deliver the actual data auto model = Sink::Store::loadModel(query); -- cgit v1.2.3