Commit 84bec655 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add autotest for Resources

parent 2e97002d
Pipeline #22462 passed with stage
in 6 minutes and 47 seconds
......@@ -5,7 +5,7 @@ set( exportmailjobinterfacetest_SRCS exportmailjobinterfacetest.cpp exportmailjo
add_executable( exportmailjobinterfacetest ${exportmailjobinterfacetest_SRCS})
add_test(NAME exportmailjobinterfacetest COMMAND exportmailjobinterfacetest)
ecm_mark_as_test(exportmailjobinterfacetest)
target_link_libraries(exportmailjobinterfacetest Qt5::Test pimdataexporterprivate KF5::ConfigCore test_resourceconverter)
target_link_libraries(exportmailjobinterfacetest Qt5::Test pimdataexporterprivate KF5::ConfigCore test_resourceconverter KF5::Mime)
#####
......@@ -14,4 +14,4 @@ set( importmailjobinterfacetest_SRCS importmailjobinterfacetest.cpp importmailjo
add_executable( importmailjobinterfacetest ${importmailjobinterfacetest_SRCS})
add_test(NAME importmailjobinterfacetest COMMAND importmailjobinterfacetest)
ecm_mark_as_test(importmailjobinterfacetest)
target_link_libraries(importmailjobinterfacetest Qt5::Test pimdataexporterprivate KF5::ConfigCore KF5::AkonadiMime test_resourceconverter KF5::IdentityManagement)
target_link_libraries(importmailjobinterfacetest Qt5::Test pimdataexporterprivate KF5::ConfigCore KF5::AkonadiMime test_resourceconverter KF5::IdentityManagement KF5::Mime)
[General]
Path[$e]=$[TEST_PATH]/resources/akonadi_maildir_resource_1/
TopLevelIsContainer=true
[General]
Path[$e]=$[TEST_PATH]/resources/akonadi_mbox_resource_1/akonadi_mbox_resource_1.mbox
......@@ -21,6 +21,7 @@
#include "exportmailjobinterfacetestimpl.h"
#include "archivestorage.h"
#include "testexportfile.h"
#include <KMime/Message>
#include <QTest>
QTEST_MAIN(ExportMailJobInterfaceTest)
......@@ -47,7 +48,7 @@ void ExportMailJobInterfaceTest::exportMail_data()
QTest::newRow("identitiesandconfig") << pathConfig + QByteArray("identitiesandconfig/") << options;
options = {Utils::StoredType::Config|Utils::StoredType::Identity|Utils::StoredType::MailTransport};
QTest::newRow("identitiesandconfigandmailtransport") << pathConfig + QByteArray("identitiesandconfigandmailtransport/") << options;
options = {Utils::StoredType::Config|Utils::StoredType::Identity|Utils::StoredType::MailTransport|Utils::StoredType::Resources};
options = {Utils::StoredType::Config|Utils::StoredType::Identity|Utils::StoredType::MailTransport|Utils::StoredType::Resources|Utils::StoredType::Mails};
QTest::newRow("identitiesandconfigandmailtransportandresources") << pathConfig + QByteArray("identitiesandconfigandmailtransportandresources/") << options;
}
......@@ -61,13 +62,21 @@ void ExportMailJobInterfaceTest::exportMail()
Utils::AkonadiInstanceInfo info;
info.identifier = QLatin1String("akonadi_mbox_resource_1");
info.mimeTypes = QStringList() << KMime::Message::mimeType();
info.capabilities = QStringList() << QLatin1String("Resource");
lstInfo << info;
info.identifier = QLatin1String("akonadi_maildir_resource_1");
info.mimeTypes = QStringList() << KMime::Message::mimeType();
info.capabilities = QStringList() << QLatin1String("Resource");
lstInfo << info;
info.identifier = QLatin1String("akonadi_mixedmaildir_resource_1");
info.mimeTypes = QStringList() << KMime::Message::mimeType();
info.capabilities = QStringList() << QLatin1String("Resource");
lstInfo << info;
//TODO add kolab and other
//Add extra resource.
info.identifier = QStringLiteral("akonadi_kolab_resource_2");
info.identifier = QStringLiteral("akonadi_kalarm_dir_resource_2");
lstInfo << info;
ExportMailJobInterfaceTestImpl *exportMail = new ExportMailJobInterfaceTestImpl(this, options, file->archiveStorage(), 1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment