diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-01-20 19:07:07 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-01-20 19:07:07 +0100 |
commit | bdb01c2c068df326f5a8328ed1492ab1bea388c5 (patch) | |
tree | 25c2ee1b29bc481b6914c244ed9ca194b1415d16 /tests/pipelinetest.cpp | |
parent | 17e7ee40c9185c0505883853345fd6024c675b1a (diff) | |
download | sink-bdb01c2c068df326f5a8328ed1492ab1bea388c5.tar.gz sink-bdb01c2c068df326f5a8328ed1492ab1bea388c5.zip |
Renamed Akonadi2 to Sink
(except for documentation).
Diffstat (limited to 'tests/pipelinetest.cpp')
-rw-r--r-- | tests/pipelinetest.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/tests/pipelinetest.cpp b/tests/pipelinetest.cpp index f0fd1a4..c74d319 100644 --- a/tests/pipelinetest.cpp +++ b/tests/pipelinetest.cpp | |||
@@ -22,14 +22,14 @@ | |||
22 | 22 | ||
23 | static void removeFromDisk(const QString &name) | 23 | static void removeFromDisk(const QString &name) |
24 | { | 24 | { |
25 | Akonadi2::Storage store(Akonadi2::Store::storageLocation(), name, Akonadi2::Storage::ReadWrite); | 25 | Sink::Storage store(Sink::Store::storageLocation(), name, Sink::Storage::ReadWrite); |
26 | store.removeFromDisk(); | 26 | store.removeFromDisk(); |
27 | } | 27 | } |
28 | 28 | ||
29 | static QList<QByteArray> getKeys(const QByteArray &dbEnv, const QByteArray &name) | 29 | static QList<QByteArray> getKeys(const QByteArray &dbEnv, const QByteArray &name) |
30 | { | 30 | { |
31 | Akonadi2::Storage store(Akonadi2::storageLocation(), dbEnv, Akonadi2::Storage::ReadOnly); | 31 | Sink::Storage store(Sink::storageLocation(), dbEnv, Sink::Storage::ReadOnly); |
32 | auto transaction = store.createTransaction(Akonadi2::Storage::ReadOnly); | 32 | auto transaction = store.createTransaction(Sink::Storage::ReadOnly); |
33 | auto db = transaction.openDatabase(name, nullptr, false); | 33 | auto db = transaction.openDatabase(name, nullptr, false); |
34 | QList<QByteArray> result; | 34 | QList<QByteArray> result; |
35 | db.scan("", [&](const QByteArray &key, const QByteArray &value) { | 35 | db.scan("", [&](const QByteArray &key, const QByteArray &value) { |
@@ -41,8 +41,8 @@ static QList<QByteArray> getKeys(const QByteArray &dbEnv, const QByteArray &name | |||
41 | 41 | ||
42 | static QByteArray getEntity(const QByteArray &dbEnv, const QByteArray &name, const QByteArray &uid) | 42 | static QByteArray getEntity(const QByteArray &dbEnv, const QByteArray &name, const QByteArray &uid) |
43 | { | 43 | { |
44 | Akonadi2::Storage store(Akonadi2::storageLocation(), dbEnv, Akonadi2::Storage::ReadOnly); | 44 | Sink::Storage store(Sink::storageLocation(), dbEnv, Sink::Storage::ReadOnly); |
45 | auto transaction = store.createTransaction(Akonadi2::Storage::ReadOnly); | 45 | auto transaction = store.createTransaction(Sink::Storage::ReadOnly); |
46 | auto db = transaction.openDatabase(name, nullptr, false); | 46 | auto db = transaction.openDatabase(name, nullptr, false); |
47 | QByteArray result; | 47 | QByteArray result; |
48 | db.scan(uid, [&](const QByteArray &key, const QByteArray &value) { | 48 | db.scan(uid, [&](const QByteArray &key, const QByteArray &value) { |
@@ -57,41 +57,41 @@ flatbuffers::FlatBufferBuilder &createEvent(flatbuffers::FlatBufferBuilder &enti | |||
57 | flatbuffers::FlatBufferBuilder eventFbb; | 57 | flatbuffers::FlatBufferBuilder eventFbb; |
58 | eventFbb.Clear(); | 58 | eventFbb.Clear(); |
59 | { | 59 | { |
60 | Akonadi2::ApplicationDomain::Buffer::EventBuilder eventBuilder(eventFbb); | 60 | Sink::ApplicationDomain::Buffer::EventBuilder eventBuilder(eventFbb); |
61 | auto eventLocation = eventBuilder.Finish(); | 61 | auto eventLocation = eventBuilder.Finish(); |
62 | Akonadi2::ApplicationDomain::Buffer::FinishEventBuffer(eventFbb, eventLocation); | 62 | Sink::ApplicationDomain::Buffer::FinishEventBuffer(eventFbb, eventLocation); |
63 | } | 63 | } |
64 | 64 | ||
65 | flatbuffers::FlatBufferBuilder localFbb; | 65 | flatbuffers::FlatBufferBuilder localFbb; |
66 | { | 66 | { |
67 | auto uid = localFbb.CreateString("testuid"); | 67 | auto uid = localFbb.CreateString("testuid"); |
68 | auto summary = localFbb.CreateString(s.toStdString()); | 68 | auto summary = localFbb.CreateString(s.toStdString()); |
69 | auto localBuilder = Akonadi2::ApplicationDomain::Buffer::EventBuilder(localFbb); | 69 | auto localBuilder = Sink::ApplicationDomain::Buffer::EventBuilder(localFbb); |
70 | localBuilder.add_uid(uid); | 70 | localBuilder.add_uid(uid); |
71 | localBuilder.add_summary(summary); | 71 | localBuilder.add_summary(summary); |
72 | auto location = localBuilder.Finish(); | 72 | auto location = localBuilder.Finish(); |
73 | Akonadi2::ApplicationDomain::Buffer::FinishEventBuffer(localFbb, location); | 73 | Sink::ApplicationDomain::Buffer::FinishEventBuffer(localFbb, location); |
74 | } | 74 | } |
75 | 75 | ||
76 | Akonadi2::EntityBuffer::assembleEntityBuffer(entityFbb, 0, 0, eventFbb.GetBufferPointer(), eventFbb.GetSize(), localFbb.GetBufferPointer(), localFbb.GetSize()); | 76 | Sink::EntityBuffer::assembleEntityBuffer(entityFbb, 0, 0, eventFbb.GetBufferPointer(), eventFbb.GetSize(), localFbb.GetBufferPointer(), localFbb.GetSize()); |
77 | return entityFbb; | 77 | return entityFbb; |
78 | } | 78 | } |
79 | 79 | ||
80 | QByteArray createEntityCommand(const flatbuffers::FlatBufferBuilder &entityFbb) | 80 | QByteArray createEntityCommand(const flatbuffers::FlatBufferBuilder &entityFbb) |
81 | { | 81 | { |
82 | flatbuffers::FlatBufferBuilder fbb; | 82 | flatbuffers::FlatBufferBuilder fbb; |
83 | auto type = fbb.CreateString(Akonadi2::ApplicationDomain::getTypeName<Akonadi2::ApplicationDomain::Event>().toStdString().data()); | 83 | auto type = fbb.CreateString(Sink::ApplicationDomain::getTypeName<Sink::ApplicationDomain::Event>().toStdString().data()); |
84 | auto delta = fbb.CreateVector<uint8_t>(entityFbb.GetBufferPointer(), entityFbb.GetSize()); | 84 | auto delta = fbb.CreateVector<uint8_t>(entityFbb.GetBufferPointer(), entityFbb.GetSize()); |
85 | Akonadi2::Commands::CreateEntityBuilder builder(fbb); | 85 | Sink::Commands::CreateEntityBuilder builder(fbb); |
86 | builder.add_domainType(type); | 86 | builder.add_domainType(type); |
87 | builder.add_delta(delta); | 87 | builder.add_delta(delta); |
88 | auto location = builder.Finish(); | 88 | auto location = builder.Finish(); |
89 | Akonadi2::Commands::FinishCreateEntityBuffer(fbb, location); | 89 | Sink::Commands::FinishCreateEntityBuffer(fbb, location); |
90 | 90 | ||
91 | const QByteArray command(reinterpret_cast<const char *>(fbb.GetBufferPointer()), fbb.GetSize()); | 91 | const QByteArray command(reinterpret_cast<const char *>(fbb.GetBufferPointer()), fbb.GetSize()); |
92 | { | 92 | { |
93 | flatbuffers::Verifier verifyer(reinterpret_cast<const uint8_t *>(command.data()), command.size()); | 93 | flatbuffers::Verifier verifyer(reinterpret_cast<const uint8_t *>(command.data()), command.size()); |
94 | Q_ASSERT(Akonadi2::Commands::VerifyCreateEntityBuffer(verifyer)); | 94 | Q_ASSERT(Sink::Commands::VerifyCreateEntityBuffer(verifyer)); |
95 | } | 95 | } |
96 | return command; | 96 | return command; |
97 | } | 97 | } |
@@ -99,22 +99,22 @@ QByteArray createEntityCommand(const flatbuffers::FlatBufferBuilder &entityFbb) | |||
99 | QByteArray modifyEntityCommand(const flatbuffers::FlatBufferBuilder &entityFbb, const QByteArray &uid, qint64 revision) | 99 | QByteArray modifyEntityCommand(const flatbuffers::FlatBufferBuilder &entityFbb, const QByteArray &uid, qint64 revision) |
100 | { | 100 | { |
101 | flatbuffers::FlatBufferBuilder fbb; | 101 | flatbuffers::FlatBufferBuilder fbb; |
102 | auto type = fbb.CreateString(Akonadi2::ApplicationDomain::getTypeName<Akonadi2::ApplicationDomain::Event>().toStdString().data()); | 102 | auto type = fbb.CreateString(Sink::ApplicationDomain::getTypeName<Sink::ApplicationDomain::Event>().toStdString().data()); |
103 | auto id = fbb.CreateString(std::string(uid.constData(), uid.size())); | 103 | auto id = fbb.CreateString(std::string(uid.constData(), uid.size())); |
104 | auto delta = fbb.CreateVector<uint8_t>(entityFbb.GetBufferPointer(), entityFbb.GetSize()); | 104 | auto delta = fbb.CreateVector<uint8_t>(entityFbb.GetBufferPointer(), entityFbb.GetSize()); |
105 | // auto delta = Akonadi2::EntityBuffer::appendAsVector(fbb, buffer.constData(), buffer.size()); | 105 | // auto delta = Sink::EntityBuffer::appendAsVector(fbb, buffer.constData(), buffer.size()); |
106 | Akonadi2::Commands::ModifyEntityBuilder builder(fbb); | 106 | Sink::Commands::ModifyEntityBuilder builder(fbb); |
107 | builder.add_domainType(type); | 107 | builder.add_domainType(type); |
108 | builder.add_delta(delta); | 108 | builder.add_delta(delta); |
109 | builder.add_revision(revision); | 109 | builder.add_revision(revision); |
110 | builder.add_entityId(id); | 110 | builder.add_entityId(id); |
111 | auto location = builder.Finish(); | 111 | auto location = builder.Finish(); |
112 | Akonadi2::Commands::FinishModifyEntityBuffer(fbb, location); | 112 | Sink::Commands::FinishModifyEntityBuffer(fbb, location); |
113 | 113 | ||
114 | const QByteArray command(reinterpret_cast<const char *>(fbb.GetBufferPointer()), fbb.GetSize()); | 114 | const QByteArray command(reinterpret_cast<const char *>(fbb.GetBufferPointer()), fbb.GetSize()); |
115 | { | 115 | { |
116 | flatbuffers::Verifier verifyer(reinterpret_cast<const uint8_t *>(command.data()), command.size()); | 116 | flatbuffers::Verifier verifyer(reinterpret_cast<const uint8_t *>(command.data()), command.size()); |
117 | Q_ASSERT(Akonadi2::Commands::VerifyCreateEntityBuffer(verifyer)); | 117 | Q_ASSERT(Sink::Commands::VerifyCreateEntityBuffer(verifyer)); |
118 | } | 118 | } |
119 | return command; | 119 | return command; |
120 | } | 120 | } |
@@ -122,38 +122,38 @@ QByteArray modifyEntityCommand(const flatbuffers::FlatBufferBuilder &entityFbb, | |||
122 | QByteArray deleteEntityCommand(const QByteArray &uid, qint64 revision) | 122 | QByteArray deleteEntityCommand(const QByteArray &uid, qint64 revision) |
123 | { | 123 | { |
124 | flatbuffers::FlatBufferBuilder fbb; | 124 | flatbuffers::FlatBufferBuilder fbb; |
125 | auto type = fbb.CreateString(Akonadi2::ApplicationDomain::getTypeName<Akonadi2::ApplicationDomain::Event>().toStdString().data()); | 125 | auto type = fbb.CreateString(Sink::ApplicationDomain::getTypeName<Sink::ApplicationDomain::Event>().toStdString().data()); |
126 | auto id = fbb.CreateString(std::string(uid.constData(), uid.size())); | 126 | auto id = fbb.CreateString(std::string(uid.constData(), uid.size())); |
127 | Akonadi2::Commands::DeleteEntityBuilder builder(fbb); | 127 | Sink::Commands::DeleteEntityBuilder builder(fbb); |
128 | builder.add_domainType(type); | 128 | builder.add_domainType(type); |
129 | builder.add_revision(revision); | 129 | builder.add_revision(revision); |
130 | builder.add_entityId(id); | 130 | builder.add_entityId(id); |
131 | auto location = builder.Finish(); | 131 | auto location = builder.Finish(); |
132 | Akonadi2::Commands::FinishDeleteEntityBuffer(fbb, location); | 132 | Sink::Commands::FinishDeleteEntityBuffer(fbb, location); |
133 | 133 | ||
134 | const QByteArray command(reinterpret_cast<const char *>(fbb.GetBufferPointer()), fbb.GetSize()); | 134 | const QByteArray command(reinterpret_cast<const char *>(fbb.GetBufferPointer()), fbb.GetSize()); |
135 | { | 135 | { |
136 | flatbuffers::Verifier verifyer(reinterpret_cast<const uint8_t *>(command.data()), command.size()); | 136 | flatbuffers::Verifier verifyer(reinterpret_cast<const uint8_t *>(command.data()), command.size()); |
137 | Q_ASSERT(Akonadi2::Commands::VerifyDeleteEntityBuffer(verifyer)); | 137 | Q_ASSERT(Sink::Commands::VerifyDeleteEntityBuffer(verifyer)); |
138 | } | 138 | } |
139 | return command; | 139 | return command; |
140 | } | 140 | } |
141 | 141 | ||
142 | class TestProcessor : public Akonadi2::Preprocessor { | 142 | class TestProcessor : public Sink::Preprocessor { |
143 | public: | 143 | public: |
144 | void newEntity(const QByteArray &uid, qint64 revision, const Akonadi2::ApplicationDomain::BufferAdaptor &newEntity, Akonadi2::Storage::Transaction &transaction) Q_DECL_OVERRIDE | 144 | void newEntity(const QByteArray &uid, qint64 revision, const Sink::ApplicationDomain::BufferAdaptor &newEntity, Sink::Storage::Transaction &transaction) Q_DECL_OVERRIDE |
145 | { | 145 | { |
146 | newUids << uid; | 146 | newUids << uid; |
147 | newRevisions << revision; | 147 | newRevisions << revision; |
148 | } | 148 | } |
149 | 149 | ||
150 | void modifiedEntity(const QByteArray &uid, qint64 revision, const Akonadi2::ApplicationDomain::BufferAdaptor &oldEntity, const Akonadi2::ApplicationDomain::BufferAdaptor &newEntity, Akonadi2::Storage::Transaction &transaction) Q_DECL_OVERRIDE | 150 | void modifiedEntity(const QByteArray &uid, qint64 revision, const Sink::ApplicationDomain::BufferAdaptor &oldEntity, const Sink::ApplicationDomain::BufferAdaptor &newEntity, Sink::Storage::Transaction &transaction) Q_DECL_OVERRIDE |
151 | { | 151 | { |
152 | modifiedUids << uid; | 152 | modifiedUids << uid; |
153 | modifiedRevisions << revision; | 153 | modifiedRevisions << revision; |
154 | } | 154 | } |
155 | 155 | ||
156 | void deletedEntity(const QByteArray &uid, qint64 revision, const Akonadi2::ApplicationDomain::BufferAdaptor &oldEntity, Akonadi2::Storage::Transaction &transaction) Q_DECL_OVERRIDE | 156 | void deletedEntity(const QByteArray &uid, qint64 revision, const Sink::ApplicationDomain::BufferAdaptor &oldEntity, Sink::Storage::Transaction &transaction) Q_DECL_OVERRIDE |
157 | { | 157 | { |
158 | deletedUids << uid; | 158 | deletedUids << uid; |
159 | deletedRevisions << revision; | 159 | deletedRevisions << revision; |
@@ -178,7 +178,7 @@ class PipelineTest : public QObject | |||
178 | private Q_SLOTS: | 178 | private Q_SLOTS: |
179 | void initTestCase() | 179 | void initTestCase() |
180 | { | 180 | { |
181 | Akonadi2::Log::setDebugOutputLevel(Akonadi2::Log::Trace); | 181 | Sink::Log::setDebugOutputLevel(Sink::Log::Trace); |
182 | } | 182 | } |
183 | 183 | ||
184 | void init() | 184 | void init() |
@@ -191,7 +191,7 @@ private Q_SLOTS: | |||
191 | flatbuffers::FlatBufferBuilder entityFbb; | 191 | flatbuffers::FlatBufferBuilder entityFbb; |
192 | auto command = createEntityCommand(createEvent(entityFbb)); | 192 | auto command = createEntityCommand(createEvent(entityFbb)); |
193 | 193 | ||
194 | Akonadi2::Pipeline pipeline("org.kde.pipelinetest.instance1"); | 194 | Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); |
195 | pipeline.startTransaction(); | 195 | pipeline.startTransaction(); |
196 | pipeline.newEntity(command.constData(), command.size()); | 196 | pipeline.newEntity(command.constData(), command.size()); |
197 | pipeline.commit(); | 197 | pipeline.commit(); |
@@ -205,7 +205,7 @@ private Q_SLOTS: | |||
205 | flatbuffers::FlatBufferBuilder entityFbb; | 205 | flatbuffers::FlatBufferBuilder entityFbb; |
206 | auto command = createEntityCommand(createEvent(entityFbb)); | 206 | auto command = createEntityCommand(createEvent(entityFbb)); |
207 | 207 | ||
208 | Akonadi2::Pipeline pipeline("org.kde.pipelinetest.instance1"); | 208 | Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); |
209 | 209 | ||
210 | auto adaptorFactory = QSharedPointer<TestEventAdaptorFactory>::create(); | 210 | auto adaptorFactory = QSharedPointer<TestEventAdaptorFactory>::create(); |
211 | pipeline.setAdaptorFactory("event", adaptorFactory); | 211 | pipeline.setAdaptorFactory("event", adaptorFactory); |
@@ -219,7 +219,7 @@ private Q_SLOTS: | |||
219 | auto keys = getKeys("org.kde.pipelinetest.instance1", "event.main"); | 219 | auto keys = getKeys("org.kde.pipelinetest.instance1", "event.main"); |
220 | QCOMPARE(keys.size(), 1); | 220 | QCOMPARE(keys.size(), 1); |
221 | const auto key = keys.first(); | 221 | const auto key = keys.first(); |
222 | const auto uid = Akonadi2::Storage::uidFromKey(key); | 222 | const auto uid = Sink::Storage::uidFromKey(key); |
223 | 223 | ||
224 | //Execute the modification | 224 | //Execute the modification |
225 | entityFbb.Clear(); | 225 | entityFbb.Clear(); |
@@ -229,9 +229,9 @@ private Q_SLOTS: | |||
229 | pipeline.commit(); | 229 | pipeline.commit(); |
230 | 230 | ||
231 | //Ensure we've got the new revision with the modification | 231 | //Ensure we've got the new revision with the modification |
232 | auto buffer = getEntity("org.kde.pipelinetest.instance1", "event.main", Akonadi2::Storage::assembleKey(uid, 2)); | 232 | auto buffer = getEntity("org.kde.pipelinetest.instance1", "event.main", Sink::Storage::assembleKey(uid, 2)); |
233 | QVERIFY(!buffer.isEmpty()); | 233 | QVERIFY(!buffer.isEmpty()); |
234 | Akonadi2::EntityBuffer entityBuffer(buffer.data(), buffer.size()); | 234 | Sink::EntityBuffer entityBuffer(buffer.data(), buffer.size()); |
235 | auto adaptor = adaptorFactory->createAdaptor(entityBuffer.entity()); | 235 | auto adaptor = adaptorFactory->createAdaptor(entityBuffer.entity()); |
236 | QCOMPARE(adaptor->getProperty("summary").toString(), QString("summary2")); | 236 | QCOMPARE(adaptor->getProperty("summary").toString(), QString("summary2")); |
237 | 237 | ||
@@ -252,7 +252,7 @@ private Q_SLOTS: | |||
252 | flatbuffers::FlatBufferBuilder entityFbb; | 252 | flatbuffers::FlatBufferBuilder entityFbb; |
253 | auto command = createEntityCommand(createEvent(entityFbb)); | 253 | auto command = createEntityCommand(createEvent(entityFbb)); |
254 | 254 | ||
255 | Akonadi2::Pipeline pipeline("org.kde.pipelinetest.instance1"); | 255 | Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); |
256 | 256 | ||
257 | auto adaptorFactory = QSharedPointer<TestEventAdaptorFactory>::create(); | 257 | auto adaptorFactory = QSharedPointer<TestEventAdaptorFactory>::create(); |
258 | pipeline.setAdaptorFactory("event", adaptorFactory); | 258 | pipeline.setAdaptorFactory("event", adaptorFactory); |
@@ -265,7 +265,7 @@ private Q_SLOTS: | |||
265 | //Get uid of written entity | 265 | //Get uid of written entity |
266 | auto keys = getKeys("org.kde.pipelinetest.instance1", "event.main"); | 266 | auto keys = getKeys("org.kde.pipelinetest.instance1", "event.main"); |
267 | QCOMPARE(keys.size(), 1); | 267 | QCOMPARE(keys.size(), 1); |
268 | const auto uid = Akonadi2::Storage::uidFromKey(keys.first()); | 268 | const auto uid = Sink::Storage::uidFromKey(keys.first()); |
269 | 269 | ||
270 | 270 | ||
271 | //Create another operation inbetween | 271 | //Create another operation inbetween |
@@ -285,9 +285,9 @@ private Q_SLOTS: | |||
285 | pipeline.commit(); | 285 | pipeline.commit(); |
286 | 286 | ||
287 | //Ensure we've got the new revision with the modification | 287 | //Ensure we've got the new revision with the modification |
288 | auto buffer = getEntity("org.kde.pipelinetest.instance1", "event.main", Akonadi2::Storage::assembleKey(uid, 3)); | 288 | auto buffer = getEntity("org.kde.pipelinetest.instance1", "event.main", Sink::Storage::assembleKey(uid, 3)); |
289 | QVERIFY(!buffer.isEmpty()); | 289 | QVERIFY(!buffer.isEmpty()); |
290 | Akonadi2::EntityBuffer entityBuffer(buffer.data(), buffer.size()); | 290 | Sink::EntityBuffer entityBuffer(buffer.data(), buffer.size()); |
291 | auto adaptor = adaptorFactory->createAdaptor(entityBuffer.entity()); | 291 | auto adaptor = adaptorFactory->createAdaptor(entityBuffer.entity()); |
292 | QCOMPARE(adaptor->getProperty("summary").toString(), QString("summary2")); | 292 | QCOMPARE(adaptor->getProperty("summary").toString(), QString("summary2")); |
293 | } | 293 | } |
@@ -296,7 +296,7 @@ private Q_SLOTS: | |||
296 | { | 296 | { |
297 | flatbuffers::FlatBufferBuilder entityFbb; | 297 | flatbuffers::FlatBufferBuilder entityFbb; |
298 | auto command = createEntityCommand(createEvent(entityFbb)); | 298 | auto command = createEntityCommand(createEvent(entityFbb)); |
299 | Akonadi2::Pipeline pipeline("org.kde.pipelinetest.instance1"); | 299 | Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); |
300 | pipeline.setAdaptorFactory("event", QSharedPointer<TestEventAdaptorFactory>::create()); | 300 | pipeline.setAdaptorFactory("event", QSharedPointer<TestEventAdaptorFactory>::create()); |
301 | 301 | ||
302 | //Create the initial revision | 302 | //Create the initial revision |
@@ -307,7 +307,7 @@ private Q_SLOTS: | |||
307 | auto result = getKeys("org.kde.pipelinetest.instance1", "event.main"); | 307 | auto result = getKeys("org.kde.pipelinetest.instance1", "event.main"); |
308 | QCOMPARE(result.size(), 1); | 308 | QCOMPARE(result.size(), 1); |
309 | 309 | ||
310 | const auto uid = Akonadi2::Storage::uidFromKey(result.first()); | 310 | const auto uid = Sink::Storage::uidFromKey(result.first()); |
311 | 311 | ||
312 | //Delete entity | 312 | //Delete entity |
313 | auto deleteCommand = deleteEntityCommand(uid, 1); | 313 | auto deleteCommand = deleteEntityCommand(uid, 1); |
@@ -333,8 +333,8 @@ private Q_SLOTS: | |||
333 | 333 | ||
334 | TestProcessor testProcessor; | 334 | TestProcessor testProcessor; |
335 | 335 | ||
336 | Akonadi2::Pipeline pipeline("org.kde.pipelinetest.instance1"); | 336 | Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); |
337 | pipeline.setPreprocessors("event", QVector<Akonadi2::Preprocessor*>() << &testProcessor); | 337 | pipeline.setPreprocessors("event", QVector<Sink::Preprocessor*>() << &testProcessor); |
338 | pipeline.startTransaction(); | 338 | pipeline.startTransaction(); |
339 | pipeline.setAdaptorFactory("event", QSharedPointer<TestEventAdaptorFactory>::create()); | 339 | pipeline.setAdaptorFactory("event", QSharedPointer<TestEventAdaptorFactory>::create()); |
340 | 340 | ||
@@ -345,21 +345,21 @@ private Q_SLOTS: | |||
345 | QCOMPARE(testProcessor.newUids.size(), 1); | 345 | QCOMPARE(testProcessor.newUids.size(), 1); |
346 | QCOMPARE(testProcessor.newRevisions.size(), 1); | 346 | QCOMPARE(testProcessor.newRevisions.size(), 1); |
347 | //Key doesn't contain revision and is just the uid | 347 | //Key doesn't contain revision and is just the uid |
348 | QCOMPARE(testProcessor.newUids.at(0), Akonadi2::Storage::uidFromKey(testProcessor.newUids.at(0))); | 348 | QCOMPARE(testProcessor.newUids.at(0), Sink::Storage::uidFromKey(testProcessor.newUids.at(0))); |
349 | } | 349 | } |
350 | pipeline.commit(); | 350 | pipeline.commit(); |
351 | entityFbb.Clear(); | 351 | entityFbb.Clear(); |
352 | pipeline.startTransaction(); | 352 | pipeline.startTransaction(); |
353 | auto keys = getKeys("org.kde.pipelinetest.instance1", "event.main"); | 353 | auto keys = getKeys("org.kde.pipelinetest.instance1", "event.main"); |
354 | QCOMPARE(keys.size(), 1); | 354 | QCOMPARE(keys.size(), 1); |
355 | const auto uid = Akonadi2::Storage::uidFromKey(keys.first()); | 355 | const auto uid = Sink::Storage::uidFromKey(keys.first()); |
356 | { | 356 | { |
357 | auto modifyCommand = modifyEntityCommand(createEvent(entityFbb, "summary2"), uid, 1); | 357 | auto modifyCommand = modifyEntityCommand(createEvent(entityFbb, "summary2"), uid, 1); |
358 | pipeline.modifiedEntity(modifyCommand.constData(), modifyCommand.size()); | 358 | pipeline.modifiedEntity(modifyCommand.constData(), modifyCommand.size()); |
359 | QCOMPARE(testProcessor.modifiedUids.size(), 1); | 359 | QCOMPARE(testProcessor.modifiedUids.size(), 1); |
360 | QCOMPARE(testProcessor.modifiedRevisions.size(), 1); | 360 | QCOMPARE(testProcessor.modifiedRevisions.size(), 1); |
361 | //Key doesn't contain revision and is just the uid | 361 | //Key doesn't contain revision and is just the uid |
362 | QCOMPARE(testProcessor.modifiedUids.at(0), Akonadi2::Storage::uidFromKey(testProcessor.modifiedUids.at(0))); | 362 | QCOMPARE(testProcessor.modifiedUids.at(0), Sink::Storage::uidFromKey(testProcessor.modifiedUids.at(0))); |
363 | } | 363 | } |
364 | pipeline.commit(); | 364 | pipeline.commit(); |
365 | entityFbb.Clear(); | 365 | entityFbb.Clear(); |
@@ -371,7 +371,7 @@ private Q_SLOTS: | |||
371 | QCOMPARE(testProcessor.deletedUids.size(), 1); | 371 | QCOMPARE(testProcessor.deletedUids.size(), 1); |
372 | QCOMPARE(testProcessor.deletedSummaries.size(), 1); | 372 | QCOMPARE(testProcessor.deletedSummaries.size(), 1); |
373 | //Key doesn't contain revision and is just the uid | 373 | //Key doesn't contain revision and is just the uid |
374 | QCOMPARE(testProcessor.deletedUids.at(0), Akonadi2::Storage::uidFromKey(testProcessor.deletedUids.at(0))); | 374 | QCOMPARE(testProcessor.deletedUids.at(0), Sink::Storage::uidFromKey(testProcessor.deletedUids.at(0))); |
375 | QCOMPARE(testProcessor.deletedSummaries.at(0), QByteArray("summary2")); | 375 | QCOMPARE(testProcessor.deletedSummaries.at(0), QByteArray("summary2")); |
376 | } | 376 | } |
377 | } | 377 | } |