diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-08 11:22:40 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-08 11:36:32 +0200 |
commit | 81fa4c3635a029b1c8f9cc3cd670f0b04f1c3f21 (patch) | |
tree | 3acd44ee1d055e4dfe6c8c0409406235b39e0980 /tests/querytest.cpp | |
parent | 9317fbffeab4a8c258acb1116eb12fbded7053d8 (diff) | |
download | sink-81fa4c3635a029b1c8f9cc3cd670f0b04f1c3f21.tar.gz sink-81fa4c3635a029b1c8f9cc3cd670f0b04f1c3f21.zip |
Shorten the types to be more distinctive.
The org.kde prefix is useless and possibly misleading.
Simply prefixing with sink is more unique and shorter.
Diffstat (limited to 'tests/querytest.cpp')
-rw-r--r-- | tests/querytest.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/tests/querytest.cpp b/tests/querytest.cpp index 95c22b3..d3a97f6 100644 --- a/tests/querytest.cpp +++ b/tests/querytest.cpp | |||
@@ -23,15 +23,15 @@ private slots: | |||
23 | void initTestCase() | 23 | void initTestCase() |
24 | { | 24 | { |
25 | Sink::Test::initTest(); | 25 | Sink::Test::initTest(); |
26 | auto factory = Sink::ResourceFactory::load("org.kde.dummy"); | 26 | auto factory = Sink::ResourceFactory::load("sink.dummy"); |
27 | QVERIFY(factory); | 27 | QVERIFY(factory); |
28 | ResourceConfig::addResource("org.kde.dummy.instance1", "org.kde.dummy"); | 28 | ResourceConfig::addResource("sink.dummy.instance1", "sink.dummy"); |
29 | Sink::Store::removeDataFromDisk(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); | 29 | Sink::Store::removeDataFromDisk(QByteArray("sink.dummy.instance1")).exec().waitForFinished(); |
30 | } | 30 | } |
31 | 31 | ||
32 | void cleanup() | 32 | void cleanup() |
33 | { | 33 | { |
34 | Sink::Store::removeDataFromDisk(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); | 34 | Sink::Store::removeDataFromDisk(QByteArray("sink.dummy.instance1")).exec().waitForFinished(); |
35 | } | 35 | } |
36 | 36 | ||
37 | void init() | 37 | void init() |
@@ -59,13 +59,13 @@ private slots: | |||
59 | { | 59 | { |
60 | // Setup | 60 | // Setup |
61 | { | 61 | { |
62 | Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); | 62 | Sink::ApplicationDomain::Mail mail("sink.dummy.instance1"); |
63 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); | 63 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); |
64 | } | 64 | } |
65 | 65 | ||
66 | // Test | 66 | // Test |
67 | Sink::Query query; | 67 | Sink::Query query; |
68 | query.resources << "org.kde.dummy.instance1"; | 68 | query.resources << "sink.dummy.instance1"; |
69 | query.liveQuery = true; | 69 | query.liveQuery = true; |
70 | 70 | ||
71 | // We fetch before the data is available and rely on the live query mechanism to deliver the actual data | 71 | // We fetch before the data is available and rely on the live query mechanism to deliver the actual data |
@@ -77,13 +77,13 @@ private slots: | |||
77 | { | 77 | { |
78 | // Setup | 78 | // Setup |
79 | { | 79 | { |
80 | Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); | 80 | Sink::ApplicationDomain::Mail mail("sink.dummy.instance1"); |
81 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); | 81 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); |
82 | } | 82 | } |
83 | 83 | ||
84 | // Test | 84 | // Test |
85 | Sink::Query query; | 85 | Sink::Query query; |
86 | query.resources << "org.kde.dummy.instance1"; | 86 | query.resources << "sink.dummy.instance1"; |
87 | query.liveQuery = false; | 87 | query.liveQuery = false; |
88 | 88 | ||
89 | // Ensure all local data is processed | 89 | // Ensure all local data is processed |
@@ -101,12 +101,12 @@ private slots: | |||
101 | QByteArray id; | 101 | QByteArray id; |
102 | // Setup | 102 | // Setup |
103 | { | 103 | { |
104 | Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); | 104 | Sink::ApplicationDomain::Mail mail("sink.dummy.instance1"); |
105 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); | 105 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); |
106 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); | 106 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); |
107 | 107 | ||
108 | Sink::Query query; | 108 | Sink::Query query; |
109 | query.resources << "org.kde.dummy.instance1"; | 109 | query.resources << "sink.dummy.instance1"; |
110 | 110 | ||
111 | // Ensure all local data is processed | 111 | // Ensure all local data is processed |
112 | Sink::Store::synchronize(query).exec().waitForFinished(); | 112 | Sink::Store::synchronize(query).exec().waitForFinished(); |
@@ -120,7 +120,7 @@ private slots: | |||
120 | 120 | ||
121 | // Test | 121 | // Test |
122 | Sink::Query query; | 122 | Sink::Query query; |
123 | query.resources << "org.kde.dummy.instance1"; | 123 | query.resources << "sink.dummy.instance1"; |
124 | query.ids << id; | 124 | query.ids << id; |
125 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Mail>(query); | 125 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Mail>(query); |
126 | QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); | 126 | QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); |
@@ -131,13 +131,13 @@ private slots: | |||
131 | { | 131 | { |
132 | // Setup | 132 | // Setup |
133 | { | 133 | { |
134 | Sink::ApplicationDomain::Folder folder("org.kde.dummy.instance1"); | 134 | Sink::ApplicationDomain::Folder folder("sink.dummy.instance1"); |
135 | Sink::Store::create<Sink::ApplicationDomain::Folder>(folder).exec().waitForFinished(); | 135 | Sink::Store::create<Sink::ApplicationDomain::Folder>(folder).exec().waitForFinished(); |
136 | } | 136 | } |
137 | 137 | ||
138 | // Test | 138 | // Test |
139 | Sink::Query query; | 139 | Sink::Query query; |
140 | query.resources << "org.kde.dummy.instance1"; | 140 | query.resources << "sink.dummy.instance1"; |
141 | query.liveQuery = true; | 141 | query.liveQuery = true; |
142 | 142 | ||
143 | // We fetch before the data is available and rely on the live query mechanism to deliver the actual data | 143 | // We fetch before the data is available and rely on the live query mechanism to deliver the actual data |
@@ -151,11 +151,11 @@ private slots: | |||
151 | { | 151 | { |
152 | // Setup | 152 | // Setup |
153 | { | 153 | { |
154 | Sink::ApplicationDomain::Folder folder("org.kde.dummy.instance1"); | 154 | Sink::ApplicationDomain::Folder folder("sink.dummy.instance1"); |
155 | Sink::Store::create<Sink::ApplicationDomain::Folder>(folder).exec().waitForFinished(); | 155 | Sink::Store::create<Sink::ApplicationDomain::Folder>(folder).exec().waitForFinished(); |
156 | 156 | ||
157 | Sink::Query query; | 157 | Sink::Query query; |
158 | query.resources << "org.kde.dummy.instance1"; | 158 | query.resources << "sink.dummy.instance1"; |
159 | 159 | ||
160 | // Ensure all local data is processed | 160 | // Ensure all local data is processed |
161 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 161 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
@@ -167,14 +167,14 @@ private slots: | |||
167 | auto folderEntity = model->index(0, 0).data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Folder::Ptr>(); | 167 | auto folderEntity = model->index(0, 0).data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Folder::Ptr>(); |
168 | QVERIFY(!folderEntity->identifier().isEmpty()); | 168 | QVERIFY(!folderEntity->identifier().isEmpty()); |
169 | 169 | ||
170 | Sink::ApplicationDomain::Folder subfolder("org.kde.dummy.instance1"); | 170 | Sink::ApplicationDomain::Folder subfolder("sink.dummy.instance1"); |
171 | subfolder.setProperty("parent", folderEntity->identifier()); | 171 | subfolder.setProperty("parent", folderEntity->identifier()); |
172 | Sink::Store::create<Sink::ApplicationDomain::Folder>(subfolder).exec().waitForFinished(); | 172 | Sink::Store::create<Sink::ApplicationDomain::Folder>(subfolder).exec().waitForFinished(); |
173 | } | 173 | } |
174 | 174 | ||
175 | // Test | 175 | // Test |
176 | Sink::Query query; | 176 | Sink::Query query; |
177 | query.resources << "org.kde.dummy.instance1"; | 177 | query.resources << "sink.dummy.instance1"; |
178 | query.parentProperty = "parent"; | 178 | query.parentProperty = "parent"; |
179 | 179 | ||
180 | // Ensure all local data is processed | 180 | // Ensure all local data is processed |
@@ -193,7 +193,7 @@ private slots: | |||
193 | { | 193 | { |
194 | // Setup | 194 | // Setup |
195 | { | 195 | { |
196 | Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); | 196 | Sink::ApplicationDomain::Mail mail("sink.dummy.instance1"); |
197 | mail.setProperty("uid", "test1"); | 197 | mail.setProperty("uid", "test1"); |
198 | mail.setProperty("sender", "doe@example.org"); | 198 | mail.setProperty("sender", "doe@example.org"); |
199 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); | 199 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); |
@@ -201,7 +201,7 @@ private slots: | |||
201 | 201 | ||
202 | // Test | 202 | // Test |
203 | Sink::Query query; | 203 | Sink::Query query; |
204 | query.resources << "org.kde.dummy.instance1"; | 204 | query.resources << "sink.dummy.instance1"; |
205 | query.liveQuery = false; | 205 | query.liveQuery = false; |
206 | query += Sink::Query::PropertyFilter("uid", "test1"); | 206 | query += Sink::Query::PropertyFilter("uid", "test1"); |
207 | 207 | ||
@@ -219,11 +219,11 @@ private slots: | |||
219 | // Setup | 219 | // Setup |
220 | Sink::ApplicationDomain::Folder::Ptr folderEntity; | 220 | Sink::ApplicationDomain::Folder::Ptr folderEntity; |
221 | { | 221 | { |
222 | Sink::ApplicationDomain::Folder folder("org.kde.dummy.instance1"); | 222 | Sink::ApplicationDomain::Folder folder("sink.dummy.instance1"); |
223 | Sink::Store::create<Sink::ApplicationDomain::Folder>(folder).exec().waitForFinished(); | 223 | Sink::Store::create<Sink::ApplicationDomain::Folder>(folder).exec().waitForFinished(); |
224 | 224 | ||
225 | Sink::Query query; | 225 | Sink::Query query; |
226 | query.resources << "org.kde.dummy.instance1"; | 226 | query.resources << "sink.dummy.instance1"; |
227 | 227 | ||
228 | // Ensure all local data is processed | 228 | // Ensure all local data is processed |
229 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 229 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
@@ -235,7 +235,7 @@ private slots: | |||
235 | folderEntity = model->index(0, 0).data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Folder::Ptr>(); | 235 | folderEntity = model->index(0, 0).data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Folder::Ptr>(); |
236 | QVERIFY(!folderEntity->identifier().isEmpty()); | 236 | QVERIFY(!folderEntity->identifier().isEmpty()); |
237 | 237 | ||
238 | Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); | 238 | Sink::ApplicationDomain::Mail mail("sink.dummy.instance1"); |
239 | mail.setProperty("uid", "test1"); | 239 | mail.setProperty("uid", "test1"); |
240 | mail.setProperty("folder", folderEntity->identifier()); | 240 | mail.setProperty("folder", folderEntity->identifier()); |
241 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); | 241 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); |
@@ -243,7 +243,7 @@ private slots: | |||
243 | 243 | ||
244 | // Test | 244 | // Test |
245 | Sink::Query query; | 245 | Sink::Query query; |
246 | query.resources << "org.kde.dummy.instance1"; | 246 | query.resources << "sink.dummy.instance1"; |
247 | query += Sink::Query::PropertyFilter("folder", *folderEntity); | 247 | query += Sink::Query::PropertyFilter("folder", *folderEntity); |
248 | 248 | ||
249 | // Ensure all local data is processed | 249 | // Ensure all local data is processed |
@@ -260,11 +260,11 @@ private slots: | |||
260 | // Setup | 260 | // Setup |
261 | Sink::ApplicationDomain::Folder::Ptr folderEntity; | 261 | Sink::ApplicationDomain::Folder::Ptr folderEntity; |
262 | { | 262 | { |
263 | Sink::ApplicationDomain::Folder folder("org.kde.dummy.instance1"); | 263 | Sink::ApplicationDomain::Folder folder("sink.dummy.instance1"); |
264 | Sink::Store::create<Sink::ApplicationDomain::Folder>(folder).exec().waitForFinished(); | 264 | Sink::Store::create<Sink::ApplicationDomain::Folder>(folder).exec().waitForFinished(); |
265 | 265 | ||
266 | Sink::Query query; | 266 | Sink::Query query; |
267 | query.resources << "org.kde.dummy.instance1"; | 267 | query.resources << "sink.dummy.instance1"; |
268 | 268 | ||
269 | // Ensure all local data is processed | 269 | // Ensure all local data is processed |
270 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 270 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
@@ -278,21 +278,21 @@ private slots: | |||
278 | 278 | ||
279 | const auto date = QDateTime(QDate(2015, 7, 7), QTime(12, 0)); | 279 | const auto date = QDateTime(QDate(2015, 7, 7), QTime(12, 0)); |
280 | { | 280 | { |
281 | Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); | 281 | Sink::ApplicationDomain::Mail mail("sink.dummy.instance1"); |
282 | mail.setProperty("uid", "testSecond"); | 282 | mail.setProperty("uid", "testSecond"); |
283 | mail.setProperty("folder", folderEntity->identifier()); | 283 | mail.setProperty("folder", folderEntity->identifier()); |
284 | mail.setProperty("date", date.addDays(-1)); | 284 | mail.setProperty("date", date.addDays(-1)); |
285 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); | 285 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); |
286 | } | 286 | } |
287 | { | 287 | { |
288 | Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); | 288 | Sink::ApplicationDomain::Mail mail("sink.dummy.instance1"); |
289 | mail.setProperty("uid", "testLatest"); | 289 | mail.setProperty("uid", "testLatest"); |
290 | mail.setProperty("folder", folderEntity->identifier()); | 290 | mail.setProperty("folder", folderEntity->identifier()); |
291 | mail.setProperty("date", date); | 291 | mail.setProperty("date", date); |
292 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); | 292 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); |
293 | } | 293 | } |
294 | { | 294 | { |
295 | Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); | 295 | Sink::ApplicationDomain::Mail mail("sink.dummy.instance1"); |
296 | mail.setProperty("uid", "testLast"); | 296 | mail.setProperty("uid", "testLast"); |
297 | mail.setProperty("folder", folderEntity->identifier()); | 297 | mail.setProperty("folder", folderEntity->identifier()); |
298 | mail.setProperty("date", date.addDays(-2)); | 298 | mail.setProperty("date", date.addDays(-2)); |
@@ -302,7 +302,7 @@ private slots: | |||
302 | 302 | ||
303 | // Test | 303 | // Test |
304 | Sink::Query query; | 304 | Sink::Query query; |
305 | query.resources << "org.kde.dummy.instance1"; | 305 | query.resources << "sink.dummy.instance1"; |
306 | query += Sink::Query::PropertyFilter("folder", *folderEntity); | 306 | query += Sink::Query::PropertyFilter("folder", *folderEntity); |
307 | query.sortProperty = "date"; | 307 | query.sortProperty = "date"; |
308 | query.limit = 1; | 308 | query.limit = 1; |