summaryrefslogtreecommitdiffstats
path: root/tests/testimplementations.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testimplementations.h')
-rw-r--r--tests/testimplementations.h45
1 files changed, 25 insertions, 20 deletions
diff --git a/tests/testimplementations.h b/tests/testimplementations.h
index adfdab3..688875d 100644
--- a/tests/testimplementations.h
+++ b/tests/testimplementations.h
@@ -28,7 +28,7 @@
28#include <common/genericresource.h> 28#include <common/genericresource.h>
29#include <common/commands.h> 29#include <common/commands.h>
30 30
31//Replace with something different 31// Replace with something different
32#include "event_generated.h" 32#include "event_generated.h"
33#include "mail_generated.h" 33#include "mail_generated.h"
34#include "createentity_generated.h" 34#include "createentity_generated.h"
@@ -36,37 +36,48 @@
36class TestEventAdaptorFactory : public DomainTypeAdaptorFactory<Sink::ApplicationDomain::Event, Sink::ApplicationDomain::Buffer::Event, Sink::ApplicationDomain::Buffer::EventBuilder> 36class TestEventAdaptorFactory : public DomainTypeAdaptorFactory<Sink::ApplicationDomain::Event, Sink::ApplicationDomain::Buffer::Event, Sink::ApplicationDomain::Buffer::EventBuilder>
37{ 37{
38public: 38public:
39 TestEventAdaptorFactory() 39 TestEventAdaptorFactory() : DomainTypeAdaptorFactory()
40 : DomainTypeAdaptorFactory()
41 { 40 {
42 } 41 }
43 42
44 virtual ~TestEventAdaptorFactory() {}; 43 virtual ~TestEventAdaptorFactory(){};
45}; 44};
46 45
47class TestMailAdaptorFactory : public DomainTypeAdaptorFactory<Sink::ApplicationDomain::Mail, Sink::ApplicationDomain::Buffer::Mail, Sink::ApplicationDomain::Buffer::MailBuilder> 46class TestMailAdaptorFactory : public DomainTypeAdaptorFactory<Sink::ApplicationDomain::Mail, Sink::ApplicationDomain::Buffer::Mail, Sink::ApplicationDomain::Buffer::MailBuilder>
48{ 47{
49public: 48public:
50 TestMailAdaptorFactory() 49 TestMailAdaptorFactory() : DomainTypeAdaptorFactory()
51 : DomainTypeAdaptorFactory()
52 { 50 {
53 } 51 }
54 52
55 virtual ~TestMailAdaptorFactory() {}; 53 virtual ~TestMailAdaptorFactory(){};
56}; 54};
57 55
58class TestResourceAccess : public Sink::ResourceAccessInterface 56class TestResourceAccess : public Sink::ResourceAccessInterface
59{ 57{
60 Q_OBJECT 58 Q_OBJECT
61public: 59public:
62 virtual ~TestResourceAccess() {}; 60 virtual ~TestResourceAccess(){};
63 KAsync::Job<void> sendCommand(int commandId) Q_DECL_OVERRIDE { return KAsync::null<void>(); } 61 KAsync::Job<void> sendCommand(int commandId) Q_DECL_OVERRIDE
64 KAsync::Job<void> sendCommand(int commandId, flatbuffers::FlatBufferBuilder &fbb) Q_DECL_OVERRIDE { return KAsync::null<void>(); } 62 {
65 KAsync::Job<void> synchronizeResource(bool remoteSync, bool localSync) Q_DECL_OVERRIDE { return KAsync::null<void>(); } 63 return KAsync::null<void>();
64 }
65 KAsync::Job<void> sendCommand(int commandId, flatbuffers::FlatBufferBuilder &fbb) Q_DECL_OVERRIDE
66 {
67 return KAsync::null<void>();
68 }
69 KAsync::Job<void> synchronizeResource(bool remoteSync, bool localSync) Q_DECL_OVERRIDE
70 {
71 return KAsync::null<void>();
72 }
66 73
67public slots: 74public slots:
68 void open() Q_DECL_OVERRIDE {} 75 void open() Q_DECL_OVERRIDE
69 void close() Q_DECL_OVERRIDE {} 76 {
77 }
78 void close() Q_DECL_OVERRIDE
79 {
80 }
70}; 81};
71 82
72class TestResourceFacade : public Sink::GenericFacade<Sink::ApplicationDomain::Event> 83class TestResourceFacade : public Sink::GenericFacade<Sink::ApplicationDomain::Event>
@@ -75,11 +86,9 @@ public:
75 TestResourceFacade(const QByteArray &instanceIdentifier, const QSharedPointer<Sink::ResourceAccessInterface> resourceAccess) 86 TestResourceFacade(const QByteArray &instanceIdentifier, const QSharedPointer<Sink::ResourceAccessInterface> resourceAccess)
76 : Sink::GenericFacade<Sink::ApplicationDomain::Event>(instanceIdentifier, QSharedPointer<TestEventAdaptorFactory>::create(), resourceAccess) 87 : Sink::GenericFacade<Sink::ApplicationDomain::Event>(instanceIdentifier, QSharedPointer<TestEventAdaptorFactory>::create(), resourceAccess)
77 { 88 {
78
79 } 89 }
80 virtual ~TestResourceFacade() 90 virtual ~TestResourceFacade()
81 { 91 {
82
83 } 92 }
84}; 93};
85 94
@@ -89,19 +98,16 @@ public:
89 TestMailResourceFacade(const QByteArray &instanceIdentifier, const QSharedPointer<Sink::ResourceAccessInterface> resourceAccess) 98 TestMailResourceFacade(const QByteArray &instanceIdentifier, const QSharedPointer<Sink::ResourceAccessInterface> resourceAccess)
90 : Sink::GenericFacade<Sink::ApplicationDomain::Mail>(instanceIdentifier, QSharedPointer<TestMailAdaptorFactory>::create(), resourceAccess) 99 : Sink::GenericFacade<Sink::ApplicationDomain::Mail>(instanceIdentifier, QSharedPointer<TestMailAdaptorFactory>::create(), resourceAccess)
91 { 100 {
92
93 } 101 }
94 virtual ~TestMailResourceFacade() 102 virtual ~TestMailResourceFacade()
95 { 103 {
96
97 } 104 }
98}; 105};
99 106
100class TestResource : public Sink::GenericResource 107class TestResource : public Sink::GenericResource
101{ 108{
102public: 109public:
103 TestResource(const QByteArray &instanceIdentifier, QSharedPointer<Sink::Pipeline> pipeline) 110 TestResource(const QByteArray &instanceIdentifier, QSharedPointer<Sink::Pipeline> pipeline) : Sink::GenericResource(instanceIdentifier, pipeline)
104 : Sink::GenericResource(instanceIdentifier, pipeline)
105 { 111 {
106 } 112 }
107 113
@@ -126,4 +132,3 @@ QByteArray createCommand(const DomainType &domainObject, DomainTypeAdaptorFactor
126 Sink::Commands::FinishCreateEntityBuffer(fbb, location); 132 Sink::Commands::FinishCreateEntityBuffer(fbb, location);
127 return QByteArray(reinterpret_cast<const char *>(fbb.GetBufferPointer()), fbb.GetSize()); 133 return QByteArray(reinterpret_cast<const char *>(fbb.GetBufferPointer()), fbb.GetSize());
128} 134}
129