diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-05-28 00:24:53 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-05-28 00:24:53 +0200 |
commit | e9c75177590d8546ebd9425f16c4269a9c92f517 (patch) | |
tree | 8a953631e467d9df50657e22bd90954b7b71c990 /tests/mailquerybenchmark.cpp | |
parent | 8f01eb530262d1442fc4fa0782a41e052412d43b (diff) | |
download | sink-e9c75177590d8546ebd9425f16c4269a9c92f517.tar.gz sink-e9c75177590d8546ebd9425f16c4269a9c92f517.zip |
Refactored the generic resource to use separate classes for
changereplay and synchronization.
This cleans up the API and avoids the excessive passing around of
transactions. It also provides more flexibility in eventually using
different synchronization strategies for different resources.
Diffstat (limited to 'tests/mailquerybenchmark.cpp')
-rw-r--r-- | tests/mailquerybenchmark.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/mailquerybenchmark.cpp b/tests/mailquerybenchmark.cpp index 20ee63c..4e58899 100644 --- a/tests/mailquerybenchmark.cpp +++ b/tests/mailquerybenchmark.cpp | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <common/pipeline.h> | 33 | #include <common/pipeline.h> |
34 | #include <common/index.h> | 34 | #include <common/index.h> |
35 | #include <common/indexupdater.h> | 35 | #include <common/indexupdater.h> |
36 | #include <common/adaptorfactoryregistry.h> | ||
36 | 37 | ||
37 | #include "hawd/dataset.h" | 38 | #include "hawd/dataset.h" |
38 | #include "hawd/formatter.h" | 39 | #include "hawd/formatter.h" |
@@ -59,12 +60,11 @@ class MailQueryBenchmark : public QObject | |||
59 | TestResource::removeFromDisk(resourceIdentifier); | 60 | TestResource::removeFromDisk(resourceIdentifier); |
60 | 61 | ||
61 | auto pipeline = QSharedPointer<Sink::Pipeline>::create(resourceIdentifier); | 62 | auto pipeline = QSharedPointer<Sink::Pipeline>::create(resourceIdentifier); |
63 | pipeline->setResourceType("test"); | ||
62 | 64 | ||
63 | auto mailFactory = QSharedPointer<TestMailAdaptorFactory>::create(); | ||
64 | auto indexer = QSharedPointer<DefaultIndexUpdater<Sink::ApplicationDomain::Mail>>::create(); | 65 | auto indexer = QSharedPointer<DefaultIndexUpdater<Sink::ApplicationDomain::Mail>>::create(); |
65 | 66 | ||
66 | pipeline->setPreprocessors("mail", QVector<Sink::Preprocessor *>() << indexer.data()); | 67 | pipeline->setPreprocessors("mail", QVector<Sink::Preprocessor *>() << indexer.data()); |
67 | pipeline->setAdaptorFactory("mail", mailFactory); | ||
68 | 68 | ||
69 | auto domainTypeAdaptorFactory = QSharedPointer<TestMailAdaptorFactory>::create(); | 69 | auto domainTypeAdaptorFactory = QSharedPointer<TestMailAdaptorFactory>::create(); |
70 | 70 | ||
@@ -149,6 +149,7 @@ private slots: | |||
149 | void init() | 149 | void init() |
150 | { | 150 | { |
151 | resourceIdentifier = "org.kde.test.instance1"; | 151 | resourceIdentifier = "org.kde.test.instance1"; |
152 | Sink::AdaptorFactoryRegistry::instance().registerFactory<Sink::ApplicationDomain::Mail, TestMailAdaptorFactory>("test"); | ||
152 | } | 153 | } |
153 | 154 | ||
154 | void test50k() | 155 | void test50k() |