File indexing completed on 2025-01-05 04:59:50
0001 /* 0002 * SPDX-FileCopyrightText: 2017 Kevin Ottens <ervin@kde.org> 0003 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0004 */ 0005 0006 0007 #include <testlib/qtest_zanshin.h> 0008 0009 #include <testlib/akonadistoragetestbase.h> 0010 #include <testlib/testsafety.h> 0011 0012 #include "akonadi/akonadicachingstorage.h" 0013 #include "akonadi/akonadimonitorimpl.h" 0014 #include "akonadi/akonadiserializer.h" 0015 #include "akonadi/akonadistorage.h" 0016 0017 class AkonadiCachingStorageIntegrationTest : public Testlib::AkonadiStorageTestBase 0018 { 0019 Q_OBJECT 0020 public: 0021 explicit AkonadiCachingStorageIntegrationTest(QObject *parent = nullptr) 0022 : AkonadiStorageTestBase(parent) 0023 { 0024 } 0025 0026 Akonadi::StorageInterface::Ptr createStorage() override 0027 { 0028 auto serializer = Akonadi::SerializerInterface::Ptr(new Akonadi::Serializer); 0029 return Akonadi::StorageInterface::Ptr(new Akonadi::CachingStorage(Akonadi::Cache::Ptr::create(serializer, 0030 createMonitor()), 0031 Akonadi::StorageInterface::Ptr(new Akonadi::Storage))); 0032 } 0033 0034 Akonadi::MonitorInterface::Ptr createMonitor() override 0035 { 0036 return Akonadi::MonitorInterface::Ptr(new Akonadi::MonitorImpl); 0037 } 0038 0039 private slots: 0040 void initTestCase() 0041 { 0042 QVERIFY(TestLib::TestSafety::checkTestIsIsolated()); 0043 } 0044 }; 0045 0046 ZANSHIN_TEST_MAIN(AkonadiCachingStorageIntegrationTest) 0047 0048 #include "akonadicachingstorageintegrationtest.moc"