Commit e44ad396 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Export akonadi config file too

parent d642383e
......@@ -5,7 +5,7 @@ set( exportnotesjobinterfacetest_SRCS exportnotesjobinterfacetest.cpp)
add_executable( exportnotesjobinterfacetest ${exportnotesjobinterfacetest_SRCS})
add_test(NAME exportnotesjobinterfacetest COMMAND exportnotesjobinterfacetest)
ecm_mark_as_test(exportnotesjobinterfacetest)
target_link_libraries( exportnotesjobinterfacetest Qt5::Test pimdataexporterprivate test_resourceconverter KF5::ConfigCore KF5::Archive)
target_link_libraries( exportnotesjobinterfacetest Qt5::Test pimdataexporterprivate test_resourceconverter KF5::ConfigCore KF5::Archive KF5::AkonadiCore)
#######
set( importnotesjobinterfacetest_SRCS importnotesjobinterfacetest.cpp)
......
......@@ -21,6 +21,7 @@
#include "archivestorage.h"
#include "resourceconvertertest.h"
#include "testexportfile.h"
#include <AkonadiCore/ServerManager>
#include <KZip>
#include <QDebug>
#include <QTest>
......@@ -59,7 +60,14 @@ void ExportNotesJobInterfaceTestImpl::exportResourceToArchive(const QString &arc
qDebug() << " void ExportNotesJobInterfaceTestImpl::exportResourceToArchive(const QString &archivePath, const QString &url, const QString &identifier)" << archivePath << " url " << url << " identifier " << identifier;
QVERIFY(identifier.startsWith(QLatin1String("akonadi_akonotes_resource_")));
QVERIFY(mArchiveStorage->archive()->addLocalFile(url + identifier + QLatin1String(".zip"), archivePath + Utils::resourceNoteArchiveName()));
//TODO export config file too.
ResourceConverterTest converter;
const QString errorStr = converter.storeResources(archive(), identifier, archivePath);
QVERIFY(!errorStr.isEmpty());
const QString urlAgentConfig = Akonadi::ServerManager::agentConfigFilePath(identifier);
QVERIFY(!urlAgentConfig.isEmpty());
const QFileInfo fi(urlAgentConfig);
const QString filename = fi.fileName();
QVERIFY(mArchiveStorage->archive()->addLocalFile(urlAgentConfig, archivePath + filename));
slotNoteJobTerminated();
}
......
......@@ -25,7 +25,6 @@
#include <KZip>
#include <QDir>
#include <QFileInfo>
#include <QFileInfo>
#include <QTemporaryFile>
ResourceConverterBase::ResourceConverterBase()
......
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