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

Add more autotest

parent a09a3c3c
......@@ -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::MailCommon)
#####
......
[Filter #0]
Applicability=0
AutomaticName=true
ConfigureShortcut=false
ConfigureToolbar=false
Enabled=true
Icon=system-run
StopProcessingHere=true
ToolbarName=<List-Id>: <development.lists.qt-project.org>
action-args-0=3807
action-name-0=transfer
actions=1
apply-on=check-mail,manual-filtering
contentsA=<development.lists.qt-project.org>
fieldA=List-Id
funcA=contains
identifier=oFmAmBrxrnkSmZZi
name=<List-Id>: <development.lists.qt-project.org>
operator=and
rules=1
[Filter #1]
Applicability=0
AutomaticName=true
ConfigureShortcut=false
ConfigureToolbar=false
Enabled=true
Icon=system-run
StopProcessingHere=true
ToolbarName=<List-Id>: <interest.lists.qt-project.org>
action-args-0=3808
action-name-0=transfer
actions=1
apply-on=check-mail,manual-filtering
contentsA=<interest.lists.qt-project.org>
fieldA=List-Id
funcA=contains
identifier=g4zR6v8Ic9wEsrWK
name=<List-Id>: <interest.lists.qt-project.org>
operator=and
rules=1
[FilterActionMissingAccountDialog]
Size=1280,669
[General]
filters=2
[Geometry]
filterLogSize=600,400
identities/emailidentities
information/VERSION_2
information/exportdatatype.xml
configs/akonadi_archivemail_agentrc
configs/foldermailarchiverc
configs/kabldaprc
configs/kmail2rc
configs/templatesconfigurationrc
transports/mailtransports
[FolderArchiveAccount akonadi_akonotes_resource_0]
enabled=false
folderArchiveType=0
instanceName=akonadi_akonotes_resource_0
keepExistingStructure=false
[FolderArchiveAccount akonadi_akonotes_resource_1]
enabled=false
folderArchiveType=0
instanceName=akonadi_akonotes_resource_1
keepExistingStructure=false
[FolderArchiveAccount akonadi_akonotes_resource_2]
enabled=false
folderArchiveType=0
instanceName=akonadi_akonotes_resource_2
keepExistingStructure=false
[FolderArchiveAccount akonadi_akonotes_resource_3]
enabled=false
folderArchiveType=0
instanceName=akonadi_akonotes_resource_3
keepExistingStructure=false
[FolderArchiveAccount akonadi_akonotes_resource_5]
enabled=false
folderArchiveType=0
instanceName=akonadi_akonotes_resource_5
keepExistingStructure=false
[FolderArchiveAccount akonadi_akonotes_resource_6]
enabled=false
folderArchiveType=0
instanceName=akonadi_akonotes_resource_6
keepExistingStructure=false
[FolderArchiveAccount akonadi_imap_resource_2]
enabled=false
folderArchiveType=0
instanceName=akonadi_imap_resource_2
keepExistingStructure=false
[FolderArchiveAccount akonadi_imap_resource_3]
enabled=false
folderArchiveType=0
instanceName=akonadi_imap_resource_3
keepExistingStructure=false
[FolderArchiveAccount akonadi_imap_resource_4]
enabled=false
folderArchiveType=0
instanceName=akonadi_imap_resource_4
keepExistingStructure=false
[FolderArchiveAccount akonadi_imap_resource_43]
enabled=false
folderArchiveType=0
instanceName=akonadi_imap_resource_43
keepExistingStructure=false
[FolderArchiveAccount akonadi_imap_resource_5]
enabled=false
folderArchiveType=0
instanceName=akonadi_imap_resource_5
keepExistingStructure=false
[FolderArchiveAccount akonadi_kolab_resource_1]
enabled=true
folderArchiveType=0
instanceName=akonadi_kolab_resource_1
keepExistingStructure=false
topLevelCollectionId=foo/bla bla/bli2378
[FolderArchiveAccount akonadi_kolab_resource_8]
enabled=true
folderArchiveType=0
instanceName=akonadi_kolab_resource_8
keepExistingStructure=false
topLevelCollectionId=foo/bla bla/bli4032
[FolderArchiveAccount akonadi_maildir_resource_10]
enabled=false
folderArchiveType=0
instanceName=akonadi_maildir_resource_10
keepExistingStructure=false
[FolderArchiveAccount akonadi_maildir_resource_3]
enabled=false
folderArchiveType=0
instanceName=akonadi_maildir_resource_3
keepExistingStructure=false
[FolderArchiveAccount akonadi_maildir_resource_4]
enabled=false
folderArchiveType=0
instanceName=akonadi_maildir_resource_4
keepExistingStructure=false
[FolderArchiveAccount akonadi_maildir_resource_5]
enabled=false
folderArchiveType=0
instanceName=akonadi_maildir_resource_5
keepExistingStructure=false
[FolderArchiveAccount akonadi_maildir_resource_6]
enabled=false
folderArchiveType=0
instanceName=akonadi_maildir_resource_6
keepExistingStructure=false
[FolderArchiveAccount akonadi_maildir_resource_7]
enabled=false
folderArchiveType=0
instanceName=akonadi_maildir_resource_7
keepExistingStructure=false
[FolderArchiveAccount akonadi_maildir_resource_8]
enabled=false
folderArchiveType=0
instanceName=akonadi_maildir_resource_8
keepExistingStructure=false
[FolderArchiveAccount akonadi_maildir_resource_9]
enabled=false
folderArchiveType=0
instanceName=akonadi_maildir_resource_9
keepExistingStructure=false
[Headers]
HeaderState=\x00\x00\x00\xff\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x08\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x88\x00\x00\x00\x12\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00T\xff\xff\xff\xff\x00\x00\x00\x84\x00\x00\x00\x00\x00\x00\x00\x12\x00\x00\x00\xd5\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00w\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\xfe\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00t\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\xda\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00d\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00d\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00d\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x01$\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00d\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00d\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00d\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00d\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00d\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00d\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00(\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\xa0\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x03\xe8\x00\xff\xff\xff\xff
[LDAP]
NumHosts=0
NumSelectedHosts=1
SelectedAuth0=Simple
SelectedBase0=dc=bli,dc=com
SelectedBind0=uid=foo,ou=people,dc=bli,dc=com
SelectedCompletionWeight0=98
SelectedHost0=ciphony.kdab.com
SelectedMech0=DIGEST-MD5
SelectedPageSize0=0
SelectedPort0=636
SelectedSecurity0=SSL
SelectedSizeLimit0=0
SelectedTimeLimit0=0
SelectedUser0=
SelectedUserFilter0=nsRole=cn=d,dc=bli,dc=com
SelectedVersion0=3
[LDAPSearch]
SearchType=1
[Size]
Size=1172,673
[General]
default-transport=2
[Transport 1]
authenticationType=0
encryption=1
host=smtp.foo.fr
localHostname=
name=transportname1
port=465
precommand=
requiresAuthentication=false
senderOverwriteAddress=bla@foo.fr
specifyHostname=false
specifySenderOverwriteAddress=true
storePassword=true
userName=vla@bla.fr
[Transport 2]
authenticationType=0
encryption=1
host=smtp.bla.org
localHostname=
name=transportname2
port=587
precommand=
requiresAuthentication=true
senderOverwriteAddress=
specifyHostname=false
specifySenderOverwriteAddress=false
storePassword=true
userName=foo@bla.org
[General]
Default Identity=1
[Identity #0]
Attach Vcard=false
Autocorrection Language=fr_FR
Bcc=foo@kde.org
Default Domain=zym0
Dictionary=American English (United States)
Disable Fcc=false
Drafts=3730
Email Address=foo@kde.org
Email Aliases=
Fcc=3734
Identity=Default
Image Location=
Inline Signature=olutions\s
Inlined Html=false
Name=kd
Organization=kde
PGP Encryption Key=CDF87D8A5BAA692D34B30D1065D31
PGP Signing Key=F87D8A5BAA692D34B30D1065D31
Pgp Auto Encrypt=false
Pgp Auto Sign=false
Preferred Crypto Message Format=openpgp/mime
Reply-To Address=foo@kde.org
Signature Enabled=true
Signature Type=inline
Templates=3735
Transport=1701481874
X-FaceEnabled=false
uoid=1
[Identity #1]
Attach Vcard=false
Autocorrection Language=fr_FR
Bcc=dd@foo.com
Default Domain=9td
Dictionary=français (France)
Disable Fcc=false
Drafts=3730
Email Address=dd@foo.com
Email Aliases=dde@foo.com
Fcc=3734
Identity=Kolab
Image Location=
Inline Signature=OpenGL Experts\n
Inlined Html=false
Name=Bla Bli
Pgp Auto Encrypt=false
Pgp Auto Sign=false
Preferred Crypto Message Format=s/mime
SMIME Encryption Key=E225DBF44009243D1F177F552D5397C
SMIME Signing Key=9243D1F177F552D5397C
Signature Enabled=true
Signature Type=inline
Templates=3735
Transport=1960518839
X-FaceEnabled=true
uoid=2
identities/emailidentities
information/VERSION_2
information/exportdatatype.xml
Special Collection : 3 colId 3734
--------------------------
Special Collection : 5 colId 3730
--------------------------
Special Collection : 6 colId 3735
--------------------------
Special Collection : 3 colId 3734
--------------------------
Special Collection : 5 colId 3730
--------------------------
Special Collection : 6 colId 3735
--------------------------
......@@ -68,10 +68,10 @@ void ExportMailJobInterfaceTest::exportMail()
info.identifier = QStringLiteral("akonadi_kolab_resource_2");
lstInfo << info;
ExportMailJobInterfaceTestImpl *exportNote = new ExportMailJobInterfaceTestImpl(this, options, file->archiveStorage(), 1);
exportNote->setListOfResource(lstInfo);
exportNote->setPathConfig(QLatin1String(configpath));
file->setAbstractImportExportJob(exportNote);
ExportMailJobInterfaceTestImpl *exportMail = new ExportMailJobInterfaceTestImpl(this, options, file->archiveStorage(), 1);
exportMail->setListOfResource(lstInfo);
exportMail->setPathConfig(QLatin1String(configpath));
file->setAbstractImportExportJob(exportMail);
file->start();
delete exportNote;
delete exportMail;
}
......@@ -22,6 +22,7 @@
#include "resourceconvertertest.h"
#include "saveresourceconfigtest.h"
#include "testbackupresourcefilejob.h"
#include <MailCommon/FilterImporterExporter>
#include <QDebug>
ExportMailJobInterfaceTestImpl::ExportMailJobInterfaceTestImpl(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep)
......@@ -63,9 +64,13 @@ Akonadi::Collection::Id ExportMailJobInterfaceTestImpl::convertFolderPathToColle
QVector<MailCommon::MailFilter *> ExportMailJobInterfaceTestImpl::filters()
{
qDebug() << " not implement yet ExportMailJobInterfaceTestImpl::filters()";
//TODO implement it
return {};
MailCommon::FilterImporterExporter exportFilters;
const QString filename = mPathConfig + QLatin1String("filters");
KSharedConfig::Ptr config = KSharedConfig::openConfig(filename);
qDebug() << " filename " << filename;
QStringList lst;
const QVector<MailCommon::MailFilter *> filters = exportFilters.readFiltersFromConfig(config, lst);
return filters;
}
void ExportMailJobInterfaceTestImpl::exportResourceToArchive(const QString &archivePath, const QString &url, const QString &identifier)
......@@ -103,11 +108,6 @@ QString ExportMailJobInterfaceTestImpl::resourcePath(const QString &identifier)
return url;
}
void ExportMailJobInterfaceTestImpl::exportFilters()
{
qDebug() << " void ExportMailJobInterfaceTestImpl::exportFilters() not implemented yet";
}
void ExportMailJobInterfaceTestImpl::backupMailResourceFile(const QString &agentIdentifier, const QString &defaultPath)
{
TestBackupResourceFileJob *job = new TestBackupResourceFileJob(this);
......
......@@ -51,6 +51,5 @@ protected:
Q_REQUIRED_RESULT QString createResource(const QString &resources, const QString &name, const QMap<QString, QVariant> &settings, bool synchronizeTree) override;
Q_REQUIRED_RESULT QVector<uint> listIdentityUoid() const override;
void exportFilters() override;
};
#endif // EXPORTMAILJOBINTERFACETESTIMPL_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