diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-07-30 13:43:31 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-07-30 13:43:31 +0200 |
commit | 01adeefb24bf72f1015e93aa5f075f93f56d94da (patch) | |
tree | ee6d204a47f246688202b4a3a9eb0db23b462f7f /tests/genericresourcetest.cpp | |
parent | 07572b25af45c41a82eb8ddfdecf18e58958788b (diff) | |
download | sink-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.cpp | 22 |
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 @@ | |||
14 | class TestResource : public Akonadi2::GenericResource | 14 | class TestResource : public Akonadi2::GenericResource |
15 | { | 15 | { |
16 | public: | 16 | public: |
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); |