Commit 3428205d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to export resource in each autotest

parent e510a900
......@@ -23,6 +23,7 @@
#include "resourceconvertertest.h"
#include <QDebug>
#include <QTest>
#include <saveresourceconfigtest.h>
QTEST_MAIN(ExportAddressbookJobInterfaceTest)
......@@ -49,7 +50,10 @@ Akonadi::Collection::Id ExportAddressbookJobInterfaceTestImpl::convertFolderPath
void ExportAddressbookJobInterfaceTestImpl::exportResourceToArchive(const QString &archivePath, const QString &url, const QString &identifier)
{
//TODO implement it
SaveResoureConfigTest saveResourceConfig;
saveResourceConfig.setArchive(mArchiveStorage->archive());
saveResourceConfig.exportResourceToArchive(archivePath, url, identifier, Utils::resourceAddressbookArchiveName(),
{ QLatin1String("akonadi_vcarddir_resource_"), QLatin1String("akonadi_contacts_resource_") });
slotAddressbookJobTerminated();
}
......
......@@ -24,6 +24,7 @@
#include <QDebug>
#include <QTest>
#include <QSignalSpy>
#include <saveresourceconfigtest.h>
QTEST_MAIN(ExportAlarmJobInterfaceTest)
......@@ -56,7 +57,9 @@ Akonadi::Collection::Id ExportAlarmJobInterfaceTestImpl::convertFolderPathToColl
void ExportAlarmJobInterfaceTestImpl::exportResourceToArchive(const QString &archivePath, const QString &url, const QString &identifier)
{
//TODO implement me
SaveResoureConfigTest saveResourceConfig;
saveResourceConfig.setArchive(mArchiveStorage->archive());
saveResourceConfig.exportResourceToArchive(archivePath, url, identifier, Utils::resourceAlarmArchiveName(), { QLatin1String("akonadi_kalarm_dir_resource_")});
slotAlarmJobTerminated();
}
......
......@@ -23,6 +23,7 @@
#include "testexportfile.h"
#include <QDebug>
#include <QTest>
#include <saveresourceconfigtest.h>
QTEST_MAIN(ExportCalendarsJobInterfaceTest)
......@@ -56,7 +57,9 @@ QString ExportCalendarsJobInterfaceTestImpl::convertToFullCollectionPath(const q
void ExportCalendarsJobInterfaceTestImpl::exportResourceToArchive(const QString &archivePath, const QString &url, const QString &identifier)
{
//TODO implement it
SaveResoureConfigTest saveResourceConfig;
saveResourceConfig.setArchive(mArchiveStorage->archive());
saveResourceConfig.exportResourceToArchive(archivePath, url, identifier, Utils::resourceCalendarArchiveName(), { QLatin1String("akonadi_icaldir_resource_")});
slotCalendarJobTerminated();
}
......
......@@ -23,6 +23,7 @@
#include "testexportfile.h"
#include <QDebug>
#include <QTest>
#include <saveresourceconfigtest.h>
QTEST_MAIN(ExportMailJobInterfaceTest)
......@@ -77,7 +78,11 @@ QVector<MailCommon::MailFilter *> ExportMailJobInterfaceTestImpl::filters()
void ExportMailJobInterfaceTestImpl::exportResourceToArchive(const QString &archivePath, const QString &url, const QString &identifier)
{
qDebug() << " not implement yet";
SaveResoureConfigTest saveResourceConfig;
saveResourceConfig.setArchive(mArchiveStorage->archive());
saveResourceConfig.exportResourceToArchive(archivePath, url, identifier, Utils::resourceMailArchiveName(),
{ QLatin1String("akonadi_maildir_resource_"), QLatin1String("akonadi_mixedmaildir_resource_")});
slotMailsJobTerminated();
}
QVector<Utils::AkonadiInstanceInfo> ExportMailJobInterfaceTestImpl::listOfResource()
......
......@@ -618,7 +618,7 @@ void ExportMailJobInterface::slotWriteNextArchiveResource()
QTimer::singleShot(0, this, &ExportMailJobInterface::slotMailsJobTerminated);
}
} else if (identifier.contains(QLatin1String("akonadi_mbox_resource_"))) {
backupResourceFile(identifier, Utils::addressbookPath());
backupResourceFile(identifier, Utils::addressbookPath()); //FIxME addressbookPath or MailPAth ???
QTimer::singleShot(0, this, &ExportMailJobInterface::slotMailsJobTerminated);
} else {
QTimer::singleShot(0, this, &ExportMailJobInterface::slotMailsJobTerminated);
......
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