From bdb01c2c068df326f5a8328ed1492ab1bea388c5 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 20 Jan 2016 19:07:07 +0100 Subject: Renamed Akonadi2 to Sink (except for documentation). --- tests/CMakeLists.txt | 18 +-- tests/clientapitest.cpp | 118 +++++++++--------- .../databasepopulationandfacadequerybenchmark.cpp | 22 ++-- tests/domainadaptortest.cpp | 26 ++-- tests/dummyresourcebenchmark.cpp | 44 +++---- tests/dummyresourcetest.cpp | 124 +++++++++--------- tests/dummyresourcewritebenchmark.cpp | 24 ++-- tests/genericfacadetest.cpp | 38 +++--- tests/genericresourcebenchmark.cpp | 46 +++---- tests/genericresourcetest.cpp | 28 ++--- tests/hawd/CMakeLists.txt | 2 +- tests/hawd/dataset.cpp | 8 +- tests/hawd/dataset.h | 4 +- tests/indextest.cpp | 6 +- tests/inspectiontest.cpp | 14 +-- tests/maildirresourcetest.cpp | 138 ++++++++++----------- tests/messagequeuetest.cpp | 24 ++-- tests/modelinteractivitytest.cpp | 18 +-- tests/pipelinetest.cpp | 90 +++++++------- tests/querytest.cpp | 136 ++++++++++---------- tests/resourcecommunicationtest.cpp | 20 +-- tests/storagebenchmark.cpp | 22 ++-- tests/storagetest.cpp | 120 +++++++++--------- tests/testimplementations.h | 16 +-- 24 files changed, 553 insertions(+), 553 deletions(-) (limited to 'tests') diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 38e5512..b01a329 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -15,7 +15,7 @@ macro(manual_tests) add_executable(${_testname} ${_testname}.cpp testimplementations.cpp getrssusage.cpp) generate_flatbuffers(${_testname} calendar) qt5_use_modules(${_testname} Core Test Concurrent) - target_link_libraries(${_testname} akonadi2common libhawd) + target_link_libraries(${_testname} sinkcommon libhawd) endforeach(_testname) endmacro(manual_tests) @@ -25,7 +25,7 @@ macro(auto_tests) generate_flatbuffers(${_testname} calendar) add_test(${_testname} ${_testname}) qt5_use_modules(${_testname} Core Test Concurrent) - target_link_libraries(${_testname} akonadi2common libhawd) + target_link_libraries(${_testname} sinkcommon libhawd) endforeach(_testname) endmacro(auto_tests) @@ -53,16 +53,16 @@ auto_tests ( modelinteractivitytest inspectiontest ) -target_link_libraries(dummyresourcetest akonadi2_resource_dummy) -target_link_libraries(dummyresourcebenchmark akonadi2_resource_dummy) -target_link_libraries(dummyresourcewritebenchmark akonadi2_resource_dummy) -target_link_libraries(querytest akonadi2_resource_dummy) -target_link_libraries(modelinteractivitytest akonadi2_resource_dummy) -target_link_libraries(inspectiontest akonadi2_resource_dummy) +target_link_libraries(dummyresourcetest sink_resource_dummy) +target_link_libraries(dummyresourcebenchmark sink_resource_dummy) +target_link_libraries(dummyresourcewritebenchmark sink_resource_dummy) +target_link_libraries(querytest sink_resource_dummy) +target_link_libraries(modelinteractivitytest sink_resource_dummy) +target_link_libraries(inspectiontest sink_resource_dummy) if (BUILD_MAILDIR) auto_tests ( maildirresourcetest ) - target_link_libraries(maildirresourcetest akonadi2_resource_maildir) + target_link_libraries(maildirresourcetest sink_resource_maildir) endif() diff --git a/tests/clientapitest.cpp b/tests/clientapitest.cpp index 5942849..a85b03b 100644 --- a/tests/clientapitest.cpp +++ b/tests/clientapitest.cpp @@ -10,7 +10,7 @@ #include "facadefactory.h" template -class DummyResourceFacade : public Akonadi2::StoreFacade +class DummyResourceFacade : public Sink::StoreFacade { public: static std::shared_ptr > registerFacade(const QByteArray &instanceIdentifier = QByteArray()) @@ -19,7 +19,7 @@ public: auto facade = std::make_shared >(); map.insert(instanceIdentifier, facade); bool alwaysReturnFacade = instanceIdentifier.isEmpty(); - Akonadi2::FacadeFactory::instance().registerFacade >("dummyresource", + Sink::FacadeFactory::instance().registerFacade >("dummyresource", [alwaysReturnFacade](const QByteArray &instanceIdentifier) { if (alwaysReturnFacade) { return map.value(QByteArray()); @@ -33,9 +33,9 @@ public: KAsync::Job create(const T &domainObject) Q_DECL_OVERRIDE { return KAsync::null(); }; KAsync::Job modify(const T &domainObject) Q_DECL_OVERRIDE { return KAsync::null(); }; KAsync::Job remove(const T &domainObject) Q_DECL_OVERRIDE { return KAsync::null(); }; - QPair, typename Akonadi2::ResultEmitter::Ptr > load(const Akonadi2::Query &query) Q_DECL_OVERRIDE + QPair, typename Sink::ResultEmitter::Ptr > load(const Sink::Query &query) Q_DECL_OVERRIDE { - auto resultProvider = new Akonadi2::ResultProvider(); + auto resultProvider = new Sink::ResultProvider(); resultProvider->onDone([resultProvider]() { Trace() << "Result provider is done"; delete resultProvider; @@ -67,7 +67,7 @@ public: } QList results; - Akonadi2::ResultProviderInterface *mResultProvider; + Sink::ResultProviderInterface *mResultProvider; }; @@ -83,117 +83,117 @@ private Q_SLOTS: void initTestCase() { - Akonadi2::FacadeFactory::instance().resetFactory(); + Sink::FacadeFactory::instance().resetFactory(); ResourceConfig::clear(); - Akonadi2::Log::setDebugOutputLevel(Akonadi2::Log::Trace); + Sink::Log::setDebugOutputLevel(Sink::Log::Trace); } void testLoad() { - auto facade = DummyResourceFacade::registerFacade(); - facade->results << QSharedPointer::create("resource", "id", 0, QSharedPointer::create()); + auto facade = DummyResourceFacade::registerFacade(); + facade->results << QSharedPointer::create("resource", "id", 0, QSharedPointer::create()); ResourceConfig::addResource("dummyresource.instance1", "dummyresource"); - Akonadi2::Query query; + Sink::Query query; query.resources << "dummyresource.instance1"; query.liveQuery = false; - auto model = Akonadi2::Store::loadModel(query); - QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + auto model = Sink::Store::loadModel(query); + QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); QCOMPARE(model->rowCount(QModelIndex()), 1); } void testLoadWithoutResource() { - Akonadi2::Query query; + Sink::Query query; query.resources << "nonexisting.resource"; query.liveQuery = false; - auto model = Akonadi2::Store::loadModel(query); - QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + auto model = Sink::Store::loadModel(query); + QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); } //TODO: This test doesn't belong to this testsuite void resourceManagement() { ResourceConfig::clear(); - Akonadi2::FacadeFactory::instance().registerStaticFacades(); + Sink::FacadeFactory::instance().registerStaticFacades(); - Akonadi2::ApplicationDomain::AkonadiResource res("", "dummyresource.identifier1", 0, QSharedPointer::create()); + Sink::ApplicationDomain::SinkResource res("", "dummyresource.identifier1", 0, QSharedPointer::create()); res.setProperty("identifier", "dummyresource.identifier1"); res.setProperty("type", "dummyresource"); - Akonadi2::Store::create(res).exec().waitForFinished(); + Sink::Store::create(res).exec().waitForFinished(); { - Akonadi2::Query query; + Sink::Query query; query.propertyFilter.insert("type", "dummyresource"); - auto model = Akonadi2::Store::loadModel(query); + auto model = Sink::Store::loadModel(query); QTRY_COMPARE(model->rowCount(QModelIndex()), 1); } - Akonadi2::Store::remove(res).exec().waitForFinished(); + Sink::Store::remove(res).exec().waitForFinished(); { - Akonadi2::Query query; + Sink::Query query; query.propertyFilter.insert("type", "dummyresource"); - auto model = Akonadi2::Store::loadModel(query); - QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + auto model = Sink::Store::loadModel(query); + QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); QCOMPARE(model->rowCount(QModelIndex()), 0); } } void testModelSingle() { - auto facade = DummyResourceFacade::registerFacade(); - facade->results << QSharedPointer::create("resource", "id", 0, QSharedPointer::create()); + auto facade = DummyResourceFacade::registerFacade(); + facade->results << QSharedPointer::create("resource", "id", 0, QSharedPointer::create()); ResourceConfig::addResource("dummyresource.instance1", "dummyresource"); - Akonadi2::Query query; + Sink::Query query; query.resources << "dummyresource.instance1"; query.liveQuery = false; - auto model = Akonadi2::Store::loadModel(query); + auto model = Sink::Store::loadModel(query); QTRY_COMPARE(model->rowCount(), 1); } void testModelNested() { - auto facade = DummyResourceFacade::registerFacade(); - auto folder = QSharedPointer::create("resource", "id", 0, QSharedPointer::create()); - auto subfolder = QSharedPointer::create("resource", "subId", 0, QSharedPointer::create()); + auto facade = DummyResourceFacade::registerFacade(); + auto folder = QSharedPointer::create("resource", "id", 0, QSharedPointer::create()); + auto subfolder = QSharedPointer::create("resource", "subId", 0, QSharedPointer::create()); subfolder->setProperty("parent", "id"); facade->results << folder << subfolder; ResourceConfig::addResource("dummyresource.instance1", "dummyresource"); //Test - Akonadi2::Query query; + Sink::Query query; query.resources << "dummyresource.instance1"; query.liveQuery = false; query.parentProperty = "parent"; - auto model = Akonadi2::Store::loadModel(query); - QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + auto model = Sink::Store::loadModel(query); + QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); QCOMPARE(model->rowCount(), 1); model->fetchMore(model->index(0, 0)); - QTRY_VERIFY(model->data(model->index(0, 0), Akonadi2::Store::ChildrenFetchedRole).toBool()); + QTRY_VERIFY(model->data(model->index(0, 0), Sink::Store::ChildrenFetchedRole).toBool()); QCOMPARE(model->rowCount(model->index(0, 0)), 1); } void testModelSignals() { - auto facade = DummyResourceFacade::registerFacade(); - auto folder = QSharedPointer::create("resource", "id", 0, QSharedPointer::create()); - auto subfolder = QSharedPointer::create("resource", "subId", 0, QSharedPointer::create()); + auto facade = DummyResourceFacade::registerFacade(); + auto folder = QSharedPointer::create("resource", "id", 0, QSharedPointer::create()); + auto subfolder = QSharedPointer::create("resource", "subId", 0, QSharedPointer::create()); subfolder->setProperty("parent", "id"); facade->results << folder << subfolder; ResourceConfig::addResource("dummyresource.instance1", "dummyresource"); //Test - Akonadi2::Query query; + Sink::Query query; query.resources << "dummyresource.instance1"; query.liveQuery = false; query.parentProperty = "parent"; - auto model = Akonadi2::Store::loadModel(query); + auto model = Sink::Store::loadModel(query); QSignalSpy spy(model.data(), SIGNAL(rowsInserted(const QModelIndex &, int, int))); QVERIFY(spy.isValid()); model->fetchMore(model->index(0, 0)); @@ -202,20 +202,20 @@ private Q_SLOTS: void testModelNestedLive() { - auto facade = DummyResourceFacade::registerFacade(); - auto folder = QSharedPointer::create("dummyresource.instance1", "id", 0, QSharedPointer::create()); - auto subfolder = QSharedPointer::create("dummyresource.instance1", "subId", 0, QSharedPointer::create()); + auto facade = DummyResourceFacade::registerFacade(); + auto folder = QSharedPointer::create("dummyresource.instance1", "id", 0, QSharedPointer::create()); + auto subfolder = QSharedPointer::create("dummyresource.instance1", "subId", 0, QSharedPointer::create()); subfolder->setProperty("parent", "id"); facade->results << folder << subfolder; ResourceConfig::addResource("dummyresource.instance1", "dummyresource"); //Test - Akonadi2::Query query; + Sink::Query query; query.resources << "dummyresource.instance1"; query.liveQuery = true; query.parentProperty = "parent"; - auto model = Akonadi2::Store::loadModel(query); + auto model = Sink::Store::loadModel(query); QTRY_COMPARE(model->rowCount(), 1); model->fetchMore(model->index(0, 0)); QTRY_COMPARE(model->rowCount(model->index(0, 0)), 1); @@ -225,7 +225,7 @@ private Q_SLOTS: //Test new toplevel folder { QSignalSpy rowsInsertedSpy(model.data(), SIGNAL(rowsInserted(const QModelIndex &, int, int))); - auto folder2 = QSharedPointer::create("resource", "id2", 0, QSharedPointer::create()); + auto folder2 = QSharedPointer::create("resource", "id2", 0, QSharedPointer::create()); resultProvider->add(folder2); QTRY_COMPARE(model->rowCount(), 2); QTRY_COMPARE(rowsInsertedSpy.count(), 1); @@ -255,24 +255,24 @@ private Q_SLOTS: void testLoadMultiResource() { - auto facade1 = DummyResourceFacade::registerFacade("dummyresource.instance1"); - facade1->results << QSharedPointer::create("resource1", "id", 0, QSharedPointer::create()); - auto facade2 = DummyResourceFacade::registerFacade("dummyresource.instance2"); - facade2->results << QSharedPointer::create("resource2", "id", 0, QSharedPointer::create()); + auto facade1 = DummyResourceFacade::registerFacade("dummyresource.instance1"); + facade1->results << QSharedPointer::create("resource1", "id", 0, QSharedPointer::create()); + auto facade2 = DummyResourceFacade::registerFacade("dummyresource.instance2"); + facade2->results << QSharedPointer::create("resource2", "id", 0, QSharedPointer::create()); ResourceConfig::addResource("dummyresource.instance1", "dummyresource"); ResourceConfig::addResource("dummyresource.instance2", "dummyresource"); - Akonadi2::Query query; + Sink::Query query; query.liveQuery = false; int childrenFetchedCount = 0; - auto model = Akonadi2::Store::loadModel(query); + auto model = Sink::Store::loadModel(query); QObject::connect(model.data(), &QAbstractItemModel::dataChanged, [&childrenFetchedCount](const QModelIndex &, const QModelIndex &, const QVector &roles) { - if (roles.contains(Akonadi2::Store::ChildrenFetchedRole)) { + if (roles.contains(Sink::Store::ChildrenFetchedRole)) { childrenFetchedCount++; } }); - QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); QCOMPARE(model->rowCount(QModelIndex()), 2); //Ensure children fetched is only emitted once (when all resources are done) QTest::qWait(50); @@ -281,17 +281,17 @@ private Q_SLOTS: void testImperativeLoad() { - auto facade = DummyResourceFacade::registerFacade(); - facade->results << QSharedPointer::create("resource", "id", 0, QSharedPointer::create()); + auto facade = DummyResourceFacade::registerFacade(); + facade->results << QSharedPointer::create("resource", "id", 0, QSharedPointer::create()); ResourceConfig::addResource("dummyresource.instance1", "dummyresource"); - Akonadi2::Query query; + Sink::Query query; query.resources << "dummyresource.instance1"; query.liveQuery = false; bool gotValue = false; - auto result = Akonadi2::Store::fetchOne(query) - .then([&gotValue](const Akonadi2::ApplicationDomain::Event &event) { + auto result = Sink::Store::fetchOne(query) + .then([&gotValue](const Sink::ApplicationDomain::Event &event) { gotValue = true; }).exec(); result.waitForFinished(); diff --git a/tests/databasepopulationandfacadequerybenchmark.cpp b/tests/databasepopulationandfacadequerybenchmark.cpp index 5a96bdd..8581c49 100644 --- a/tests/databasepopulationandfacadequerybenchmark.cpp +++ b/tests/databasepopulationandfacadequerybenchmark.cpp @@ -34,12 +34,12 @@ class DatabasePopulationAndFacadeQueryBenchmark : public QObject void populateDatabase(int count) { - Akonadi2::Storage(Akonadi2::storageLocation(), "identifier", Akonadi2::Storage::ReadWrite).removeFromDisk(); + Sink::Storage(Sink::storageLocation(), "identifier", Sink::Storage::ReadWrite).removeFromDisk(); //Setup auto domainTypeAdaptorFactory = QSharedPointer::create(); { - Akonadi2::Storage storage(Akonadi2::storageLocation(), identifier, Akonadi2::Storage::ReadWrite); - auto transaction = storage.createTransaction(Akonadi2::Storage::ReadWrite); + Sink::Storage storage(Sink::storageLocation(), identifier, Sink::Storage::ReadWrite); + auto transaction = storage.createTransaction(Sink::Storage::ReadWrite); auto db = transaction.openDatabase("event.main"); int bufferSizeTotal = 0; @@ -47,7 +47,7 @@ class DatabasePopulationAndFacadeQueryBenchmark : public QObject QByteArray attachment; attachment.fill('c', 1000); for (int i = 0; i < count; i++) { - auto domainObject = Akonadi2::ApplicationDomain::Event::Ptr::create(); + auto domainObject = Sink::ApplicationDomain::Event::Ptr::create(); domainObject->setProperty("uid", "uid"); domainObject->setProperty("summary", "summary"); domainObject->setProperty("attachment", attachment); @@ -82,7 +82,7 @@ class DatabasePopulationAndFacadeQueryBenchmark : public QObject { const auto startingRss = getCurrentRSS(); - Akonadi2::Query query; + Sink::Query query; query.liveQuery = false; query.requestedProperties << "uid" << "summary"; @@ -90,22 +90,22 @@ class DatabasePopulationAndFacadeQueryBenchmark : public QObject QTime time; time.start(); - auto resultSet = QSharedPointer >::create(); + auto resultSet = QSharedPointer >::create(); auto resourceAccess = QSharedPointer::create(); TestResourceFacade facade(identifier, resourceAccess); auto ret = facade.load(query); ret.first.exec().waitForFinished(); auto emitter = ret.second; - QList list; - emitter->onAdded([&list](const Akonadi2::ApplicationDomain::Event::Ptr &event) { + QList list; + emitter->onAdded([&list](const Sink::ApplicationDomain::Event::Ptr &event) { list << event; }); bool done = false; - emitter->onInitialResultSetComplete([&done](const Akonadi2::ApplicationDomain::Event::Ptr &event) { + emitter->onInitialResultSetComplete([&done](const Sink::ApplicationDomain::Event::Ptr &event) { done = true; }); - emitter->fetch(Akonadi2::ApplicationDomain::Event::Ptr()); + emitter->fetch(Sink::ApplicationDomain::Event::Ptr()); QTRY_VERIFY(done); QCOMPARE(list.size(), count); @@ -114,7 +114,7 @@ class DatabasePopulationAndFacadeQueryBenchmark : public QObject const auto finalRss = getCurrentRSS(); const auto rssGrowth = finalRss - startingRss; //Since the database is memory mapped it is attributted to the resident set size. - const auto rssWithoutDb = finalRss - Akonadi2::Storage(Akonadi2::storageLocation(), identifier, Akonadi2::Storage::ReadWrite).diskUsage(); + const auto rssWithoutDb = finalRss - Sink::Storage(Sink::storageLocation(), identifier, Sink::Storage::ReadWrite).diskUsage(); const auto peakRss = getPeakRSS(); //How much peak deviates from final rss in percent (should be around 0) const auto percentageRssError = static_cast(peakRss - finalRss)*100.0/static_cast(finalRss); diff --git a/tests/domainadaptortest.cpp b/tests/domainadaptortest.cpp index b3d2a00..ff8f639 100644 --- a/tests/domainadaptortest.cpp +++ b/tests/domainadaptortest.cpp @@ -13,12 +13,12 @@ #include "metadata_generated.h" #include "entity_generated.h" -class TestFactory : public DomainTypeAdaptorFactory +class TestFactory : public DomainTypeAdaptorFactory { public: TestFactory() { - mResourceWriteMapper = Akonadi2::ApplicationDomain::TypeImplementation::initializeWritePropertyMapper(); + mResourceWriteMapper = Sink::ApplicationDomain::TypeImplementation::initializeWritePropertyMapper(); } }; @@ -39,27 +39,27 @@ private Q_SLOTS: void testCreateBufferPart() { - auto writeMapper = Akonadi2::ApplicationDomain::TypeImplementation::initializeWritePropertyMapper(); + auto writeMapper = Sink::ApplicationDomain::TypeImplementation::initializeWritePropertyMapper(); - Akonadi2::ApplicationDomain::Event event; + Sink::ApplicationDomain::Event event; event.setProperty("summary", "foo"); flatbuffers::FlatBufferBuilder fbb; - auto pos = createBufferPart(event, fbb, *writeMapper); - Akonadi2::ApplicationDomain::Buffer::FinishEventBuffer(fbb, pos); + auto pos = createBufferPart(event, fbb, *writeMapper); + Sink::ApplicationDomain::Buffer::FinishEventBuffer(fbb, pos); flatbuffers::Verifier verifier(fbb.GetBufferPointer(), fbb.GetSize()); - QVERIFY(verifier.VerifyBuffer()); + QVERIFY(verifier.VerifyBuffer()); } void testAdaptor() { //Create entity buffer flatbuffers::FlatBufferBuilder metadataFbb; - auto metadataBuilder = Akonadi2::MetadataBuilder(metadataFbb); + auto metadataBuilder = Sink::MetadataBuilder(metadataFbb); metadataBuilder.add_revision(1); auto metadataBuffer = metadataBuilder.Finish(); - Akonadi2::FinishMetadataBuffer(metadataFbb, metadataBuffer); + Sink::FinishMetadataBuffer(metadataFbb, metadataBuffer); flatbuffers::FlatBufferBuilder m_fbb; auto summary = m_fbb.CreateString("summary1"); @@ -67,20 +67,20 @@ private Q_SLOTS: static uint8_t rawData[100]; auto attachment = m_fbb.CreateVector(rawData, 100); - auto builder = Akonadi2::ApplicationDomain::Buffer::EventBuilder(m_fbb); + auto builder = Sink::ApplicationDomain::Buffer::EventBuilder(m_fbb); builder.add_summary(summary); builder.add_description(description); builder.add_attachment(attachment); auto buffer = builder.Finish(); - Akonadi2::ApplicationDomain::Buffer::FinishEventBuffer(m_fbb, buffer); + Sink::ApplicationDomain::Buffer::FinishEventBuffer(m_fbb, buffer); flatbuffers::FlatBufferBuilder fbb; - Akonadi2::EntityBuffer::assembleEntityBuffer(fbb, metadataFbb.GetBufferPointer(), metadataFbb.GetSize(), m_fbb.GetBufferPointer(), m_fbb.GetSize(), m_fbb.GetBufferPointer(), m_fbb.GetSize()); + Sink::EntityBuffer::assembleEntityBuffer(fbb, metadataFbb.GetBufferPointer(), metadataFbb.GetSize(), m_fbb.GetBufferPointer(), m_fbb.GetSize(), m_fbb.GetBufferPointer(), m_fbb.GetSize()); //Extract entity buffer { std::string data(reinterpret_cast(fbb.GetBufferPointer()), fbb.GetSize()); - Akonadi2::EntityBuffer buffer((void*)(data.data()), data.size()); + Sink::EntityBuffer buffer((void*)(data.data()), data.size()); TestFactory factory; auto adaptor = factory.createAdaptor(buffer.entity()); diff --git a/tests/dummyresourcebenchmark.cpp b/tests/dummyresourcebenchmark.cpp index c52eee3..e511613 100644 --- a/tests/dummyresourcebenchmark.cpp +++ b/tests/dummyresourcebenchmark.cpp @@ -30,8 +30,8 @@ private: private Q_SLOTS: void initTestCase() { - Akonadi2::Log::setDebugOutputLevel(Akonadi2::Log::Warning); - auto factory = Akonadi2::ResourceFactory::load("org.kde.dummy"); + Sink::Log::setDebugOutputLevel(Sink::Log::Warning); + auto factory = Sink::ResourceFactory::load("org.kde.dummy"); QVERIFY(factory); ResourceConfig::addResource("org.kde.dummy.instance1", "org.kde.dummy"); num = 5000; @@ -79,20 +79,20 @@ private Q_SLOTS: time.start(); QList > waitCondition; for (int i = 0; i < num; i++) { - Akonadi2::ApplicationDomain::Event event("org.kde.dummy.instance1"); + Sink::ApplicationDomain::Event event("org.kde.dummy.instance1"); event.setProperty("uid", "testuid"); QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); event.setProperty("summary", "summaryValue"); - waitCondition << Akonadi2::Store::create(event).exec(); + waitCondition << Sink::Store::create(event).exec(); } waitForCompletion(waitCondition).exec().waitForFinished(); auto appendTime = time.elapsed(); //Ensure everything is processed { - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.dummy.instance1"; - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); } auto allProcessedTime = time.elapsed(); @@ -119,11 +119,11 @@ private Q_SLOTS: //Measure query { time.start(); - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.dummy.instance1"; query.propertyFilter.insert("uid", "testuid"); - auto model = Akonadi2::Store::loadModel(query); + auto model = Sink::Store::loadModel(query); QTRY_COMPARE(model->rowCount(QModelIndex()), num); } auto queryTime = time.elapsed(); @@ -142,44 +142,44 @@ private Q_SLOTS: QTime time; time.start(); - auto pipeline = QSharedPointer::create("org.kde.dummy.instance1"); + auto pipeline = QSharedPointer::create("org.kde.dummy.instance1"); DummyResource resource("org.kde.dummy.instance1", pipeline); flatbuffers::FlatBufferBuilder eventFbb; eventFbb.Clear(); { auto summary = eventFbb.CreateString("summary"); - Akonadi2::ApplicationDomain::Buffer::EventBuilder eventBuilder(eventFbb); + Sink::ApplicationDomain::Buffer::EventBuilder eventBuilder(eventFbb); eventBuilder.add_summary(summary); auto eventLocation = eventBuilder.Finish(); - Akonadi2::ApplicationDomain::Buffer::FinishEventBuffer(eventFbb, eventLocation); + Sink::ApplicationDomain::Buffer::FinishEventBuffer(eventFbb, eventLocation); } flatbuffers::FlatBufferBuilder localFbb; { auto uid = localFbb.CreateString("testuid"); - auto localBuilder = Akonadi2::ApplicationDomain::Buffer::EventBuilder(localFbb); + auto localBuilder = Sink::ApplicationDomain::Buffer::EventBuilder(localFbb); localBuilder.add_uid(uid); auto location = localBuilder.Finish(); - Akonadi2::ApplicationDomain::Buffer::FinishEventBuffer(localFbb, location); + Sink::ApplicationDomain::Buffer::FinishEventBuffer(localFbb, location); } flatbuffers::FlatBufferBuilder entityFbb; - Akonadi2::EntityBuffer::assembleEntityBuffer(entityFbb, 0, 0, eventFbb.GetBufferPointer(), eventFbb.GetSize(), localFbb.GetBufferPointer(), localFbb.GetSize()); + Sink::EntityBuffer::assembleEntityBuffer(entityFbb, 0, 0, eventFbb.GetBufferPointer(), eventFbb.GetSize(), localFbb.GetBufferPointer(), localFbb.GetSize()); flatbuffers::FlatBufferBuilder fbb; - auto type = fbb.CreateString(Akonadi2::ApplicationDomain::getTypeName().toStdString().data()); + auto type = fbb.CreateString(Sink::ApplicationDomain::getTypeName().toStdString().data()); auto delta = fbb.CreateVector(entityFbb.GetBufferPointer(), entityFbb.GetSize()); - Akonadi2::Commands::CreateEntityBuilder builder(fbb); + Sink::Commands::CreateEntityBuilder builder(fbb); builder.add_domainType(type); builder.add_delta(delta); auto location = builder.Finish(); - Akonadi2::Commands::FinishCreateEntityBuffer(fbb, location); + Sink::Commands::FinishCreateEntityBuffer(fbb, location); const QByteArray command(reinterpret_cast(fbb.GetBufferPointer()), fbb.GetSize()); for (int i = 0; i < num; i++) { - resource.processCommand(Akonadi2::Commands::CreateEntityCommand, command); + resource.processCommand(Sink::Commands::CreateEntityCommand, command); } auto appendTime = time.elapsed(); @@ -203,7 +203,7 @@ private Q_SLOTS: void testCreateCommand() { - Akonadi2::ApplicationDomain::Event event; + Sink::ApplicationDomain::Event event; QBENCHMARK { auto mFactory = new DummyEventAdaptorFactory; @@ -217,9 +217,9 @@ private Q_SLOTS: auto entityId = fbb.CreateString(""); auto type = fbb.CreateString("event"); // auto delta = fbb.CreateVector(entityFbb.GetBufferPointer(), entityFbb.GetSize()); - auto delta = Akonadi2::EntityBuffer::appendAsVector(fbb, entityFbb.GetBufferPointer(), entityFbb.GetSize()); - auto location = Akonadi2::Commands::CreateCreateEntity(fbb, entityId, type, delta); - Akonadi2::Commands::FinishCreateEntityBuffer(fbb, location); + auto delta = Sink::EntityBuffer::appendAsVector(fbb, entityFbb.GetBufferPointer(), entityFbb.GetSize()); + auto location = Sink::Commands::CreateCreateEntity(fbb, entityId, type, delta); + Sink::Commands::FinishCreateEntityBuffer(fbb, location); } } diff --git a/tests/dummyresourcetest.cpp b/tests/dummyresourcetest.cpp index 72a24b6..82c713d 100644 --- a/tests/dummyresourcetest.cpp +++ b/tests/dummyresourcetest.cpp @@ -22,8 +22,8 @@ class DummyResourceTest : public QObject private Q_SLOTS: void initTestCase() { - Akonadi2::Log::setDebugOutputLevel(Akonadi2::Log::Trace); - auto factory = Akonadi2::ResourceFactory::load("org.kde.dummy"); + Sink::Log::setDebugOutputLevel(Sink::Log::Trace); + auto factory = Sink::ResourceFactory::load("org.kde.dummy"); QVERIFY(factory); DummyResource::removeFromDisk("org.kde.dummy.instance1"); ResourceConfig::addResource("org.kde.dummy.instance1", "org.kde.dummy"); @@ -31,11 +31,11 @@ private Q_SLOTS: void cleanup() { - Akonadi2::Store::shutdown(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); + Sink::Store::shutdown(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); DummyResource::removeFromDisk("org.kde.dummy.instance1"); - auto factory = Akonadi2::ResourceFactory::load("org.kde.dummy"); + auto factory = Sink::ResourceFactory::load("org.kde.dummy"); QVERIFY(factory); - Akonadi2::Store::start(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); + Sink::Store::start(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); } void init() @@ -47,54 +47,54 @@ private Q_SLOTS: void testProperty() { - Akonadi2::ApplicationDomain::Event event; + Sink::ApplicationDomain::Event event; event.setProperty("uid", "testuid"); QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); } void testWriteToFacadeAndQueryByUid() { - Akonadi2::ApplicationDomain::Event event("org.kde.dummy.instance1"); + Sink::ApplicationDomain::Event event("org.kde.dummy.instance1"); event.setProperty("uid", "testuid"); QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); event.setProperty("summary", "summaryValue"); - Akonadi2::Store::create(event).exec().waitForFinished(); + Sink::Store::create(event).exec().waitForFinished(); - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.dummy.instance1"; //Ensure all local data is processed - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); query.propertyFilter.insert("uid", "testuid"); - auto model = Akonadi2::Store::loadModel(query); + auto model = Sink::Store::loadModel(query); QTRY_COMPARE(model->rowCount(QModelIndex()), 1); - auto value = model->index(0, 0, QModelIndex()).data(Akonadi2::Store::DomainObjectRole).value(); + auto value = model->index(0, 0, QModelIndex()).data(Sink::Store::DomainObjectRole).value(); QCOMPARE(value->getProperty("uid").toByteArray(), QByteArray("testuid")); } void testWriteToFacadeAndQueryByUid2() { - Akonadi2::ApplicationDomain::Event event("org.kde.dummy.instance1"); + Sink::ApplicationDomain::Event event("org.kde.dummy.instance1"); event.setProperty("summary", "summaryValue"); event.setProperty("uid", "testuid"); - Akonadi2::Store::create(event).exec().waitForFinished(); + Sink::Store::create(event).exec().waitForFinished(); event.setProperty("uid", "testuid2"); - Akonadi2::Store::create(event).exec().waitForFinished(); + Sink::Store::create(event).exec().waitForFinished(); - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.dummy.instance1"; //Ensure all local data is processed - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); query.propertyFilter.insert("uid", "testuid"); - auto model = Akonadi2::Store::loadModel(query); + auto model = Sink::Store::loadModel(query); QTRY_COMPARE(model->rowCount(QModelIndex()), 1); - auto value = model->index(0, 0, QModelIndex()).data(Akonadi2::Store::DomainObjectRole).value(); + auto value = model->index(0, 0, QModelIndex()).data(Sink::Store::DomainObjectRole).value(); qDebug() << value->getProperty("uid").toByteArray(); QCOMPARE(value->getProperty("uid").toByteArray(), QByteArray("testuid")); @@ -102,27 +102,27 @@ private Q_SLOTS: void testWriteToFacadeAndQueryBySummary() { - Akonadi2::ApplicationDomain::Event event("org.kde.dummy.instance1"); + Sink::ApplicationDomain::Event event("org.kde.dummy.instance1"); event.setProperty("uid", "testuid"); event.setProperty("summary", "summaryValue1"); - Akonadi2::Store::create(event).exec().waitForFinished(); + Sink::Store::create(event).exec().waitForFinished(); event.setProperty("uid", "testuid2"); event.setProperty("summary", "summaryValue2"); - Akonadi2::Store::create(event).exec().waitForFinished(); + Sink::Store::create(event).exec().waitForFinished(); - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.dummy.instance1"; //Ensure all local data is processed - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); query.propertyFilter.insert("summary", "summaryValue2"); - auto model = Akonadi2::Store::loadModel(query); + auto model = Sink::Store::loadModel(query); QTRY_COMPARE(model->rowCount(QModelIndex()), 1); - auto value = model->index(0, 0, QModelIndex()).data(Akonadi2::Store::DomainObjectRole).value(); + auto value = model->index(0, 0, QModelIndex()).data(Sink::Store::DomainObjectRole).value(); qDebug() << value->getProperty("uid").toByteArray(); QCOMPARE(value->getProperty("uid").toByteArray(), QByteArray("testuid2")); @@ -130,7 +130,7 @@ private Q_SLOTS: void testResourceSync() { - auto pipeline = QSharedPointer::create("org.kde.dummy.instance1"); + auto pipeline = QSharedPointer::create("org.kde.dummy.instance1"); DummyResource resource("org.kde.dummy.instance1", pipeline); auto job = resource.synchronizeWithSource(); //TODO pass in optional timeout? @@ -145,16 +145,16 @@ private Q_SLOTS: void testSyncAndFacade() { - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.dummy.instance1"; //Ensure all local data is processed - Akonadi2::Store::synchronize(query).exec().waitForFinished(); - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::synchronize(query).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); - auto model = Akonadi2::Store::loadModel(query); + auto model = Sink::Store::loadModel(query); QTRY_VERIFY(model->rowCount(QModelIndex()) >= 1); - auto value = model->index(0, 0, QModelIndex()).data(Akonadi2::Store::DomainObjectRole).value(); + auto value = model->index(0, 0, QModelIndex()).data(Sink::Store::DomainObjectRole).value(); QVERIFY(!value->getProperty("summary").toString().isEmpty()); qDebug() << value->getProperty("summary").toString(); @@ -162,16 +162,16 @@ private Q_SLOTS: void testSyncAndFacadeMail() { - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.dummy.instance1"; //Ensure all local data is processed - Akonadi2::Store::synchronize(query).exec().waitForFinished(); - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::synchronize(query).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); - auto model = Akonadi2::Store::loadModel(query); + auto model = Sink::Store::loadModel(query); QTRY_VERIFY(model->rowCount(QModelIndex()) >= 1); - auto value = model->index(0, 0, QModelIndex()).data(Akonadi2::Store::DomainObjectRole).value(); + auto value = model->index(0, 0, QModelIndex()).data(Sink::Store::DomainObjectRole).value(); QVERIFY(!value->getProperty("subject").toString().isEmpty()); qDebug() << value->getProperty("subject").toString(); @@ -179,25 +179,25 @@ private Q_SLOTS: void testWriteModifyDelete() { - Akonadi2::ApplicationDomain::Event event("org.kde.dummy.instance1"); + Sink::ApplicationDomain::Event event("org.kde.dummy.instance1"); event.setProperty("uid", "testuid"); QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); event.setProperty("summary", "summaryValue"); - Akonadi2::Store::create(event).exec().waitForFinished(); + Sink::Store::create(event).exec().waitForFinished(); - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.dummy.instance1"; query.propertyFilter.insert("uid", "testuid"); //Ensure all local data is processed - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); //Test create - Akonadi2::ApplicationDomain::Event event2; + Sink::ApplicationDomain::Event event2; { - auto model = Akonadi2::Store::loadModel(query); + auto model = Sink::Store::loadModel(query); QTRY_COMPARE(model->rowCount(QModelIndex()), 1); - auto value = model->index(0, 0, QModelIndex()).data(Akonadi2::Store::DomainObjectRole).value(); + auto value = model->index(0, 0, QModelIndex()).data(Sink::Store::DomainObjectRole).value(); QCOMPARE(value->getProperty("uid").toByteArray(), QByteArray("testuid")); QCOMPARE(value->getProperty("summary").toByteArray(), QByteArray("summaryValue")); @@ -206,30 +206,30 @@ private Q_SLOTS: event2.setProperty("uid", "testuid"); event2.setProperty("summary", "summaryValue2"); - Akonadi2::Store::modify(event2).exec().waitForFinished(); + Sink::Store::modify(event2).exec().waitForFinished(); //Ensure all local data is processed - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); //Test modify { - auto model = Akonadi2::Store::loadModel(query); + auto model = Sink::Store::loadModel(query); QTRY_COMPARE(model->rowCount(QModelIndex()), 1); - auto value = model->index(0, 0, QModelIndex()).data(Akonadi2::Store::DomainObjectRole).value(); + auto value = model->index(0, 0, QModelIndex()).data(Sink::Store::DomainObjectRole).value(); QCOMPARE(value->getProperty("uid").toByteArray(), QByteArray("testuid")); QCOMPARE(value->getProperty("summary").toByteArray(), QByteArray("summaryValue2")); } - Akonadi2::Store::remove(event2).exec().waitForFinished(); + Sink::Store::remove(event2).exec().waitForFinished(); //Ensure all local data is processed - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); //Test remove { - auto model = Akonadi2::Store::loadModel(query); - QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + auto model = Sink::Store::loadModel(query); + QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); QTRY_COMPARE(model->rowCount(QModelIndex()), 0); } } @@ -237,25 +237,25 @@ private Q_SLOTS: void testWriteModifyDeleteLive() { - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.dummy.instance1"; query.liveQuery = true; query.propertyFilter.insert("uid", "testuid"); - auto model = Akonadi2::Store::loadModel(query); - QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + auto model = Sink::Store::loadModel(query); + QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); - Akonadi2::ApplicationDomain::Event event("org.kde.dummy.instance1"); + Sink::ApplicationDomain::Event event("org.kde.dummy.instance1"); event.setProperty("uid", "testuid"); QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); event.setProperty("summary", "summaryValue"); - Akonadi2::Store::create(event).exec().waitForFinished(); + Sink::Store::create(event).exec().waitForFinished(); //Test create - Akonadi2::ApplicationDomain::Event event2; + Sink::ApplicationDomain::Event event2; { QTRY_COMPARE(model->rowCount(QModelIndex()), 1); - auto value = model->index(0, 0, QModelIndex()).data(Akonadi2::Store::DomainObjectRole).value(); + auto value = model->index(0, 0, QModelIndex()).data(Sink::Store::DomainObjectRole).value(); QCOMPARE(value->getProperty("uid").toByteArray(), QByteArray("testuid")); QCOMPARE(value->getProperty("summary").toByteArray(), QByteArray("summaryValue")); event2 = *value; @@ -263,18 +263,18 @@ private Q_SLOTS: event2.setProperty("uid", "testuid"); event2.setProperty("summary", "summaryValue2"); - Akonadi2::Store::modify(event2).exec().waitForFinished(); + Sink::Store::modify(event2).exec().waitForFinished(); //Test modify { //TODO wait for a change signal QTRY_COMPARE(model->rowCount(QModelIndex()), 1); - auto value = model->index(0, 0, QModelIndex()).data(Akonadi2::Store::DomainObjectRole).value(); + auto value = model->index(0, 0, QModelIndex()).data(Sink::Store::DomainObjectRole).value(); QCOMPARE(value->getProperty("uid").toByteArray(), QByteArray("testuid")); QCOMPARE(value->getProperty("summary").toByteArray(), QByteArray("summaryValue2")); } - Akonadi2::Store::remove(event2).exec().waitForFinished(); + Sink::Store::remove(event2).exec().waitForFinished(); //Test remove { diff --git a/tests/dummyresourcewritebenchmark.cpp b/tests/dummyresourcewritebenchmark.cpp index 1e7f1ef..1a8893b 100644 --- a/tests/dummyresourcewritebenchmark.cpp +++ b/tests/dummyresourcewritebenchmark.cpp @@ -60,33 +60,33 @@ static QByteArray createEntityBuffer(int &bufferSize) eventFbb.Clear(); { auto summary = eventFbb.CreateString("summary"); - Akonadi2::ApplicationDomain::Buffer::EventBuilder eventBuilder(eventFbb); + Sink::ApplicationDomain::Buffer::EventBuilder eventBuilder(eventFbb); eventBuilder.add_summary(summary); auto eventLocation = eventBuilder.Finish(); - Akonadi2::ApplicationDomain::Buffer::FinishEventBuffer(eventFbb, eventLocation); + Sink::ApplicationDomain::Buffer::FinishEventBuffer(eventFbb, eventLocation); } flatbuffers::FlatBufferBuilder localFbb; { auto uid = localFbb.CreateString("testuid"); - auto localBuilder = Akonadi2::ApplicationDomain::Buffer::EventBuilder(localFbb); + auto localBuilder = Sink::ApplicationDomain::Buffer::EventBuilder(localFbb); localBuilder.add_uid(uid); auto location = localBuilder.Finish(); - Akonadi2::ApplicationDomain::Buffer::FinishEventBuffer(localFbb, location); + Sink::ApplicationDomain::Buffer::FinishEventBuffer(localFbb, location); } flatbuffers::FlatBufferBuilder entityFbb; - Akonadi2::EntityBuffer::assembleEntityBuffer(entityFbb, 0, 0, eventFbb.GetBufferPointer(), eventFbb.GetSize(), localFbb.GetBufferPointer(), localFbb.GetSize()); + Sink::EntityBuffer::assembleEntityBuffer(entityFbb, 0, 0, eventFbb.GetBufferPointer(), eventFbb.GetSize(), localFbb.GetBufferPointer(), localFbb.GetSize()); bufferSize = entityFbb.GetSize(); flatbuffers::FlatBufferBuilder fbb; - auto type = fbb.CreateString(Akonadi2::ApplicationDomain::getTypeName().toStdString().data()); + auto type = fbb.CreateString(Sink::ApplicationDomain::getTypeName().toStdString().data()); auto delta = fbb.CreateVector(entityFbb.GetBufferPointer(), entityFbb.GetSize()); - Akonadi2::Commands::CreateEntityBuilder builder(fbb); + Sink::Commands::CreateEntityBuilder builder(fbb); builder.add_domainType(type); builder.add_delta(delta); auto location = builder.Finish(); - Akonadi2::Commands::FinishCreateEntityBuffer(fbb, location); + Sink::Commands::FinishCreateEntityBuffer(fbb, location); return QByteArray(reinterpret_cast(fbb.GetBufferPointer()), fbb.GetSize()); } @@ -109,7 +109,7 @@ class DummyResourceWriteBenchmark : public QObject QTime time; time.start(); - auto pipeline = QSharedPointer::create("org.kde.dummy.instance1"); + auto pipeline = QSharedPointer::create("org.kde.dummy.instance1"); DummyResource resource("org.kde.dummy.instance1", pipeline); int bufferSize = 0; @@ -117,7 +117,7 @@ class DummyResourceWriteBenchmark : public QObject const auto startingRss = getCurrentRSS(); for (int i = 0; i < num; i++) { - resource.processCommand(Akonadi2::Commands::CreateEntityCommand, command); + resource.processCommand(Sink::Commands::CreateEntityCommand, command); } auto appendTime = time.elapsed(); auto bufferSizeTotal = bufferSize * num; @@ -174,7 +174,7 @@ class DummyResourceWriteBenchmark : public QObject private Q_SLOTS: void initTestCase() { - Akonadi2::Log::setDebugOutputLevel(Akonadi2::Log::Warning); + Sink::Log::setDebugOutputLevel(Sink::Log::Warning); } void cleanup() @@ -215,7 +215,7 @@ private Q_SLOTS: void getFreePages() { - std::system(QString("mdb_stat %1/%2 -ff").arg(Akonadi2::storageLocation()).arg("org.kde.dummy.instance1").toLatin1().constData()); + std::system(QString("mdb_stat %1/%2 -ff").arg(Sink::storageLocation()).arg("org.kde.dummy.instance1").toLatin1().constData()); } //This allows to run individual parts without doing a cleanup, but still cleaning up normally diff --git a/tests/genericfacadetest.cpp b/tests/genericfacadetest.cpp index bb95f4e..63e93f8 100644 --- a/tests/genericfacadetest.cpp +++ b/tests/genericfacadetest.cpp @@ -26,20 +26,20 @@ private Q_SLOTS: void init() { - Akonadi2::Log::setDebugOutputLevel(Akonadi2::Log::Trace); + Sink::Log::setDebugOutputLevel(Sink::Log::Trace); } void testLoad() { - Akonadi2::Query query; + Sink::Query query; query.liveQuery = false; - auto resultSet = QSharedPointer >::create(); + auto resultSet = QSharedPointer >::create(); auto resourceAccess = QSharedPointer::create(); - // storage->mResults << Akonadi2::ApplicationDomain::Event::Ptr::create(); + // storage->mResults << Sink::ApplicationDomain::Event::Ptr::create(); TestResourceFacade facade("identifier", resourceAccess); - async::SyncListResult result(resultSet->emitter()); + async::SyncListResult result(resultSet->emitter()); facade.load(query, *resultSet).exec().waitForFinished(); resultSet->initialResultSetComplete(); @@ -52,15 +52,15 @@ private Q_SLOTS: void testLiveQuery() { - Akonadi2::Query query; + Sink::Query query; query.liveQuery = true; - auto resultSet = QSharedPointer >::create(); + auto resultSet = QSharedPointer >::create(); auto resourceAccess = QSharedPointer::create(); - // storage->mResults << Akonadi2::ApplicationDomain::Event::Ptr::create(); + // storage->mResults << Sink::ApplicationDomain::Event::Ptr::create(); TestResourceFacade facade("identifier", resourceAccess); - async::SyncListResult result(resultSet->emitter()); + async::SyncListResult result(resultSet->emitter()); facade.load(query, *resultSet).exec().waitForFinished(); resultSet->initialResultSetComplete(); @@ -70,7 +70,7 @@ private Q_SLOTS: //Enter a second result // storage->mResults.clear(); - // storage->mResults << QSharedPointer::create("resource", "id2", 0, QSharedPointer()); + // storage->mResults << QSharedPointer::create("resource", "id2", 0, QSharedPointer()); // storage->mLatestRevision = 2; resourceAccess->emit revisionChanged(2); @@ -83,17 +83,17 @@ private Q_SLOTS: void testLiveQueryModify() { - Akonadi2::Query query; + Sink::Query query; query.liveQuery = true; - auto resultSet = QSharedPointer >::create(); + auto resultSet = QSharedPointer >::create(); auto resourceAccess = QSharedPointer::create(); - auto entity = QSharedPointer::create("resource", "id2", 0, QSharedPointer::create()); + auto entity = QSharedPointer::create("resource", "id2", 0, QSharedPointer::create()); entity->setProperty("test", "test1"); // storage->mResults << entity; TestResourceFacade facade("identifier", resourceAccess); - async::SyncListResult result(resultSet->emitter()); + async::SyncListResult result(resultSet->emitter()); facade.load(query, *resultSet).exec().waitForFinished(); resultSet->initialResultSetComplete(); @@ -103,7 +103,7 @@ private Q_SLOTS: //Modify the entity again // storage->mResults.clear(); - entity = QSharedPointer::create("resource", "id2", 0, QSharedPointer::create()); + entity = QSharedPointer::create("resource", "id2", 0, QSharedPointer::create()); entity->setProperty("test", "test2"); // storage->mModifications << entity; // storage->mLatestRevision = 2; @@ -119,16 +119,16 @@ private Q_SLOTS: void testLiveQueryRemove() { - Akonadi2::Query query; + Sink::Query query; query.liveQuery = true; - auto resultSet = QSharedPointer >::create(); + auto resultSet = QSharedPointer >::create(); auto resourceAccess = QSharedPointer::create(); - auto entity = QSharedPointer::create("resource", "id2", 0, QSharedPointer()); + auto entity = QSharedPointer::create("resource", "id2", 0, QSharedPointer()); // storage->mResults << entity; TestResourceFacade facade("identifier", resourceAccess); - async::SyncListResult result(resultSet->emitter()); + async::SyncListResult result(resultSet->emitter()); facade.load(query, *resultSet).exec().waitForFinished(); resultSet->initialResultSetComplete(); diff --git a/tests/genericresourcebenchmark.cpp b/tests/genericresourcebenchmark.cpp index fbe0d12..7f0d3a2 100644 --- a/tests/genericresourcebenchmark.cpp +++ b/tests/genericresourcebenchmark.cpp @@ -20,7 +20,7 @@ static void removeFromDisk(const QString &name) { - Akonadi2::Storage store(Akonadi2::storageLocation(), name, Akonadi2::Storage::ReadWrite); + Sink::Storage store(Sink::storageLocation(), name, Sink::Storage::ReadWrite); store.removeFromDisk(); } @@ -30,39 +30,39 @@ static QByteArray createEntityBuffer() eventFbb.Clear(); { auto summary = eventFbb.CreateString("summary"); - Akonadi2::ApplicationDomain::Buffer::EventBuilder eventBuilder(eventFbb); + Sink::ApplicationDomain::Buffer::EventBuilder eventBuilder(eventFbb); eventBuilder.add_summary(summary); auto eventLocation = eventBuilder.Finish(); - Akonadi2::ApplicationDomain::Buffer::FinishEventBuffer(eventFbb, eventLocation); + Sink::ApplicationDomain::Buffer::FinishEventBuffer(eventFbb, eventLocation); } flatbuffers::FlatBufferBuilder localFbb; { auto uid = localFbb.CreateString("testuid"); - auto localBuilder = Akonadi2::ApplicationDomain::Buffer::EventBuilder(localFbb); + auto localBuilder = Sink::ApplicationDomain::Buffer::EventBuilder(localFbb); localBuilder.add_uid(uid); auto location = localBuilder.Finish(); - Akonadi2::ApplicationDomain::Buffer::FinishEventBuffer(localFbb, location); + Sink::ApplicationDomain::Buffer::FinishEventBuffer(localFbb, location); } flatbuffers::FlatBufferBuilder entityFbb; - Akonadi2::EntityBuffer::assembleEntityBuffer(entityFbb, 0, 0, eventFbb.GetBufferPointer(), eventFbb.GetSize(), localFbb.GetBufferPointer(), localFbb.GetSize()); + Sink::EntityBuffer::assembleEntityBuffer(entityFbb, 0, 0, eventFbb.GetBufferPointer(), eventFbb.GetSize(), localFbb.GetBufferPointer(), localFbb.GetSize()); flatbuffers::FlatBufferBuilder fbb; - auto type = fbb.CreateString(Akonadi2::ApplicationDomain::getTypeName().toStdString().data()); + auto type = fbb.CreateString(Sink::ApplicationDomain::getTypeName().toStdString().data()); auto delta = fbb.CreateVector(entityFbb.GetBufferPointer(), entityFbb.GetSize()); - Akonadi2::Commands::CreateEntityBuilder builder(fbb); + Sink::Commands::CreateEntityBuilder builder(fbb); builder.add_domainType(type); builder.add_delta(delta); auto location = builder.Finish(); - Akonadi2::Commands::FinishCreateEntityBuffer(fbb, location); + Sink::Commands::FinishCreateEntityBuffer(fbb, location); return QByteArray(reinterpret_cast(fbb.GetBufferPointer()), fbb.GetSize()); } -class IndexUpdater : public Akonadi2::Preprocessor { +class IndexUpdater : public Sink::Preprocessor { public: - void newEntity(const QByteArray &uid, qint64 revision, const Akonadi2::ApplicationDomain::BufferAdaptor &newEntity, Akonadi2::Storage::Transaction &transaction) Q_DECL_OVERRIDE + void newEntity(const QByteArray &uid, qint64 revision, const Sink::ApplicationDomain::BufferAdaptor &newEntity, Sink::Storage::Transaction &transaction) Q_DECL_OVERRIDE { for (int i = 0; i < 10; i++) { Index ridIndex(QString("index.index%1").arg(i).toLatin1(), transaction); @@ -70,11 +70,11 @@ public: } } - void modifiedEntity(const QByteArray &key, qint64 revision, const Akonadi2::ApplicationDomain::BufferAdaptor &oldEntity, const Akonadi2::ApplicationDomain::BufferAdaptor &newEntity, Akonadi2::Storage::Transaction &transaction) Q_DECL_OVERRIDE + void modifiedEntity(const QByteArray &key, qint64 revision, const Sink::ApplicationDomain::BufferAdaptor &oldEntity, const Sink::ApplicationDomain::BufferAdaptor &newEntity, Sink::Storage::Transaction &transaction) Q_DECL_OVERRIDE { } - void deletedEntity(const QByteArray &key, qint64 revision, const Akonadi2::ApplicationDomain::BufferAdaptor &oldEntity, Akonadi2::Storage::Transaction &transaction) Q_DECL_OVERRIDE + void deletedEntity(const QByteArray &key, qint64 revision, const Sink::ApplicationDomain::BufferAdaptor &oldEntity, Sink::Storage::Transaction &transaction) Q_DECL_OVERRIDE { } }; @@ -89,7 +89,7 @@ private Q_SLOTS: void init() { - Akonadi2::Log::setDebugOutputLevel(Akonadi2::Log::Warning); + Sink::Log::setDebugOutputLevel(Sink::Log::Warning); } void initTestCase() @@ -104,7 +104,7 @@ private Q_SLOTS: { int num = 10000; - auto pipeline = QSharedPointer::create("org.kde.test.instance1"); + auto pipeline = QSharedPointer::create("org.kde.test.instance1"); TestResource resource("org.kde.test.instance1", pipeline); auto command = createEntityBuffer(); @@ -113,7 +113,7 @@ private Q_SLOTS: time.start(); for (int i = 0; i < num; i++) { - resource.processCommand(Akonadi2::Commands::CreateEntityCommand, command); + resource.processCommand(Sink::Commands::CreateEntityCommand, command); } auto appendTime = time.elapsed(); @@ -139,13 +139,13 @@ private Q_SLOTS: { int num = 50000; - auto pipeline = QSharedPointer::create("org.kde.test.instance1"); + auto pipeline = QSharedPointer::create("org.kde.test.instance1"); auto eventFactory = QSharedPointer::create(); const QByteArray resourceIdentifier = "org.kde.test.instance1"; auto indexer = QSharedPointer::create(); - pipeline->setPreprocessors("event", QVector() << indexer.data()); + pipeline->setPreprocessors("event", QVector() << indexer.data()); pipeline->setAdaptorFactory("event", eventFactory); TestResource resource("org.kde.test.instance1", pipeline); @@ -156,7 +156,7 @@ private Q_SLOTS: time.start(); for (int i = 0; i < num; i++) { - resource.processCommand(Akonadi2::Commands::CreateEntityCommand, command); + resource.processCommand(Sink::Commands::CreateEntityCommand, command); } auto appendTime = time.elapsed(); @@ -180,7 +180,7 @@ private Q_SLOTS: void testCreateCommand() { - Akonadi2::ApplicationDomain::Event event; + Sink::ApplicationDomain::Event event; QBENCHMARK { auto mFactory = new TestEventAdaptorFactory; @@ -193,9 +193,9 @@ private Q_SLOTS: //This is the resource buffer type and not the domain type auto type = fbb.CreateString("event"); // auto delta = fbb.CreateVector(entityFbb.GetBufferPointer(), entityFbb.GetSize()); - auto delta = Akonadi2::EntityBuffer::appendAsVector(fbb, entityFbb.GetBufferPointer(), entityFbb.GetSize()); - auto location = Akonadi2::Commands::CreateCreateEntity(fbb, type, delta); - Akonadi2::Commands::FinishCreateEntityBuffer(fbb, location); + auto delta = Sink::EntityBuffer::appendAsVector(fbb, entityFbb.GetBufferPointer(), entityFbb.GetSize()); + auto location = Sink::Commands::CreateCreateEntity(fbb, type, delta); + Sink::Commands::FinishCreateEntityBuffer(fbb, location); } } diff --git a/tests/genericresourcetest.cpp b/tests/genericresourcetest.cpp index 0c64659..76c604e 100644 --- a/tests/genericresourcetest.cpp +++ b/tests/genericresourcetest.cpp @@ -26,8 +26,8 @@ private Q_SLOTS: void init() { - Akonadi2::GenericResource::removeFromDisk("org.kde.test.instance1"); - Akonadi2::Log::setDebugOutputLevel(Akonadi2::Log::Trace); + Sink::GenericResource::removeFromDisk("org.kde.test.instance1"); + Sink::Log::setDebugOutputLevel(Sink::Log::Trace); } ///Ensure the resource can process messages @@ -37,46 +37,46 @@ private Q_SLOTS: eventFbb.Clear(); { auto summary = eventFbb.CreateString("summary"); - Akonadi2::ApplicationDomain::Buffer::EventBuilder eventBuilder(eventFbb); + Sink::ApplicationDomain::Buffer::EventBuilder eventBuilder(eventFbb); eventBuilder.add_summary(summary); auto eventLocation = eventBuilder.Finish(); - Akonadi2::ApplicationDomain::Buffer::FinishEventBuffer(eventFbb, eventLocation); + Sink::ApplicationDomain::Buffer::FinishEventBuffer(eventFbb, eventLocation); } flatbuffers::FlatBufferBuilder localFbb; { auto uid = localFbb.CreateString("testuid"); - auto localBuilder = Akonadi2::ApplicationDomain::Buffer::EventBuilder(localFbb); + auto localBuilder = Sink::ApplicationDomain::Buffer::EventBuilder(localFbb); localBuilder.add_uid(uid); auto location = localBuilder.Finish(); - Akonadi2::ApplicationDomain::Buffer::FinishEventBuffer(localFbb, location); + Sink::ApplicationDomain::Buffer::FinishEventBuffer(localFbb, location); } flatbuffers::FlatBufferBuilder entityFbb; - Akonadi2::EntityBuffer::assembleEntityBuffer(entityFbb, 0, 0, eventFbb.GetBufferPointer(), eventFbb.GetSize(), localFbb.GetBufferPointer(), localFbb.GetSize()); + Sink::EntityBuffer::assembleEntityBuffer(entityFbb, 0, 0, eventFbb.GetBufferPointer(), eventFbb.GetSize(), localFbb.GetBufferPointer(), localFbb.GetSize()); flatbuffers::FlatBufferBuilder fbb; - auto type = fbb.CreateString(Akonadi2::ApplicationDomain::getTypeName().toStdString().data()); + auto type = fbb.CreateString(Sink::ApplicationDomain::getTypeName().toStdString().data()); auto delta = fbb.CreateVector(entityFbb.GetBufferPointer(), entityFbb.GetSize()); - Akonadi2::Commands::CreateEntityBuilder builder(fbb); + Sink::Commands::CreateEntityBuilder builder(fbb); builder.add_domainType(type); builder.add_delta(delta); auto location = builder.Finish(); - Akonadi2::Commands::FinishCreateEntityBuffer(fbb, location); + Sink::Commands::FinishCreateEntityBuffer(fbb, location); const QByteArray command(reinterpret_cast(fbb.GetBufferPointer()), fbb.GetSize()); { flatbuffers::Verifier verifyer(reinterpret_cast(command.data()), command.size()); - QVERIFY(Akonadi2::Commands::VerifyCreateEntityBuffer(verifyer)); + QVERIFY(Sink::Commands::VerifyCreateEntityBuffer(verifyer)); } //Actual test - auto pipeline = QSharedPointer::create("org.kde.test.instance1"); + auto pipeline = QSharedPointer::create("org.kde.test.instance1"); QSignalSpy revisionSpy(pipeline.data(), SIGNAL(revisionUpdated(qint64))); QVERIFY(revisionSpy.isValid()); TestResource resource("org.kde.test.instance1", pipeline); - resource.processCommand(Akonadi2::Commands::CreateEntityCommand, command); - resource.processCommand(Akonadi2::Commands::CreateEntityCommand, command); + resource.processCommand(Sink::Commands::CreateEntityCommand, command); + resource.processCommand(Sink::Commands::CreateEntityCommand, command); resource.processAllMessages().exec().waitForFinished(); QCOMPARE(revisionSpy.last().at(0).toInt(), 2); } diff --git a/tests/hawd/CMakeLists.txt b/tests/hawd/CMakeLists.txt index 071f2ba..268e7a9 100644 --- a/tests/hawd/CMakeLists.txt +++ b/tests/hawd/CMakeLists.txt @@ -26,7 +26,7 @@ set(SRCS add_library(lib${PROJECT_NAME} SHARED ${lib_SRCS}) generate_export_header(lib${PROJECT_NAME} BASE_NAME HAWD EXPORT_FILE_NAME hawd_export.h) qt5_use_modules(lib${PROJECT_NAME} Core) -target_link_libraries(lib${PROJECT_NAME} akonadi2common) +target_link_libraries(lib${PROJECT_NAME} sinkcommon) if (LIBGIT2_FOUND) target_link_libraries(lib${PROJECT_NAME} ${LIBGIT2_LIBRARIES}) endif(LIBGIT2_FOUND) diff --git a/tests/hawd/dataset.cpp b/tests/hawd/dataset.cpp index 93eb5cd..fd931e8 100644 --- a/tests/hawd/dataset.cpp +++ b/tests/hawd/dataset.cpp @@ -215,7 +215,7 @@ QString Dataset::Row::toString(const QStringList &cols, int standardCols, const Dataset::Dataset(const QString &name, const State &state) : m_definition(state.datasetDefinition(name)), - m_storage(state.resultsPath(), name, Akonadi2::Storage::ReadWrite), + m_storage(state.resultsPath(), name, Sink::Storage::ReadWrite), m_commitHash(state.commitHash()), m_transaction(std::move(m_storage.createTransaction())) { @@ -270,13 +270,13 @@ void Dataset::eachRow(const std::function &resultHandler) resultHandler(row); return true; }, - Akonadi2::Storage::basicErrorHandler()); + Sink::Storage::basicErrorHandler()); } Dataset::Row Dataset::row(qint64 key) { if (key < 1) { - Row row(*this, Akonadi2::Storage::maxRevision(m_transaction)); + Row row(*this, Sink::Storage::maxRevision(m_transaction)); row.setCommitHash(m_commitHash); return row; } @@ -287,7 +287,7 @@ Dataset::Row Dataset::row(qint64 key) row.fromBinary(value); return true; }, - Akonadi2::Storage::basicErrorHandler() + Sink::Storage::basicErrorHandler() ); return row; } diff --git a/tests/hawd/dataset.h b/tests/hawd/dataset.h index cdfd3f2..0fca8f0 100644 --- a/tests/hawd/dataset.h +++ b/tests/hawd/dataset.h @@ -84,8 +84,8 @@ public: private: DatasetDefinition m_definition; - Akonadi2::Storage m_storage; - Akonadi2::Storage::Transaction m_transaction; + Sink::Storage m_storage; + Sink::Storage::Transaction m_transaction; QString m_commitHash; }; diff --git a/tests/indextest.cpp b/tests/indextest.cpp index edaf907..7ec95ce 100644 --- a/tests/indextest.cpp +++ b/tests/indextest.cpp @@ -16,19 +16,19 @@ class IndexTest : public QObject private Q_SLOTS: void initTestCase() { - Akonadi2::Storage store("./testindex", "org.kde.dummy.testindex", Akonadi2::Storage::ReadWrite); + Sink::Storage store("./testindex", "org.kde.dummy.testindex", Sink::Storage::ReadWrite); store.removeFromDisk(); } void cleanup() { - Akonadi2::Storage store("./testindex", "org.kde.dummy.testindex", Akonadi2::Storage::ReadWrite); + Sink::Storage store("./testindex", "org.kde.dummy.testindex", Sink::Storage::ReadWrite); store.removeFromDisk(); } void testIndex() { - Index index("./testindex", "org.kde.dummy.testindex", Akonadi2::Storage::ReadWrite); + Index index("./testindex", "org.kde.dummy.testindex", Sink::Storage::ReadWrite); //The first key is specifically a substring of the second key index.add("key", "value1"); index.add("keyFoo", "value2"); diff --git a/tests/inspectiontest.cpp b/tests/inspectiontest.cpp index 29cce6c..c876aa9 100644 --- a/tests/inspectiontest.cpp +++ b/tests/inspectiontest.cpp @@ -18,8 +18,8 @@ class InspectionTest : public QObject private Q_SLOTS: void initTestCase() { - Akonadi2::Log::setDebugOutputLevel(Akonadi2::Log::Trace); - auto factory = Akonadi2::ResourceFactory::load("org.kde.dummy"); + Sink::Log::setDebugOutputLevel(Sink::Log::Trace); + auto factory = Sink::ResourceFactory::load("org.kde.dummy"); QVERIFY(factory); DummyResource::removeFromDisk("org.kde.dummy.instance1"); ResourceConfig::addResource("org.kde.dummy.instance1", "org.kde.dummy"); @@ -27,11 +27,11 @@ private Q_SLOTS: void cleanup() { - Akonadi2::Store::shutdown(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); + Sink::Store::shutdown(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); DummyResource::removeFromDisk("org.kde.dummy.instance1"); - auto factory = Akonadi2::ResourceFactory::load("org.kde.dummy"); + auto factory = Sink::ResourceFactory::load("org.kde.dummy"); QVERIFY(factory); - Akonadi2::Store::start(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); + Sink::Store::start(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); } void testInspection_data() @@ -44,8 +44,8 @@ private Q_SLOTS: void testInspection() { QFETCH(bool, success); - using namespace Akonadi2; - using namespace Akonadi2::ApplicationDomain; + using namespace Sink; + using namespace Sink::ApplicationDomain; Mail mail(QByteArray("org.kde.dummy.instance1"), QByteArray("identifier"), 0, QSharedPointer::create()); diff --git a/tests/maildirresourcetest.cpp b/tests/maildirresourcetest.cpp index ec4f6a4..6ad6ca6 100644 --- a/tests/maildirresourcetest.cpp +++ b/tests/maildirresourcetest.cpp @@ -57,18 +57,18 @@ private Q_SLOTS: { targetPath = tempDir.path() + "/maildir1/"; - Akonadi2::Log::setDebugOutputLevel(Akonadi2::Log::Trace); + Sink::Log::setDebugOutputLevel(Sink::Log::Trace); MaildirResource::removeFromDisk("org.kde.maildir.instance1"); - Akonadi2::ApplicationDomain::AkonadiResource resource; + Sink::ApplicationDomain::SinkResource resource; resource.setProperty("identifier", "org.kde.maildir.instance1"); resource.setProperty("type", "org.kde.maildir"); resource.setProperty("path", targetPath); - Akonadi2::Store::create(resource).exec().waitForFinished(); + Sink::Store::create(resource).exec().waitForFinished(); } void cleanup() { - Akonadi2::Store::shutdown(QByteArray("org.kde.maildir.instance1")).exec().waitForFinished(); + Sink::Store::shutdown(QByteArray("org.kde.maildir.instance1")).exec().waitForFinished(); MaildirResource::removeFromDisk("org.kde.maildir.instance1"); QDir dir(targetPath); dir.removeRecursively(); @@ -80,46 +80,46 @@ private Q_SLOTS: qDebug() << "-----------------------------------------"; qDebug(); copyRecursively(TESTDATAPATH "/maildir1", targetPath); - Akonadi2::Store::start(QByteArray("org.kde.maildir.instance1")).exec().waitForFinished(); + Sink::Store::start(QByteArray("org.kde.maildir.instance1")).exec().waitForFinished(); } void testListFolders() { - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.maildir.instance1"; //Ensure all local data is processed - Akonadi2::Store::synchronize(query).exec().waitForFinished(); - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::synchronize(query).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); - auto model = Akonadi2::Store::loadModel(query); - QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + auto model = Sink::Store::loadModel(query); + QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); QCOMPARE(model->rowCount(QModelIndex()), 2); } void testListFolderTree() { - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.maildir.instance1"; query.parentProperty = "parent"; //Ensure all local data is processed - Akonadi2::Store::synchronize(query).exec().waitForFinished(); - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::synchronize(query).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); - auto model = Akonadi2::Store::loadModel(query); - QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + auto model = Sink::Store::loadModel(query); + QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); QCOMPARE(model->rowCount(QModelIndex()), 1); auto parentIndex = model->index(0, 0, QModelIndex()); model->fetchMore(parentIndex); - QTRY_VERIFY(model->data(parentIndex, Akonadi2::Store::ChildrenFetchedRole).toBool()); + QTRY_VERIFY(model->data(parentIndex, Sink::Store::ChildrenFetchedRole).toBool()); QCOMPARE(model->rowCount(parentIndex), 1); } void testListMailsOfFolder() { - using namespace Akonadi2; - using namespace Akonadi2::ApplicationDomain; + using namespace Sink; + using namespace Sink::ApplicationDomain; //Ensure all local data is processed auto query = Query::ResourceFilter("org.kde.maildir.instance1"); Store::synchronize(query).exec().waitForFinished(); @@ -143,18 +143,18 @@ private Q_SLOTS: void testMailContent() { - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.maildir.instance1"; query.requestedProperties << "folder" << "subject" << "mimeMessage" << "date"; //Ensure all local data is processed - Akonadi2::Store::synchronize(query).exec().waitForFinished(); - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::synchronize(query).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); - auto mailModel = Akonadi2::Store::loadModel(query); - QTRY_VERIFY(mailModel->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + auto mailModel = Sink::Store::loadModel(query); + QTRY_VERIFY(mailModel->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); QVERIFY(mailModel->rowCount(QModelIndex()) >= 1); - auto mail = mailModel->index(0, 0, QModelIndex()).data(Akonadi2::Store::DomainObjectRole).value(); + auto mail = mailModel->index(0, 0, QModelIndex()).data(Sink::Store::DomainObjectRole).value(); QVERIFY(!mail->getProperty("subject").toString().isEmpty()); QVERIFY(!mail->getProperty("mimeMessage").toString().isEmpty()); QVERIFY(mail->getProperty("date").toDateTime().isValid()); @@ -163,85 +163,85 @@ private Q_SLOTS: void testSyncFolderMove() { - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.maildir.instance1"; query.requestedProperties << "name"; //Ensure all local data is processed - Akonadi2::Store::synchronize(query).exec().waitForFinished(); - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::synchronize(query).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); auto targetPath = tempDir.path() + "/maildir1/"; QDir dir(targetPath); QVERIFY(dir.rename("inbox", "newbox")); //Ensure all local data is processed - Akonadi2::Store::synchronize(query).exec().waitForFinished(); - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::synchronize(query).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); - auto model = Akonadi2::Store::loadModel(query); - QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + auto model = Sink::Store::loadModel(query); + QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); QCOMPARE(model->rowCount(QModelIndex()), 2); QCOMPARE(model->match(model->index(0, 0, QModelIndex()), Qt::DisplayRole, QStringLiteral("newbox"), 1).size(), 1); } void testReSyncMail() { - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.maildir.instance1"; query.requestedProperties << "folder" << "subject"; //Ensure all local data is processed - Akonadi2::Store::synchronize(query).exec().waitForFinished(); - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::synchronize(query).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); //Ensure all local data is processed - Akonadi2::Store::synchronize(query).exec().waitForFinished(); - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::synchronize(query).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); - auto mailModel = Akonadi2::Store::loadModel(query); - QTRY_VERIFY(mailModel->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + auto mailModel = Sink::Store::loadModel(query); + QTRY_VERIFY(mailModel->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); QCOMPARE(mailModel->rowCount(QModelIndex()), 2); } void testSyncMailRemoval() { - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.maildir.instance1"; query.requestedProperties << "folder" << "subject"; //Ensure all local data is processed - Akonadi2::Store::synchronize(query).exec().waitForFinished(); - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::synchronize(query).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); auto targetPath = tempDir.path() + "/maildir1/cur/1365777830.R28.localhost.localdomain:2,S"; QFile file(targetPath); QVERIFY(file.remove()); //Ensure all local data is processed - Akonadi2::Store::synchronize(query).exec().waitForFinished(); - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::synchronize(query).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); - auto mailModel = Akonadi2::Store::loadModel(query); - QTRY_VERIFY(mailModel->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + auto mailModel = Sink::Store::loadModel(query); + QTRY_VERIFY(mailModel->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); QCOMPARE(mailModel->rowCount(QModelIndex()), 1); } void testCreateFolder() { - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.maildir.instance1"; //Ensure all local data is processed - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); - Akonadi2::ApplicationDomain::Folder folder("org.kde.maildir.instance1"); + Sink::ApplicationDomain::Folder folder("org.kde.maildir.instance1"); folder.setProperty("name", "testCreateFolder"); - Akonadi2::Store::create(folder).exec().waitForFinished(); + Sink::Store::create(folder).exec().waitForFinished(); //Ensure all local data is processed - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); auto targetPath = tempDir.path() + "/maildir1/testCreateFolder"; QFileInfo file(targetPath); @@ -251,45 +251,45 @@ private Q_SLOTS: void testRemoveFolder() { - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.maildir.instance1"; auto targetPath = tempDir.path() + "/maildir1/testCreateFolder"; - Akonadi2::ApplicationDomain::Folder folder("org.kde.maildir.instance1"); + Sink::ApplicationDomain::Folder folder("org.kde.maildir.instance1"); folder.setProperty("name", "testCreateFolder"); - Akonadi2::Store::create(folder).exec().waitForFinished(); - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::create(folder).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); QTRY_VERIFY(QFileInfo(targetPath).exists()); - Akonadi2::Query folderQuery; + Sink::Query folderQuery; folderQuery.resources << "org.kde.maildir.instance1"; folderQuery.propertyFilter.insert("name", "testCreateFolder"); - auto model = Akonadi2::Store::loadModel(folderQuery); - QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + auto model = Sink::Store::loadModel(folderQuery); + QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); QCOMPARE(model->rowCount(QModelIndex()), 1); - auto createdFolder = model->index(0, 0, QModelIndex()).data(Akonadi2::Store::DomainObjectRole).value(); + auto createdFolder = model->index(0, 0, QModelIndex()).data(Sink::Store::DomainObjectRole).value(); - Akonadi2::Store::remove(*createdFolder).exec().waitForFinished(); - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::remove(*createdFolder).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); QTRY_VERIFY(!QFileInfo(targetPath).exists()); } void testCreateMail() { - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.maildir.instance1"; //Ensure all local data is processed - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); - Akonadi2::ApplicationDomain::Mail mail("org.kde.maildir.instance1"); + Sink::ApplicationDomain::Mail mail("org.kde.maildir.instance1"); mail.setProperty("name", "testCreateMail"); - Akonadi2::Store::create(mail).exec().waitForFinished(); + Sink::Store::create(mail).exec().waitForFinished(); //Ensure all local data is processed - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); auto targetPath = tempDir.path() + "/maildir1/new"; QDir dir(targetPath); @@ -299,8 +299,8 @@ private Q_SLOTS: void testRemoveMail() { - using namespace Akonadi2; - using namespace Akonadi2::ApplicationDomain; + using namespace Sink; + using namespace Sink::ApplicationDomain; auto query = Query::ResourceFilter("org.kde.maildir.instance1"); Store::synchronize(query).exec().waitForFinished(); @@ -333,8 +333,8 @@ private Q_SLOTS: void testMarkMailAsRead() { - using namespace Akonadi2; - using namespace Akonadi2::ApplicationDomain; + using namespace Sink; + using namespace Sink::ApplicationDomain; auto query = Query::ResourceFilter("org.kde.maildir.instance1"); Store::synchronize(query).exec().waitForFinished(); diff --git a/tests/messagequeuetest.cpp b/tests/messagequeuetest.cpp index 7d406ed..c835b53 100644 --- a/tests/messagequeuetest.cpp +++ b/tests/messagequeuetest.cpp @@ -17,8 +17,8 @@ class MessageQueueTest : public QObject private Q_SLOTS: void initTestCase() { - Akonadi2::Log::setDebugOutputLevel(Akonadi2::Log::Trace); - Akonadi2::Storage store(Akonadi2::Store::storageLocation(), "org.kde.dummy.testqueue", Akonadi2::Storage::ReadWrite); + Sink::Log::setDebugOutputLevel(Sink::Log::Trace); + Sink::Storage store(Sink::Store::storageLocation(), "org.kde.dummy.testqueue", Sink::Storage::ReadWrite); store.removeFromDisk(); } @@ -28,13 +28,13 @@ private Q_SLOTS: void cleanup() { - Akonadi2::Storage store(Akonadi2::Store::storageLocation(), "org.kde.dummy.testqueue", Akonadi2::Storage::ReadWrite); + Sink::Storage store(Sink::Store::storageLocation(), "org.kde.dummy.testqueue", Sink::Storage::ReadWrite); store.removeFromDisk(); } void testEmpty() { - MessageQueue queue(Akonadi2::Store::storageLocation(), "org.kde.dummy.testqueue"); + MessageQueue queue(Sink::Store::storageLocation(), "org.kde.dummy.testqueue"); QVERIFY(queue.isEmpty()); queue.enqueue("value"); QVERIFY(!queue.isEmpty()); @@ -42,7 +42,7 @@ private Q_SLOTS: void testDequeueEmpty() { - MessageQueue queue(Akonadi2::Store::storageLocation(), "org.kde.dummy.testqueue"); + MessageQueue queue(Sink::Store::storageLocation(), "org.kde.dummy.testqueue"); bool gotValue = false; bool gotError = false; queue.dequeue([&](void *ptr, int size, std::function callback) { @@ -57,7 +57,7 @@ private Q_SLOTS: void testEnqueue() { - MessageQueue queue(Akonadi2::Store::storageLocation(), "org.kde.dummy.testqueue"); + MessageQueue queue(Sink::Store::storageLocation(), "org.kde.dummy.testqueue"); QSignalSpy spy(&queue, SIGNAL(messageReady())); queue.enqueue("value1"); QCOMPARE(spy.size(), 1); @@ -65,7 +65,7 @@ private Q_SLOTS: void testDrained() { - MessageQueue queue(Akonadi2::Store::storageLocation(), "org.kde.dummy.testqueue"); + MessageQueue queue(Sink::Store::storageLocation(), "org.kde.dummy.testqueue"); QSignalSpy spy(&queue, SIGNAL(drained())); queue.enqueue("value1"); @@ -81,7 +81,7 @@ private Q_SLOTS: values << "value1"; values << "value2"; - MessageQueue queue(Akonadi2::Store::storageLocation(), "org.kde.dummy.testqueue"); + MessageQueue queue(Sink::Store::storageLocation(), "org.kde.dummy.testqueue"); for (const QByteArray &value : values) { queue.enqueue(value); } @@ -112,7 +112,7 @@ private Q_SLOTS: values << "value1"; values << "value2"; - MessageQueue queue(Akonadi2::Store::storageLocation(), "org.kde.dummy.testqueue"); + MessageQueue queue(Sink::Store::storageLocation(), "org.kde.dummy.testqueue"); for (const QByteArray &value : values) { queue.enqueue(value); } @@ -151,7 +151,7 @@ private Q_SLOTS: */ void testNestedEnqueue() { - MessageQueue queue(Akonadi2::Store::storageLocation(), "org.kde.dummy.testqueue"); + MessageQueue queue(Sink::Store::storageLocation(), "org.kde.dummy.testqueue"); queue.enqueue("value1"); bool gotError = false; @@ -167,7 +167,7 @@ private Q_SLOTS: void testBatchDequeue() { - MessageQueue queue(Akonadi2::Store::storageLocation(), "org.kde.dummy.testqueue"); + MessageQueue queue(Sink::Store::storageLocation(), "org.kde.dummy.testqueue"); queue.enqueue("value1"); queue.enqueue("value2"); queue.enqueue("value3"); @@ -188,7 +188,7 @@ private Q_SLOTS: void testBatchEnqueue() { - MessageQueue queue(Akonadi2::Store::storageLocation(), "org.kde.dummy.testqueue"); + MessageQueue queue(Sink::Store::storageLocation(), "org.kde.dummy.testqueue"); QSignalSpy spy(&queue, SIGNAL(messageReady())); queue.startTransaction(); queue.enqueue("value1"); diff --git a/tests/modelinteractivitytest.cpp b/tests/modelinteractivitytest.cpp index 59c2c6f..14c9fd0 100644 --- a/tests/modelinteractivitytest.cpp +++ b/tests/modelinteractivitytest.cpp @@ -45,16 +45,16 @@ class ModelinteractivityTest : public QObject private Q_SLOTS: void initTestCase() { - Akonadi2::Log::setDebugOutputLevel(Akonadi2::Log::Warning); + Sink::Log::setDebugOutputLevel(Sink::Log::Warning); DummyResource::removeFromDisk("org.kde.dummy.instance1"); ResourceConfig::addResource("org.kde.dummy.instance1", "org.kde.dummy"); } void cleanup() { - Akonadi2::Store::shutdown(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); + Sink::Store::shutdown(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); DummyResource::removeFromDisk("org.kde.dummy.instance1"); - Akonadi2::Store::start(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); + Sink::Store::start(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); } void init() @@ -65,24 +65,24 @@ private Q_SLOTS: { //Setup { - Akonadi2::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); + Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); for (int i = 0; i < 1000; i++) { - Akonadi2::Store::create(mail).exec().waitForFinished(); + Sink::Store::create(mail).exec().waitForFinished(); } } - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.dummy.instance1"; query.liveQuery = true; - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); //Test QTime time; time.start(); - auto model = Akonadi2::Store::loadModel(query); + auto model = Sink::Store::loadModel(query); blockingTime += time.elapsed(); - QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); //Never block longer than 10 ms QVERIFY2(blockingTime < 10, QString("Total blocking time: %1").arg(blockingTime).toLatin1().data()); } diff --git a/tests/pipelinetest.cpp b/tests/pipelinetest.cpp index f0fd1a4..c74d319 100644 --- a/tests/pipelinetest.cpp +++ b/tests/pipelinetest.cpp @@ -22,14 +22,14 @@ static void removeFromDisk(const QString &name) { - Akonadi2::Storage store(Akonadi2::Store::storageLocation(), name, Akonadi2::Storage::ReadWrite); + Sink::Storage store(Sink::Store::storageLocation(), name, Sink::Storage::ReadWrite); store.removeFromDisk(); } static QList getKeys(const QByteArray &dbEnv, const QByteArray &name) { - Akonadi2::Storage store(Akonadi2::storageLocation(), dbEnv, Akonadi2::Storage::ReadOnly); - auto transaction = store.createTransaction(Akonadi2::Storage::ReadOnly); + Sink::Storage store(Sink::storageLocation(), dbEnv, Sink::Storage::ReadOnly); + auto transaction = store.createTransaction(Sink::Storage::ReadOnly); auto db = transaction.openDatabase(name, nullptr, false); QList result; db.scan("", [&](const QByteArray &key, const QByteArray &value) { @@ -41,8 +41,8 @@ static QList getKeys(const QByteArray &dbEnv, const QByteArray &name static QByteArray getEntity(const QByteArray &dbEnv, const QByteArray &name, const QByteArray &uid) { - Akonadi2::Storage store(Akonadi2::storageLocation(), dbEnv, Akonadi2::Storage::ReadOnly); - auto transaction = store.createTransaction(Akonadi2::Storage::ReadOnly); + Sink::Storage store(Sink::storageLocation(), dbEnv, Sink::Storage::ReadOnly); + auto transaction = store.createTransaction(Sink::Storage::ReadOnly); auto db = transaction.openDatabase(name, nullptr, false); QByteArray result; db.scan(uid, [&](const QByteArray &key, const QByteArray &value) { @@ -57,41 +57,41 @@ flatbuffers::FlatBufferBuilder &createEvent(flatbuffers::FlatBufferBuilder &enti flatbuffers::FlatBufferBuilder eventFbb; eventFbb.Clear(); { - Akonadi2::ApplicationDomain::Buffer::EventBuilder eventBuilder(eventFbb); + Sink::ApplicationDomain::Buffer::EventBuilder eventBuilder(eventFbb); auto eventLocation = eventBuilder.Finish(); - Akonadi2::ApplicationDomain::Buffer::FinishEventBuffer(eventFbb, eventLocation); + Sink::ApplicationDomain::Buffer::FinishEventBuffer(eventFbb, eventLocation); } flatbuffers::FlatBufferBuilder localFbb; { auto uid = localFbb.CreateString("testuid"); auto summary = localFbb.CreateString(s.toStdString()); - auto localBuilder = Akonadi2::ApplicationDomain::Buffer::EventBuilder(localFbb); + auto localBuilder = Sink::ApplicationDomain::Buffer::EventBuilder(localFbb); localBuilder.add_uid(uid); localBuilder.add_summary(summary); auto location = localBuilder.Finish(); - Akonadi2::ApplicationDomain::Buffer::FinishEventBuffer(localFbb, location); + Sink::ApplicationDomain::Buffer::FinishEventBuffer(localFbb, location); } - Akonadi2::EntityBuffer::assembleEntityBuffer(entityFbb, 0, 0, eventFbb.GetBufferPointer(), eventFbb.GetSize(), localFbb.GetBufferPointer(), localFbb.GetSize()); + Sink::EntityBuffer::assembleEntityBuffer(entityFbb, 0, 0, eventFbb.GetBufferPointer(), eventFbb.GetSize(), localFbb.GetBufferPointer(), localFbb.GetSize()); return entityFbb; } QByteArray createEntityCommand(const flatbuffers::FlatBufferBuilder &entityFbb) { flatbuffers::FlatBufferBuilder fbb; - auto type = fbb.CreateString(Akonadi2::ApplicationDomain::getTypeName().toStdString().data()); + auto type = fbb.CreateString(Sink::ApplicationDomain::getTypeName().toStdString().data()); auto delta = fbb.CreateVector(entityFbb.GetBufferPointer(), entityFbb.GetSize()); - Akonadi2::Commands::CreateEntityBuilder builder(fbb); + Sink::Commands::CreateEntityBuilder builder(fbb); builder.add_domainType(type); builder.add_delta(delta); auto location = builder.Finish(); - Akonadi2::Commands::FinishCreateEntityBuffer(fbb, location); + Sink::Commands::FinishCreateEntityBuffer(fbb, location); const QByteArray command(reinterpret_cast(fbb.GetBufferPointer()), fbb.GetSize()); { flatbuffers::Verifier verifyer(reinterpret_cast(command.data()), command.size()); - Q_ASSERT(Akonadi2::Commands::VerifyCreateEntityBuffer(verifyer)); + Q_ASSERT(Sink::Commands::VerifyCreateEntityBuffer(verifyer)); } return command; } @@ -99,22 +99,22 @@ QByteArray createEntityCommand(const flatbuffers::FlatBufferBuilder &entityFbb) QByteArray modifyEntityCommand(const flatbuffers::FlatBufferBuilder &entityFbb, const QByteArray &uid, qint64 revision) { flatbuffers::FlatBufferBuilder fbb; - auto type = fbb.CreateString(Akonadi2::ApplicationDomain::getTypeName().toStdString().data()); + auto type = fbb.CreateString(Sink::ApplicationDomain::getTypeName().toStdString().data()); auto id = fbb.CreateString(std::string(uid.constData(), uid.size())); auto delta = fbb.CreateVector(entityFbb.GetBufferPointer(), entityFbb.GetSize()); - // auto delta = Akonadi2::EntityBuffer::appendAsVector(fbb, buffer.constData(), buffer.size()); - Akonadi2::Commands::ModifyEntityBuilder builder(fbb); + // auto delta = Sink::EntityBuffer::appendAsVector(fbb, buffer.constData(), buffer.size()); + Sink::Commands::ModifyEntityBuilder builder(fbb); builder.add_domainType(type); builder.add_delta(delta); builder.add_revision(revision); builder.add_entityId(id); auto location = builder.Finish(); - Akonadi2::Commands::FinishModifyEntityBuffer(fbb, location); + Sink::Commands::FinishModifyEntityBuffer(fbb, location); const QByteArray command(reinterpret_cast(fbb.GetBufferPointer()), fbb.GetSize()); { flatbuffers::Verifier verifyer(reinterpret_cast(command.data()), command.size()); - Q_ASSERT(Akonadi2::Commands::VerifyCreateEntityBuffer(verifyer)); + Q_ASSERT(Sink::Commands::VerifyCreateEntityBuffer(verifyer)); } return command; } @@ -122,38 +122,38 @@ QByteArray modifyEntityCommand(const flatbuffers::FlatBufferBuilder &entityFbb, QByteArray deleteEntityCommand(const QByteArray &uid, qint64 revision) { flatbuffers::FlatBufferBuilder fbb; - auto type = fbb.CreateString(Akonadi2::ApplicationDomain::getTypeName().toStdString().data()); + auto type = fbb.CreateString(Sink::ApplicationDomain::getTypeName().toStdString().data()); auto id = fbb.CreateString(std::string(uid.constData(), uid.size())); - Akonadi2::Commands::DeleteEntityBuilder builder(fbb); + Sink::Commands::DeleteEntityBuilder builder(fbb); builder.add_domainType(type); builder.add_revision(revision); builder.add_entityId(id); auto location = builder.Finish(); - Akonadi2::Commands::FinishDeleteEntityBuffer(fbb, location); + Sink::Commands::FinishDeleteEntityBuffer(fbb, location); const QByteArray command(reinterpret_cast(fbb.GetBufferPointer()), fbb.GetSize()); { flatbuffers::Verifier verifyer(reinterpret_cast(command.data()), command.size()); - Q_ASSERT(Akonadi2::Commands::VerifyDeleteEntityBuffer(verifyer)); + Q_ASSERT(Sink::Commands::VerifyDeleteEntityBuffer(verifyer)); } return command; } -class TestProcessor : public Akonadi2::Preprocessor { +class TestProcessor : public Sink::Preprocessor { public: - void newEntity(const QByteArray &uid, qint64 revision, const Akonadi2::ApplicationDomain::BufferAdaptor &newEntity, Akonadi2::Storage::Transaction &transaction) Q_DECL_OVERRIDE + void newEntity(const QByteArray &uid, qint64 revision, const Sink::ApplicationDomain::BufferAdaptor &newEntity, Sink::Storage::Transaction &transaction) Q_DECL_OVERRIDE { newUids << uid; newRevisions << revision; } - void modifiedEntity(const QByteArray &uid, qint64 revision, const Akonadi2::ApplicationDomain::BufferAdaptor &oldEntity, const Akonadi2::ApplicationDomain::BufferAdaptor &newEntity, Akonadi2::Storage::Transaction &transaction) Q_DECL_OVERRIDE + void modifiedEntity(const QByteArray &uid, qint64 revision, const Sink::ApplicationDomain::BufferAdaptor &oldEntity, const Sink::ApplicationDomain::BufferAdaptor &newEntity, Sink::Storage::Transaction &transaction) Q_DECL_OVERRIDE { modifiedUids << uid; modifiedRevisions << revision; } - void deletedEntity(const QByteArray &uid, qint64 revision, const Akonadi2::ApplicationDomain::BufferAdaptor &oldEntity, Akonadi2::Storage::Transaction &transaction) Q_DECL_OVERRIDE + void deletedEntity(const QByteArray &uid, qint64 revision, const Sink::ApplicationDomain::BufferAdaptor &oldEntity, Sink::Storage::Transaction &transaction) Q_DECL_OVERRIDE { deletedUids << uid; deletedRevisions << revision; @@ -178,7 +178,7 @@ class PipelineTest : public QObject private Q_SLOTS: void initTestCase() { - Akonadi2::Log::setDebugOutputLevel(Akonadi2::Log::Trace); + Sink::Log::setDebugOutputLevel(Sink::Log::Trace); } void init() @@ -191,7 +191,7 @@ private Q_SLOTS: flatbuffers::FlatBufferBuilder entityFbb; auto command = createEntityCommand(createEvent(entityFbb)); - Akonadi2::Pipeline pipeline("org.kde.pipelinetest.instance1"); + Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); pipeline.startTransaction(); pipeline.newEntity(command.constData(), command.size()); pipeline.commit(); @@ -205,7 +205,7 @@ private Q_SLOTS: flatbuffers::FlatBufferBuilder entityFbb; auto command = createEntityCommand(createEvent(entityFbb)); - Akonadi2::Pipeline pipeline("org.kde.pipelinetest.instance1"); + Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); auto adaptorFactory = QSharedPointer::create(); pipeline.setAdaptorFactory("event", adaptorFactory); @@ -219,7 +219,7 @@ private Q_SLOTS: auto keys = getKeys("org.kde.pipelinetest.instance1", "event.main"); QCOMPARE(keys.size(), 1); const auto key = keys.first(); - const auto uid = Akonadi2::Storage::uidFromKey(key); + const auto uid = Sink::Storage::uidFromKey(key); //Execute the modification entityFbb.Clear(); @@ -229,9 +229,9 @@ private Q_SLOTS: pipeline.commit(); //Ensure we've got the new revision with the modification - auto buffer = getEntity("org.kde.pipelinetest.instance1", "event.main", Akonadi2::Storage::assembleKey(uid, 2)); + auto buffer = getEntity("org.kde.pipelinetest.instance1", "event.main", Sink::Storage::assembleKey(uid, 2)); QVERIFY(!buffer.isEmpty()); - Akonadi2::EntityBuffer entityBuffer(buffer.data(), buffer.size()); + Sink::EntityBuffer entityBuffer(buffer.data(), buffer.size()); auto adaptor = adaptorFactory->createAdaptor(entityBuffer.entity()); QCOMPARE(adaptor->getProperty("summary").toString(), QString("summary2")); @@ -252,7 +252,7 @@ private Q_SLOTS: flatbuffers::FlatBufferBuilder entityFbb; auto command = createEntityCommand(createEvent(entityFbb)); - Akonadi2::Pipeline pipeline("org.kde.pipelinetest.instance1"); + Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); auto adaptorFactory = QSharedPointer::create(); pipeline.setAdaptorFactory("event", adaptorFactory); @@ -265,7 +265,7 @@ private Q_SLOTS: //Get uid of written entity auto keys = getKeys("org.kde.pipelinetest.instance1", "event.main"); QCOMPARE(keys.size(), 1); - const auto uid = Akonadi2::Storage::uidFromKey(keys.first()); + const auto uid = Sink::Storage::uidFromKey(keys.first()); //Create another operation inbetween @@ -285,9 +285,9 @@ private Q_SLOTS: pipeline.commit(); //Ensure we've got the new revision with the modification - auto buffer = getEntity("org.kde.pipelinetest.instance1", "event.main", Akonadi2::Storage::assembleKey(uid, 3)); + auto buffer = getEntity("org.kde.pipelinetest.instance1", "event.main", Sink::Storage::assembleKey(uid, 3)); QVERIFY(!buffer.isEmpty()); - Akonadi2::EntityBuffer entityBuffer(buffer.data(), buffer.size()); + Sink::EntityBuffer entityBuffer(buffer.data(), buffer.size()); auto adaptor = adaptorFactory->createAdaptor(entityBuffer.entity()); QCOMPARE(adaptor->getProperty("summary").toString(), QString("summary2")); } @@ -296,7 +296,7 @@ private Q_SLOTS: { flatbuffers::FlatBufferBuilder entityFbb; auto command = createEntityCommand(createEvent(entityFbb)); - Akonadi2::Pipeline pipeline("org.kde.pipelinetest.instance1"); + Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); pipeline.setAdaptorFactory("event", QSharedPointer::create()); //Create the initial revision @@ -307,7 +307,7 @@ private Q_SLOTS: auto result = getKeys("org.kde.pipelinetest.instance1", "event.main"); QCOMPARE(result.size(), 1); - const auto uid = Akonadi2::Storage::uidFromKey(result.first()); + const auto uid = Sink::Storage::uidFromKey(result.first()); //Delete entity auto deleteCommand = deleteEntityCommand(uid, 1); @@ -333,8 +333,8 @@ private Q_SLOTS: TestProcessor testProcessor; - Akonadi2::Pipeline pipeline("org.kde.pipelinetest.instance1"); - pipeline.setPreprocessors("event", QVector() << &testProcessor); + Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); + pipeline.setPreprocessors("event", QVector() << &testProcessor); pipeline.startTransaction(); pipeline.setAdaptorFactory("event", QSharedPointer::create()); @@ -345,21 +345,21 @@ private Q_SLOTS: QCOMPARE(testProcessor.newUids.size(), 1); QCOMPARE(testProcessor.newRevisions.size(), 1); //Key doesn't contain revision and is just the uid - QCOMPARE(testProcessor.newUids.at(0), Akonadi2::Storage::uidFromKey(testProcessor.newUids.at(0))); + QCOMPARE(testProcessor.newUids.at(0), Sink::Storage::uidFromKey(testProcessor.newUids.at(0))); } pipeline.commit(); entityFbb.Clear(); pipeline.startTransaction(); auto keys = getKeys("org.kde.pipelinetest.instance1", "event.main"); QCOMPARE(keys.size(), 1); - const auto uid = Akonadi2::Storage::uidFromKey(keys.first()); + const auto uid = Sink::Storage::uidFromKey(keys.first()); { auto modifyCommand = modifyEntityCommand(createEvent(entityFbb, "summary2"), uid, 1); pipeline.modifiedEntity(modifyCommand.constData(), modifyCommand.size()); QCOMPARE(testProcessor.modifiedUids.size(), 1); QCOMPARE(testProcessor.modifiedRevisions.size(), 1); //Key doesn't contain revision and is just the uid - QCOMPARE(testProcessor.modifiedUids.at(0), Akonadi2::Storage::uidFromKey(testProcessor.modifiedUids.at(0))); + QCOMPARE(testProcessor.modifiedUids.at(0), Sink::Storage::uidFromKey(testProcessor.modifiedUids.at(0))); } pipeline.commit(); entityFbb.Clear(); @@ -371,7 +371,7 @@ private Q_SLOTS: QCOMPARE(testProcessor.deletedUids.size(), 1); QCOMPARE(testProcessor.deletedSummaries.size(), 1); //Key doesn't contain revision and is just the uid - QCOMPARE(testProcessor.deletedUids.at(0), Akonadi2::Storage::uidFromKey(testProcessor.deletedUids.at(0))); + QCOMPARE(testProcessor.deletedUids.at(0), Sink::Storage::uidFromKey(testProcessor.deletedUids.at(0))); QCOMPARE(testProcessor.deletedSummaries.at(0), QByteArray("summary2")); } } diff --git a/tests/querytest.cpp b/tests/querytest.cpp index f9344cd..62db15b 100644 --- a/tests/querytest.cpp +++ b/tests/querytest.cpp @@ -20,8 +20,8 @@ class QueryTest : public QObject private Q_SLOTS: void initTestCase() { - Akonadi2::Log::setDebugOutputLevel(Akonadi2::Log::Trace); - auto factory = Akonadi2::ResourceFactory::load("org.kde.dummy"); + Sink::Log::setDebugOutputLevel(Sink::Log::Trace); + auto factory = Sink::ResourceFactory::load("org.kde.dummy"); QVERIFY(factory); DummyResource::removeFromDisk("org.kde.dummy.instance1"); ResourceConfig::addResource("org.kde.dummy.instance1", "org.kde.dummy"); @@ -29,11 +29,11 @@ private Q_SLOTS: void cleanup() { - Akonadi2::Store::shutdown(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); + Sink::Store::shutdown(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); DummyResource::removeFromDisk("org.kde.dummy.instance1"); - auto factory = Akonadi2::ResourceFactory::load("org.kde.dummy"); + auto factory = Sink::ResourceFactory::load("org.kde.dummy"); QVERIFY(factory); - Akonadi2::Store::start(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); + Sink::Store::start(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); } void init() @@ -46,13 +46,13 @@ private Q_SLOTS: void testNoResources() { //Test - Akonadi2::Query query; + Sink::Query query; query.resources << "foobar"; query.liveQuery = true; //We fetch before the data is available and rely on the live query mechanism to deliver the actual data - auto model = Akonadi2::Store::loadModel(query); - QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + auto model = Sink::Store::loadModel(query); + QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); QCOMPARE(model->rowCount(), 0); } @@ -61,17 +61,17 @@ private Q_SLOTS: { //Setup { - Akonadi2::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); - Akonadi2::Store::create(mail).exec().waitForFinished(); + Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); + Sink::Store::create(mail).exec().waitForFinished(); } //Test - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.dummy.instance1"; query.liveQuery = true; //We fetch before the data is available and rely on the live query mechanism to deliver the actual data - auto model = Akonadi2::Store::loadModel(query); + auto model = Sink::Store::loadModel(query); model->fetchMore(QModelIndex()); QTRY_COMPARE(model->rowCount(), 1); } @@ -80,23 +80,23 @@ private Q_SLOTS: { //Setup { - Akonadi2::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); - Akonadi2::Store::create(mail).exec().waitForFinished(); + Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); + Sink::Store::create(mail).exec().waitForFinished(); } //Test - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.dummy.instance1"; query.liveQuery = false; //Ensure all local data is processed - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::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 = Akonadi2::Store::loadModel(query); + auto model = Sink::Store::loadModel(query); model->fetchMore(QModelIndex()); - QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); QCOMPARE(model->rowCount(), 1); } @@ -105,31 +105,31 @@ private Q_SLOTS: QByteArray id; //Setup { - Akonadi2::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); - Akonadi2::Store::create(mail).exec().waitForFinished(); - Akonadi2::Store::create(mail).exec().waitForFinished(); + Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); + Sink::Store::create(mail).exec().waitForFinished(); + Sink::Store::create(mail).exec().waitForFinished(); - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.dummy.instance1"; //Ensure all local data is processed - Akonadi2::Store::synchronize(query).exec().waitForFinished(); + Sink::Store::synchronize(query).exec().waitForFinished(); //We fetch before the data is available and rely on the live query mechanism to deliver the actual data - auto model = Akonadi2::Store::loadModel(query); + auto model = Sink::Store::loadModel(query); model->fetchMore(QModelIndex()); - QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); QVERIFY(model->rowCount() >= 1); - id = model->index(0, 0).data(Akonadi2::Store::DomainObjectRole).value()->identifier(); + id = model->index(0, 0).data(Sink::Store::DomainObjectRole).value()->identifier(); } //Test - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.dummy.instance1"; query.ids << id; - auto model = Akonadi2::Store::loadModel(query); + auto model = Sink::Store::loadModel(query); model->fetchMore(QModelIndex()); - QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); QCOMPARE(model->rowCount(), 1); } @@ -137,20 +137,20 @@ private Q_SLOTS: { //Setup { - Akonadi2::ApplicationDomain::Folder folder("org.kde.dummy.instance1"); - Akonadi2::Store::create(folder).exec().waitForFinished(); + Sink::ApplicationDomain::Folder folder("org.kde.dummy.instance1"); + Sink::Store::create(folder).exec().waitForFinished(); } //Test - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.dummy.instance1"; query.liveQuery = true; //We fetch before the data is available and rely on the live query mechanism to deliver the actual data - auto model = Akonadi2::Store::loadModel(query); + auto model = Sink::Store::loadModel(query); model->fetchMore(QModelIndex()); QTRY_COMPARE(model->rowCount(), 1); - auto folderEntity = model->index(0, 0).data(Akonadi2::Store::DomainObjectRole).value(); + auto folderEntity = model->index(0, 0).data(Sink::Store::DomainObjectRole).value(); QVERIFY(!folderEntity->identifier().isEmpty()); } @@ -158,42 +158,42 @@ private Q_SLOTS: { //Setup { - Akonadi2::ApplicationDomain::Folder folder("org.kde.dummy.instance1"); - Akonadi2::Store::create(folder).exec().waitForFinished(); + Sink::ApplicationDomain::Folder folder("org.kde.dummy.instance1"); + Sink::Store::create(folder).exec().waitForFinished(); - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.dummy.instance1"; //Ensure all local data is processed - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); - auto model = Akonadi2::Store::loadModel(query); - QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + auto model = Sink::Store::loadModel(query); + QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); QCOMPARE(model->rowCount(), 1); - auto folderEntity = model->index(0, 0).data(Akonadi2::Store::DomainObjectRole).value(); + auto folderEntity = model->index(0, 0).data(Sink::Store::DomainObjectRole).value(); QVERIFY(!folderEntity->identifier().isEmpty()); - Akonadi2::ApplicationDomain::Folder subfolder("org.kde.dummy.instance1"); + Sink::ApplicationDomain::Folder subfolder("org.kde.dummy.instance1"); subfolder.setProperty("parent", folderEntity->identifier()); - Akonadi2::Store::create(subfolder).exec().waitForFinished(); + Sink::Store::create(subfolder).exec().waitForFinished(); } //Test - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.dummy.instance1"; query.parentProperty = "parent"; //Ensure all local data is processed - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::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 = Akonadi2::Store::loadModel(query); + auto model = Sink::Store::loadModel(query); model->fetchMore(QModelIndex()); - QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); QCOMPARE(model->rowCount(), 1); model->fetchMore(model->index(0, 0)); - QTRY_VERIFY(model->data(model->index(0, 0), Akonadi2::Store::ChildrenFetchedRole).toBool()); + QTRY_VERIFY(model->data(model->index(0, 0), Sink::Store::ChildrenFetchedRole).toBool()); QCOMPARE(model->rowCount(model->index(0, 0)), 1); } @@ -201,65 +201,65 @@ private Q_SLOTS: { //Setup { - Akonadi2::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); + Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); mail.setProperty("uid", "test1"); mail.setProperty("sender", "doe@example.org"); - Akonadi2::Store::create(mail).exec().waitForFinished(); + Sink::Store::create(mail).exec().waitForFinished(); } //Test - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.dummy.instance1"; query.liveQuery = false; query.propertyFilter.insert("uid", "test1"); //Ensure all local data is processed - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::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 = Akonadi2::Store::loadModel(query); - QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + auto model = Sink::Store::loadModel(query); + QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); QCOMPARE(model->rowCount(), 1); } void testMailByFolder() { //Setup - Akonadi2::ApplicationDomain::Folder::Ptr folderEntity; + Sink::ApplicationDomain::Folder::Ptr folderEntity; { - Akonadi2::ApplicationDomain::Folder folder("org.kde.dummy.instance1"); - Akonadi2::Store::create(folder).exec().waitForFinished(); + Sink::ApplicationDomain::Folder folder("org.kde.dummy.instance1"); + Sink::Store::create(folder).exec().waitForFinished(); - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.dummy.instance1"; //Ensure all local data is processed - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); - auto model = Akonadi2::Store::loadModel(query); - QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + auto model = Sink::Store::loadModel(query); + QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); QCOMPARE(model->rowCount(), 1); - folderEntity = model->index(0, 0).data(Akonadi2::Store::DomainObjectRole).value(); + folderEntity = model->index(0, 0).data(Sink::Store::DomainObjectRole).value(); QVERIFY(!folderEntity->identifier().isEmpty()); - Akonadi2::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); + Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); mail.setProperty("uid", "test1"); mail.setProperty("folder", folderEntity->identifier()); - Akonadi2::Store::create(mail).exec().waitForFinished(); + Sink::Store::create(mail).exec().waitForFinished(); } //Test - Akonadi2::Query query; + Sink::Query query; query.resources << "org.kde.dummy.instance1"; query.propertyFilter.insert("folder", folderEntity->identifier()); //Ensure all local data is processed - Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); + Sink::Store::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 = Akonadi2::Store::loadModel(query); - QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); + auto model = Sink::Store::loadModel(query); + QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); QCOMPARE(model->rowCount(), 1); } }; diff --git a/tests/resourcecommunicationtest.cpp b/tests/resourcecommunicationtest.cpp index 1b09c5f..f9ea3de 100644 --- a/tests/resourcecommunicationtest.cpp +++ b/tests/resourcecommunicationtest.cpp @@ -16,9 +16,9 @@ private Q_SLOTS: { const QByteArray resourceIdentifier("test"); Listener listener(resourceIdentifier); - Akonadi2::ResourceAccess resourceAccess(resourceIdentifier); + Sink::ResourceAccess resourceAccess(resourceIdentifier); - QSignalSpy spy(&resourceAccess, &Akonadi2::ResourceAccess::ready); + QSignalSpy spy(&resourceAccess, &Sink::ResourceAccess::ready); resourceAccess.open(); QTRY_COMPARE(spy.size(), 1); } @@ -27,14 +27,14 @@ private Q_SLOTS: { const QByteArray resourceIdentifier("test"); Listener listener(resourceIdentifier); - Akonadi2::ResourceAccess resourceAccess(resourceIdentifier); + Sink::ResourceAccess resourceAccess(resourceIdentifier); resourceAccess.open(); flatbuffers::FlatBufferBuilder fbb; auto name = fbb.CreateString("test"); - auto command = Akonadi2::Commands::CreateHandshake(fbb, name); - Akonadi2::Commands::FinishHandshakeBuffer(fbb, command); - auto result = resourceAccess.sendCommand(Akonadi2::Commands::HandshakeCommand, fbb).exec(); + auto command = Sink::Commands::CreateHandshake(fbb, name); + Sink::Commands::FinishHandshakeBuffer(fbb, command); + auto result = resourceAccess.sendCommand(Sink::Commands::HandshakeCommand, fbb).exec(); result.waitForFinished(); QVERIFY(!result.errorCode()); } @@ -43,14 +43,14 @@ private Q_SLOTS: { const QByteArray resourceIdentifier("test"); Listener listener(resourceIdentifier); - Akonadi2::ResourceAccess resourceAccess(resourceIdentifier); + Sink::ResourceAccess resourceAccess(resourceIdentifier); resourceAccess.open(); const int count = 500; int complete = 0; int errors = 0; for (int i = 0; i < count; i++) { - auto result = resourceAccess.sendCommand(Akonadi2::Commands::PingCommand) + auto result = resourceAccess.sendCommand(Sink::Commands::PingCommand) .then([&complete]() { complete++; }, @@ -69,14 +69,14 @@ private Q_SLOTS: qDebug(); const QByteArray resourceIdentifier("test"); Listener listener(resourceIdentifier); - Akonadi2::ResourceAccess resourceAccess(resourceIdentifier); + Sink::ResourceAccess resourceAccess(resourceIdentifier); resourceAccess.open(); const int count = 10; int complete = 0; int errors = 0; for (int i = 0; i < count; i++) { - resourceAccess.sendCommand(Akonadi2::Commands::PingCommand) + resourceAccess.sendCommand(Sink::Commands::PingCommand) .then([&complete]() { complete++; }, diff --git a/tests/storagebenchmark.cpp b/tests/storagebenchmark.cpp index 3e7b609..eada4ee 100644 --- a/tests/storagebenchmark.cpp +++ b/tests/storagebenchmark.cpp @@ -54,7 +54,7 @@ private: private Q_SLOTS: void initTestCase() { - Akonadi2::Log::setDebugOutputLevel(Akonadi2::Log::Warning); + Sink::Log::setDebugOutputLevel(Sink::Log::Warning); testDataPath = "./testdb"; dbName = "test"; filePath = testDataPath + "buffer.fb"; @@ -62,7 +62,7 @@ private Q_SLOTS: void cleanupTestCase() { - Akonadi2::Storage store(testDataPath, dbName); + Sink::Storage store(testDataPath, dbName); store.removeFromDisk(); } @@ -70,7 +70,7 @@ private Q_SLOTS: { auto event = createEvent(); - QScopedPointer store(new Akonadi2::Storage(testDataPath, dbName, Akonadi2::Storage::ReadWrite)); + QScopedPointer store(new Sink::Storage(testDataPath, dbName, Sink::Storage::ReadWrite)); const char *keyPrefix = "key"; @@ -78,12 +78,12 @@ private Q_SLOTS: time.start(); //Test db write time { - auto transaction = store->createTransaction(Akonadi2::Storage::ReadWrite); + auto transaction = store->createTransaction(Sink::Storage::ReadWrite); for (int i = 0; i < count; i++) { transaction.openDatabase().write(keyPrefix + QByteArray::number(i), event); if ((i % 10000) == 0) { transaction.commit(); - transaction = store->createTransaction(Akonadi2::Storage::ReadWrite); + transaction = store->createTransaction(Sink::Storage::ReadWrite); } } transaction.commit(); @@ -105,7 +105,7 @@ private Q_SLOTS: //Db read time { - auto transaction = store->createTransaction(Akonadi2::Storage::ReadOnly); + auto transaction = store->createTransaction(Sink::Storage::ReadOnly); auto db = transaction.openDatabase(); for (int i = 0; i < count; i++) { db.scan(keyPrefix + QByteArray::number(i), [](const QByteArray &key, const QByteArray &value) -> bool { return true; }); @@ -126,7 +126,7 @@ private Q_SLOTS: void testSizes() { - Akonadi2::Storage store(testDataPath, dbName); + Sink::Storage store(testDataPath, dbName); qDebug() << "Database size [kb]: " << store.diskUsage()/1024; QFileInfo fileInfo(filePath); @@ -135,11 +135,11 @@ private Q_SLOTS: void testScan() { - QScopedPointer store(new Akonadi2::Storage(testDataPath, dbName, Akonadi2::Storage::ReadOnly)); + QScopedPointer store(new Sink::Storage(testDataPath, dbName, Sink::Storage::ReadOnly)); QBENCHMARK { int hit = 0; - store->createTransaction(Akonadi2::Storage::ReadOnly).openDatabase().scan("", [&](const QByteArray &key, const QByteArray &value) -> bool { + store->createTransaction(Sink::Storage::ReadOnly).openDatabase().scan("", [&](const QByteArray &key, const QByteArray &value) -> bool { if (key == "key10000") { //qDebug() << "hit"; hit++; @@ -152,11 +152,11 @@ private Q_SLOTS: void testKeyLookup() { - QScopedPointer store(new Akonadi2::Storage(testDataPath, dbName, Akonadi2::Storage::ReadOnly)); + QScopedPointer store(new Sink::Storage(testDataPath, dbName, Sink::Storage::ReadOnly)); QBENCHMARK { int hit = 0; - store->createTransaction(Akonadi2::Storage::ReadOnly).openDatabase().scan("key40000", [&](const QByteArray &key, const QByteArray &value) -> bool { + store->createTransaction(Sink::Storage::ReadOnly).openDatabase().scan("key40000", [&](const QByteArray &key, const QByteArray &value) -> bool { hit++; return true; }); diff --git a/tests/storagetest.cpp b/tests/storagetest.cpp index d950961..b0db1ac 100644 --- a/tests/storagetest.cpp +++ b/tests/storagetest.cpp @@ -21,14 +21,14 @@ private: void populate(int count) { - Akonadi2::Storage storage(testDataPath, dbName, Akonadi2::Storage::ReadWrite); - auto transaction = storage.createTransaction(Akonadi2::Storage::ReadWrite); + Sink::Storage storage(testDataPath, dbName, Sink::Storage::ReadWrite); + auto transaction = storage.createTransaction(Sink::Storage::ReadWrite); for (int i = 0; i < count; i++) { //This should perhaps become an implementation detail of the db? if (i % 10000 == 0) { if (i > 0) { transaction.commit(); - transaction = std::move(storage.createTransaction(Akonadi2::Storage::ReadWrite)); + transaction = std::move(storage.createTransaction(Sink::Storage::ReadWrite)); } } transaction.openDatabase().write(keyPrefix + QByteArray::number(i), keyPrefix + QByteArray::number(i)); @@ -36,12 +36,12 @@ private: transaction.commit(); } - bool verify(Akonadi2::Storage &storage, int i) + bool verify(Sink::Storage &storage, int i) { bool success = true; bool keyMatch = true; const auto reference = keyPrefix + QByteArray::number(i); - storage.createTransaction(Akonadi2::Storage::ReadOnly).openDatabase().scan(keyPrefix + QByteArray::number(i), + storage.createTransaction(Sink::Storage::ReadOnly).openDatabase().scan(keyPrefix + QByteArray::number(i), [&keyMatch, &reference](const QByteArray &key, const QByteArray &value) -> bool { if (value != reference) { qDebug() << "Mismatch while reading"; @@ -49,7 +49,7 @@ private: } return keyMatch; }, - [&success](const Akonadi2::Storage::Error &error) { + [&success](const Sink::Storage::Error &error) { qDebug() << error.message; success = false; } @@ -62,20 +62,20 @@ private Q_SLOTS: { testDataPath = "./testdb"; dbName = "test"; - Akonadi2::Storage storage(testDataPath, dbName); + Sink::Storage storage(testDataPath, dbName); storage.removeFromDisk(); } void cleanup() { - Akonadi2::Storage storage(testDataPath, dbName); + Sink::Storage storage(testDataPath, dbName); storage.removeFromDisk(); } void testCleanup() { populate(1); - Akonadi2::Storage storage(testDataPath, dbName); + Sink::Storage storage(testDataPath, dbName); storage.removeFromDisk(); QFileInfo info(testDataPath + "/" + dbName); QVERIFY(!info.exists()); @@ -89,7 +89,7 @@ private Q_SLOTS: //ensure we can read everything back correctly { - Akonadi2::Storage storage(testDataPath, dbName); + Sink::Storage storage(testDataPath, dbName); for (int i = 0; i < count; i++) { QVERIFY(verify(storage, i)); } @@ -104,8 +104,8 @@ private Q_SLOTS: //ensure we can scan for values { int hit = 0; - Akonadi2::Storage store(testDataPath, dbName); - store.createTransaction(Akonadi2::Storage::ReadOnly).openDatabase().scan("", [&](const QByteArray &key, const QByteArray &value) -> bool { + Sink::Storage store(testDataPath, dbName); + store.createTransaction(Sink::Storage::ReadOnly).openDatabase().scan("", [&](const QByteArray &key, const QByteArray &value) -> bool { if (key == "key50") { hit++; } @@ -118,8 +118,8 @@ private Q_SLOTS: { int hit = 0; bool foundInvalidValue = false; - Akonadi2::Storage store(testDataPath, dbName); - store.createTransaction(Akonadi2::Storage::ReadOnly).openDatabase().scan("key50", [&](const QByteArray &key, const QByteArray &value) -> bool { + Sink::Storage store(testDataPath, dbName); + store.createTransaction(Sink::Storage::ReadOnly).openDatabase().scan("key50", [&](const QByteArray &key, const QByteArray &value) -> bool { if (key != "key50") { foundInvalidValue = true; } @@ -134,10 +134,10 @@ private Q_SLOTS: void testNestedOperations() { populate(3); - Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); - auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite); + Sink::Storage store(testDataPath, dbName, Sink::Storage::ReadWrite); + auto transaction = store.createTransaction(Sink::Storage::ReadWrite); transaction.openDatabase().scan("key1", [&](const QByteArray &key, const QByteArray &value) -> bool { - transaction.openDatabase().remove(key, [](const Akonadi2::Storage::Error &) { + transaction.openDatabase().remove(key, [](const Sink::Storage::Error &) { QVERIFY(false); }); return false; @@ -147,9 +147,9 @@ private Q_SLOTS: void testNestedTransactions() { populate(3); - Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); - store.createTransaction(Akonadi2::Storage::ReadOnly).openDatabase().scan("key1", [&](const QByteArray &key, const QByteArray &value) -> bool { - store.createTransaction(Akonadi2::Storage::ReadWrite).openDatabase().remove(key, [](const Akonadi2::Storage::Error &) { + Sink::Storage store(testDataPath, dbName, Sink::Storage::ReadWrite); + store.createTransaction(Sink::Storage::ReadOnly).openDatabase().scan("key1", [&](const QByteArray &key, const QByteArray &value) -> bool { + store.createTransaction(Sink::Storage::ReadWrite).openDatabase().remove(key, [](const Sink::Storage::Error &) { QVERIFY(false); }); return false; @@ -160,9 +160,9 @@ private Q_SLOTS: { bool gotResult = false; bool gotError = false; - Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); - auto transaction = store.createTransaction(Akonadi2::Storage::ReadOnly); - auto db = transaction.openDatabase("default", [&](const Akonadi2::Storage::Error &error) { + Sink::Storage store(testDataPath, dbName, Sink::Storage::ReadWrite); + auto transaction = store.createTransaction(Sink::Storage::ReadOnly); + auto db = transaction.openDatabase("default", [&](const Sink::Storage::Error &error) { qDebug() << error.message; gotError = true; }); @@ -170,7 +170,7 @@ private Q_SLOTS: gotResult = true; return false; }, - [&](const Akonadi2::Storage::Error &error) { + [&](const Sink::Storage::Error &error) { qDebug() << error.message; gotError = true; }); @@ -195,8 +195,8 @@ private Q_SLOTS: const int concurrencyLevel = 20; for (int num = 0; num < concurrencyLevel; num++) { futures << QtConcurrent::run([this, count, &error](){ - Akonadi2::Storage storage(testDataPath, dbName, Akonadi2::Storage::ReadOnly); - Akonadi2::Storage storage2(testDataPath, dbName + "2", Akonadi2::Storage::ReadOnly); + Sink::Storage storage(testDataPath, dbName, Sink::Storage::ReadOnly); + Sink::Storage storage2(testDataPath, dbName + "2", Sink::Storage::ReadOnly); for (int i = 0; i < count; i++) { if (!verify(storage, i)) { error = true; @@ -212,9 +212,9 @@ private Q_SLOTS: } { - Akonadi2::Storage storage(testDataPath, dbName); + Sink::Storage storage(testDataPath, dbName); storage.removeFromDisk(); - Akonadi2::Storage storage2(testDataPath, dbName + "2"); + Sink::Storage storage2(testDataPath, dbName + "2"); storage2.removeFromDisk(); } } @@ -223,8 +223,8 @@ private Q_SLOTS: { bool gotResult = false; bool gotError = false; - Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); - auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite); + Sink::Storage store(testDataPath, dbName, Sink::Storage::ReadWrite); + auto transaction = store.createTransaction(Sink::Storage::ReadWrite); auto db = transaction.openDatabase("default", nullptr, false); db.write("key","value"); db.write("key","value"); @@ -233,7 +233,7 @@ private Q_SLOTS: gotResult = true; return true; }, - [&](const Akonadi2::Storage::Error &error) { + [&](const Sink::Storage::Error &error) { qDebug() << error.message; gotError = true; }); @@ -246,8 +246,8 @@ private Q_SLOTS: { bool gotResult = false; bool gotError = false; - Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); - auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite); + Sink::Storage store(testDataPath, dbName, Sink::Storage::ReadWrite); + auto transaction = store.createTransaction(Sink::Storage::ReadWrite); auto db = transaction.openDatabase("default", nullptr, true); db.write("key","value1"); db.write("key","value2"); @@ -255,7 +255,7 @@ private Q_SLOTS: gotResult = true; return true; }, - [&](const Akonadi2::Storage::Error &error) { + [&](const Sink::Storage::Error &error) { qDebug() << error.message; gotError = true; }); @@ -268,12 +268,12 @@ private Q_SLOTS: { bool gotResult = false; bool gotError = false; - Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadOnly); - int numValues = store.createTransaction(Akonadi2::Storage::ReadOnly).openDatabase("test").scan("", [&](const QByteArray &key, const QByteArray &value) -> bool { + Sink::Storage store(testDataPath, dbName, Sink::Storage::ReadOnly); + int numValues = store.createTransaction(Sink::Storage::ReadOnly).openDatabase("test").scan("", [&](const QByteArray &key, const QByteArray &value) -> bool { gotResult = true; return false; }, - [&](const Akonadi2::Storage::Error &error) { + [&](const Sink::Storage::Error &error) { qDebug() << error.message; gotError = true; }); @@ -285,8 +285,8 @@ private Q_SLOTS: void testWriteToNamedDb() { bool gotError = false; - Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); - store.createTransaction(Akonadi2::Storage::ReadWrite).openDatabase("test").write("key1", "value1", [&](const Akonadi2::Storage::Error &error) { + Sink::Storage store(testDataPath, dbName, Sink::Storage::ReadWrite); + store.createTransaction(Sink::Storage::ReadWrite).openDatabase("test").write("key1", "value1", [&](const Sink::Storage::Error &error) { qDebug() << error.message; gotError = true; }); @@ -296,8 +296,8 @@ private Q_SLOTS: void testWriteDuplicatesToNamedDb() { bool gotError = false; - Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); - store.createTransaction(Akonadi2::Storage::ReadWrite).openDatabase("test", nullptr, true).write("key1", "value1", [&](const Akonadi2::Storage::Error &error) { + Sink::Storage store(testDataPath, dbName, Sink::Storage::ReadWrite); + store.createTransaction(Sink::Storage::ReadWrite).openDatabase("test", nullptr, true).write("key1", "value1", [&](const Sink::Storage::Error &error) { qDebug() << error.message; gotError = true; }); @@ -307,8 +307,8 @@ private Q_SLOTS: //By default we want only exact matches void testSubstringKeys() { - Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); - auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite); + Sink::Storage store(testDataPath, dbName, Sink::Storage::ReadWrite); + auto transaction = store.createTransaction(Sink::Storage::ReadWrite); auto db = transaction.openDatabase("test", nullptr, true); db.write("sub","value1"); db.write("subsub","value2"); @@ -321,8 +321,8 @@ private Q_SLOTS: void testFindSubstringKeys() { - Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); - auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite); + Sink::Storage store(testDataPath, dbName, Sink::Storage::ReadWrite); + auto transaction = store.createTransaction(Sink::Storage::ReadWrite); auto db = transaction.openDatabase("test", nullptr, false); db.write("sub","value1"); db.write("subsub","value2"); @@ -336,8 +336,8 @@ private Q_SLOTS: void testKeySorting() { - Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); - auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite); + Sink::Storage store(testDataPath, dbName, Sink::Storage::ReadWrite); + auto transaction = store.createTransaction(Sink::Storage::ReadWrite); auto db = transaction.openDatabase("test", nullptr, false); db.write("sub_2","value2"); db.write("sub_1","value1"); @@ -357,8 +357,8 @@ private Q_SLOTS: //Ensure we don't retrieve a key that is greater than the current key. We only want equal keys. void testKeyRange() { - Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); - auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite); + Sink::Storage store(testDataPath, dbName, Sink::Storage::ReadWrite); + auto transaction = store.createTransaction(Sink::Storage::ReadWrite); auto db = transaction.openDatabase("test", nullptr, true); db.write("sub1","value1"); int numValues = db.scan("sub", [&](const QByteArray &key, const QByteArray &value) -> bool { @@ -370,8 +370,8 @@ private Q_SLOTS: void testFindLatest() { - Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); - auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite); + Sink::Storage store(testDataPath, dbName, Sink::Storage::ReadWrite); + auto transaction = store.createTransaction(Sink::Storage::ReadWrite); auto db = transaction.openDatabase("test", nullptr, false); db.write("sub1","value1"); db.write("sub2","value2"); @@ -387,8 +387,8 @@ private Q_SLOTS: void testFindLatestInSingle() { - Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); - auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite); + Sink::Storage store(testDataPath, dbName, Sink::Storage::ReadWrite); + auto transaction = store.createTransaction(Sink::Storage::ReadWrite); auto db = transaction.openDatabase("test", nullptr, false); db.write("sub2","value2"); QByteArray result; @@ -401,8 +401,8 @@ private Q_SLOTS: void testFindLast() { - Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); - auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite); + Sink::Storage store(testDataPath, dbName, Sink::Storage::ReadWrite); + auto transaction = store.createTransaction(Sink::Storage::ReadWrite); auto db = transaction.openDatabase("test", nullptr, false); db.write("sub2","value2"); db.write("wub3","value3"); @@ -416,11 +416,11 @@ private Q_SLOTS: void testRecordRevision() { - Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); - auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite); - Akonadi2::Storage::recordRevision(transaction, 1, "uid", "type"); - QCOMPARE(Akonadi2::Storage::getTypeFromRevision(transaction, 1), QByteArray("type")); - QCOMPARE(Akonadi2::Storage::getUidFromRevision(transaction, 1), QByteArray("uid")); + Sink::Storage store(testDataPath, dbName, Sink::Storage::ReadWrite); + auto transaction = store.createTransaction(Sink::Storage::ReadWrite); + Sink::Storage::recordRevision(transaction, 1, "uid", "type"); + QCOMPARE(Sink::Storage::getTypeFromRevision(transaction, 1), QByteArray("type")); + QCOMPARE(Sink::Storage::getUidFromRevision(transaction, 1), QByteArray("uid")); } }; diff --git a/tests/testimplementations.h b/tests/testimplementations.h index a47a775..785c408 100644 --- a/tests/testimplementations.h +++ b/tests/testimplementations.h @@ -30,7 +30,7 @@ //Replace with something different #include "event_generated.h" -class TestEventAdaptorFactory : public DomainTypeAdaptorFactory +class TestEventAdaptorFactory : public DomainTypeAdaptorFactory { public: TestEventAdaptorFactory() @@ -41,7 +41,7 @@ public: virtual ~TestEventAdaptorFactory() {}; }; -class TestResourceAccess : public Akonadi2::ResourceAccessInterface +class TestResourceAccess : public Sink::ResourceAccessInterface { Q_OBJECT public: @@ -55,11 +55,11 @@ public Q_SLOTS: void close() Q_DECL_OVERRIDE {} }; -class TestResourceFacade : public Akonadi2::GenericFacade +class TestResourceFacade : public Sink::GenericFacade { public: - TestResourceFacade(const QByteArray &instanceIdentifier, const QSharedPointer resourceAccess) - : Akonadi2::GenericFacade(instanceIdentifier, QSharedPointer::create(), resourceAccess) + TestResourceFacade(const QByteArray &instanceIdentifier, const QSharedPointer resourceAccess) + : Sink::GenericFacade(instanceIdentifier, QSharedPointer::create(), resourceAccess) { } @@ -69,11 +69,11 @@ public: } }; -class TestResource : public Akonadi2::GenericResource +class TestResource : public Sink::GenericResource { public: - TestResource(const QByteArray &instanceIdentifier, QSharedPointer pipeline) - : Akonadi2::GenericResource(instanceIdentifier, pipeline) + TestResource(const QByteArray &instanceIdentifier, QSharedPointer pipeline) + : Sink::GenericResource(instanceIdentifier, pipeline) { } -- cgit v1.2.3