summaryrefslogtreecommitdiffstats
path: root/tests/genericfacadebenchmark.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/genericfacadebenchmark.cpp')
-rw-r--r--tests/genericfacadebenchmark.cpp39
1 files changed, 2 insertions, 37 deletions
diff --git a/tests/genericfacadebenchmark.cpp b/tests/genericfacadebenchmark.cpp
index 7cd6c75..3e98fce 100644
--- a/tests/genericfacadebenchmark.cpp
+++ b/tests/genericfacadebenchmark.cpp
@@ -2,6 +2,8 @@
2 2
3#include <QString> 3#include <QString>
4 4
5#include "testimplementations.h"
6
5#include <common/facade.h> 7#include <common/facade.h>
6#include <common/domainadaptor.h> 8#include <common/domainadaptor.h>
7#include <common/resultprovider.h> 9#include <common/resultprovider.h>
@@ -9,44 +11,7 @@
9 11
10#include "event_generated.h" 12#include "event_generated.h"
11 13
12class TestEventAdaptorFactory : public DomainTypeAdaptorFactory<Akonadi2::ApplicationDomain::Event, Akonadi2::ApplicationDomain::Buffer::Event, Akonadi2::ApplicationDomain::Buffer::EventBuilder>
13{
14public:
15 TestEventAdaptorFactory()
16 : DomainTypeAdaptorFactory()
17 {
18 }
19
20 virtual ~TestEventAdaptorFactory() {};
21};
22
23class TestResourceAccess : public Akonadi2::ResourceAccessInterface
24{
25 Q_OBJECT
26public:
27 virtual ~TestResourceAccess() {};
28 KAsync::Job<void> sendCommand(int commandId) Q_DECL_OVERRIDE { return KAsync::null<void>(); }
29 KAsync::Job<void> sendCommand(int commandId, flatbuffers::FlatBufferBuilder &fbb) Q_DECL_OVERRIDE { return KAsync::null<void>(); }
30 KAsync::Job<void> synchronizeResource(bool remoteSync, bool localSync) Q_DECL_OVERRIDE { return KAsync::null<void>(); }
31
32public Q_SLOTS:
33 void open() Q_DECL_OVERRIDE {}
34 void close() Q_DECL_OVERRIDE {}
35};
36
37class TestResourceFacade : public Akonadi2::GenericFacade<Akonadi2::ApplicationDomain::Event>
38{
39public:
40 TestResourceFacade(const QByteArray &instanceIdentifier, const QSharedPointer<EntityStorage<Akonadi2::ApplicationDomain::Event> > storage, const QSharedPointer<Akonadi2::ResourceAccessInterface> resourceAccess)
41 : Akonadi2::GenericFacade<Akonadi2::ApplicationDomain::Event>(instanceIdentifier, QSharedPointer<TestEventAdaptorFactory>::create(), storage, resourceAccess)
42 {
43 14
44 }
45 virtual ~TestResourceFacade()
46 {
47
48 }
49};
50 15
51class GenericFacadeBenchmark : public QObject 16class GenericFacadeBenchmark : public QObject
52{ 17{