diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-11-13 23:31:41 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-11-13 23:31:41 +0100 |
commit | 75c231f0758603120ec562af772b48b5f6ac0e24 (patch) | |
tree | 39abf8f038bd379ee3c0640a7476e6129ed71f8c /tests/dummyresourcetest.cpp | |
parent | 09aafbd1373b5d1152ac7a453a140a7f76c2e90e (diff) | |
download | sink-75c231f0758603120ec562af772b48b5f6ac0e24.tar.gz sink-75c231f0758603120ec562af772b48b5f6ac0e24.zip |
DummyResourceTest and QueryTest are passing
sync has been removed from the query code and is now a separate step
Diffstat (limited to 'tests/dummyresourcetest.cpp')
-rw-r--r-- | tests/dummyresourcetest.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/dummyresourcetest.cpp b/tests/dummyresourcetest.cpp index d027266..3b90e6c 100644 --- a/tests/dummyresourcetest.cpp +++ b/tests/dummyresourcetest.cpp | |||
@@ -64,6 +64,9 @@ private Q_SLOTS: | |||
64 | query.syncOnDemand = false; | 64 | query.syncOnDemand = false; |
65 | query.processAll = true; | 65 | query.processAll = true; |
66 | 66 | ||
67 | //Ensure all local data is processed | ||
68 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | ||
69 | |||
67 | query.propertyFilter.insert("uid", "testuid"); | 70 | query.propertyFilter.insert("uid", "testuid"); |
68 | async::SyncListResult<Akonadi2::ApplicationDomain::Event::Ptr> result(Akonadi2::Store::load<Akonadi2::ApplicationDomain::Event>(query)); | 71 | async::SyncListResult<Akonadi2::ApplicationDomain::Event::Ptr> result(Akonadi2::Store::load<Akonadi2::ApplicationDomain::Event>(query)); |
69 | result.exec(); | 72 | result.exec(); |
@@ -88,6 +91,9 @@ private Q_SLOTS: | |||
88 | query.syncOnDemand = false; | 91 | query.syncOnDemand = false; |
89 | query.processAll = true; | 92 | query.processAll = true; |
90 | 93 | ||
94 | //Ensure all local data is processed | ||
95 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | ||
96 | |||
91 | query.propertyFilter.insert("uid", "testuid"); | 97 | query.propertyFilter.insert("uid", "testuid"); |
92 | async::SyncListResult<Akonadi2::ApplicationDomain::Event::Ptr> result(Akonadi2::Store::load<Akonadi2::ApplicationDomain::Event>(query)); | 98 | async::SyncListResult<Akonadi2::ApplicationDomain::Event::Ptr> result(Akonadi2::Store::load<Akonadi2::ApplicationDomain::Event>(query)); |
93 | result.exec(); | 99 | result.exec(); |
@@ -114,6 +120,9 @@ private Q_SLOTS: | |||
114 | query.syncOnDemand = false; | 120 | query.syncOnDemand = false; |
115 | query.processAll = true; | 121 | query.processAll = true; |
116 | 122 | ||
123 | //Ensure all local data is processed | ||
124 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | ||
125 | |||
117 | query.propertyFilter.insert("summary", "summaryValue2"); | 126 | query.propertyFilter.insert("summary", "summaryValue2"); |
118 | async::SyncListResult<Akonadi2::ApplicationDomain::Event::Ptr> result(Akonadi2::Store::load<Akonadi2::ApplicationDomain::Event>(query)); | 127 | async::SyncListResult<Akonadi2::ApplicationDomain::Event::Ptr> result(Akonadi2::Store::load<Akonadi2::ApplicationDomain::Event>(query)); |
119 | result.exec(); | 128 | result.exec(); |
@@ -145,6 +154,9 @@ private Q_SLOTS: | |||
145 | query.syncOnDemand = true; | 154 | query.syncOnDemand = true; |
146 | query.processAll = true; | 155 | query.processAll = true; |
147 | 156 | ||
157 | //Ensure all local data is processed | ||
158 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | ||
159 | |||
148 | async::SyncListResult<Akonadi2::ApplicationDomain::Event::Ptr> result(Akonadi2::Store::load<Akonadi2::ApplicationDomain::Event>(query)); | 160 | async::SyncListResult<Akonadi2::ApplicationDomain::Event::Ptr> result(Akonadi2::Store::load<Akonadi2::ApplicationDomain::Event>(query)); |
149 | result.exec(); | 161 | result.exec(); |
150 | QVERIFY(!result.isEmpty()); | 162 | QVERIFY(!result.isEmpty()); |
@@ -160,6 +172,9 @@ private Q_SLOTS: | |||
160 | query.syncOnDemand = true; | 172 | query.syncOnDemand = true; |
161 | query.processAll = true; | 173 | query.processAll = true; |
162 | 174 | ||
175 | //Ensure all local data is processed | ||
176 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | ||
177 | |||
163 | async::SyncListResult<Akonadi2::ApplicationDomain::Mail::Ptr> result(Akonadi2::Store::load<Akonadi2::ApplicationDomain::Mail>(query)); | 178 | async::SyncListResult<Akonadi2::ApplicationDomain::Mail::Ptr> result(Akonadi2::Store::load<Akonadi2::ApplicationDomain::Mail>(query)); |
164 | result.exec(); | 179 | result.exec(); |
165 | QVERIFY(!result.isEmpty()); | 180 | QVERIFY(!result.isEmpty()); |
@@ -182,6 +197,9 @@ private Q_SLOTS: | |||
182 | query.processAll = true; | 197 | query.processAll = true; |
183 | query.propertyFilter.insert("uid", "testuid"); | 198 | query.propertyFilter.insert("uid", "testuid"); |
184 | 199 | ||
200 | //Ensure all local data is processed | ||
201 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | ||
202 | |||
185 | //Test create | 203 | //Test create |
186 | Akonadi2::ApplicationDomain::Event event2; | 204 | Akonadi2::ApplicationDomain::Event event2; |
187 | { | 205 | { |
@@ -198,6 +216,9 @@ private Q_SLOTS: | |||
198 | event2.setProperty("summary", "summaryValue2"); | 216 | event2.setProperty("summary", "summaryValue2"); |
199 | Akonadi2::Store::modify<Akonadi2::ApplicationDomain::Event>(event2).exec().waitForFinished(); | 217 | Akonadi2::Store::modify<Akonadi2::ApplicationDomain::Event>(event2).exec().waitForFinished(); |
200 | 218 | ||
219 | //Ensure all local data is processed | ||
220 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | ||
221 | |||
201 | //Test modify | 222 | //Test modify |
202 | { | 223 | { |
203 | async::SyncListResult<Akonadi2::ApplicationDomain::Event::Ptr> result(Akonadi2::Store::load<Akonadi2::ApplicationDomain::Event>(query)); | 224 | async::SyncListResult<Akonadi2::ApplicationDomain::Event::Ptr> result(Akonadi2::Store::load<Akonadi2::ApplicationDomain::Event>(query)); |
@@ -210,6 +231,9 @@ private Q_SLOTS: | |||
210 | 231 | ||
211 | Akonadi2::Store::remove<Akonadi2::ApplicationDomain::Event>(event2).exec().waitForFinished(); | 232 | Akonadi2::Store::remove<Akonadi2::ApplicationDomain::Event>(event2).exec().waitForFinished(); |
212 | 233 | ||
234 | //Ensure all local data is processed | ||
235 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | ||
236 | |||
213 | //Test remove | 237 | //Test remove |
214 | { | 238 | { |
215 | async::SyncListResult<Akonadi2::ApplicationDomain::Event::Ptr> result(Akonadi2::Store::load<Akonadi2::ApplicationDomain::Event>(query)); | 239 | async::SyncListResult<Akonadi2::ApplicationDomain::Event::Ptr> result(Akonadi2::Store::load<Akonadi2::ApplicationDomain::Event>(query)); |