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
KDE PIM Runtime
Commits
7a8246ef
Commit
7a8246ef
authored
Nov 16, 2019
by
Krzysztof Nowicki
Committed by
Laurent Montel
Aug 24, 2021
Browse files
Expose the main resource DBus interface for testability
Signed-off-by:
Krzysztof Nowicki
<
krissn@op.pl
>
parent
88fb9bf3
Changes
3
Hide whitespace changes
Inline
Side-by-side
resources/ews/test/CMakeLists.txt
View file @
7a8246ef
...
...
@@ -13,9 +13,12 @@ kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/../ewsresource.kcfg org
set
(
ewssettingsinterface_xml
${
CMAKE_CURRENT_BINARY_DIR
}
/org.kde.Akonadi.Ews.Settings.xml
)
qt_generate_dbus_interface
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/../ewssettings.h org.kde.Akonadi.Ews.Wallet.xml OPTIONS -a
)
set
(
ewswalletinterface_xml
${
CMAKE_CURRENT_BINARY_DIR
}
/org.kde.Akonadi.Ews.Wallet.xml
)
qt_generate_dbus_interface
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/../ewsresource.h org.kde.Akonadi.Ews.Resource.xml OPTIONS -a
)
set
(
ewsresourceinterface_xml
${
CMAKE_CURRENT_BINARY_DIR
}
/org.kde.Akonadi.Ews.Resource.xml
)
qt_add_dbus_interface
(
isolatestestcommon_SRCS
${
ewssettingsinterface_xml
}
ewssettings
)
qt_add_dbus_interface
(
isolatestestcommon_SRCS
${
ewswalletinterface_xml
}
ewswallet
)
qt_add_dbus_interface
(
isolatestestcommon_SRCS
${
ewsresourceinterface_xml
}
ewsresource
)
add_library
(
isolatedtestcommon STATIC
${
isolatestestcommon_SRCS
}
)
target_link_libraries
(
isolatedtestcommon
...
...
resources/ews/test/isolatedtestbase.cpp
View file @
7a8246ef
...
...
@@ -12,6 +12,7 @@
#include
<AkonadiCore/AgentManager>
#include
<AkonadiCore/Control>
#include
"ewsresourceinterface.h"
#include
"ewssettings.h"
#include
"ewswallet.h"
#include
"fakeewsserverthread.h"
...
...
@@ -103,6 +104,13 @@ TestAgentInstance::TestAgentInstance(const QString &url)
this
));
QVERIFY
(
mEwsWalletInterface
->
isValid
());
mEwsResourceInterface
.
reset
(
new
OrgKdeAkonadiEwsResourceInterface
(
QStringLiteral
(
"org.freedesktop.Akonadi.Resource."
)
+
mIdentifier
+
QLatin1Char
(
'.'
)
+
akonadiInstanceIdentifier
,
QStringLiteral
(
"/"
),
QDBusConnection
::
sessionBus
(),
this
));
QVERIFY
(
mEwsResourceInterface
->
isValid
());
/* The EWS resource initializes its DBus adapters asynchronously. Therefore it can happen that
* due to a race access is attempted prior to their initialization. To fix this retry the DBus
* communication a few times before declaring failure. */
...
...
@@ -188,6 +196,11 @@ OrgKdeAkonadiEwsWalletInterface &TestAgentInstance::walletInterface() const
return
*
mEwsWalletInterface
;
}
OrgKdeAkonadiEwsResourceInterface
&
TestAgentInstance
::
resourceInterface
()
const
{
return
*
mEwsResourceInterface
;
}
Akonadi
::
AgentInstance
&
TestAgentInstance
::
instance
()
const
{
return
*
mEwsInstance
;
...
...
resources/ews/test/isolatedtestbase.h
View file @
7a8246ef
...
...
@@ -20,6 +20,7 @@ class AgentInstance;
class
FakeEwsServerThread
;
class
OrgKdeAkonadiEwsSettingsInterface
;
class
OrgKdeAkonadiEwsWalletInterface
;
class
OrgKdeAkonadiEwsResourceInterface
;
class
IsolatedTestBase
:
public
QObject
{
...
...
@@ -77,12 +78,14 @@ public:
OrgKdeAkonadiEwsSettingsInterface
&
settingsInterface
()
const
;
OrgKdeAkonadiEwsWalletInterface
&
walletInterface
()
const
;
OrgKdeAkonadiEwsResourceInterface
&
resourceInterface
()
const
;
Akonadi
::
AgentInstance
&
instance
()
const
;
private:
QScopedPointer
<
Akonadi
::
AgentInstance
>
mEwsInstance
;
QScopedPointer
<
OrgKdeAkonadiEwsSettingsInterface
>
mEwsSettingsInterface
;
QScopedPointer
<
OrgKdeAkonadiEwsWalletInterface
>
mEwsWalletInterface
;
QScopedPointer
<
OrgKdeAkonadiEwsResourceInterface
>
mEwsResourceInterface
;
QString
mIdentifier
;
};
...
...
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