~ubuntu-branches/ubuntu/utopic/nepomuk-core/utopic

« back to all changes in this revision

Viewing changes to autotests/lib/testbase.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2012-07-26 22:43:09 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20120726224309-pf2v1e78ee7uljjp
Tags: 4:4.9.0a-0ubuntu1
* Use direct build-depends versions rather than kde-sc-dev-latest
* New upstream release
* New symbols, rename libnepomukcore4 to libnepomukcore4abi and enable Debian ABI manager

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of nepomuk-testlib
 
3
 *
 
4
 * Copyright (C) 2010-12 Vishesh Handa <me@vhanda.in>
 
5
 *
 
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.
 
10
 *
 
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.
 
15
 *
 
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
 
19
 */
 
20
 
 
21
 
 
22
#ifndef NEPOMUK_TESTBASE_H
 
23
#define NEPOMUK_TESTBASE_H
 
24
 
 
25
#include <QtCore/QObject>
 
26
 
 
27
#include "nepomuktest_export.h"
 
28
 
 
29
namespace Nepomuk2 {
 
30
 
 
31
    /**
 
32
     * \class TestBase testbase.h Nepomuk/TestBase
 
33
     *
 
34
     * All Nepomuk unit tests are to be derived from this class. It provides
 
35
     * an interface to manage the services.
 
36
     *
 
37
     * By default only these services are started -
 
38
     *  - nepomukstorage
 
39
     *  - nepomukqueryservice
 
40
     *
 
41
     * This class aditionally provides a mechanism to reeset the nepomuk
 
42
     * repository to its original form.
 
43
     *
 
44
     * \author Vishesh Handa <handa.vish@gmail.com>
 
45
     */
 
46
    class NEPOMUKTEST_EXPORT TestBase : public QObject
 
47
    {
 
48
        Q_OBJECT
 
49
    public:
 
50
 
 
51
        TestBase(QObject* parent = 0);
 
52
        virtual ~TestBase();
 
53
 
 
54
 
 
55
    private Q_SLOTS:
 
56
        void initTestCase();
 
57
        void cleanupTestCase();
 
58
 
 
59
    protected:
 
60
        void resetRepository();
 
61
 
 
62
    public Q_SLOTS:
 
63
        QStringList availableServices();
 
64
        QStringList runningServices();
 
65
 
 
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);
 
70
 
 
71
        bool startService(const QString &name);
 
72
        bool stopService(const QString &name);
 
73
 
 
74
        void waitForServiceInitialization( const QString & service );
 
75
        void startServiceAndWait( const QString & service );
 
76
 
 
77
    Q_SIGNALS:
 
78
        void serviceInitialized(const QString &name);
 
79
 
 
80
    private:
 
81
        class Private;
 
82
        Private * d;
 
83
    };
 
84
 
 
85
}
 
86
 
 
87
#endif // NEPOMUK_TESTBASE_H