Changeset View
Changeset View
Standalone View
Standalone View
tests/units/akonadi/akonadicachingstorageintegrationtest.cpp
- This file was added.
1 | /* This file is part of Zanshin | ||||
---|---|---|---|---|---|
2 | | ||||
3 | Copyright 2017 Kevin Ottens <ervin@kde.org> | ||||
4 | | ||||
5 | This program is free software; you can redistribute it and/or | ||||
6 | modify it under the terms of the GNU General Public License as | ||||
7 | published by the Free Software Foundation; either version 2 of | ||||
8 | the License or (at your option) version 3 or any later version | ||||
9 | accepted by the membership of KDE e.V. (or its successor approved | ||||
10 | by the membership of KDE e.V.), which shall act as a proxy | ||||
11 | defined in Section 14 of version 3 of the license. | ||||
12 | | ||||
13 | This program is distributed in the hope that it will be useful, | ||||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
16 | GNU General Public License for more details. | ||||
17 | | ||||
18 | You should have received a copy of the GNU General Public License | ||||
19 | along with this program; if not, write to the Free Software | ||||
20 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | ||||
21 | USA. | ||||
22 | */ | ||||
23 | | ||||
24 | #include <testlib/qtest_zanshin.h> | ||||
25 | | ||||
26 | #include <testlib/akonadistoragetestbase.h> | ||||
27 | #include <testlib/testsafety.h> | ||||
28 | | ||||
29 | #include "akonadi/akonadicachingstorage.h" | ||||
30 | #include "akonadi/akonadimonitorimpl.h" | ||||
31 | #include "akonadi/akonadiserializer.h" | ||||
32 | #include "akonadi/akonadistorage.h" | ||||
33 | | ||||
34 | class AkonadiCachingStorageIntegrationTest : public Testlib::AkonadiStorageTestBase | ||||
35 | { | ||||
36 | Q_OBJECT | ||||
37 | public: | ||||
38 | explicit AkonadiCachingStorageIntegrationTest(QObject *parent = Q_NULLPTR) | ||||
39 | : AkonadiStorageTestBase(parent) | ||||
40 | { | ||||
41 | } | ||||
42 | | ||||
43 | Akonadi::StorageInterface::Ptr createStorage() Q_DECL_OVERRIDE | ||||
44 | { | ||||
45 | auto serializer = Akonadi::SerializerInterface::Ptr(new Akonadi::Serializer); | ||||
46 | return Akonadi::StorageInterface::Ptr(new Akonadi::CachingStorage(Akonadi::Cache::Ptr::create(serializer, | ||||
47 | createMonitor()), | ||||
48 | Akonadi::StorageInterface::Ptr(new Akonadi::Storage))); | ||||
49 | } | ||||
50 | | ||||
51 | Akonadi::MonitorInterface::Ptr createMonitor() Q_DECL_OVERRIDE | ||||
52 | { | ||||
53 | return Akonadi::MonitorInterface::Ptr(new Akonadi::MonitorImpl); | ||||
54 | } | ||||
55 | | ||||
56 | private slots: | ||||
57 | void initTestCase() | ||||
58 | { | ||||
59 | QVERIFY(TestLib::TestSafety::checkTestIsIsolated()); | ||||
60 | } | ||||
61 | }; | ||||
62 | | ||||
63 | ZANSHIN_TEST_MAIN(AkonadiCachingStorageIntegrationTest) | ||||
64 | | ||||
65 | #include "akonadicachingstorageintegrationtest.moc" |