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/pipelinetest.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/pipelinetest.cpp')
-rw-r--r-- | tests/pipelinetest.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/tests/pipelinetest.cpp b/tests/pipelinetest.cpp index 65d4b49..7216f62 100644 --- a/tests/pipelinetest.cpp +++ b/tests/pipelinetest.cpp | |||
@@ -195,7 +195,7 @@ private slots: | |||
195 | 195 | ||
196 | void init() | 196 | void init() |
197 | { | 197 | { |
198 | removeFromDisk("org.kde.pipelinetest.instance1"); | 198 | removeFromDisk("sink.pipelinetest.instance1"); |
199 | } | 199 | } |
200 | 200 | ||
201 | void testCreate() | 201 | void testCreate() |
@@ -203,14 +203,14 @@ private slots: | |||
203 | flatbuffers::FlatBufferBuilder entityFbb; | 203 | flatbuffers::FlatBufferBuilder entityFbb; |
204 | auto command = createEntityCommand(createEvent(entityFbb)); | 204 | auto command = createEntityCommand(createEvent(entityFbb)); |
205 | 205 | ||
206 | Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); | 206 | Sink::Pipeline pipeline("sink.pipelinetest.instance1"); |
207 | pipeline.setResourceType("test"); | 207 | pipeline.setResourceType("test"); |
208 | 208 | ||
209 | pipeline.startTransaction(); | 209 | pipeline.startTransaction(); |
210 | pipeline.newEntity(command.constData(), command.size()); | 210 | pipeline.newEntity(command.constData(), command.size()); |
211 | pipeline.commit(); | 211 | pipeline.commit(); |
212 | 212 | ||
213 | auto result = getKeys("org.kde.pipelinetest.instance1", "event.main"); | 213 | auto result = getKeys("sink.pipelinetest.instance1", "event.main"); |
214 | qDebug() << result; | 214 | qDebug() << result; |
215 | QCOMPARE(result.size(), 1); | 215 | QCOMPARE(result.size(), 1); |
216 | } | 216 | } |
@@ -220,7 +220,7 @@ private slots: | |||
220 | flatbuffers::FlatBufferBuilder entityFbb; | 220 | flatbuffers::FlatBufferBuilder entityFbb; |
221 | auto command = createEntityCommand(createEvent(entityFbb, "summary", "description")); | 221 | auto command = createEntityCommand(createEvent(entityFbb, "summary", "description")); |
222 | 222 | ||
223 | Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); | 223 | Sink::Pipeline pipeline("sink.pipelinetest.instance1"); |
224 | pipeline.setResourceType("test"); | 224 | pipeline.setResourceType("test"); |
225 | 225 | ||
226 | auto adaptorFactory = QSharedPointer<TestEventAdaptorFactory>::create(); | 226 | auto adaptorFactory = QSharedPointer<TestEventAdaptorFactory>::create(); |
@@ -231,7 +231,7 @@ private slots: | |||
231 | pipeline.commit(); | 231 | pipeline.commit(); |
232 | 232 | ||
233 | // Get uid of written entity | 233 | // Get uid of written entity |
234 | auto keys = getKeys("org.kde.pipelinetest.instance1", "event.main"); | 234 | auto keys = getKeys("sink.pipelinetest.instance1", "event.main"); |
235 | QCOMPARE(keys.size(), 1); | 235 | QCOMPARE(keys.size(), 1); |
236 | const auto key = keys.first(); | 236 | const auto key = keys.first(); |
237 | const auto uid = Sink::Storage::uidFromKey(key); | 237 | const auto uid = Sink::Storage::uidFromKey(key); |
@@ -244,7 +244,7 @@ private slots: | |||
244 | pipeline.commit(); | 244 | pipeline.commit(); |
245 | 245 | ||
246 | // Ensure we've got the new revision with the modification | 246 | // Ensure we've got the new revision with the modification |
247 | auto buffer = getEntity("org.kde.pipelinetest.instance1", "event.main", Sink::Storage::assembleKey(uid, 2)); | 247 | auto buffer = getEntity("sink.pipelinetest.instance1", "event.main", Sink::Storage::assembleKey(uid, 2)); |
248 | QVERIFY(!buffer.isEmpty()); | 248 | QVERIFY(!buffer.isEmpty()); |
249 | Sink::EntityBuffer entityBuffer(buffer.data(), buffer.size()); | 249 | Sink::EntityBuffer entityBuffer(buffer.data(), buffer.size()); |
250 | auto adaptor = adaptorFactory->createAdaptor(entityBuffer.entity()); | 250 | auto adaptor = adaptorFactory->createAdaptor(entityBuffer.entity()); |
@@ -253,7 +253,7 @@ private slots: | |||
253 | QVERIFY2(adaptor->getProperty("description").toString() == QString("description"), "The modification has sideeffects."); | 253 | QVERIFY2(adaptor->getProperty("description").toString() == QString("description"), "The modification has sideeffects."); |
254 | 254 | ||
255 | // Both revisions are in the store at this point | 255 | // Both revisions are in the store at this point |
256 | QCOMPARE(getKeys("org.kde.pipelinetest.instance1", "event.main").size(), 2); | 256 | QCOMPARE(getKeys("sink.pipelinetest.instance1", "event.main").size(), 2); |
257 | 257 | ||
258 | // Cleanup old revisions | 258 | // Cleanup old revisions |
259 | pipeline.startTransaction(); | 259 | pipeline.startTransaction(); |
@@ -261,7 +261,7 @@ private slots: | |||
261 | pipeline.commit(); | 261 | pipeline.commit(); |
262 | 262 | ||
263 | // And now only the latest revision is left | 263 | // And now only the latest revision is left |
264 | QCOMPARE(getKeys("org.kde.pipelinetest.instance1", "event.main").size(), 1); | 264 | QCOMPARE(getKeys("sink.pipelinetest.instance1", "event.main").size(), 1); |
265 | } | 265 | } |
266 | 266 | ||
267 | void testModifyWithUnrelatedOperationInbetween() | 267 | void testModifyWithUnrelatedOperationInbetween() |
@@ -269,7 +269,7 @@ private slots: | |||
269 | flatbuffers::FlatBufferBuilder entityFbb; | 269 | flatbuffers::FlatBufferBuilder entityFbb; |
270 | auto command = createEntityCommand(createEvent(entityFbb)); | 270 | auto command = createEntityCommand(createEvent(entityFbb)); |
271 | 271 | ||
272 | Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); | 272 | Sink::Pipeline pipeline("sink.pipelinetest.instance1"); |
273 | pipeline.setResourceType("test"); | 273 | pipeline.setResourceType("test"); |
274 | 274 | ||
275 | auto adaptorFactory = QSharedPointer<TestEventAdaptorFactory>::create(); | 275 | auto adaptorFactory = QSharedPointer<TestEventAdaptorFactory>::create(); |
@@ -280,7 +280,7 @@ private slots: | |||
280 | pipeline.commit(); | 280 | pipeline.commit(); |
281 | 281 | ||
282 | // Get uid of written entity | 282 | // Get uid of written entity |
283 | auto keys = getKeys("org.kde.pipelinetest.instance1", "event.main"); | 283 | auto keys = getKeys("sink.pipelinetest.instance1", "event.main"); |
284 | QCOMPARE(keys.size(), 1); | 284 | QCOMPARE(keys.size(), 1); |
285 | const auto uid = Sink::Storage::uidFromKey(keys.first()); | 285 | const auto uid = Sink::Storage::uidFromKey(keys.first()); |
286 | 286 | ||
@@ -302,7 +302,7 @@ private slots: | |||
302 | pipeline.commit(); | 302 | pipeline.commit(); |
303 | 303 | ||
304 | // Ensure we've got the new revision with the modification | 304 | // Ensure we've got the new revision with the modification |
305 | auto buffer = getEntity("org.kde.pipelinetest.instance1", "event.main", Sink::Storage::assembleKey(uid, 3)); | 305 | auto buffer = getEntity("sink.pipelinetest.instance1", "event.main", Sink::Storage::assembleKey(uid, 3)); |
306 | QVERIFY(!buffer.isEmpty()); | 306 | QVERIFY(!buffer.isEmpty()); |
307 | Sink::EntityBuffer entityBuffer(buffer.data(), buffer.size()); | 307 | Sink::EntityBuffer entityBuffer(buffer.data(), buffer.size()); |
308 | auto adaptor = adaptorFactory->createAdaptor(entityBuffer.entity()); | 308 | auto adaptor = adaptorFactory->createAdaptor(entityBuffer.entity()); |
@@ -313,7 +313,7 @@ private slots: | |||
313 | { | 313 | { |
314 | flatbuffers::FlatBufferBuilder entityFbb; | 314 | flatbuffers::FlatBufferBuilder entityFbb; |
315 | auto command = createEntityCommand(createEvent(entityFbb)); | 315 | auto command = createEntityCommand(createEvent(entityFbb)); |
316 | Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); | 316 | Sink::Pipeline pipeline("sink.pipelinetest.instance1"); |
317 | pipeline.setResourceType("test"); | 317 | pipeline.setResourceType("test"); |
318 | 318 | ||
319 | // Create the initial revision | 319 | // Create the initial revision |
@@ -321,7 +321,7 @@ private slots: | |||
321 | pipeline.newEntity(command.constData(), command.size()); | 321 | pipeline.newEntity(command.constData(), command.size()); |
322 | pipeline.commit(); | 322 | pipeline.commit(); |
323 | 323 | ||
324 | auto result = getKeys("org.kde.pipelinetest.instance1", "event.main"); | 324 | auto result = getKeys("sink.pipelinetest.instance1", "event.main"); |
325 | QCOMPARE(result.size(), 1); | 325 | QCOMPARE(result.size(), 1); |
326 | 326 | ||
327 | const auto uid = Sink::Storage::uidFromKey(result.first()); | 327 | const auto uid = Sink::Storage::uidFromKey(result.first()); |
@@ -333,7 +333,7 @@ private slots: | |||
333 | pipeline.commit(); | 333 | pipeline.commit(); |
334 | 334 | ||
335 | // We have a new revision that indicates the deletion | 335 | // We have a new revision that indicates the deletion |
336 | QCOMPARE(getKeys("org.kde.pipelinetest.instance1", "event.main").size(), 2); | 336 | QCOMPARE(getKeys("sink.pipelinetest.instance1", "event.main").size(), 2); |
337 | 337 | ||
338 | // Cleanup old revisions | 338 | // Cleanup old revisions |
339 | pipeline.startTransaction(); | 339 | pipeline.startTransaction(); |
@@ -341,7 +341,7 @@ private slots: | |||
341 | pipeline.commit(); | 341 | pipeline.commit(); |
342 | 342 | ||
343 | // And all revisions are gone | 343 | // And all revisions are gone |
344 | QCOMPARE(getKeys("org.kde.pipelinetest.instance1", "event.main").size(), 0); | 344 | QCOMPARE(getKeys("sink.pipelinetest.instance1", "event.main").size(), 0); |
345 | } | 345 | } |
346 | 346 | ||
347 | void testPreprocessor() | 347 | void testPreprocessor() |
@@ -350,7 +350,7 @@ private slots: | |||
350 | 350 | ||
351 | auto testProcessor = new TestProcessor; | 351 | auto testProcessor = new TestProcessor; |
352 | 352 | ||
353 | Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); | 353 | Sink::Pipeline pipeline("sink.pipelinetest.instance1"); |
354 | pipeline.setResourceType("test"); | 354 | pipeline.setResourceType("test"); |
355 | pipeline.setPreprocessors("event", QVector<Sink::Preprocessor *>() << testProcessor); | 355 | pipeline.setPreprocessors("event", QVector<Sink::Preprocessor *>() << testProcessor); |
356 | pipeline.startTransaction(); | 356 | pipeline.startTransaction(); |
@@ -368,7 +368,7 @@ private slots: | |||
368 | pipeline.commit(); | 368 | pipeline.commit(); |
369 | entityFbb.Clear(); | 369 | entityFbb.Clear(); |
370 | pipeline.startTransaction(); | 370 | pipeline.startTransaction(); |
371 | auto keys = getKeys("org.kde.pipelinetest.instance1", "event.main"); | 371 | auto keys = getKeys("sink.pipelinetest.instance1", "event.main"); |
372 | QCOMPARE(keys.size(), 1); | 372 | QCOMPARE(keys.size(), 1); |
373 | const auto uid = Sink::Storage::uidFromKey(keys.first()); | 373 | const auto uid = Sink::Storage::uidFromKey(keys.first()); |
374 | { | 374 | { |