summaryrefslogtreecommitdiffstats
path: root/tests/pipelinetest.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-05-28 00:24:53 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-05-28 00:24:53 +0200
commite9c75177590d8546ebd9425f16c4269a9c92f517 (patch)
tree8a953631e467d9df50657e22bd90954b7b71c990 /tests/pipelinetest.cpp
parent8f01eb530262d1442fc4fa0782a41e052412d43b (diff)
downloadsink-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/pipelinetest.cpp')
-rw-r--r--tests/pipelinetest.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/pipelinetest.cpp b/tests/pipelinetest.cpp
index 9290050..6ea2041 100644
--- a/tests/pipelinetest.cpp
+++ b/tests/pipelinetest.cpp
@@ -19,6 +19,7 @@
19#include "log.h" 19#include "log.h"
20#include "domainadaptor.h" 20#include "domainadaptor.h"
21#include "definitions.h" 21#include "definitions.h"
22#include "adaptorfactoryregistry.h"
22 23
23static void removeFromDisk(const QString &name) 24static void removeFromDisk(const QString &name)
24{ 25{
@@ -185,6 +186,7 @@ private slots:
185 void initTestCase() 186 void initTestCase()
186 { 187 {
187 Sink::Log::setDebugOutputLevel(Sink::Log::Trace); 188 Sink::Log::setDebugOutputLevel(Sink::Log::Trace);
189 Sink::AdaptorFactoryRegistry::instance().registerFactory<Sink::ApplicationDomain::Event, TestEventAdaptorFactory>("test");
188 } 190 }
189 191
190 void init() 192 void init()
@@ -198,9 +200,7 @@ private slots:
198 auto command = createEntityCommand(createEvent(entityFbb)); 200 auto command = createEntityCommand(createEvent(entityFbb));
199 201
200 Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); 202 Sink::Pipeline pipeline("org.kde.pipelinetest.instance1");
201 203 pipeline.setResourceType("test");
202 auto adaptorFactory = QSharedPointer<TestEventAdaptorFactory>::create();
203 pipeline.setAdaptorFactory("event", adaptorFactory);
204 204
205 pipeline.startTransaction(); 205 pipeline.startTransaction();
206 pipeline.newEntity(command.constData(), command.size()); 206 pipeline.newEntity(command.constData(), command.size());
@@ -216,9 +216,9 @@ private slots:
216 auto command = createEntityCommand(createEvent(entityFbb, "summary", "description")); 216 auto command = createEntityCommand(createEvent(entityFbb, "summary", "description"));
217 217
218 Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); 218 Sink::Pipeline pipeline("org.kde.pipelinetest.instance1");
219 pipeline.setResourceType("test");
219 220
220 auto adaptorFactory = QSharedPointer<TestEventAdaptorFactory>::create(); 221 auto adaptorFactory = QSharedPointer<TestEventAdaptorFactory>::create();
221 pipeline.setAdaptorFactory("event", adaptorFactory);
222 222
223 // Create the initial revision 223 // Create the initial revision
224 pipeline.startTransaction(); 224 pipeline.startTransaction();
@@ -265,9 +265,9 @@ private slots:
265 auto command = createEntityCommand(createEvent(entityFbb)); 265 auto command = createEntityCommand(createEvent(entityFbb));
266 266
267 Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); 267 Sink::Pipeline pipeline("org.kde.pipelinetest.instance1");
268 pipeline.setResourceType("test");
268 269
269 auto adaptorFactory = QSharedPointer<TestEventAdaptorFactory>::create(); 270 auto adaptorFactory = QSharedPointer<TestEventAdaptorFactory>::create();
270 pipeline.setAdaptorFactory("event", adaptorFactory);
271 271
272 // Create the initial revision 272 // Create the initial revision
273 pipeline.startTransaction(); 273 pipeline.startTransaction();
@@ -309,7 +309,7 @@ private slots:
309 flatbuffers::FlatBufferBuilder entityFbb; 309 flatbuffers::FlatBufferBuilder entityFbb;
310 auto command = createEntityCommand(createEvent(entityFbb)); 310 auto command = createEntityCommand(createEvent(entityFbb));
311 Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); 311 Sink::Pipeline pipeline("org.kde.pipelinetest.instance1");
312 pipeline.setAdaptorFactory("event", QSharedPointer<TestEventAdaptorFactory>::create()); 312 pipeline.setResourceType("test");
313 313
314 // Create the initial revision 314 // Create the initial revision
315 pipeline.startTransaction(); 315 pipeline.startTransaction();
@@ -346,9 +346,9 @@ private slots:
346 TestProcessor testProcessor; 346 TestProcessor testProcessor;
347 347
348 Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); 348 Sink::Pipeline pipeline("org.kde.pipelinetest.instance1");
349 pipeline.setResourceType("test");
349 pipeline.setPreprocessors("event", QVector<Sink::Preprocessor *>() << &testProcessor); 350 pipeline.setPreprocessors("event", QVector<Sink::Preprocessor *>() << &testProcessor);
350 pipeline.startTransaction(); 351 pipeline.startTransaction();
351 pipeline.setAdaptorFactory("event", QSharedPointer<TestEventAdaptorFactory>::create());
352 352
353 // Actual test 353 // Actual test
354 { 354 {