diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-09-08 21:08:54 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-09-08 21:08:54 +0200 |
commit | bbbda3fe9444eba6795a5490da0425cdf8f26361 (patch) | |
tree | d558ce110b71278df91135db5ac29c484e588ac5 /tests | |
parent | 43ae43bc74800473aadf9c5c807603cdf8516d36 (diff) | |
download | sink-bbbda3fe9444eba6795a5490da0425cdf8f26361.tar.gz sink-bbbda3fe9444eba6795a5490da0425cdf8f26361.zip |
Added support for mails to akonadi and the dummyresource.
Adding new types definitely needs to become easier.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/dummyresourcetest.cpp | 15 | ||||
-rw-r--r-- | tests/genericfacadebenchmark.cpp | 2 | ||||
-rw-r--r-- | tests/genericfacadetest.cpp | 4 |
3 files changed, 18 insertions, 3 deletions
diff --git a/tests/dummyresourcetest.cpp b/tests/dummyresourcetest.cpp index e3b3f07..a28e071 100644 --- a/tests/dummyresourcetest.cpp +++ b/tests/dummyresourcetest.cpp | |||
@@ -164,6 +164,21 @@ private Q_SLOTS: | |||
164 | qDebug() << value->getProperty("summary").toString(); | 164 | qDebug() << value->getProperty("summary").toString(); |
165 | } | 165 | } |
166 | 166 | ||
167 | void testSyncAndFacadeMail() | ||
168 | { | ||
169 | Akonadi2::Query query; | ||
170 | query.resources << "org.kde.dummy.instance1"; | ||
171 | query.syncOnDemand = true; | ||
172 | query.processAll = true; | ||
173 | |||
174 | async::SyncListResult<Akonadi2::ApplicationDomain::Mail::Ptr> result(Akonadi2::Store::load<Akonadi2::ApplicationDomain::Mail>(query)); | ||
175 | result.exec(); | ||
176 | QVERIFY(!result.isEmpty()); | ||
177 | auto value = result.first(); | ||
178 | QVERIFY(!value->getProperty("subject").toString().isEmpty()); | ||
179 | qDebug() << value->getProperty("subject").toString(); | ||
180 | } | ||
181 | |||
167 | void testWriteModifyDelete() | 182 | void testWriteModifyDelete() |
168 | { | 183 | { |
169 | Akonadi2::ApplicationDomain::Event event; | 184 | Akonadi2::ApplicationDomain::Event event; |
diff --git a/tests/genericfacadebenchmark.cpp b/tests/genericfacadebenchmark.cpp index 483a597..7cd6c75 100644 --- a/tests/genericfacadebenchmark.cpp +++ b/tests/genericfacadebenchmark.cpp | |||
@@ -88,7 +88,7 @@ private Q_SLOTS: | |||
88 | QBENCHMARK { | 88 | QBENCHMARK { |
89 | auto resultSet = QSharedPointer<Akonadi2::ResultProvider<Akonadi2::ApplicationDomain::Event::Ptr> >::create(); | 89 | auto resultSet = QSharedPointer<Akonadi2::ResultProvider<Akonadi2::ApplicationDomain::Event::Ptr> >::create(); |
90 | auto resourceAccess = QSharedPointer<TestResourceAccess>::create(); | 90 | auto resourceAccess = QSharedPointer<TestResourceAccess>::create(); |
91 | auto storage = QSharedPointer<EntityStorage<Akonadi2::ApplicationDomain::Event> >::create("identifier", domainTypeAdaptorFactory); | 91 | auto storage = QSharedPointer<EntityStorage<Akonadi2::ApplicationDomain::Event> >::create("identifier", domainTypeAdaptorFactory, "bufferType"); |
92 | TestResourceFacade facade(identifier, storage, resourceAccess); | 92 | TestResourceFacade facade(identifier, storage, resourceAccess); |
93 | 93 | ||
94 | async::SyncListResult<Akonadi2::ApplicationDomain::Event::Ptr> result(resultSet->emitter()); | 94 | async::SyncListResult<Akonadi2::ApplicationDomain::Event::Ptr> result(resultSet->emitter()); |
diff --git a/tests/genericfacadetest.cpp b/tests/genericfacadetest.cpp index 7aaec23..45ca54d 100644 --- a/tests/genericfacadetest.cpp +++ b/tests/genericfacadetest.cpp | |||
@@ -74,7 +74,7 @@ private Q_SLOTS: | |||
74 | query.liveQuery = false; | 74 | query.liveQuery = false; |
75 | 75 | ||
76 | auto resultSet = QSharedPointer<Akonadi2::ResultProvider<Akonadi2::ApplicationDomain::Event::Ptr> >::create(); | 76 | auto resultSet = QSharedPointer<Akonadi2::ResultProvider<Akonadi2::ApplicationDomain::Event::Ptr> >::create(); |
77 | auto storage = QSharedPointer<TestEntityStorage>::create("identifier", QSharedPointer<TestEventAdaptorFactory>::create()); | 77 | auto storage = QSharedPointer<TestEntityStorage>::create("identifier", QSharedPointer<TestEventAdaptorFactory>::create(), "bufferType"); |
78 | auto resourceAccess = QSharedPointer<TestResourceAccess>::create(); | 78 | auto resourceAccess = QSharedPointer<TestResourceAccess>::create(); |
79 | storage->mResults << Akonadi2::ApplicationDomain::Event::Ptr::create(); | 79 | storage->mResults << Akonadi2::ApplicationDomain::Event::Ptr::create(); |
80 | TestResourceFacade facade("identifier", storage, resourceAccess); | 80 | TestResourceFacade facade("identifier", storage, resourceAccess); |
@@ -96,7 +96,7 @@ private Q_SLOTS: | |||
96 | query.liveQuery = true; | 96 | query.liveQuery = true; |
97 | 97 | ||
98 | auto resultSet = QSharedPointer<Akonadi2::ResultProvider<Akonadi2::ApplicationDomain::Event::Ptr> >::create(); | 98 | auto resultSet = QSharedPointer<Akonadi2::ResultProvider<Akonadi2::ApplicationDomain::Event::Ptr> >::create(); |
99 | auto storage = QSharedPointer<TestEntityStorage>::create("identifier", QSharedPointer<TestEventAdaptorFactory>::create()); | 99 | auto storage = QSharedPointer<TestEntityStorage>::create("identifier", QSharedPointer<TestEventAdaptorFactory>::create(), "bufferType"); |
100 | auto resourceAccess = QSharedPointer<TestResourceAccess>::create(); | 100 | auto resourceAccess = QSharedPointer<TestResourceAccess>::create(); |
101 | storage->mResults << Akonadi2::ApplicationDomain::Event::Ptr::create(); | 101 | storage->mResults << Akonadi2::ApplicationDomain::Event::Ptr::create(); |
102 | TestResourceFacade facade("identifier", storage, resourceAccess); | 102 | TestResourceFacade facade("identifier", storage, resourceAccess); |