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/dummyresourcetest.cpp | |
parent | 17e7ee40c9185c0505883853345fd6024c675b1a (diff) | |
download | sink-bdb01c2c068df326f5a8328ed1492ab1bea388c5.tar.gz sink-bdb01c2c068df326f5a8328ed1492ab1bea388c5.zip |
Renamed Akonadi2 to Sink
(except for documentation).
Diffstat (limited to 'tests/dummyresourcetest.cpp')
-rw-r--r-- | tests/dummyresourcetest.cpp | 124 |
1 files changed, 62 insertions, 62 deletions
diff --git a/tests/dummyresourcetest.cpp b/tests/dummyresourcetest.cpp index 72a24b6..82c713d 100644 --- a/tests/dummyresourcetest.cpp +++ b/tests/dummyresourcetest.cpp | |||
@@ -22,8 +22,8 @@ class DummyResourceTest : public QObject | |||
22 | private Q_SLOTS: | 22 | private Q_SLOTS: |
23 | void initTestCase() | 23 | void initTestCase() |
24 | { | 24 | { |
25 | Akonadi2::Log::setDebugOutputLevel(Akonadi2::Log::Trace); | 25 | Sink::Log::setDebugOutputLevel(Sink::Log::Trace); |
26 | auto factory = Akonadi2::ResourceFactory::load("org.kde.dummy"); | 26 | auto factory = Sink::ResourceFactory::load("org.kde.dummy"); |
27 | QVERIFY(factory); | 27 | QVERIFY(factory); |
28 | DummyResource::removeFromDisk("org.kde.dummy.instance1"); | 28 | DummyResource::removeFromDisk("org.kde.dummy.instance1"); |
29 | ResourceConfig::addResource("org.kde.dummy.instance1", "org.kde.dummy"); | 29 | ResourceConfig::addResource("org.kde.dummy.instance1", "org.kde.dummy"); |
@@ -31,11 +31,11 @@ private Q_SLOTS: | |||
31 | 31 | ||
32 | void cleanup() | 32 | void cleanup() |
33 | { | 33 | { |
34 | Akonadi2::Store::shutdown(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); | 34 | Sink::Store::shutdown(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); |
35 | DummyResource::removeFromDisk("org.kde.dummy.instance1"); | 35 | DummyResource::removeFromDisk("org.kde.dummy.instance1"); |
36 | auto factory = Akonadi2::ResourceFactory::load("org.kde.dummy"); | 36 | auto factory = Sink::ResourceFactory::load("org.kde.dummy"); |
37 | QVERIFY(factory); | 37 | QVERIFY(factory); |
38 | Akonadi2::Store::start(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); | 38 | Sink::Store::start(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); |
39 | } | 39 | } |
40 | 40 | ||
41 | void init() | 41 | void init() |
@@ -47,54 +47,54 @@ private Q_SLOTS: | |||
47 | 47 | ||
48 | void testProperty() | 48 | void testProperty() |
49 | { | 49 | { |
50 | Akonadi2::ApplicationDomain::Event event; | 50 | Sink::ApplicationDomain::Event event; |
51 | event.setProperty("uid", "testuid"); | 51 | event.setProperty("uid", "testuid"); |
52 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); | 52 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); |
53 | } | 53 | } |
54 | 54 | ||
55 | void testWriteToFacadeAndQueryByUid() | 55 | void testWriteToFacadeAndQueryByUid() |
56 | { | 56 | { |
57 | Akonadi2::ApplicationDomain::Event event("org.kde.dummy.instance1"); | 57 | Sink::ApplicationDomain::Event event("org.kde.dummy.instance1"); |
58 | event.setProperty("uid", "testuid"); | 58 | event.setProperty("uid", "testuid"); |
59 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); | 59 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); |
60 | event.setProperty("summary", "summaryValue"); | 60 | event.setProperty("summary", "summaryValue"); |
61 | Akonadi2::Store::create<Akonadi2::ApplicationDomain::Event>(event).exec().waitForFinished(); | 61 | Sink::Store::create<Sink::ApplicationDomain::Event>(event).exec().waitForFinished(); |
62 | 62 | ||
63 | Akonadi2::Query query; | 63 | Sink::Query query; |
64 | query.resources << "org.kde.dummy.instance1"; | 64 | query.resources << "org.kde.dummy.instance1"; |
65 | 65 | ||
66 | //Ensure all local data is processed | 66 | //Ensure all local data is processed |
67 | Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); | 67 | Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); |
68 | 68 | ||
69 | query.propertyFilter.insert("uid", "testuid"); | 69 | query.propertyFilter.insert("uid", "testuid"); |
70 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Event>(query); | 70 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Event>(query); |
71 | QTRY_COMPARE(model->rowCount(QModelIndex()), 1); | 71 | QTRY_COMPARE(model->rowCount(QModelIndex()), 1); |
72 | auto value = model->index(0, 0, QModelIndex()).data(Akonadi2::Store::DomainObjectRole).value<Akonadi2::ApplicationDomain::Event::Ptr>(); | 72 | auto value = model->index(0, 0, QModelIndex()).data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Event::Ptr>(); |
73 | QCOMPARE(value->getProperty("uid").toByteArray(), QByteArray("testuid")); | 73 | QCOMPARE(value->getProperty("uid").toByteArray(), QByteArray("testuid")); |
74 | } | 74 | } |
75 | 75 | ||
76 | void testWriteToFacadeAndQueryByUid2() | 76 | void testWriteToFacadeAndQueryByUid2() |
77 | { | 77 | { |
78 | Akonadi2::ApplicationDomain::Event event("org.kde.dummy.instance1"); | 78 | Sink::ApplicationDomain::Event event("org.kde.dummy.instance1"); |
79 | event.setProperty("summary", "summaryValue"); | 79 | event.setProperty("summary", "summaryValue"); |
80 | 80 | ||
81 | event.setProperty("uid", "testuid"); | 81 | event.setProperty("uid", "testuid"); |
82 | Akonadi2::Store::create<Akonadi2::ApplicationDomain::Event>(event).exec().waitForFinished(); | 82 | Sink::Store::create<Sink::ApplicationDomain::Event>(event).exec().waitForFinished(); |
83 | 83 | ||
84 | event.setProperty("uid", "testuid2"); | 84 | event.setProperty("uid", "testuid2"); |
85 | Akonadi2::Store::create<Akonadi2::ApplicationDomain::Event>(event).exec().waitForFinished(); | 85 | Sink::Store::create<Sink::ApplicationDomain::Event>(event).exec().waitForFinished(); |
86 | 86 | ||
87 | Akonadi2::Query query; | 87 | Sink::Query query; |
88 | query.resources << "org.kde.dummy.instance1"; | 88 | query.resources << "org.kde.dummy.instance1"; |
89 | 89 | ||
90 | //Ensure all local data is processed | 90 | //Ensure all local data is processed |
91 | Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); | 91 | Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); |
92 | 92 | ||
93 | query.propertyFilter.insert("uid", "testuid"); | 93 | query.propertyFilter.insert("uid", "testuid"); |
94 | 94 | ||
95 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Event>(query); | 95 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Event>(query); |
96 | QTRY_COMPARE(model->rowCount(QModelIndex()), 1); | 96 | QTRY_COMPARE(model->rowCount(QModelIndex()), 1); |
97 | auto value = model->index(0, 0, QModelIndex()).data(Akonadi2::Store::DomainObjectRole).value<Akonadi2::ApplicationDomain::Event::Ptr>(); | 97 | auto value = model->index(0, 0, QModelIndex()).data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Event::Ptr>(); |
98 | 98 | ||
99 | qDebug() << value->getProperty("uid").toByteArray(); | 99 | qDebug() << value->getProperty("uid").toByteArray(); |
100 | QCOMPARE(value->getProperty("uid").toByteArray(), QByteArray("testuid")); | 100 | QCOMPARE(value->getProperty("uid").toByteArray(), QByteArray("testuid")); |
@@ -102,27 +102,27 @@ private Q_SLOTS: | |||
102 | 102 | ||
103 | void testWriteToFacadeAndQueryBySummary() | 103 | void testWriteToFacadeAndQueryBySummary() |
104 | { | 104 | { |
105 | Akonadi2::ApplicationDomain::Event event("org.kde.dummy.instance1"); | 105 | Sink::ApplicationDomain::Event event("org.kde.dummy.instance1"); |
106 | 106 | ||
107 | event.setProperty("uid", "testuid"); | 107 | event.setProperty("uid", "testuid"); |
108 | event.setProperty("summary", "summaryValue1"); | 108 | event.setProperty("summary", "summaryValue1"); |
109 | Akonadi2::Store::create<Akonadi2::ApplicationDomain::Event>(event).exec().waitForFinished(); | 109 | Sink::Store::create<Sink::ApplicationDomain::Event>(event).exec().waitForFinished(); |
110 | 110 | ||
111 | event.setProperty("uid", "testuid2"); | 111 | event.setProperty("uid", "testuid2"); |
112 | event.setProperty("summary", "summaryValue2"); | 112 | event.setProperty("summary", "summaryValue2"); |
113 | Akonadi2::Store::create<Akonadi2::ApplicationDomain::Event>(event).exec().waitForFinished(); | 113 | Sink::Store::create<Sink::ApplicationDomain::Event>(event).exec().waitForFinished(); |
114 | 114 | ||
115 | Akonadi2::Query query; | 115 | Sink::Query query; |
116 | query.resources << "org.kde.dummy.instance1"; | 116 | query.resources << "org.kde.dummy.instance1"; |
117 | 117 | ||
118 | //Ensure all local data is processed | 118 | //Ensure all local data is processed |
119 | Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); | 119 | Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); |
120 | 120 | ||
121 | query.propertyFilter.insert("summary", "summaryValue2"); | 121 | query.propertyFilter.insert("summary", "summaryValue2"); |
122 | 122 | ||
123 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Event>(query); | 123 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Event>(query); |
124 | QTRY_COMPARE(model->rowCount(QModelIndex()), 1); | 124 | QTRY_COMPARE(model->rowCount(QModelIndex()), 1); |
125 | auto value = model->index(0, 0, QModelIndex()).data(Akonadi2::Store::DomainObjectRole).value<Akonadi2::ApplicationDomain::Event::Ptr>(); | 125 | auto value = model->index(0, 0, QModelIndex()).data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Event::Ptr>(); |
126 | 126 | ||
127 | qDebug() << value->getProperty("uid").toByteArray(); | 127 | qDebug() << value->getProperty("uid").toByteArray(); |
128 | QCOMPARE(value->getProperty("uid").toByteArray(), QByteArray("testuid2")); | 128 | QCOMPARE(value->getProperty("uid").toByteArray(), QByteArray("testuid2")); |
@@ -130,7 +130,7 @@ private Q_SLOTS: | |||
130 | 130 | ||
131 | void testResourceSync() | 131 | void testResourceSync() |
132 | { | 132 | { |
133 | auto pipeline = QSharedPointer<Akonadi2::Pipeline>::create("org.kde.dummy.instance1"); | 133 | auto pipeline = QSharedPointer<Sink::Pipeline>::create("org.kde.dummy.instance1"); |
134 | DummyResource resource("org.kde.dummy.instance1", pipeline); | 134 | DummyResource resource("org.kde.dummy.instance1", pipeline); |
135 | auto job = resource.synchronizeWithSource(); | 135 | auto job = resource.synchronizeWithSource(); |
136 | //TODO pass in optional timeout? | 136 | //TODO pass in optional timeout? |
@@ -145,16 +145,16 @@ private Q_SLOTS: | |||
145 | 145 | ||
146 | void testSyncAndFacade() | 146 | void testSyncAndFacade() |
147 | { | 147 | { |
148 | Akonadi2::Query query; | 148 | Sink::Query query; |
149 | query.resources << "org.kde.dummy.instance1"; | 149 | query.resources << "org.kde.dummy.instance1"; |
150 | 150 | ||
151 | //Ensure all local data is processed | 151 | //Ensure all local data is processed |
152 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | 152 | Sink::Store::synchronize(query).exec().waitForFinished(); |
153 | Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); | 153 | Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); |
154 | 154 | ||
155 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Event>(query); | 155 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Event>(query); |
156 | QTRY_VERIFY(model->rowCount(QModelIndex()) >= 1); | 156 | QTRY_VERIFY(model->rowCount(QModelIndex()) >= 1); |
157 | auto value = model->index(0, 0, QModelIndex()).data(Akonadi2::Store::DomainObjectRole).value<Akonadi2::ApplicationDomain::Event::Ptr>(); | 157 | auto value = model->index(0, 0, QModelIndex()).data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Event::Ptr>(); |
158 | 158 | ||
159 | QVERIFY(!value->getProperty("summary").toString().isEmpty()); | 159 | QVERIFY(!value->getProperty("summary").toString().isEmpty()); |
160 | qDebug() << value->getProperty("summary").toString(); | 160 | qDebug() << value->getProperty("summary").toString(); |
@@ -162,16 +162,16 @@ private Q_SLOTS: | |||
162 | 162 | ||
163 | void testSyncAndFacadeMail() | 163 | void testSyncAndFacadeMail() |
164 | { | 164 | { |
165 | Akonadi2::Query query; | 165 | Sink::Query query; |
166 | query.resources << "org.kde.dummy.instance1"; | 166 | query.resources << "org.kde.dummy.instance1"; |
167 | 167 | ||
168 | //Ensure all local data is processed | 168 | //Ensure all local data is processed |
169 | Akonadi2::Store::synchronize(query).exec().waitForFinished(); | 169 | Sink::Store::synchronize(query).exec().waitForFinished(); |
170 | Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); | 170 | Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); |
171 | 171 | ||
172 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Mail>(query); | 172 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Mail>(query); |
173 | QTRY_VERIFY(model->rowCount(QModelIndex()) >= 1); | 173 | QTRY_VERIFY(model->rowCount(QModelIndex()) >= 1); |
174 | auto value = model->index(0, 0, QModelIndex()).data(Akonadi2::Store::DomainObjectRole).value<Akonadi2::ApplicationDomain::Mail::Ptr>(); | 174 | auto value = model->index(0, 0, QModelIndex()).data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Mail::Ptr>(); |
175 | 175 | ||
176 | QVERIFY(!value->getProperty("subject").toString().isEmpty()); | 176 | QVERIFY(!value->getProperty("subject").toString().isEmpty()); |
177 | qDebug() << value->getProperty("subject").toString(); | 177 | qDebug() << value->getProperty("subject").toString(); |
@@ -179,25 +179,25 @@ private Q_SLOTS: | |||
179 | 179 | ||
180 | void testWriteModifyDelete() | 180 | void testWriteModifyDelete() |
181 | { | 181 | { |
182 | Akonadi2::ApplicationDomain::Event event("org.kde.dummy.instance1"); | 182 | Sink::ApplicationDomain::Event event("org.kde.dummy.instance1"); |
183 | event.setProperty("uid", "testuid"); | 183 | event.setProperty("uid", "testuid"); |
184 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); | 184 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); |
185 | event.setProperty("summary", "summaryValue"); | 185 | event.setProperty("summary", "summaryValue"); |
186 | Akonadi2::Store::create<Akonadi2::ApplicationDomain::Event>(event).exec().waitForFinished(); | 186 | Sink::Store::create<Sink::ApplicationDomain::Event>(event).exec().waitForFinished(); |
187 | 187 | ||
188 | Akonadi2::Query query; | 188 | Sink::Query query; |
189 | query.resources << "org.kde.dummy.instance1"; | 189 | query.resources << "org.kde.dummy.instance1"; |
190 | query.propertyFilter.insert("uid", "testuid"); | 190 | query.propertyFilter.insert("uid", "testuid"); |
191 | 191 | ||
192 | //Ensure all local data is processed | 192 | //Ensure all local data is processed |
193 | Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); | 193 | Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); |
194 | 194 | ||
195 | //Test create | 195 | //Test create |
196 | Akonadi2::ApplicationDomain::Event event2; | 196 | Sink::ApplicationDomain::Event event2; |
197 | { | 197 | { |
198 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Event>(query); | 198 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Event>(query); |
199 | QTRY_COMPARE(model->rowCount(QModelIndex()), 1); | 199 | QTRY_COMPARE(model->rowCount(QModelIndex()), 1); |
200 | auto value = model->index(0, 0, QModelIndex()).data(Akonadi2::Store::DomainObjectRole).value<Akonadi2::ApplicationDomain::Event::Ptr>(); | 200 | auto value = model->index(0, 0, QModelIndex()).data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Event::Ptr>(); |
201 | 201 | ||
202 | QCOMPARE(value->getProperty("uid").toByteArray(), QByteArray("testuid")); | 202 | QCOMPARE(value->getProperty("uid").toByteArray(), QByteArray("testuid")); |
203 | QCOMPARE(value->getProperty("summary").toByteArray(), QByteArray("summaryValue")); | 203 | QCOMPARE(value->getProperty("summary").toByteArray(), QByteArray("summaryValue")); |
@@ -206,30 +206,30 @@ private Q_SLOTS: | |||
206 | 206 | ||
207 | event2.setProperty("uid", "testuid"); | 207 | event2.setProperty("uid", "testuid"); |
208 | event2.setProperty("summary", "summaryValue2"); | 208 | event2.setProperty("summary", "summaryValue2"); |
209 | Akonadi2::Store::modify<Akonadi2::ApplicationDomain::Event>(event2).exec().waitForFinished(); | 209 | Sink::Store::modify<Sink::ApplicationDomain::Event>(event2).exec().waitForFinished(); |
210 | 210 | ||
211 | //Ensure all local data is processed | 211 | //Ensure all local data is processed |
212 | Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); | 212 | Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); |
213 | 213 | ||
214 | //Test modify | 214 | //Test modify |
215 | { | 215 | { |
216 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Event>(query); | 216 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Event>(query); |
217 | QTRY_COMPARE(model->rowCount(QModelIndex()), 1); | 217 | QTRY_COMPARE(model->rowCount(QModelIndex()), 1); |
218 | auto value = model->index(0, 0, QModelIndex()).data(Akonadi2::Store::DomainObjectRole).value<Akonadi2::ApplicationDomain::Event::Ptr>(); | 218 | auto value = model->index(0, 0, QModelIndex()).data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Event::Ptr>(); |
219 | 219 | ||
220 | QCOMPARE(value->getProperty("uid").toByteArray(), QByteArray("testuid")); | 220 | QCOMPARE(value->getProperty("uid").toByteArray(), QByteArray("testuid")); |
221 | QCOMPARE(value->getProperty("summary").toByteArray(), QByteArray("summaryValue2")); | 221 | QCOMPARE(value->getProperty("summary").toByteArray(), QByteArray("summaryValue2")); |
222 | } | 222 | } |
223 | 223 | ||
224 | Akonadi2::Store::remove<Akonadi2::ApplicationDomain::Event>(event2).exec().waitForFinished(); | 224 | Sink::Store::remove<Sink::ApplicationDomain::Event>(event2).exec().waitForFinished(); |
225 | 225 | ||
226 | //Ensure all local data is processed | 226 | //Ensure all local data is processed |
227 | Akonadi2::Store::flushMessageQueue(query.resources).exec().waitForFinished(); | 227 | Sink::Store::flushMessageQueue(query.resources).exec().waitForFinished(); |
228 | 228 | ||
229 | //Test remove | 229 | //Test remove |
230 | { | 230 | { |
231 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Event>(query); | 231 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Event>(query); |
232 | QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); | 232 | QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); |
233 | QTRY_COMPARE(model->rowCount(QModelIndex()), 0); | 233 | QTRY_COMPARE(model->rowCount(QModelIndex()), 0); |
234 | } | 234 | } |
235 | } | 235 | } |
@@ -237,25 +237,25 @@ private Q_SLOTS: | |||
237 | void testWriteModifyDeleteLive() | 237 | void testWriteModifyDeleteLive() |
238 | { | 238 | { |
239 | 239 | ||
240 | Akonadi2::Query query; | 240 | Sink::Query query; |
241 | query.resources << "org.kde.dummy.instance1"; | 241 | query.resources << "org.kde.dummy.instance1"; |
242 | query.liveQuery = true; | 242 | query.liveQuery = true; |
243 | query.propertyFilter.insert("uid", "testuid"); | 243 | query.propertyFilter.insert("uid", "testuid"); |
244 | 244 | ||
245 | auto model = Akonadi2::Store::loadModel<Akonadi2::ApplicationDomain::Event>(query); | 245 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Event>(query); |
246 | QTRY_VERIFY(model->data(QModelIndex(), Akonadi2::Store::ChildrenFetchedRole).toBool()); | 246 | QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); |
247 | 247 | ||
248 | Akonadi2::ApplicationDomain::Event event("org.kde.dummy.instance1"); | 248 | Sink::ApplicationDomain::Event event("org.kde.dummy.instance1"); |
249 | event.setProperty("uid", "testuid"); | 249 | event.setProperty("uid", "testuid"); |
250 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); | 250 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); |
251 | event.setProperty("summary", "summaryValue"); | 251 | event.setProperty("summary", "summaryValue"); |
252 | Akonadi2::Store::create<Akonadi2::ApplicationDomain::Event>(event).exec().waitForFinished(); | 252 | Sink::Store::create<Sink::ApplicationDomain::Event>(event).exec().waitForFinished(); |
253 | 253 | ||
254 | //Test create | 254 | //Test create |
255 | Akonadi2::ApplicationDomain::Event event2; | 255 | Sink::ApplicationDomain::Event event2; |
256 | { | 256 | { |
257 | QTRY_COMPARE(model->rowCount(QModelIndex()), 1); | 257 | QTRY_COMPARE(model->rowCount(QModelIndex()), 1); |
258 | auto value = model->index(0, 0, QModelIndex()).data(Akonadi2::Store::DomainObjectRole).value<Akonadi2::ApplicationDomain::Event::Ptr>(); | 258 | auto value = model->index(0, 0, QModelIndex()).data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Event::Ptr>(); |
259 | QCOMPARE(value->getProperty("uid").toByteArray(), QByteArray("testuid")); | 259 | QCOMPARE(value->getProperty("uid").toByteArray(), QByteArray("testuid")); |
260 | QCOMPARE(value->getProperty("summary").toByteArray(), QByteArray("summaryValue")); | 260 | QCOMPARE(value->getProperty("summary").toByteArray(), QByteArray("summaryValue")); |
261 | event2 = *value; | 261 | event2 = *value; |
@@ -263,18 +263,18 @@ private Q_SLOTS: | |||
263 | 263 | ||
264 | event2.setProperty("uid", "testuid"); | 264 | event2.setProperty("uid", "testuid"); |
265 | event2.setProperty("summary", "summaryValue2"); | 265 | event2.setProperty("summary", "summaryValue2"); |
266 | Akonadi2::Store::modify<Akonadi2::ApplicationDomain::Event>(event2).exec().waitForFinished(); | 266 | Sink::Store::modify<Sink::ApplicationDomain::Event>(event2).exec().waitForFinished(); |
267 | 267 | ||
268 | //Test modify | 268 | //Test modify |
269 | { | 269 | { |
270 | //TODO wait for a change signal | 270 | //TODO wait for a change signal |
271 | QTRY_COMPARE(model->rowCount(QModelIndex()), 1); | 271 | QTRY_COMPARE(model->rowCount(QModelIndex()), 1); |
272 | auto value = model->index(0, 0, QModelIndex()).data(Akonadi2::Store::DomainObjectRole).value<Akonadi2::ApplicationDomain::Event::Ptr>(); | 272 | auto value = model->index(0, 0, QModelIndex()).data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Event::Ptr>(); |
273 | QCOMPARE(value->getProperty("uid").toByteArray(), QByteArray("testuid")); | 273 | QCOMPARE(value->getProperty("uid").toByteArray(), QByteArray("testuid")); |
274 | QCOMPARE(value->getProperty("summary").toByteArray(), QByteArray("summaryValue2")); | 274 | QCOMPARE(value->getProperty("summary").toByteArray(), QByteArray("summaryValue2")); |
275 | } | 275 | } |
276 | 276 | ||
277 | Akonadi2::Store::remove<Akonadi2::ApplicationDomain::Event>(event2).exec().waitForFinished(); | 277 | Sink::Store::remove<Sink::ApplicationDomain::Event>(event2).exec().waitForFinished(); |
278 | 278 | ||
279 | //Test remove | 279 | //Test remove |
280 | { | 280 | { |