2
* This file is part of nepomuk-testlib
4
* Copyright (C) 2010-12 Vishesh Handa <me@vhanda.in>
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
#ifndef NEPOMUK_TESTBASE_H
23
#define NEPOMUK_TESTBASE_H
25
#include <QtCore/QObject>
27
#include "nepomuktest_export.h"
32
* \class TestBase testbase.h Nepomuk/TestBase
34
* All Nepomuk unit tests are to be derived from this class. It provides
35
* an interface to manage the services.
37
* By default only these services are started -
39
* - nepomukqueryservice
41
* This class aditionally provides a mechanism to reeset the nepomuk
42
* repository to its original form.
44
* \author Vishesh Handa <handa.vish@gmail.com>
46
class NEPOMUKTEST_EXPORT TestBase : public QObject
51
TestBase(QObject* parent = 0);
57
void cleanupTestCase();
60
void resetRepository();
63
QStringList availableServices();
64
QStringList runningServices();
66
bool isServiceAutostarted(const QString &service);
67
bool isServiceInitialized(const QString &name);
68
bool isServiceRunning(const QString &name);
69
void setServiceAutostarted(const QString &service, bool autostart);
71
bool startService(const QString &name);
72
bool stopService(const QString &name);
74
void waitForServiceInitialization( const QString & service );
75
void startServiceAndWait( const QString & service );
78
void serviceInitialized(const QString &name);
87
#endif // NEPOMUK_TESTBASE_H