Changeset View
Changeset View
Standalone View
Standalone View
autotests/libs/testenvironmenttest.cpp
Show All 11 Lines | 1 | /* | |||
---|---|---|---|---|---|
12 | License for more details. | 12 | License for more details. | ||
13 | 13 | | |||
14 | You should have received a copy of the GNU Library General Public License | 14 | You should have received a copy of the GNU Library General Public License | ||
15 | along with this library; see the file COPYING.LIB. If not, write to the | 15 | along with this library; see the file COPYING.LIB. If not, write to the | ||
16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | 16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
17 | 02110-1301, USA. | 17 | 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #include "KDBusConnectionPool" | | |||
21 | | ||||
22 | #include <qtest_akonadi.h> | 20 | #include <qtest_akonadi.h> | ||
23 | #include <servermanager.h> | 21 | #include <servermanager.h> | ||
24 | 22 | | |||
25 | #include <QObject> | 23 | #include <QObject> | ||
26 | #include <QDBusConnection> | 24 | #include <QDBusConnection> | ||
27 | #include <QDBusConnectionInterface> | 25 | #include <QDBusConnectionInterface> | ||
28 | 26 | | |||
29 | using namespace Akonadi; | 27 | using namespace Akonadi; | ||
30 | 28 | | |||
31 | /** | 29 | /** | ||
32 | This test verifies that the testrunner set everything up correctly, so all the | 30 | This test verifies that the testrunner set everything up correctly, so all the | ||
33 | other tests work as expected. | 31 | other tests work as expected. | ||
34 | */ | 32 | */ | ||
35 | class TestEnvironmentTest : public QObject | 33 | class TestEnvironmentTest : public QObject | ||
36 | { | 34 | { | ||
37 | Q_OBJECT | 35 | Q_OBJECT | ||
38 | private Q_SLOTS: | 36 | private Q_SLOTS: | ||
39 | void initTestCase() | 37 | void initTestCase() | ||
40 | { | 38 | { | ||
41 | AkonadiTest::checkTestIsIsolated(); | 39 | AkonadiTest::checkTestIsIsolated(); | ||
42 | } | 40 | } | ||
43 | 41 | | |||
44 | void testDBus() | 42 | void testDBus() | ||
45 | { | 43 | { | ||
46 | QVERIFY(KDBusConnectionPool::threadConnection().isConnected()); | 44 | QVERIFY(QDBusConnection::sessionBus().isConnected()); | ||
47 | } | 45 | } | ||
48 | 46 | | |||
49 | void testAkonadiServer() | 47 | void testAkonadiServer() | ||
50 | { | 48 | { | ||
51 | QVERIFY(ServerManager::isRunning()); | 49 | QVERIFY(ServerManager::isRunning()); | ||
52 | } | 50 | } | ||
53 | 51 | | |||
54 | void testResources() | 52 | void testResources() | ||
55 | { | 53 | { | ||
56 | QVERIFY(KDBusConnectionPool::threadConnection().interface()->isServiceRegistered( | 54 | QVERIFY(QDBusConnection::sessionBus().interface()->isServiceRegistered( | ||
57 | ServerManager::agentServiceName(ServerManager::Resource, QStringLiteral("akonadi_knut_resource_0")))); | 55 | ServerManager::agentServiceName(ServerManager::Resource, QStringLiteral("akonadi_knut_resource_0")))); | ||
58 | QVERIFY(KDBusConnectionPool::threadConnection().interface()->isServiceRegistered( | 56 | QVERIFY(QDBusConnection::sessionBus().interface()->isServiceRegistered( | ||
59 | ServerManager::agentServiceName(ServerManager::Resource, QStringLiteral("akonadi_knut_resource_1")))); | 57 | ServerManager::agentServiceName(ServerManager::Resource, QStringLiteral("akonadi_knut_resource_1")))); | ||
60 | QVERIFY(KDBusConnectionPool::threadConnection().interface()->isServiceRegistered( | 58 | QVERIFY(QDBusConnection::sessionBus().interface()->isServiceRegistered( | ||
61 | ServerManager::agentServiceName(ServerManager::Resource, QStringLiteral("akonadi_knut_resource_2")))); | 59 | ServerManager::agentServiceName(ServerManager::Resource, QStringLiteral("akonadi_knut_resource_2")))); | ||
62 | } | 60 | } | ||
63 | }; | 61 | }; | ||
64 | 62 | | |||
65 | QTEST_AKONADIMAIN(TestEnvironmentTest) | 63 | QTEST_AKONADIMAIN(TestEnvironmentTest) | ||
66 | 64 | | |||
67 | #include "testenvironmenttest.moc" | 65 | #include "testenvironmenttest.moc" |