File indexing completed on 2024-12-22 05:05:23
0001 /* 0002 SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "exportakregatorjobinterfacetest.h" 0008 #include "archivestorage.h" 0009 #include "exportakregatorjobinterfacetestimpl.h" 0010 #include "testexportfile.h" 0011 #include <QTest> 0012 0013 QTEST_MAIN(ExportAkregatorJobInterfaceTest) 0014 0015 ExportAkregatorJobInterfaceTest::ExportAkregatorJobInterfaceTest(QObject *parent) 0016 : QObject(parent) 0017 { 0018 } 0019 0020 void ExportAkregatorJobInterfaceTest::exportAkregator_data() 0021 { 0022 QTest::addColumn<QByteArray>("configpath"); 0023 QTest::addColumn<Utils::StoredTypes>("options"); 0024 const QByteArray pathConfig(QByteArray(PIMDATAEXPORTER_DIR) + "/export/"); 0025 Utils::StoredTypes options = {Utils::StoredType::Config}; 0026 // TODO 0027 options = {Utils::StoredType::Config | Utils::StoredType::Resources}; 0028 QTest::newRow("fullresource") << pathConfig + QByteArray("fullresource/") << options; 0029 } 0030 0031 void ExportAkregatorJobInterfaceTest::exportAkregator() 0032 { 0033 QFETCH(QByteArray, configpath); 0034 QFETCH(Utils::StoredTypes, options); 0035 std::unique_ptr<TestExportFile> file{new TestExportFile(this)}; 0036 file->setPathConfig(configpath); 0037 0038 auto exportAkregator = new ExportAkregatorJobInterfaceTestImpl(this, options, file->archiveStorage(), 1); 0039 file->setAbstractImportExportJob(exportAkregator); 0040 file->start(); 0041 delete exportAkregator; 0042 } 0043 0044 #include "moc_exportakregatorjobinterfacetest.cpp"