Commit 5570bdf5 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add akregator support

parent 148b83ce
......@@ -16,3 +16,4 @@ add_subdirectory(notes)
add_subdirectory(calendar)
add_subdirectory(addressbook)
add_subdirectory(alarm)
add_subdirectory(akregator)
add_definitions( -DPIMDATAEXPORTER_DIR="${CMAKE_CURRENT_SOURCE_DIR}/data" )
set( exportakregatorjobinterfacetest_SRCS exportakregatorjobinterfacetest.cpp ../resourceconvertertest.cpp )
add_executable( exportakregatorjobinterfacetest ${exportakregatorjobinterfacetest_SRCS})
add_test(NAME exportakregatorjobinterfacetest COMMAND exportakregatorjobinterfacetest)
ecm_mark_as_test(exportakregatorjobinterfacetest)
target_link_libraries(exportakregatorjobinterfacetest Qt5::Test pimdataexporterprivate KF5::ConfigCore)
[Defaults]
Profile=Default
[PROFILE_Default]
EmailAddress=
FullName=laurent
Organization=
ReplyAddr=
ServerType=
[General]
Default Identity=1578759321
[Identity #0]
Default Domain=linux-zym0
Disable Fcc=false
Identity=laurent
Image Location=
Inline Signature=
Name=laurent
Signature Enabled=false
uoid=1578759321
[Network]
KnownHosts=199.168.1.13
NoteHostDialogSize=596,334
Port=12
SenderID=VV
[SelectNoteFolder]
DefaultFolder=31
[$Version]
update_info=noteglobalsettings.upd:initial-noteagent-migration,noteglobalsettings.upd:selectcollection-noteagent-migration
[AgentTypeDialog]
Size=979,637
[Display]
width=260
[DownloadDialog Settings]
Height 1080=522
Width 1920=700
[Editor]
titlefont=Liberation Sans,12,-1,5,50,0,0,0,0,0,Regular
[KFileDialog Settings]
Height 1080=540
Width 1920=960
[KNoteDeleteSelectedNotesDialog]
Size=300,200
[KNoteFindDialog]
Size=461,270
[KNotePrintSelectedNotesDialog]
Size=960,656
[KNoteSimpleConfigDialog]
Size=600,400
[KNotesKeyDialog]
Size=1120,685
[KPimPrintPreviewDialog]
Size=1054,732
[Migratekde4]
Version=1
[Misc]
SystemTrayShowNotes=true
[SelectedNotefolderDialog]
Size=600,400
/*
Copyright (C) 2020 Laurent Montel <montel@kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "exportakregatorjobinterfacetest.h"
#include "archivestorage.h"
#include "../resourceconvertertest.h"
#include <QDebug>
#include <QTest>
#include <QSignalSpy>
QTEST_MAIN(ExportAkregatorJobInterfaceTest)
ExportAkregatorJobInterfaceTestImpl::ExportAkregatorJobInterfaceTestImpl(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
: ExportAkregatorJobInterface(parent, typeSelected, archiveStorage, numberOfStep)
{
}
ExportAkregatorJobInterfaceTestImpl::~ExportAkregatorJobInterfaceTestImpl()
{
}
ExportAkregatorJobInterfaceTest::ExportAkregatorJobInterfaceTest(QObject *parent)
: QObject(parent)
{
}
void ExportAkregatorJobInterfaceTest::importAkregatorConfigTest1()
{
//Don't use setTestModeEnabled otherwise we can set env
//QStandardPaths::setTestModeEnabled(true);
qputenv("XDG_DATA_HOME", PIMDATAEXPORTER_DIR "/test1/share");
qputenv("XDG_CONFIG_HOME", PIMDATAEXPORTER_DIR "/test1/config");
//TODO fix file name.
const QString storeArchivePath(QStringLiteral("/tmp/foo.zip"));
ArchiveStorage *archiveStorage = new ArchiveStorage(storeArchivePath, this);
Q_ASSERT(archiveStorage->openArchive(true));
Utils::addVersion(archiveStorage->archive());
Utils::storeDataExportInfo(storeArchivePath, archiveStorage->archive());
ExportAkregatorJobInterfaceTestImpl *exportNote = new ExportAkregatorJobInterfaceTestImpl(this, {Utils::StoredType::Config}, archiveStorage, 1);
QSignalSpy finish(exportNote, &ExportAkregatorJobInterfaceTestImpl::jobFinished);
QSignalSpy error(exportNote, &ExportAkregatorJobInterfaceTestImpl::error);
exportNote->start();
QVERIFY(finish.wait());
QCOMPARE(error.count(), 0);
delete exportNote;
delete archiveStorage;
}
/*
Copyright (C) 2020 Laurent Montel <montel@kde.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef EXPORTAKREGATORJOBINTERFACETEST_H
#define EXPORTAKREGATORJOBINTERFACETEST_H
#include <QObject>
#include "akregator/exportakregatorjobinterface.h"
class ExportAkregatorJobInterfaceTestImpl : public ExportAkregatorJobInterface
{
Q_OBJECT
public:
explicit ExportAkregatorJobInterfaceTestImpl(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep);
~ExportAkregatorJobInterfaceTestImpl();
};
class ExportAkregatorJobInterfaceTest : public QObject
{
Q_OBJECT
public:
explicit ExportAkregatorJobInterfaceTest(QObject *parent = nullptr);
~ExportAkregatorJobInterfaceTest() = default;
private Q_SLOTS:
void importAkregatorConfigTest1();
};
#endif // EXPORTAKREGATORJOBINTERFACETEST_H
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