Commit 8a27e287 authored by David Faure's avatar David Faure

pop3test: fix unittest setup, and fix the test itself (wrong dbus service name)

parent 19bc7624
......@@ -25,6 +25,7 @@
#include <AkonadiCore/ItemDeleteJob>
#include <AkonadiCore/ItemFetchJob>
#include <AkonadiCore/ItemFetchScope>
#include <AkonadiCore/ServerManager>
#include <qtest_akonadi.h>
#include <KMime/Message>
......@@ -37,6 +38,7 @@ using namespace Akonadi;
void Pop3Test::initTestCase()
{
AkonadiTest::checkTestIsIsolated();
QVERIFY(Akonadi::Control::start());
// switch all resources offline to reduce interference from them
......@@ -112,41 +114,41 @@ void Pop3Test::initTestCase()
// Configure the pop3 resource
//
mPOP3SettingsInterface = new OrgKdeAkonadiPOP3SettingsInterface(
QLatin1String("org.freedesktop.Akonadi.Resource.") + mPop3Identifier,
Akonadi::ServerManager::agentServiceName(Akonadi::ServerManager::Resource, mPop3Identifier),
QStringLiteral("/Settings"), QDBusConnection::sessionBus(), this);
QDBusReply<uint> reply0 = mPOP3SettingsInterface->port();
QVERIFY(reply0.isValid());
QVERIFY(reply0.value() == 110);
QCOMPARE(reply0.value(), 110u);
mPOP3SettingsInterface->setPort(5989);
AgentManager::self()->instance(mPop3Identifier).reconfigure();
QDBusReply<uint> reply = mPOP3SettingsInterface->port();
QVERIFY(reply.isValid());
QVERIFY(reply.value() == 5989);
QCOMPARE(reply.value(), 5989u);
mPOP3SettingsInterface->setHost(QStringLiteral("localhost"));
AgentManager::self()->instance(mPop3Identifier).reconfigure();
QDBusReply<QString> reply2 = mPOP3SettingsInterface->host();
QVERIFY(reply2.isValid());
QVERIFY(reply2.value() == QLatin1String("localhost"));
QCOMPARE(reply2.value(), QLatin1String("localhost"));
mPOP3SettingsInterface->setLogin(QStringLiteral("HansWurst"));
AgentManager::self()->instance(mPop3Identifier).reconfigure();
QDBusReply<QString> reply3 = mPOP3SettingsInterface->login();
QVERIFY(reply3.isValid());
QVERIFY(reply3.value() == QLatin1String("HansWurst"));
QCOMPARE(reply3.value(), QLatin1String("HansWurst"));
mPOP3SettingsInterface->setUnitTestPassword(QStringLiteral("Geheim"));
AgentManager::self()->instance(mPop3Identifier).reconfigure();
QDBusReply<QString> reply4 = mPOP3SettingsInterface->unitTestPassword();
QVERIFY(reply4.isValid());
QVERIFY(reply4.value() == QLatin1String("Geheim"));
QCOMPARE(reply4.value(), QLatin1String("Geheim"));
mPOP3SettingsInterface->setTargetCollection(mMaildirCollection.id());
AgentManager::self()->instance(mPop3Identifier).reconfigure();
QDBusReply<qlonglong> reply5 = mPOP3SettingsInterface->targetCollection();
QVERIFY(reply5.isValid());
QVERIFY(reply5.value() == mMaildirCollection.id());
QCOMPARE(reply5.value(), mMaildirCollection.id());
}
void Pop3Test::cleanupTestCase()
......
<config>
<kdehome>kdehome</kdehome>
<confighome>xdgconfig</confighome>
<confighome>xdgconfig-mysql.fs</confighome>
<datahome>xdglocal</datahome>
<envvar name="AKONADI_DISABLE_AGENT_AUTOSTART">true</envvar>
<envvar name="TESTRUNNER_DB_ENVIRONMENT">mysql</envvar>
</config>
<config>
<confighome>xdgconfig-sqlite.db</confighome>
<datahome>xdglocal</datahome>
<envvar name="AKONADI_DISABLE_AGENT_AUTOSTART">true</envvar>
<envvar name="TESTRUNNER_DB_ENVIRONMENT">sqlite</envvar>
</config>
[ProcessedDefaults]
defaultaddressbook=done
defaultcalendar=done
[0]
AbortFatal=true
ErrorFilename[$e]=kdebug.dbg
ErrorOutput=2
FatalFilename[$e]=kdebug.dbg
FatalOutput=2
InfoFilename[$e]=kdebug.dbg
InfoOutput=2
WarnFilename[$e]=kdebug.dbg
WarnOutput=2
[kbuildsycoca4]
AbortFatal=true
ErrorOutput=0
FatalOutput=0
InfoOutput=0
WarnOutput=0
[kdecore (services)]
AbortFatal=true
ErrorOutput=0
FatalOutput=0
InfoOutput=0
WarnOutput=0
[264]
AbortFatal=true
ErrorFilename[$e]=kdebug.dbg
ErrorOutput=4
FatalFilename[$e]=kdebug.dbg
FatalOutput=4
InfoFilename[$e]=kdebug.dbg
WarnFilename[$e]=kdebug.dbg
WarnOutput=4
[5250]
InfoOutput=2
[7009]
AbortFatal=true
ErrorFilename[$e]=kdebug.dbg
ErrorOutput=4
FatalFilename[$e]=kdebug.dbg
FatalOutput=4
InfoFilename[$e]=kdebug.dbg
InfoOutput=4
WarnFilename[$e]=kdebug.dbg
WarnOutput=4
[7011]
AbortFatal=true
ErrorFilename[$e]=kdebug.dbg
ErrorOutput=4
FatalFilename[$e]=kdebug.dbg
FatalOutput=4
InfoFilename[$e]=kdebug.dbg
InfoOutput=4
WarnFilename[$e]=kdebug.dbg
WarnOutput=4
[7012]
AbortFatal=true
ErrorFilename[$e]=kdebug.dbg
ErrorOutput=4
FatalFilename[$e]=kdebug.dbg
FatalOutput=4
InfoFilename[$e]=kdebug.dbg
InfoOutput=4
WarnFilename[$e]=kdebug.dbg
WarnOutput=4
[7014]
AbortFatal=true
ErrorFilename[$e]=kdebug.dbg
ErrorOutput=0
FatalFilename[$e]=kdebug.dbg
FatalOutput=0
InfoFilename[$e]=kdebug.dbg
InfoOutput=0
WarnFilename[$e]=kdebug.dbg
WarnOutput=0
[7021]
AbortFatal=true
ErrorFilename[$e]=kdebug.dbg
ErrorOutput=4
FatalFilename[$e]=kdebug.dbg
FatalOutput=4
InfoFilename[$e]=kdebug.dbg
InfoOutput=4
WarnFilename[$e]=kdebug.dbg
WarnOutput=4
[7105]
AbortFatal=true
ErrorFilename[$e]=kdebug.dbg
ErrorOutput=2
FatalFilename[$e]=kdebug.dbg
FatalOutput=2
InfoFilename[$e]=kdebug.dbg
InfoOutput=2
WarnFilename[$e]=kdebug.dbg
WarnOutput=2
[%General]
# This is a slightly adjusted version of the QSQLITE driver from Qt
# It is provided by akonadi itself
Driver=QSQLITE3
[Search]
Manager=Dummy
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