diff options
Diffstat (limited to 'tests/dummyresourcetest.cpp')
-rw-r--r-- | tests/dummyresourcetest.cpp | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/tests/dummyresourcetest.cpp b/tests/dummyresourcetest.cpp index 0e1f382..72a24b6 100644 --- a/tests/dummyresourcetest.cpp +++ b/tests/dummyresourcetest.cpp | |||
@@ -62,11 +62,9 @@ private Q_SLOTS: | |||
62 | 62 | ||
63 | Akonadi2::Query query; | 63 | Akonadi2::Query query; |
64 | query.resources << "org.kde.dummy.instance1"; | 64 | query.resources << "org.kde.dummy.instance1"; |
65 | query.syncOnDemand = false; | ||
66 | query.processAll = true; | ||
67 | 65 | ||
68 | //Ensure all local data is processed | 66 | //Ensure all local data is processed |
69 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | 67 | Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); |
70 | 68 | ||
71 | query.propertyFilter.insert("uid", "testuid"); | 69 | query.propertyFilter.insert("uid", "testuid"); |
72 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Event>(query); | 70 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Event>(query); |
@@ -88,11 +86,9 @@ private Q_SLOTS: | |||
88 | 86 | ||
89 | Akonadi2::Query query; | 87 | Akonadi2::Query query; |
90 | query.resources << "org.kde.dummy.instance1"; | 88 | query.resources << "org.kde.dummy.instance1"; |
91 | query.syncOnDemand = false; | ||
92 | query.processAll = true; | ||
93 | 89 | ||
94 | //Ensure all local data is processed | 90 | //Ensure all local data is processed |
95 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | 91 | Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); |
96 | 92 | ||
97 | query.propertyFilter.insert("uid", "testuid"); | 93 | query.propertyFilter.insert("uid", "testuid"); |
98 | 94 | ||
@@ -118,11 +114,9 @@ private Q_SLOTS: | |||
118 | 114 | ||
119 | Akonadi2::Query query; | 115 | Akonadi2::Query query; |
120 | query.resources << "org.kde.dummy.instance1"; | 116 | query.resources << "org.kde.dummy.instance1"; |
121 | query.syncOnDemand = false; | ||
122 | query.processAll = true; | ||
123 | 117 | ||
124 | //Ensure all local data is processed | 118 | //Ensure all local data is processed |
125 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | 119 | Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); |
126 | 120 | ||
127 | query.propertyFilter.insert("summary", "summaryValue2"); | 121 | query.propertyFilter.insert("summary", "summaryValue2"); |
128 | 122 | ||
@@ -153,11 +147,10 @@ private Q_SLOTS: | |||
153 | { | 147 | { |
154 | Akonadi2::Query query; | 148 | Akonadi2::Query query; |
155 | query.resources << "org.kde.dummy.instance1"; | 149 | query.resources << "org.kde.dummy.instance1"; |
156 | query.syncOnDemand = true; | ||
157 | query.processAll = true; | ||
158 | 150 | ||
159 | //Ensure all local data is processed | 151 | //Ensure all local data is processed |
160 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | 152 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); |
153 | Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); | ||
161 | 154 | ||
162 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Event>(query); | 155 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Event>(query); |
163 | QTRY_VERIFY(model->rowCount(QModelIndex()) >= 1); | 156 | QTRY_VERIFY(model->rowCount(QModelIndex()) >= 1); |
@@ -171,11 +164,10 @@ private Q_SLOTS: | |||
171 | { | 164 | { |
172 | Akonadi2::Query query; | 165 | Akonadi2::Query query; |
173 | query.resources << "org.kde.dummy.instance1"; | 166 | query.resources << "org.kde.dummy.instance1"; |
174 | query.syncOnDemand = true; | ||
175 | query.processAll = true; | ||
176 | 167 | ||
177 | //Ensure all local data is processed | 168 | //Ensure all local data is processed |
178 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | 169 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); |
170 | Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); | ||
179 | 171 | ||
180 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Mail>(query); | 172 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Mail>(query); |
181 | QTRY_VERIFY(model->rowCount(QModelIndex()) >= 1); | 173 | QTRY_VERIFY(model->rowCount(QModelIndex()) >= 1); |
@@ -195,12 +187,10 @@ private Q_SLOTS: | |||
195 | 187 | ||
196 | Akonadi2::Query query; | 188 | Akonadi2::Query query; |
197 | query.resources << "org.kde.dummy.instance1"; | 189 | query.resources << "org.kde.dummy.instance1"; |
198 | query.syncOnDemand = false; | ||
199 | query.processAll = true; | ||
200 | query.propertyFilter.insert("uid", "testuid"); | 190 | query.propertyFilter.insert("uid", "testuid"); |
201 | 191 | ||
202 | //Ensure all local data is processed | 192 | //Ensure all local data is processed |
203 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | 193 | Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); |
204 | 194 | ||
205 | //Test create | 195 | //Test create |
206 | Akonadi2::ApplicationDomain::Event event2; | 196 | Akonadi2::ApplicationDomain::Event event2; |
@@ -219,7 +209,7 @@ private Q_SLOTS: | |||
219 | Akonadi2::Store::modify<Akonadi2::ApplicationDomain::Event>(event2).exec().waitForFinished(); | 209 | Akonadi2::Store::modify<Akonadi2::ApplicationDomain::Event>(event2).exec().waitForFinished(); |
220 | 210 | ||
221 | //Ensure all local data is processed | 211 | //Ensure all local data is processed |
222 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | 212 | Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); |
223 | 213 | ||
224 | //Test modify | 214 | //Test modify |
225 | { | 215 | { |
@@ -234,7 +224,7 @@ private Q_SLOTS: | |||
234 | Akonadi2::Store::remove<Akonadi2::ApplicationDomain::Event>(event2).exec().waitForFinished(); | 224 | Akonadi2::Store::remove<Akonadi2::ApplicationDomain::Event>(event2).exec().waitForFinished(); |
235 | 225 | ||
236 | //Ensure all local data is processed | 226 | //Ensure all local data is processed |
237 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | 227 | Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); |
238 | 228 | ||
239 | //Test remove | 229 | //Test remove |
240 | { | 230 | { |
@@ -249,8 +239,6 @@ private Q_SLOTS: | |||
249 | 239 | ||
250 | Akonadi2::Query query; | 240 | Akonadi2::Query query; |
251 | query.resources << "org.kde.dummy.instance1"; | 241 | query.resources << "org.kde.dummy.instance1"; |
252 | query.syncOnDemand = false; | ||
253 | query.processAll = true; | ||
254 | query.liveQuery = true; | 242 | query.liveQuery = true; |
255 | query.propertyFilter.insert("uid", "testuid"); | 243 | query.propertyFilter.insert("uid", "testuid"); |
256 | 244 | ||