Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
PIM Data Exporter
Commits
41bc1c2f
Commit
41bc1c2f
authored
May 26, 2020
by
Laurent Montel
😁
Browse files
Continue to implement mail autotest
parent
2e38a571
Pipeline
#21356
passed with stage
in 12 minutes and 52 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
core/autotests/addressbook/importaddressbookjobinterfacetest.cpp
View file @
41bc1c2f
...
...
@@ -33,7 +33,7 @@ ImportAddressbookJobInterfaceTestImpl::ImportAddressbookJobInterfaceTestImpl(QOb
ImportAddressbookJobInterfaceTestImpl
::~
ImportAddressbookJobInterfaceTestImpl
()
{
//Clean up temp repo
QVERIFY
(
QDir
(
QDir
::
tempPath
()
+
QLatin1Char
(
'/'
)
+
Utils
::
storeAddressbook
()).
removeRecursively
());
QVERIFY
(
QDir
(
extractPath
()).
removeRecursively
());
}
Akonadi
::
Collection
::
Id
ImportAddressbookJobInterfaceTestImpl
::
convertFolderPathToCollectionId
(
const
QString
&
path
)
...
...
@@ -98,6 +98,7 @@ void ImportAddressbookJobInterfaceTest::importAddressbook()
file
->
setExcludePath
(
Utils
::
addressbookPath
());
ImportAddressbookJobInterfaceTestImpl
*
impl
=
new
ImportAddressbookJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
impl
->
setPathConfig
(
file
->
pathConfig
());
impl
->
setExtractPath
(
file
->
extractPath
());
file
->
setAbstractImportExportJob
(
impl
);
file
->
setLoggingFilePath
(
impl
->
loggingFilePath
());
file
->
start
();
...
...
core/autotests/exportimportutil.cpp
View file @
41bc1c2f
...
...
@@ -48,3 +48,13 @@ QString ExportImportUtil::loggingFilePath() const
{
return
mLogCreateResource
->
logPath
();
}
void
ExportImportUtil
::
setExtractPath
(
const
QString
&
extractPath
)
{
mExtractPath
=
extractPath
;
}
QString
ExportImportUtil
::
extractPath
()
const
{
return
mExtractPath
;
}
core/autotests/exportimportutil.h
View file @
41bc1c2f
...
...
@@ -35,8 +35,14 @@ public:
QVector
<
Utils
::
AkonadiInstanceInfo
>
mListAkonadiInstanceInfo
;
QString
mPathConfig
;
void
setExtractPath
(
const
QString
&
extractPath
);
Q_REQUIRED_RESULT
QString
extractPath
()
const
;
protected:
LogCreatingResource
*
mLogCreateResource
=
nullptr
;
private:
QString
mExtractPath
;
};
#endif // EXPORTIMPORTUTIL_H
core/autotests/mail/importmailjobinterfacetest.cpp
View file @
41bc1c2f
...
...
@@ -35,8 +35,15 @@ ImportMailJobInterfaceTestImpl::ImportMailJobInterfaceTestImpl(QObject *parent,
ImportMailJobInterfaceTestImpl
::~
ImportMailJobInterfaceTestImpl
()
{
//Clean up temp repo
QVERIFY
(
QDir
(
QDir
::
tempPath
()
+
QLatin1Char
(
'/'
)
+
Utils
::
storeMails
()).
removeRecursively
());
//Clean up temp repo. FIXME !
QVERIFY
(
QDir
(
extractPath
()).
removeRecursively
());
}
void
ImportMailJobInterfaceTestImpl
::
start
()
{
QDir
().
mkpath
(
extractPath
());
//Create temporary file for identities
ImportMailJobInterface
::
start
();
}
Akonadi
::
Collection
::
Id
ImportMailJobInterfaceTestImpl
::
convertFolderPathToCollectionId
(
const
QString
&
path
)
...
...
@@ -149,9 +156,12 @@ void ImportMailJobInterfaceTest::importMail()
file
->
setExcludePath
(
Utils
::
mailsPath
());
// ???
ImportMailJobInterfaceTestImpl
*
impl
=
new
ImportMailJobInterfaceTestImpl
(
this
,
options
,
file
->
archiveStorage
(),
1
);
impl
->
setPathConfig
(
file
->
pathConfig
());
impl
->
setExtractPath
(
file
->
extractPath
());
file
->
setAbstractImportExportJob
(
impl
);
file
->
setLoggingFilePath
(
impl
->
loggingFilePath
());
file
->
start
();
delete
impl
;
delete
file
;
}
core/autotests/mail/importmailjobinterfacetest.h
View file @
41bc1c2f
...
...
@@ -31,6 +31,7 @@ class ImportMailJobInterfaceTestImpl : public ImportMailJobInterface, public Exp
public:
explicit
ImportMailJobInterfaceTestImpl
(
QObject
*
parent
,
Utils
::
StoredTypes
typeSelected
,
ArchiveStorage
*
archiveStorage
,
int
numberOfStep
);
~
ImportMailJobInterfaceTestImpl
();
void
start
()
override
;
protected:
Q_REQUIRED_RESULT
Akonadi
::
Collection
::
Id
convertFolderPathToCollectionId
(
const
QString
&
path
)
override
;
...
...
@@ -47,6 +48,7 @@ protected:
void
importSmtpMailTransport
(
const
KConfigGroup
&
group
,
int
defaultTransport
,
int
transportId
)
override
;
private:
uint
mIdentityUoid
=
1
;
};
class
ImportMailJobInterfaceTest
:
public
QObject
...
...
core/autotests/testimportfile.cpp
View file @
41bc1c2f
...
...
@@ -141,3 +141,8 @@ void TestImportFile::setLoggingFilePath(const QString &loggingFilePath)
{
mLoggingFilePath
=
loggingFilePath
;
}
QString
TestImportFile
::
extractPath
()
const
{
return
mExtractPath
;
}
core/autotests/testimportfile.h
View file @
41bc1c2f
...
...
@@ -48,6 +48,8 @@ public:
Q_REQUIRED_RESULT
QString
loggingFilePath
()
const
;
void
setLoggingFilePath
(
const
QString
&
loggingFilePath
);
Q_REQUIRED_RESULT
QString
extractPath
()
const
;
private:
AbstractImportExportJob
*
mAbstractImportExportJob
=
nullptr
;
ArchiveStorage
*
mArchiveStorage
=
nullptr
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment