diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/dummyresourcetest.cpp | 53 |
1 files changed, 32 insertions, 21 deletions
diff --git a/tests/dummyresourcetest.cpp b/tests/dummyresourcetest.cpp index c469796..a80d22f 100644 --- a/tests/dummyresourcetest.cpp +++ b/tests/dummyresourcetest.cpp | |||
@@ -82,27 +82,38 @@ private Q_SLOTS: | |||
82 | QCOMPARE(revisionSpy.count(), 2); | 82 | QCOMPARE(revisionSpy.count(), 2); |
83 | } | 83 | } |
84 | 84 | ||
85 | // void testResourceSync() | 85 | void testWriteToFacade() |
86 | // { | 86 | { |
87 | // Akonadi2::Pipeline pipeline("org.kde.dummy"); | 87 | Akonadi2::Query query; |
88 | // DummyResource resource; | 88 | Akonadi2::Domain::Event event; |
89 | // auto job = resource.synchronizeWithSource(&pipeline); | 89 | event.setProperty("summary", "summaryValue"); |
90 | // auto future = job.exec(); | 90 | Akonadi2::Store::create<Akonadi2::Domain::Event>(event, "org.kde.dummy"); |
91 | // QTRY_VERIFY(future.isFinished()); | 91 | |
92 | // } | 92 | QTest::qWait(1000); |
93 | 93 | //TODO wait for success response | |
94 | // void testSyncAndFacade() | 94 | } |
95 | // { | 95 | |
96 | // Akonadi2::Query query; | 96 | void testResourceSync() |
97 | // query.resources << "org.kde.dummy"; | 97 | { |
98 | 98 | Akonadi2::Pipeline pipeline("org.kde.dummy"); | |
99 | // async::SyncListResult<Akonadi2::Domain::Event::Ptr> result(Akonadi2::Store::load<Akonadi2::Domain::Event>(query)); | 99 | DummyResource resource; |
100 | // result.exec(); | 100 | auto job = resource.synchronizeWithSource(&pipeline); |
101 | // QVERIFY(!result.isEmpty()); | 101 | auto future = job.exec(); |
102 | // auto value = result.first(); | 102 | QTRY_VERIFY(future.isFinished()); |
103 | // QVERIFY(!value->getProperty("summary").toString().isEmpty()); | 103 | } |
104 | // qDebug() << value->getProperty("summary").toString(); | 104 | |
105 | // } | 105 | void testSyncAndFacade() |
106 | { | ||
107 | Akonadi2::Query query; | ||
108 | query.resources << "org.kde.dummy"; | ||
109 | |||
110 | async::SyncListResult<Akonadi2::Domain::Event::Ptr> result(Akonadi2::Store::load<Akonadi2::Domain::Event>(query)); | ||
111 | result.exec(); | ||
112 | QVERIFY(!result.isEmpty()); | ||
113 | auto value = result.first(); | ||
114 | QVERIFY(!value->getProperty("summary").toString().isEmpty()); | ||
115 | qDebug() << value->getProperty("summary").toString(); | ||
116 | } | ||
106 | 117 | ||
107 | }; | 118 | }; |
108 | 119 | ||