Commit 7f5d0688 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Start to implement export alarm autotest

parent 0b557443
......@@ -88,3 +88,35 @@ void ExportAlarmJobInterfaceTest::exportAlarmConfig()
file->start();
delete impl;
}
void ExportAlarmJobInterfaceTest::exportAlarmConfigAndResource_data()
{
QTest::addColumn<QByteArray>("configpath");
const QByteArray pathConfig(QByteArray(PIMDATAEXPORTER_DIR) + "/export/");
//QTest::newRow("test1resource") << pathConfig + QByteArray("test1resource/");
QTest::newRow("fullresource") << pathConfig + QByteArray("fullresource/");
}
void ExportAlarmJobInterfaceTest::exportAlarmConfigAndResource()
{
QFETCH(QByteArray, configpath);
TestExportFile *file = new TestExportFile(this);
file->setPathConfig(configpath);
QVector<Utils::AkonadiInstanceInfo> lstInfo;
Utils::AkonadiInstanceInfo info;
info.identifier = QLatin1String("akonadi_kalarm_dir_resource_1");
lstInfo << info;
info.identifier = QLatin1String("akonadi_kalarm_dir_resource_1");
lstInfo << info;
//Add extra resource.
info.identifier = QStringLiteral("akonadi_kolab_resource_2");
lstInfo << info;
ExportAlarmJobInterfaceTestImpl *exportNote = new ExportAlarmJobInterfaceTestImpl(this, {Utils::StoredType::Config|Utils::StoredType::Resources}, file->archiveStorage(), 1);
exportNote->setListOfResource(lstInfo);
exportNote->setPathConfig(QLatin1String(configpath));
file->setAbstractImportExportJob(exportNote);
file->start();
delete exportNote;
}
......@@ -47,6 +47,9 @@ public:
private Q_SLOTS:
void exportAlarmConfig();
void exportAlarmConfig_data();
void exportAlarmConfigAndResource_data();
void exportAlarmConfigAndResource();
};
#endif // ExportAlarmJobInterfaceTest_H
......@@ -80,3 +80,4 @@ void ImportAlarmJobInterfaceTest::importCalendarConfig()
delete impl;
delete file;
}
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