summaryrefslogtreecommitdiffstats
path: root/tests/genericresourcetest.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-07-30 13:43:31 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-07-30 13:43:31 +0200
commit01adeefb24bf72f1015e93aa5f075f93f56d94da (patch)
treeee6d204a47f246688202b4a3a9eb0db23b462f7f /tests/genericresourcetest.cpp
parent07572b25af45c41a82eb8ddfdecf18e58958788b (diff)
downloadsink-01adeefb24bf72f1015e93aa5f075f93f56d94da.tar.gz
sink-01adeefb24bf72f1015e93aa5f075f93f56d94da.zip
Made the pipeline an implementation detail of the resource.
This removes one dependency from the Listener and will allow us to test the Listener better.
Diffstat (limited to 'tests/genericresourcetest.cpp')
-rw-r--r--tests/genericresourcetest.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/tests/genericresourcetest.cpp b/tests/genericresourcetest.cpp
index 0b9a5c1..b6f629a 100644
--- a/tests/genericresourcetest.cpp
+++ b/tests/genericresourcetest.cpp
@@ -14,20 +14,15 @@
14class TestResource : public Akonadi2::GenericResource 14class TestResource : public Akonadi2::GenericResource
15{ 15{
16public: 16public:
17 TestResource(const QByteArray &instanceIdentifier) 17 TestResource(const QByteArray &instanceIdentifier, QSharedPointer<Akonadi2::Pipeline> pipeline)
18 : Akonadi2::GenericResource(instanceIdentifier) 18 : Akonadi2::GenericResource(instanceIdentifier, pipeline)
19 { 19 {
20 } 20 }
21 21
22 KAsync::Job<void> synchronizeWithSource(Akonadi2::Pipeline *pipeline) Q_DECL_OVERRIDE 22 KAsync::Job<void> synchronizeWithSource() Q_DECL_OVERRIDE
23 { 23 {
24 return KAsync::null<void>(); 24 return KAsync::null<void>();
25 } 25 }
26
27 void configurePipeline(Akonadi2::Pipeline *pipeline) Q_DECL_OVERRIDE
28 {
29 GenericResource::configurePipeline(pipeline);
30 }
31}; 26};
32 27
33 28
@@ -89,12 +84,11 @@ private Q_SLOTS:
89 } 84 }
90 85
91 //Actual test 86 //Actual test
92 Akonadi2::Pipeline pipeline("org.kde.test.instance1"); 87 auto pipeline = QSharedPointer<Akonadi2::Pipeline>::create("org.kde.test.instance1");
93 QSignalSpy revisionSpy(&pipeline, SIGNAL(revisionUpdated(qint64))); 88 QSignalSpy revisionSpy(pipeline.data(), SIGNAL(revisionUpdated(qint64)));
94 TestResource resource("org.kde.test.instance1"); 89 TestResource resource("org.kde.test.instance1", pipeline);
95 resource.configurePipeline(&pipeline); 90 resource.processCommand(Akonadi2::Commands::CreateEntityCommand, command);
96 resource.processCommand(Akonadi2::Commands::CreateEntityCommand, command, &pipeline); 91 resource.processCommand(Akonadi2::Commands::CreateEntityCommand, command);
97 resource.processCommand(Akonadi2::Commands::CreateEntityCommand, command, &pipeline);
98 92
99 QVERIFY(revisionSpy.isValid()); 93 QVERIFY(revisionSpy.isValid());
100 QTRY_COMPARE(revisionSpy.count(), 2); 94 QTRY_COMPARE(revisionSpy.count(), 2);