diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-10-21 12:05:09 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-10-21 12:11:45 +0200 |
commit | af0f69d6c267d231d01b69525b91add8309e43e0 (patch) | |
tree | d0807066f3bb230daf1877504326e9666f4a7c46 /tests/dummyresourcetest.cpp | |
parent | 98a057260f51b8af2cf3f933119e08590cc0639b (diff) | |
download | sink-af0f69d6c267d231d01b69525b91add8309e43e0.tar.gz sink-af0f69d6c267d231d01b69525b91add8309e43e0.zip |
ClientAPI: Don't require an explicit instance identifier
Diffstat (limited to 'tests/dummyresourcetest.cpp')
-rw-r--r-- | tests/dummyresourcetest.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/tests/dummyresourcetest.cpp b/tests/dummyresourcetest.cpp index 9d7d092..48bb7b0 100644 --- a/tests/dummyresourcetest.cpp +++ b/tests/dummyresourcetest.cpp | |||
@@ -48,11 +48,11 @@ private Q_SLOTS: | |||
48 | 48 | ||
49 | void testWriteToFacadeAndQueryByUid() | 49 | void testWriteToFacadeAndQueryByUid() |
50 | { | 50 | { |
51 | Akonadi2::ApplicationDomain::Event event; | 51 | Akonadi2::ApplicationDomain::Event event("org.kde.dummy.instance1"); |
52 | event.setProperty("uid", "testuid"); | 52 | event.setProperty("uid", "testuid"); |
53 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); | 53 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); |
54 | event.setProperty("summary", "summaryValue"); | 54 | event.setProperty("summary", "summaryValue"); |
55 | Akonadi2::Store::create<Akonadi2::ApplicationDomain::Event>(event, "org.kde.dummy.instance1").exec().waitForFinished(); | 55 | Akonadi2::Store::create<Akonadi2::ApplicationDomain::Event>(event).exec().waitForFinished(); |
56 | 56 | ||
57 | Akonadi2::Query query; | 57 | Akonadi2::Query query; |
58 | query.resources << "org.kde.dummy.instance1"; | 58 | query.resources << "org.kde.dummy.instance1"; |
@@ -69,14 +69,14 @@ private Q_SLOTS: | |||
69 | 69 | ||
70 | void testWriteToFacadeAndQueryByUid2() | 70 | void testWriteToFacadeAndQueryByUid2() |
71 | { | 71 | { |
72 | Akonadi2::ApplicationDomain::Event event; | 72 | Akonadi2::ApplicationDomain::Event event("org.kde.dummy.instance1"); |
73 | event.setProperty("summary", "summaryValue"); | 73 | event.setProperty("summary", "summaryValue"); |
74 | 74 | ||
75 | event.setProperty("uid", "testuid"); | 75 | event.setProperty("uid", "testuid"); |
76 | Akonadi2::Store::create<Akonadi2::ApplicationDomain::Event>(event, "org.kde.dummy.instance1").exec().waitForFinished(); | 76 | Akonadi2::Store::create<Akonadi2::ApplicationDomain::Event>(event).exec().waitForFinished(); |
77 | 77 | ||
78 | event.setProperty("uid", "testuid2"); | 78 | event.setProperty("uid", "testuid2"); |
79 | Akonadi2::Store::create<Akonadi2::ApplicationDomain::Event>(event, "org.kde.dummy.instance1").exec().waitForFinished(); | 79 | Akonadi2::Store::create<Akonadi2::ApplicationDomain::Event>(event).exec().waitForFinished(); |
80 | 80 | ||
81 | Akonadi2::Query query; | 81 | Akonadi2::Query query; |
82 | query.resources << "org.kde.dummy.instance1"; | 82 | query.resources << "org.kde.dummy.instance1"; |
@@ -94,15 +94,15 @@ private Q_SLOTS: | |||
94 | 94 | ||
95 | void testWriteToFacadeAndQueryBySummary() | 95 | void testWriteToFacadeAndQueryBySummary() |
96 | { | 96 | { |
97 | Akonadi2::ApplicationDomain::Event event; | 97 | Akonadi2::ApplicationDomain::Event event("org.kde.dummy.instance1"); |
98 | 98 | ||
99 | event.setProperty("uid", "testuid"); | 99 | event.setProperty("uid", "testuid"); |
100 | event.setProperty("summary", "summaryValue1"); | 100 | event.setProperty("summary", "summaryValue1"); |
101 | Akonadi2::Store::create<Akonadi2::ApplicationDomain::Event>(event, "org.kde.dummy.instance1").exec().waitForFinished(); | 101 | Akonadi2::Store::create<Akonadi2::ApplicationDomain::Event>(event).exec().waitForFinished(); |
102 | 102 | ||
103 | event.setProperty("uid", "testuid2"); | 103 | event.setProperty("uid", "testuid2"); |
104 | event.setProperty("summary", "summaryValue2"); | 104 | event.setProperty("summary", "summaryValue2"); |
105 | Akonadi2::Store::create<Akonadi2::ApplicationDomain::Event>(event, "org.kde.dummy.instance1").exec().waitForFinished(); | 105 | Akonadi2::Store::create<Akonadi2::ApplicationDomain::Event>(event).exec().waitForFinished(); |
106 | 106 | ||
107 | Akonadi2::Query query; | 107 | Akonadi2::Query query; |
108 | query.resources << "org.kde.dummy.instance1"; | 108 | query.resources << "org.kde.dummy.instance1"; |
@@ -165,11 +165,11 @@ private Q_SLOTS: | |||
165 | 165 | ||
166 | void testWriteModifyDelete() | 166 | void testWriteModifyDelete() |
167 | { | 167 | { |
168 | Akonadi2::ApplicationDomain::Event event; | 168 | Akonadi2::ApplicationDomain::Event event("org.kde.dummy.instance1"); |
169 | event.setProperty("uid", "testuid"); | 169 | event.setProperty("uid", "testuid"); |
170 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); | 170 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); |
171 | event.setProperty("summary", "summaryValue"); | 171 | event.setProperty("summary", "summaryValue"); |
172 | Akonadi2::Store::create<Akonadi2::ApplicationDomain::Event>(event, "org.kde.dummy.instance1").exec().waitForFinished(); | 172 | Akonadi2::Store::create<Akonadi2::ApplicationDomain::Event>(event).exec().waitForFinished(); |
173 | 173 | ||
174 | Akonadi2::Query query; | 174 | Akonadi2::Query query; |
175 | query.resources << "org.kde.dummy.instance1"; | 175 | query.resources << "org.kde.dummy.instance1"; |
@@ -191,7 +191,7 @@ private Q_SLOTS: | |||
191 | 191 | ||
192 | event2.setProperty("uid", "testuid"); | 192 | event2.setProperty("uid", "testuid"); |
193 | event2.setProperty("summary", "summaryValue2"); | 193 | event2.setProperty("summary", "summaryValue2"); |
194 | Akonadi2::Store::modify<Akonadi2::ApplicationDomain::Event>(event2, "org.kde.dummy.instance1").exec().waitForFinished(); | 194 | Akonadi2::Store::modify<Akonadi2::ApplicationDomain::Event>(event2).exec().waitForFinished(); |
195 | 195 | ||
196 | //Test modify | 196 | //Test modify |
197 | { | 197 | { |
@@ -203,7 +203,7 @@ private Q_SLOTS: | |||
203 | QCOMPARE(value->getProperty("summary").toByteArray(), QByteArray("summaryValue2")); | 203 | QCOMPARE(value->getProperty("summary").toByteArray(), QByteArray("summaryValue2")); |
204 | } | 204 | } |
205 | 205 | ||
206 | Akonadi2::Store::remove<Akonadi2::ApplicationDomain::Event>(event2, "org.kde.dummy.instance1").exec().waitForFinished(); | 206 | Akonadi2::Store::remove<Akonadi2::ApplicationDomain::Event>(event2).exec().waitForFinished(); |
207 | 207 | ||
208 | //Test remove | 208 | //Test remove |
209 | { | 209 | { |
@@ -227,11 +227,11 @@ private Q_SLOTS: | |||
227 | async::SyncListResult<Akonadi2::ApplicationDomain::Event::Ptr> result(Akonadi2::Store::load<Akonadi2::ApplicationDomain::Event>(query)); | 227 | async::SyncListResult<Akonadi2::ApplicationDomain::Event::Ptr> result(Akonadi2::Store::load<Akonadi2::ApplicationDomain::Event>(query)); |
228 | result.exec(); | 228 | result.exec(); |
229 | 229 | ||
230 | Akonadi2::ApplicationDomain::Event event; | 230 | Akonadi2::ApplicationDomain::Event event("org.kde.dummy.instance1"); |
231 | event.setProperty("uid", "testuid"); | 231 | event.setProperty("uid", "testuid"); |
232 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); | 232 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); |
233 | event.setProperty("summary", "summaryValue"); | 233 | event.setProperty("summary", "summaryValue"); |
234 | Akonadi2::Store::create<Akonadi2::ApplicationDomain::Event>(event, "org.kde.dummy.instance1").exec().waitForFinished(); | 234 | Akonadi2::Store::create<Akonadi2::ApplicationDomain::Event>(event).exec().waitForFinished(); |
235 | 235 | ||
236 | //Test create | 236 | //Test create |
237 | Akonadi2::ApplicationDomain::Event event2; | 237 | Akonadi2::ApplicationDomain::Event event2; |
@@ -245,7 +245,7 @@ private Q_SLOTS: | |||
245 | 245 | ||
246 | event2.setProperty("uid", "testuid"); | 246 | event2.setProperty("uid", "testuid"); |
247 | event2.setProperty("summary", "summaryValue2"); | 247 | event2.setProperty("summary", "summaryValue2"); |
248 | Akonadi2::Store::modify<Akonadi2::ApplicationDomain::Event>(event2, "org.kde.dummy.instance1").exec().waitForFinished(); | 248 | Akonadi2::Store::modify<Akonadi2::ApplicationDomain::Event>(event2).exec().waitForFinished(); |
249 | 249 | ||
250 | //Test modify | 250 | //Test modify |
251 | { | 251 | { |
@@ -255,7 +255,7 @@ private Q_SLOTS: | |||
255 | QCOMPARE(value->getProperty("summary").toByteArray(), QByteArray("summaryValue2")); | 255 | QCOMPARE(value->getProperty("summary").toByteArray(), QByteArray("summaryValue2")); |
256 | } | 256 | } |
257 | 257 | ||
258 | Akonadi2::Store::remove<Akonadi2::ApplicationDomain::Event>(event2, "org.kde.dummy.instance1").exec().waitForFinished(); | 258 | Akonadi2::Store::remove<Akonadi2::ApplicationDomain::Event>(event2).exec().waitForFinished(); |
259 | 259 | ||
260 | //Test remove | 260 | //Test remove |
261 | { | 261 | { |