summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/clientapitest.cpp5
-rw-r--r--tests/dummyresourcebenchmark.cpp4
-rw-r--r--tests/dummyresourcetest.cpp32
3 files changed, 20 insertions, 21 deletions
diff --git a/tests/clientapitest.cpp b/tests/clientapitest.cpp
index 03cc732..8779716 100644
--- a/tests/clientapitest.cpp
+++ b/tests/clientapitest.cpp
@@ -95,8 +95,7 @@ private Q_SLOTS:
95 res.setProperty("identifier", "dummyresource.identifier1"); 95 res.setProperty("identifier", "dummyresource.identifier1");
96 res.setProperty("type", "dummyresource"); 96 res.setProperty("type", "dummyresource");
97 97
98 Akonadi2::Store::create(res, "resourceconfig").exec().waitForFinished(); 98 Akonadi2::Store::create(res).exec().waitForFinished();
99
100 { 99 {
101 Akonadi2::Query query; 100 Akonadi2::Query query;
102 query.resources << "resourceconfig"; 101 query.resources << "resourceconfig";
@@ -106,7 +105,7 @@ private Q_SLOTS:
106 QCOMPARE(result.size(), 1); 105 QCOMPARE(result.size(), 1);
107 } 106 }
108 107
109 Akonadi2::Store::remove(res, "resourceconfig").exec().waitForFinished(); 108 Akonadi2::Store::remove(res).exec().waitForFinished();
110 { 109 {
111 Akonadi2::Query query; 110 Akonadi2::Query query;
112 query.resources << "resourceconfig"; 111 query.resources << "resourceconfig";
diff --git a/tests/dummyresourcebenchmark.cpp b/tests/dummyresourcebenchmark.cpp
index c020c6b..370acd2 100644
--- a/tests/dummyresourcebenchmark.cpp
+++ b/tests/dummyresourcebenchmark.cpp
@@ -72,11 +72,11 @@ private Q_SLOTS:
72 int num = 100; 72 int num = 100;
73 QList<KAsync::Future<void> > waitCondition; 73 QList<KAsync::Future<void> > waitCondition;
74 for (int i = 0; i < num; i++) { 74 for (int i = 0; i < num; i++) {
75 Akonadi2::ApplicationDomain::Event event; 75 Akonadi2::ApplicationDomain::Event event("org.kde.dummy.instance1");
76 event.setProperty("uid", "testuid"); 76 event.setProperty("uid", "testuid");
77 QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); 77 QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid"));
78 event.setProperty("summary", "summaryValue"); 78 event.setProperty("summary", "summaryValue");
79 waitCondition << Akonadi2::Store::create<Akonadi2::ApplicationDomain::Event>(event, "org.kde.dummy.instance1").exec(); 79 waitCondition << Akonadi2::Store::create<Akonadi2::ApplicationDomain::Event>(event).exec();
80 } 80 }
81 waitForCompletion(waitCondition).exec().waitForFinished(); 81 waitForCompletion(waitCondition).exec().waitForFinished();
82 auto appendTime = time.elapsed(); 82 auto appendTime = time.elapsed();
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 {