~ubuntu-branches/ubuntu/trusty/kdepimlibs/trusty

« back to all changes in this revision

Viewing changes to akonadi/calendar/tests/unittestbase.h

  • Committer: Package Import Robot
  • Author(s): Rohan Garg, Rohan Garg, Philip Muškovac
  • Date: 2013-11-23 17:36:44 UTC
  • mfrom: (1.1.102)
  • Revision ID: package-import@ubuntu.com-20131123173644-p5ow94192ezsny8g
Tags: 4:4.11.80-0ubuntu1
[ Rohan Garg ]
* New upstream beta release
  - Bump akonadi requirement to 1.10.45
  - Update install files
  - Update symbols

[ Philip Muškovac ]
* kdepimlibs-dev/-dbg breaks/replaces kdepim-runtime/-dbg (<< 4:4.11.80)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (c) 2013 Sérgio Martins <iamsergio@gmail.com>
 
3
 
 
4
    This library is free software; you can redistribute it and/or modify it
 
5
    under the terms of the GNU Library General Public License as published by
 
6
    the Free Software Foundation; either version 2 of the License, or (at your
 
7
    option) any later version.
 
8
 
 
9
    This library is distributed in the hope that it will be useful, but WITHOUT
 
10
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
11
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
 
12
    License for more details.
 
13
 
 
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
 
16
    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 
17
    02110-1301, USA.
 
18
*/
 
19
 
 
20
 
 
21
#ifndef UNITTEST_BASE_H
 
22
#define UNITTEST_BASE_H
 
23
 
 
24
#include <kcalcore/calendar.h>
 
25
#include <akonadi/collection.h>
 
26
#include <akonadi/item.h>
 
27
 
 
28
#include <QObject>
 
29
#include <QString>
 
30
 
 
31
namespace Akonadi {
 
32
    class IncidenceChanger;
 
33
}
 
34
 
 
35
class UnitTestBase : public QObject {
 
36
    Q_OBJECT
 
37
public:
 
38
    UnitTestBase();
 
39
    void waitForIt(); // Waits 10 seconds for signals
 
40
    void stopWaiting();
 
41
    void createIncidence(const QString &uid);
 
42
    void createIncidence(const Akonadi::Item &item);
 
43
 
 
44
    void verifyExists(const QString &uid, bool exists);
 
45
    Akonadi::Item::List calendarItems();
 
46
 
 
47
public Q_SLOTS:
 
48
    void onLoadFinished(bool success, const QString &errorMessage);
 
49
 
 
50
protected:
 
51
 
 
52
    void compareCalendars(const KCalCore::Calendar::Ptr &expectedCalendar);
 
53
    static QByteArray readFile(const QString &filename);
 
54
    static Akonadi::Item generateIncidence(const QString &uid, const QString &organizer = QString());
 
55
 
 
56
    Akonadi::Collection mCollection;
 
57
    Akonadi::IncidenceChanger *mChanger;
 
58
};
 
59
 
 
60
#endif