diff options
-rw-r--r-- | common/domain/applicationdomaintype.cpp | 8 | ||||
-rw-r--r-- | common/resource.h | 2 | ||||
-rw-r--r-- | docs/sinksh.md | 10 | ||||
-rw-r--r-- | examples/client/main.cpp | 2 | ||||
-rw-r--r-- | examples/dummyresource/resourcefactory.h | 4 | ||||
-rw-r--r-- | examples/imapresource/imapresource.h | 4 | ||||
-rw-r--r-- | examples/maildirresource/maildirresource.h | 4 | ||||
-rw-r--r-- | examples/mailtransportresource/mailtransportresource.h | 4 | ||||
-rw-r--r-- | tests/accountstest.cpp | 6 | ||||
-rw-r--r-- | tests/dummyresourcebenchmark.cpp | 30 | ||||
-rw-r--r-- | tests/dummyresourcetest.cpp | 36 | ||||
-rw-r--r-- | tests/dummyresourcewritebenchmark.cpp | 14 | ||||
-rw-r--r-- | tests/genericresourcebenchmark.cpp | 16 | ||||
-rw-r--r-- | tests/genericresourcetest.cpp | 6 | ||||
-rw-r--r-- | tests/indextest.cpp | 6 | ||||
-rw-r--r-- | tests/inspectiontest.cpp | 8 | ||||
-rw-r--r-- | tests/maildirsyncbenchmark.cpp | 12 | ||||
-rw-r--r-- | tests/mailquerybenchmark.cpp | 2 | ||||
-rw-r--r-- | tests/messagequeuetest.cpp | 22 | ||||
-rw-r--r-- | tests/modelinteractivitytest.cpp | 10 | ||||
-rw-r--r-- | tests/pipelinebenchmark.cpp | 2 | ||||
-rw-r--r-- | tests/pipelinetest.cpp | 34 | ||||
-rw-r--r-- | tests/querytest.cpp | 58 |
23 files changed, 150 insertions, 150 deletions
diff --git a/common/domain/applicationdomaintype.cpp b/common/domain/applicationdomaintype.cpp index 57919ff..ce113c2 100644 --- a/common/domain/applicationdomaintype.cpp +++ b/common/domain/applicationdomaintype.cpp | |||
@@ -253,7 +253,7 @@ namespace DummyResource { | |||
253 | SinkResource create(const QByteArray &account) | 253 | SinkResource create(const QByteArray &account) |
254 | { | 254 | { |
255 | auto &&resource = ApplicationDomainType::createEntity<SinkResource>(); | 255 | auto &&resource = ApplicationDomainType::createEntity<SinkResource>(); |
256 | resource.setProperty("type", "org.kde.dummy"); | 256 | resource.setProperty("type", "sink.dummy"); |
257 | resource.setProperty("account", account); | 257 | resource.setProperty("account", account); |
258 | resource.setProperty("capabilities", QVariant::fromValue(QByteArrayList() << ResourceCapabilities::Mail::storage << "-folder.rename")); | 258 | resource.setProperty("capabilities", QVariant::fromValue(QByteArrayList() << ResourceCapabilities::Mail::storage << "-folder.rename")); |
259 | // resource.setProperty("capabilities", QVariant::fromValue(QByteArrayList() << ResourceCapabilities::Mail::storage << ResourceCapabilities::Mail::drafts << "-folder.rename" << ResourceCapabilities::Mail::trash)); | 259 | // resource.setProperty("capabilities", QVariant::fromValue(QByteArrayList() << ResourceCapabilities::Mail::storage << ResourceCapabilities::Mail::drafts << "-folder.rename" << ResourceCapabilities::Mail::trash)); |
@@ -265,7 +265,7 @@ namespace MaildirResource { | |||
265 | SinkResource create(const QByteArray &account) | 265 | SinkResource create(const QByteArray &account) |
266 | { | 266 | { |
267 | auto &&resource = ApplicationDomainType::createEntity<SinkResource>(); | 267 | auto &&resource = ApplicationDomainType::createEntity<SinkResource>(); |
268 | resource.setProperty("type", "org.kde.maildir"); | 268 | resource.setProperty("type", "sink.maildir"); |
269 | resource.setProperty("account", account); | 269 | resource.setProperty("account", account); |
270 | resource.setProperty("capabilities", QVariant::fromValue(QByteArrayList() << ResourceCapabilities::Mail::storage << ResourceCapabilities::Mail::drafts << "-folder.rename" << ResourceCapabilities::Mail::trash)); | 270 | resource.setProperty("capabilities", QVariant::fromValue(QByteArrayList() << ResourceCapabilities::Mail::storage << ResourceCapabilities::Mail::drafts << "-folder.rename" << ResourceCapabilities::Mail::trash)); |
271 | return resource; | 271 | return resource; |
@@ -276,7 +276,7 @@ namespace MailtransportResource { | |||
276 | SinkResource create(const QByteArray &account) | 276 | SinkResource create(const QByteArray &account) |
277 | { | 277 | { |
278 | auto &&resource = ApplicationDomainType::createEntity<SinkResource>(); | 278 | auto &&resource = ApplicationDomainType::createEntity<SinkResource>(); |
279 | resource.setProperty("type", "org.kde.mailtransport"); | 279 | resource.setProperty("type", "sink.mailtransport"); |
280 | resource.setProperty("account", account); | 280 | resource.setProperty("account", account); |
281 | resource.setProperty("capabilities", QVariant::fromValue(QByteArrayList() << ResourceCapabilities::Mail::transport)); | 281 | resource.setProperty("capabilities", QVariant::fromValue(QByteArrayList() << ResourceCapabilities::Mail::transport)); |
282 | return resource; | 282 | return resource; |
@@ -287,7 +287,7 @@ namespace ImapResource { | |||
287 | SinkResource create(const QByteArray &account) | 287 | SinkResource create(const QByteArray &account) |
288 | { | 288 | { |
289 | auto &&resource = ApplicationDomainType::createEntity<SinkResource>(); | 289 | auto &&resource = ApplicationDomainType::createEntity<SinkResource>(); |
290 | resource.setProperty("type", "org.kde.imap"); | 290 | resource.setProperty("type", "sink.imap"); |
291 | resource.setProperty("account", account); | 291 | resource.setProperty("account", account); |
292 | resource.setProperty("capabilities", QVariant::fromValue(QByteArrayList() << ResourceCapabilities::Mail::storage << ResourceCapabilities::Mail::drafts << ResourceCapabilities::Mail::folderhierarchy << ResourceCapabilities::Mail::trash)); | 292 | resource.setProperty("capabilities", QVariant::fromValue(QByteArrayList() << ResourceCapabilities::Mail::storage << ResourceCapabilities::Mail::drafts << ResourceCapabilities::Mail::folderhierarchy << ResourceCapabilities::Mail::trash)); |
293 | return resource; | 293 | return resource; |
diff --git a/common/resource.h b/common/resource.h index d6c3c5f..1c35838 100644 --- a/common/resource.h +++ b/common/resource.h | |||
@@ -91,4 +91,4 @@ private: | |||
91 | 91 | ||
92 | } // namespace Sink | 92 | } // namespace Sink |
93 | 93 | ||
94 | Q_DECLARE_INTERFACE(Sink::ResourceFactory, "org.kde.sink.resourcefactory") | 94 | Q_DECLARE_INTERFACE(Sink::ResourceFactory, "sink.sink.resourcefactory") |
diff --git a/docs/sinksh.md b/docs/sinksh.md index 9884169..b04eb0c 100644 --- a/docs/sinksh.md +++ b/docs/sinksh.md | |||
@@ -33,22 +33,22 @@ Provides the same contents as "list" but in a graphical tree view. This was real | |||
33 | # Setting up a new resource instance | 33 | # Setting up a new resource instance |
34 | sink_cmd is already the primary way how you create resource instances: | 34 | sink_cmd is already the primary way how you create resource instances: |
35 | 35 | ||
36 | `sinksh create resource org.kde.maildir path /home/developer/maildir1` | 36 | `sinksh create resource sink.maildir path /home/developer/maildir1` |
37 | 37 | ||
38 | This creates a resource of type "org.kde.maildir" and a configuration of "path" with the value "home/developer/maildir1". Resources are stored in configuration files, so all this does is write to some config files. | 38 | This creates a resource of type "sink.maildir" and a configuration of "path" with the value "home/developer/maildir1". Resources are stored in configuration files, so all this does is write to some config files. |
39 | 39 | ||
40 | `sinksh list resource` | 40 | `sinksh list resource` |
41 | 41 | ||
42 | By listing all available resources we can find the identifier of the resource that was automatically assigned. | 42 | By listing all available resources we can find the identifier of the resource that was automatically assigned. |
43 | 43 | ||
44 | `sinksh synchronize org.kde.maildir.instance1` | 44 | `sinksh synchronize sink.maildir.instance1` |
45 | 45 | ||
46 | This triggers the actual synchronization in the resource, and from there on the data is available. | 46 | This triggers the actual synchronization in the resource, and from there on the data is available. |
47 | 47 | ||
48 | `sinksh list folder org.kde.maildir.instance1` | 48 | `sinksh list folder sink.maildir.instance1` |
49 | 49 | ||
50 | This will get you all folders that are in the resource. | 50 | This will get you all folders that are in the resource. |
51 | 51 | ||
52 | `sinksh remove resource org.kde.maildir.instance1` | 52 | `sinksh remove resource sink.maildir.instance1` |
53 | 53 | ||
54 | And this will finally remove all traces of the resource instance. | 54 | And this will finally remove all traces of the resource instance. |
diff --git a/examples/client/main.cpp b/examples/client/main.cpp index 07e780e..f4b472f 100644 --- a/examples/client/main.cpp +++ b/examples/client/main.cpp | |||
@@ -120,7 +120,7 @@ public: | |||
120 | syncButton->setText("Synchronize!"); | 120 | syncButton->setText("Synchronize!"); |
121 | QObject::connect(syncButton, &QPushButton::pressed, []() { | 121 | QObject::connect(syncButton, &QPushButton::pressed, []() { |
122 | Sink::Query query; | 122 | Sink::Query query; |
123 | query.resources << "org.kde.dummy.instance1"; | 123 | query.resources << "sink.dummy.instance1"; |
124 | Sink::Store::synchronize(query).exec(); | 124 | Sink::Store::synchronize(query).exec(); |
125 | }); | 125 | }); |
126 | 126 | ||
diff --git a/examples/dummyresource/resourcefactory.h b/examples/dummyresource/resourcefactory.h index a7d0281..9192c68 100644 --- a/examples/dummyresource/resourcefactory.h +++ b/examples/dummyresource/resourcefactory.h | |||
@@ -27,7 +27,7 @@ | |||
27 | #include <flatbuffers/flatbuffers.h> | 27 | #include <flatbuffers/flatbuffers.h> |
28 | 28 | ||
29 | //TODO: a little ugly to have this in two places, once here and once in Q_PLUGIN_METADATA | 29 | //TODO: a little ugly to have this in two places, once here and once in Q_PLUGIN_METADATA |
30 | #define PLUGIN_NAME "org.kde.dummy" | 30 | #define PLUGIN_NAME "sink.dummy" |
31 | 31 | ||
32 | class DummyResource : public Sink::GenericResource | 32 | class DummyResource : public Sink::GenericResource |
33 | { | 33 | { |
@@ -42,7 +42,7 @@ public: | |||
42 | class DummyResourceFactory : public Sink::ResourceFactory | 42 | class DummyResourceFactory : public Sink::ResourceFactory |
43 | { | 43 | { |
44 | Q_OBJECT | 44 | Q_OBJECT |
45 | Q_PLUGIN_METADATA(IID "org.kde.dummy") | 45 | Q_PLUGIN_METADATA(IID "sink.dummy") |
46 | Q_INTERFACES(Sink::ResourceFactory) | 46 | Q_INTERFACES(Sink::ResourceFactory) |
47 | 47 | ||
48 | public: | 48 | public: |
diff --git a/examples/imapresource/imapresource.h b/examples/imapresource/imapresource.h index 0c3b541..534a04e 100644 --- a/examples/imapresource/imapresource.h +++ b/examples/imapresource/imapresource.h | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <flatbuffers/flatbuffers.h> | 26 | #include <flatbuffers/flatbuffers.h> |
27 | 27 | ||
28 | //TODO: a little ugly to have this in two places, once here and once in Q_PLUGIN_METADATA | 28 | //TODO: a little ugly to have this in two places, once here and once in Q_PLUGIN_METADATA |
29 | #define PLUGIN_NAME "org.kde.imap" | 29 | #define PLUGIN_NAME "sink.imap" |
30 | 30 | ||
31 | class ImapMailAdaptorFactory; | 31 | class ImapMailAdaptorFactory; |
32 | class ImapFolderAdaptorFactory; | 32 | class ImapFolderAdaptorFactory; |
@@ -56,7 +56,7 @@ private: | |||
56 | class ImapResourceFactory : public Sink::ResourceFactory | 56 | class ImapResourceFactory : public Sink::ResourceFactory |
57 | { | 57 | { |
58 | Q_OBJECT | 58 | Q_OBJECT |
59 | Q_PLUGIN_METADATA(IID "org.kde.imap") | 59 | Q_PLUGIN_METADATA(IID "sink.imap") |
60 | Q_INTERFACES(Sink::ResourceFactory) | 60 | Q_INTERFACES(Sink::ResourceFactory) |
61 | 61 | ||
62 | public: | 62 | public: |
diff --git a/examples/maildirresource/maildirresource.h b/examples/maildirresource/maildirresource.h index d481b22..76aef77 100644 --- a/examples/maildirresource/maildirresource.h +++ b/examples/maildirresource/maildirresource.h | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <flatbuffers/flatbuffers.h> | 26 | #include <flatbuffers/flatbuffers.h> |
27 | 27 | ||
28 | //TODO: a little ugly to have this in two places, once here and once in Q_PLUGIN_METADATA | 28 | //TODO: a little ugly to have this in two places, once here and once in Q_PLUGIN_METADATA |
29 | #define PLUGIN_NAME "org.kde.maildir" | 29 | #define PLUGIN_NAME "sink.maildir" |
30 | 30 | ||
31 | class MaildirMailAdaptorFactory; | 31 | class MaildirMailAdaptorFactory; |
32 | class MaildirFolderAdaptorFactory; | 32 | class MaildirFolderAdaptorFactory; |
@@ -58,7 +58,7 @@ private: | |||
58 | class MaildirResourceFactory : public Sink::ResourceFactory | 58 | class MaildirResourceFactory : public Sink::ResourceFactory |
59 | { | 59 | { |
60 | Q_OBJECT | 60 | Q_OBJECT |
61 | Q_PLUGIN_METADATA(IID "org.kde.maildir") | 61 | Q_PLUGIN_METADATA(IID "sink.maildir") |
62 | Q_INTERFACES(Sink::ResourceFactory) | 62 | Q_INTERFACES(Sink::ResourceFactory) |
63 | 63 | ||
64 | public: | 64 | public: |
diff --git a/examples/mailtransportresource/mailtransportresource.h b/examples/mailtransportresource/mailtransportresource.h index 6622ea6..cf6abf2 100644 --- a/examples/mailtransportresource/mailtransportresource.h +++ b/examples/mailtransportresource/mailtransportresource.h | |||
@@ -23,7 +23,7 @@ | |||
23 | #include "common/genericresource.h" | 23 | #include "common/genericresource.h" |
24 | 24 | ||
25 | //TODO: a little ugly to have this in two places, once here and once in Q_PLUGIN_METADATA | 25 | //TODO: a little ugly to have this in two places, once here and once in Q_PLUGIN_METADATA |
26 | #define PLUGIN_NAME "org.kde.mailtransport" | 26 | #define PLUGIN_NAME "sink.mailtransport" |
27 | 27 | ||
28 | class MailtransportResource : public Sink::GenericResource | 28 | class MailtransportResource : public Sink::GenericResource |
29 | { | 29 | { |
@@ -46,7 +46,7 @@ private: | |||
46 | class MailtransportResourceFactory : public Sink::ResourceFactory | 46 | class MailtransportResourceFactory : public Sink::ResourceFactory |
47 | { | 47 | { |
48 | Q_OBJECT | 48 | Q_OBJECT |
49 | Q_PLUGIN_METADATA(IID "org.kde.mailtransport") | 49 | Q_PLUGIN_METADATA(IID "sink.mailtransport") |
50 | Q_INTERFACES(Sink::ResourceFactory) | 50 | Q_INTERFACES(Sink::ResourceFactory) |
51 | 51 | ||
52 | public: | 52 | public: |
diff --git a/tests/accountstest.cpp b/tests/accountstest.cpp index d12e7f4..8d0f2e6 100644 --- a/tests/accountstest.cpp +++ b/tests/accountstest.cpp | |||
@@ -51,7 +51,7 @@ private slots: | |||
51 | QString smtpUsername("smtpUsername"); | 51 | QString smtpUsername("smtpUsername"); |
52 | QString smtpPassword("smtpPassword"); | 52 | QString smtpPassword("smtpPassword"); |
53 | auto resource = ApplicationDomainType::createEntity<SinkResource>(); | 53 | auto resource = ApplicationDomainType::createEntity<SinkResource>(); |
54 | resource.setProperty("type", "org.kde.mailtransport"); | 54 | resource.setProperty("type", "sink.mailtransport"); |
55 | resource.setProperty("account", account.identifier()); | 55 | resource.setProperty("account", account.identifier()); |
56 | resource.setProperty("server", smtpServer); | 56 | resource.setProperty("server", smtpServer); |
57 | resource.setProperty("username", smtpUsername); | 57 | resource.setProperty("username", smtpUsername); |
@@ -62,7 +62,7 @@ private slots: | |||
62 | Store::fetchAll<SinkResource>(Query()).then<void, QList<SinkResource::Ptr>>([&](const QList<SinkResource::Ptr> &resources) { | 62 | Store::fetchAll<SinkResource>(Query()).then<void, QList<SinkResource::Ptr>>([&](const QList<SinkResource::Ptr> &resources) { |
63 | QCOMPARE(resources.size(), 1); | 63 | QCOMPARE(resources.size(), 1); |
64 | auto resource = resources.first(); | 64 | auto resource = resources.first(); |
65 | QCOMPARE(resource->getProperty("type").toString(), QString("org.kde.mailtransport")); | 65 | QCOMPARE(resource->getProperty("type").toString(), QString("sink.mailtransport")); |
66 | QCOMPARE(resource->getProperty("server").toString(), smtpServer); | 66 | QCOMPARE(resource->getProperty("server").toString(), smtpServer); |
67 | }) | 67 | }) |
68 | .exec().waitForFinished(); | 68 | .exec().waitForFinished(); |
@@ -110,7 +110,7 @@ private slots: | |||
110 | 110 | ||
111 | //Ensure the notifier only affects one type | 111 | //Ensure the notifier only affects one type |
112 | auto resource = ApplicationDomainType::createEntity<SinkResource>(); | 112 | auto resource = ApplicationDomainType::createEntity<SinkResource>(); |
113 | resource.setResourceType("org.kde.mailtransport"); | 113 | resource.setResourceType("sink.mailtransport"); |
114 | Store::create(resource).exec().waitForFinished(); | 114 | Store::create(resource).exec().waitForFinished(); |
115 | QTRY_COMPARE(model->rowCount(QModelIndex()), 2); | 115 | QTRY_COMPARE(model->rowCount(QModelIndex()), 2); |
116 | } | 116 | } |
diff --git a/tests/dummyresourcebenchmark.cpp b/tests/dummyresourcebenchmark.cpp index 7e334a6..72562c3 100644 --- a/tests/dummyresourcebenchmark.cpp +++ b/tests/dummyresourcebenchmark.cpp | |||
@@ -34,9 +34,9 @@ private slots: | |||
34 | void initTestCase() | 34 | void initTestCase() |
35 | { | 35 | { |
36 | Sink::Log::setDebugOutputLevel(Sink::Log::Warning); | 36 | Sink::Log::setDebugOutputLevel(Sink::Log::Warning); |
37 | auto factory = Sink::ResourceFactory::load("org.kde.dummy"); | 37 | auto factory = Sink::ResourceFactory::load("sink.dummy"); |
38 | QVERIFY(factory); | 38 | QVERIFY(factory); |
39 | ResourceConfig::addResource("org.kde.dummy.instance1", "org.kde.dummy"); | 39 | ResourceConfig::addResource("sink.dummy.instance1", "sink.dummy"); |
40 | num = 5000; | 40 | num = 5000; |
41 | } | 41 | } |
42 | 42 | ||
@@ -76,17 +76,17 @@ private slots: | |||
76 | void testCommandResponsiveness() | 76 | void testCommandResponsiveness() |
77 | { | 77 | { |
78 | // Test responsiveness including starting the process. | 78 | // Test responsiveness including starting the process. |
79 | Sink::Store::removeDataFromDisk("org.kde.dummy.instance1").exec().waitForFinished(); | 79 | Sink::Store::removeDataFromDisk("sink.dummy.instance1").exec().waitForFinished(); |
80 | 80 | ||
81 | QTime time; | 81 | QTime time; |
82 | time.start(); | 82 | time.start(); |
83 | 83 | ||
84 | Sink::ApplicationDomain::Event event("org.kde.dummy.instance1"); | 84 | Sink::ApplicationDomain::Event event("sink.dummy.instance1"); |
85 | event.setProperty("uid", "testuid"); | 85 | event.setProperty("uid", "testuid"); |
86 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); | 86 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); |
87 | event.setProperty("summary", "summaryValue"); | 87 | event.setProperty("summary", "summaryValue"); |
88 | 88 | ||
89 | auto notifier = QSharedPointer<Sink::Notifier>::create("org.kde.dummy.instance1", "org.kde.dummy"); | 89 | auto notifier = QSharedPointer<Sink::Notifier>::create("sink.dummy.instance1", "sink.dummy"); |
90 | bool gotNotification = false; | 90 | bool gotNotification = false; |
91 | int duration = 0; | 91 | int duration = 0; |
92 | notifier->registerHandler([&gotNotification, &duration, &time](const Sink::Notification ¬ification) { | 92 | notifier->registerHandler([&gotNotification, &duration, &time](const Sink::Notification ¬ification) { |
@@ -102,19 +102,19 @@ private slots: | |||
102 | QTRY_VERIFY(gotNotification); | 102 | QTRY_VERIFY(gotNotification); |
103 | 103 | ||
104 | QVERIFY2(duration < 100, QString::fromLatin1("Processing a create command took more than 100ms: %1").arg(duration).toLatin1()); | 104 | QVERIFY2(duration < 100, QString::fromLatin1("Processing a create command took more than 100ms: %1").arg(duration).toLatin1()); |
105 | Sink::ResourceControl::shutdown("org.kde.dummy.instance1").exec().waitForFinished(); | 105 | Sink::ResourceControl::shutdown("sink.dummy.instance1").exec().waitForFinished(); |
106 | qDebug() << "Single command took [ms]: " << duration; | 106 | qDebug() << "Single command took [ms]: " << duration; |
107 | } | 107 | } |
108 | 108 | ||
109 | void testWriteToFacade() | 109 | void testWriteToFacade() |
110 | { | 110 | { |
111 | Sink::Store::removeDataFromDisk("org.kde.dummy.instance1").exec().waitForFinished(); | 111 | Sink::Store::removeDataFromDisk("sink.dummy.instance1").exec().waitForFinished(); |
112 | 112 | ||
113 | QTime time; | 113 | QTime time; |
114 | time.start(); | 114 | time.start(); |
115 | QList<KAsync::Future<void>> waitCondition; | 115 | QList<KAsync::Future<void>> waitCondition; |
116 | for (int i = 0; i < num; i++) { | 116 | for (int i = 0; i < num; i++) { |
117 | Sink::ApplicationDomain::Event event("org.kde.dummy.instance1"); | 117 | Sink::ApplicationDomain::Event event("sink.dummy.instance1"); |
118 | event.setProperty("uid", "testuid"); | 118 | event.setProperty("uid", "testuid"); |
119 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); | 119 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); |
120 | event.setProperty("summary", "summaryValue"); | 120 | event.setProperty("summary", "summaryValue"); |
@@ -126,7 +126,7 @@ private slots: | |||
126 | // Ensure everything is processed | 126 | // Ensure everything is processed |
127 | { | 127 | { |
128 | Sink::Query query; | 128 | Sink::Query query; |
129 | query.resources << "org.kde.dummy.instance1"; | 129 | query.resources << "sink.dummy.instance1"; |
130 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 130 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
131 | } | 131 | } |
132 | auto allProcessedTime = time.elapsed(); | 132 | auto allProcessedTime = time.elapsed(); |
@@ -140,7 +140,7 @@ private slots: | |||
140 | dataset.insertRow(row); | 140 | dataset.insertRow(row); |
141 | HAWD::Formatter::print(dataset); | 141 | HAWD::Formatter::print(dataset); |
142 | 142 | ||
143 | auto diskUsage = DummyResource::diskUsage("org.kde.dummy.instance1"); | 143 | auto diskUsage = DummyResource::diskUsage("sink.dummy.instance1"); |
144 | qDebug() << "Database size [kb]: " << diskUsage / 1024; | 144 | qDebug() << "Database size [kb]: " << diskUsage / 1024; |
145 | 145 | ||
146 | // Print memory layout, RSS is what is in memory | 146 | // Print memory layout, RSS is what is in memory |
@@ -155,7 +155,7 @@ private slots: | |||
155 | { | 155 | { |
156 | time.start(); | 156 | time.start(); |
157 | Sink::Query query; | 157 | Sink::Query query; |
158 | query.resources << "org.kde.dummy.instance1"; | 158 | query.resources << "sink.dummy.instance1"; |
159 | 159 | ||
160 | query.propertyFilter.insert("uid", Sink::Query::Comparator("testuid")); | 160 | query.propertyFilter.insert("uid", Sink::Query::Comparator("testuid")); |
161 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Event>(query); | 161 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Event>(query); |
@@ -173,12 +173,12 @@ private slots: | |||
173 | 173 | ||
174 | void testWriteInProcess() | 174 | void testWriteInProcess() |
175 | { | 175 | { |
176 | Sink::Store::removeDataFromDisk("org.kde.dummy.instance1").exec().waitForFinished(); | 176 | Sink::Store::removeDataFromDisk("sink.dummy.instance1").exec().waitForFinished(); |
177 | QTime time; | 177 | QTime time; |
178 | time.start(); | 178 | time.start(); |
179 | 179 | ||
180 | auto pipeline = QSharedPointer<Sink::Pipeline>::create("org.kde.dummy.instance1"); | 180 | auto pipeline = QSharedPointer<Sink::Pipeline>::create("sink.dummy.instance1"); |
181 | DummyResource resource("org.kde.dummy.instance1", pipeline); | 181 | DummyResource resource("sink.dummy.instance1", pipeline); |
182 | 182 | ||
183 | flatbuffers::FlatBufferBuilder eventFbb; | 183 | flatbuffers::FlatBufferBuilder eventFbb; |
184 | eventFbb.Clear(); | 184 | eventFbb.Clear(); |
@@ -261,7 +261,7 @@ private slots: | |||
261 | // This allows to run individual parts without doing a cleanup, but still cleaning up normally | 261 | // This allows to run individual parts without doing a cleanup, but still cleaning up normally |
262 | void testCleanupForCompleteTest() | 262 | void testCleanupForCompleteTest() |
263 | { | 263 | { |
264 | Sink::Store::removeDataFromDisk("org.kde.dummy.instance1").exec().waitForFinished(); | 264 | Sink::Store::removeDataFromDisk("sink.dummy.instance1").exec().waitForFinished(); |
265 | } | 265 | } |
266 | 266 | ||
267 | private: | 267 | private: |
diff --git a/tests/dummyresourcetest.cpp b/tests/dummyresourcetest.cpp index 0907b1d..687a33b 100644 --- a/tests/dummyresourcetest.cpp +++ b/tests/dummyresourcetest.cpp | |||
@@ -30,10 +30,10 @@ private slots: | |||
30 | void initTestCase() | 30 | void initTestCase() |
31 | { | 31 | { |
32 | Sink::Test::initTest(); | 32 | Sink::Test::initTest(); |
33 | auto factory = Sink::ResourceFactory::load("org.kde.dummy"); | 33 | auto factory = Sink::ResourceFactory::load("sink.dummy"); |
34 | QVERIFY(factory); | 34 | QVERIFY(factory); |
35 | DummyResource::removeFromDisk("org.kde.dummy.instance1"); | 35 | DummyResource::removeFromDisk("sink.dummy.instance1"); |
36 | ResourceConfig::addResource("org.kde.dummy.instance1", "org.kde.dummy"); | 36 | ResourceConfig::addResource("sink.dummy.instance1", "sink.dummy"); |
37 | } | 37 | } |
38 | 38 | ||
39 | void init() | 39 | void init() |
@@ -47,7 +47,7 @@ private slots: | |||
47 | void cleanup() | 47 | void cleanup() |
48 | { | 48 | { |
49 | qDebug() << "Test took " << time.elapsed(); | 49 | qDebug() << "Test took " << time.elapsed(); |
50 | Sink::Store::removeDataFromDisk(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); | 50 | Sink::Store::removeDataFromDisk(QByteArray("sink.dummy.instance1")).exec().waitForFinished(); |
51 | } | 51 | } |
52 | 52 | ||
53 | void testProperty() | 53 | void testProperty() |
@@ -59,13 +59,13 @@ private slots: | |||
59 | 59 | ||
60 | void testWriteToFacadeAndQueryByUid() | 60 | void testWriteToFacadeAndQueryByUid() |
61 | { | 61 | { |
62 | Sink::ApplicationDomain::Event event("org.kde.dummy.instance1"); | 62 | Sink::ApplicationDomain::Event event("sink.dummy.instance1"); |
63 | event.setProperty("uid", "testuid"); | 63 | event.setProperty("uid", "testuid"); |
64 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); | 64 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); |
65 | event.setProperty("summary", "summaryValue"); | 65 | event.setProperty("summary", "summaryValue"); |
66 | Sink::Store::create<Sink::ApplicationDomain::Event>(event).exec().waitForFinished(); | 66 | Sink::Store::create<Sink::ApplicationDomain::Event>(event).exec().waitForFinished(); |
67 | 67 | ||
68 | const auto query = Query::ResourceFilter("org.kde.dummy.instance1") ; | 68 | const auto query = Query::ResourceFilter("sink.dummy.instance1") ; |
69 | 69 | ||
70 | // Ensure all local data is processed | 70 | // Ensure all local data is processed |
71 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 71 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
@@ -78,7 +78,7 @@ private slots: | |||
78 | 78 | ||
79 | void testWriteToFacadeAndQueryByUid2() | 79 | void testWriteToFacadeAndQueryByUid2() |
80 | { | 80 | { |
81 | Sink::ApplicationDomain::Event event("org.kde.dummy.instance1"); | 81 | Sink::ApplicationDomain::Event event("sink.dummy.instance1"); |
82 | event.setProperty("summary", "summaryValue"); | 82 | event.setProperty("summary", "summaryValue"); |
83 | 83 | ||
84 | event.setProperty("uid", "testuid"); | 84 | event.setProperty("uid", "testuid"); |
@@ -87,7 +87,7 @@ private slots: | |||
87 | event.setProperty("uid", "testuid2"); | 87 | event.setProperty("uid", "testuid2"); |
88 | Sink::Store::create<Sink::ApplicationDomain::Event>(event).exec().waitForFinished(); | 88 | Sink::Store::create<Sink::ApplicationDomain::Event>(event).exec().waitForFinished(); |
89 | 89 | ||
90 | const auto query = Query::ResourceFilter("org.kde.dummy.instance1") ; | 90 | const auto query = Query::ResourceFilter("sink.dummy.instance1") ; |
91 | 91 | ||
92 | // Ensure all local data is processed | 92 | // Ensure all local data is processed |
93 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 93 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
@@ -102,7 +102,7 @@ private slots: | |||
102 | 102 | ||
103 | void testWriteToFacadeAndQueryBySummary() | 103 | void testWriteToFacadeAndQueryBySummary() |
104 | { | 104 | { |
105 | Sink::ApplicationDomain::Event event("org.kde.dummy.instance1"); | 105 | Sink::ApplicationDomain::Event event("sink.dummy.instance1"); |
106 | 106 | ||
107 | event.setProperty("uid", "testuid"); | 107 | event.setProperty("uid", "testuid"); |
108 | event.setProperty("summary", "summaryValue1"); | 108 | event.setProperty("summary", "summaryValue1"); |
@@ -112,7 +112,7 @@ private slots: | |||
112 | event.setProperty("summary", "summaryValue2"); | 112 | event.setProperty("summary", "summaryValue2"); |
113 | Sink::Store::create<Sink::ApplicationDomain::Event>(event).exec().waitForFinished(); | 113 | Sink::Store::create<Sink::ApplicationDomain::Event>(event).exec().waitForFinished(); |
114 | 114 | ||
115 | const auto query = Query::ResourceFilter("org.kde.dummy.instance1") ; | 115 | const auto query = Query::ResourceFilter("sink.dummy.instance1") ; |
116 | 116 | ||
117 | // Ensure all local data is processed | 117 | // Ensure all local data is processed |
118 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 118 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
@@ -127,8 +127,8 @@ private slots: | |||
127 | 127 | ||
128 | void testResourceSync() | 128 | void testResourceSync() |
129 | { | 129 | { |
130 | auto pipeline = QSharedPointer<Sink::Pipeline>::create("org.kde.dummy.instance1"); | 130 | auto pipeline = QSharedPointer<Sink::Pipeline>::create("sink.dummy.instance1"); |
131 | DummyResource resource("org.kde.dummy.instance1", pipeline); | 131 | DummyResource resource("sink.dummy.instance1", pipeline); |
132 | auto job = resource.synchronizeWithSource(); | 132 | auto job = resource.synchronizeWithSource(); |
133 | // TODO pass in optional timeout? | 133 | // TODO pass in optional timeout? |
134 | auto future = job.exec(); | 134 | auto future = job.exec(); |
@@ -142,7 +142,7 @@ private slots: | |||
142 | 142 | ||
143 | void testSyncAndFacade() | 143 | void testSyncAndFacade() |
144 | { | 144 | { |
145 | const auto query = Query::ResourceFilter("org.kde.dummy.instance1"); | 145 | const auto query = Query::ResourceFilter("sink.dummy.instance1"); |
146 | 146 | ||
147 | // Ensure all local data is processed | 147 | // Ensure all local data is processed |
148 | Sink::Store::synchronize(query).exec().waitForFinished(); | 148 | Sink::Store::synchronize(query).exec().waitForFinished(); |
@@ -158,7 +158,7 @@ private slots: | |||
158 | 158 | ||
159 | void testSyncAndFacadeMail() | 159 | void testSyncAndFacadeMail() |
160 | { | 160 | { |
161 | const auto query = Query::ResourceFilter("org.kde.dummy.instance1"); | 161 | const auto query = Query::ResourceFilter("sink.dummy.instance1"); |
162 | 162 | ||
163 | // Ensure all local data is processed | 163 | // Ensure all local data is processed |
164 | Sink::Store::synchronize(query).exec().waitForFinished(); | 164 | Sink::Store::synchronize(query).exec().waitForFinished(); |
@@ -174,13 +174,13 @@ private slots: | |||
174 | 174 | ||
175 | void testWriteModifyDelete() | 175 | void testWriteModifyDelete() |
176 | { | 176 | { |
177 | Sink::ApplicationDomain::Event event("org.kde.dummy.instance1"); | 177 | Sink::ApplicationDomain::Event event("sink.dummy.instance1"); |
178 | event.setProperty("uid", "testuid"); | 178 | event.setProperty("uid", "testuid"); |
179 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); | 179 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); |
180 | event.setProperty("summary", "summaryValue"); | 180 | event.setProperty("summary", "summaryValue"); |
181 | Sink::Store::create<Sink::ApplicationDomain::Event>(event).exec().waitForFinished(); | 181 | Sink::Store::create<Sink::ApplicationDomain::Event>(event).exec().waitForFinished(); |
182 | 182 | ||
183 | const auto query = Query::ResourceFilter("org.kde.dummy.instance1") + Query::PropertyFilter("uid", "testuid"); | 183 | const auto query = Query::ResourceFilter("sink.dummy.instance1") + Query::PropertyFilter("uid", "testuid"); |
184 | 184 | ||
185 | // Ensure all local data is processed | 185 | // Ensure all local data is processed |
186 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 186 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
@@ -229,14 +229,14 @@ private slots: | |||
229 | 229 | ||
230 | void testWriteModifyDeleteLive() | 230 | void testWriteModifyDeleteLive() |
231 | { | 231 | { |
232 | auto query = Query::ResourceFilter("org.kde.dummy.instance1"); | 232 | auto query = Query::ResourceFilter("sink.dummy.instance1"); |
233 | query.liveQuery = true; | 233 | query.liveQuery = true; |
234 | query += Query::PropertyFilter("uid", "testuid"); | 234 | query += Query::PropertyFilter("uid", "testuid"); |
235 | 235 | ||
236 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Event>(query); | 236 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Event>(query); |
237 | QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); | 237 | QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); |
238 | 238 | ||
239 | Sink::ApplicationDomain::Event event("org.kde.dummy.instance1"); | 239 | Sink::ApplicationDomain::Event event("sink.dummy.instance1"); |
240 | event.setProperty("uid", "testuid"); | 240 | event.setProperty("uid", "testuid"); |
241 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); | 241 | QCOMPARE(event.getProperty("uid").toByteArray(), QByteArray("testuid")); |
242 | event.setProperty("summary", "summaryValue"); | 242 | event.setProperty("summary", "summaryValue"); |
diff --git a/tests/dummyresourcewritebenchmark.cpp b/tests/dummyresourcewritebenchmark.cpp index b4ab438..5cd7007 100644 --- a/tests/dummyresourcewritebenchmark.cpp +++ b/tests/dummyresourcewritebenchmark.cpp | |||
@@ -103,14 +103,14 @@ class DummyResourceWriteBenchmark : public QObject | |||
103 | 103 | ||
104 | void writeInProcess(int num) | 104 | void writeInProcess(int num) |
105 | { | 105 | { |
106 | DummyResource::removeFromDisk("org.kde.dummy.instance1"); | 106 | DummyResource::removeFromDisk("sink.dummy.instance1"); |
107 | 107 | ||
108 | 108 | ||
109 | QTime time; | 109 | QTime time; |
110 | time.start(); | 110 | time.start(); |
111 | 111 | ||
112 | auto pipeline = QSharedPointer<Sink::Pipeline>::create("org.kde.dummy.instance1"); | 112 | auto pipeline = QSharedPointer<Sink::Pipeline>::create("sink.dummy.instance1"); |
113 | DummyResource resource("org.kde.dummy.instance1", pipeline); | 113 | DummyResource resource("sink.dummy.instance1", pipeline); |
114 | 114 | ||
115 | int bufferSize = 0; | 115 | int bufferSize = 0; |
116 | auto command = createEntityBuffer(bufferSize); | 116 | auto command = createEntityBuffer(bufferSize); |
@@ -131,7 +131,7 @@ class DummyResourceWriteBenchmark : public QObject | |||
131 | const auto finalRss = getCurrentRSS(); | 131 | const auto finalRss = getCurrentRSS(); |
132 | const auto rssGrowth = finalRss - startingRss; | 132 | const auto rssGrowth = finalRss - startingRss; |
133 | // Since the database is memory mapped it is attributted to the resident set size. | 133 | // Since the database is memory mapped it is attributted to the resident set size. |
134 | const auto rssWithoutDb = finalRss - DummyResource::diskUsage("org.kde.dummy.instance1"); | 134 | const auto rssWithoutDb = finalRss - DummyResource::diskUsage("sink.dummy.instance1"); |
135 | const auto peakRss = getPeakRSS(); | 135 | const auto peakRss = getPeakRSS(); |
136 | // How much peak deviates from final rss in percent | 136 | // How much peak deviates from final rss in percent |
137 | const auto percentageRssError = static_cast<double>(peakRss - finalRss) * 100.0 / static_cast<double>(finalRss); | 137 | const auto percentageRssError = static_cast<double>(peakRss - finalRss) * 100.0 / static_cast<double>(finalRss); |
@@ -143,7 +143,7 @@ class DummyResourceWriteBenchmark : public QObject | |||
143 | std::cout << "Rss without db [kb]: " << rssWithoutDb / 1024 << std::endl; | 143 | std::cout << "Rss without db [kb]: " << rssWithoutDb / 1024 << std::endl; |
144 | std::cout << "Percentage peak rss error: " << percentageRssError << std::endl; | 144 | std::cout << "Percentage peak rss error: " << percentageRssError << std::endl; |
145 | 145 | ||
146 | auto onDisk = DummyResource::diskUsage("org.kde.dummy.instance1"); | 146 | auto onDisk = DummyResource::diskUsage("sink.dummy.instance1"); |
147 | auto writeAmplification = static_cast<double>(onDisk) / static_cast<double>(bufferSizeTotal); | 147 | auto writeAmplification = static_cast<double>(onDisk) / static_cast<double>(bufferSizeTotal); |
148 | std::cout << "On disk [kb]: " << onDisk / 1024 << std::endl; | 148 | std::cout << "On disk [kb]: " << onDisk / 1024 << std::endl; |
149 | std::cout << "Buffer size total [kb]: " << bufferSizeTotal / 1024 << std::endl; | 149 | std::cout << "Buffer size total [kb]: " << bufferSizeTotal / 1024 << std::endl; |
@@ -216,13 +216,13 @@ private slots: | |||
216 | 216 | ||
217 | void getFreePages() | 217 | void getFreePages() |
218 | { | 218 | { |
219 | std::system(QString("mdb_stat %1/%2 -ff").arg(Sink::storageLocation()).arg("org.kde.dummy.instance1").toLatin1().constData()); | 219 | std::system(QString("mdb_stat %1/%2 -ff").arg(Sink::storageLocation()).arg("sink.dummy.instance1").toLatin1().constData()); |
220 | } | 220 | } |
221 | 221 | ||
222 | // This allows to run individual parts without doing a cleanup, but still cleaning up normally | 222 | // This allows to run individual parts without doing a cleanup, but still cleaning up normally |
223 | void testCleanupForCompleteTest() | 223 | void testCleanupForCompleteTest() |
224 | { | 224 | { |
225 | DummyResource::removeFromDisk("org.kde.dummy.instance1"); | 225 | DummyResource::removeFromDisk("sink.dummy.instance1"); |
226 | } | 226 | } |
227 | 227 | ||
228 | private: | 228 | private: |
diff --git a/tests/genericresourcebenchmark.cpp b/tests/genericresourcebenchmark.cpp index a0a368c..2315d0b 100644 --- a/tests/genericresourcebenchmark.cpp +++ b/tests/genericresourcebenchmark.cpp | |||
@@ -96,9 +96,9 @@ private slots: | |||
96 | 96 | ||
97 | void initTestCase() | 97 | void initTestCase() |
98 | { | 98 | { |
99 | removeFromDisk("org.kde.test.instance1"); | 99 | removeFromDisk("sink.test.instance1"); |
100 | removeFromDisk("org.kde.test.instance1.userqueue"); | 100 | removeFromDisk("sink.test.instance1.userqueue"); |
101 | removeFromDisk("org.kde.test.instance1.synchronizerqueue"); | 101 | removeFromDisk("sink.test.instance1.synchronizerqueue"); |
102 | } | 102 | } |
103 | 103 | ||
104 | 104 | ||
@@ -106,8 +106,8 @@ private slots: | |||
106 | { | 106 | { |
107 | int num = 10000; | 107 | int num = 10000; |
108 | 108 | ||
109 | auto pipeline = QSharedPointer<Sink::Pipeline>::create("org.kde.test.instance1"); | 109 | auto pipeline = QSharedPointer<Sink::Pipeline>::create("sink.test.instance1"); |
110 | TestResource resource("org.kde.test.instance1", pipeline); | 110 | TestResource resource("sink.test.instance1", pipeline); |
111 | 111 | ||
112 | auto command = createEntityBuffer(); | 112 | auto command = createEntityBuffer(); |
113 | 113 | ||
@@ -141,16 +141,16 @@ private slots: | |||
141 | { | 141 | { |
142 | int num = 50000; | 142 | int num = 50000; |
143 | 143 | ||
144 | auto pipeline = QSharedPointer<Sink::Pipeline>::create("org.kde.test.instance1"); | 144 | auto pipeline = QSharedPointer<Sink::Pipeline>::create("sink.test.instance1"); |
145 | 145 | ||
146 | auto eventFactory = QSharedPointer<TestEventAdaptorFactory>::create(); | 146 | auto eventFactory = QSharedPointer<TestEventAdaptorFactory>::create(); |
147 | const QByteArray resourceIdentifier = "org.kde.test.instance1"; | 147 | const QByteArray resourceIdentifier = "sink.test.instance1"; |
148 | auto indexer = QSharedPointer<IndexUpdater>::create(); | 148 | auto indexer = QSharedPointer<IndexUpdater>::create(); |
149 | 149 | ||
150 | pipeline->setPreprocessors("event", QVector<Sink::Preprocessor *>() << indexer.data()); | 150 | pipeline->setPreprocessors("event", QVector<Sink::Preprocessor *>() << indexer.data()); |
151 | pipeline->setAdaptorFactory("event", eventFactory); | 151 | pipeline->setAdaptorFactory("event", eventFactory); |
152 | 152 | ||
153 | TestResource resource("org.kde.test.instance1", pipeline); | 153 | TestResource resource("sink.test.instance1", pipeline); |
154 | 154 | ||
155 | auto command = createEntityBuffer(); | 155 | auto command = createEntityBuffer(); |
156 | 156 | ||
diff --git a/tests/genericresourcetest.cpp b/tests/genericresourcetest.cpp index fe2c146..77a901d 100644 --- a/tests/genericresourcetest.cpp +++ b/tests/genericresourcetest.cpp | |||
@@ -26,7 +26,7 @@ private slots: | |||
26 | 26 | ||
27 | void init() | 27 | void init() |
28 | { | 28 | { |
29 | Sink::GenericResource::removeFromDisk("org.kde.test.instance1"); | 29 | Sink::GenericResource::removeFromDisk("sink.test.instance1"); |
30 | } | 30 | } |
31 | 31 | ||
32 | /// Ensure the resource can process messages | 32 | /// Ensure the resource can process messages |
@@ -70,10 +70,10 @@ private slots: | |||
70 | } | 70 | } |
71 | 71 | ||
72 | // Actual test | 72 | // Actual test |
73 | auto pipeline = QSharedPointer<Sink::Pipeline>::create("org.kde.test.instance1"); | 73 | auto pipeline = QSharedPointer<Sink::Pipeline>::create("sink.test.instance1"); |
74 | QSignalSpy revisionSpy(pipeline.data(), SIGNAL(revisionUpdated(qint64))); | 74 | QSignalSpy revisionSpy(pipeline.data(), SIGNAL(revisionUpdated(qint64))); |
75 | QVERIFY(revisionSpy.isValid()); | 75 | QVERIFY(revisionSpy.isValid()); |
76 | TestResource resource("org.kde.test.instance1", pipeline); | 76 | TestResource resource("sink.test.instance1", pipeline); |
77 | resource.processCommand(Sink::Commands::CreateEntityCommand, command); | 77 | resource.processCommand(Sink::Commands::CreateEntityCommand, command); |
78 | resource.processCommand(Sink::Commands::CreateEntityCommand, command); | 78 | resource.processCommand(Sink::Commands::CreateEntityCommand, command); |
79 | resource.processAllMessages().exec().waitForFinished(); | 79 | resource.processAllMessages().exec().waitForFinished(); |
diff --git a/tests/indextest.cpp b/tests/indextest.cpp index fa3ace4..8566803 100644 --- a/tests/indextest.cpp +++ b/tests/indextest.cpp | |||
@@ -16,19 +16,19 @@ class IndexTest : public QObject | |||
16 | private slots: | 16 | private slots: |
17 | void initTestCase() | 17 | void initTestCase() |
18 | { | 18 | { |
19 | Sink::Storage store("./testindex", "org.kde.dummy.testindex", Sink::Storage::ReadWrite); | 19 | Sink::Storage store("./testindex", "sink.dummy.testindex", Sink::Storage::ReadWrite); |
20 | store.removeFromDisk(); | 20 | store.removeFromDisk(); |
21 | } | 21 | } |
22 | 22 | ||
23 | void cleanup() | 23 | void cleanup() |
24 | { | 24 | { |
25 | Sink::Storage store("./testindex", "org.kde.dummy.testindex", Sink::Storage::ReadWrite); | 25 | Sink::Storage store("./testindex", "sink.dummy.testindex", Sink::Storage::ReadWrite); |
26 | store.removeFromDisk(); | 26 | store.removeFromDisk(); |
27 | } | 27 | } |
28 | 28 | ||
29 | void testIndex() | 29 | void testIndex() |
30 | { | 30 | { |
31 | Index index("./testindex", "org.kde.dummy.testindex", Sink::Storage::ReadWrite); | 31 | Index index("./testindex", "sink.dummy.testindex", Sink::Storage::ReadWrite); |
32 | // The first key is specifically a substring of the second key | 32 | // The first key is specifically a substring of the second key |
33 | index.add("key", "value1"); | 33 | index.add("key", "value1"); |
34 | index.add("keyFoo", "value2"); | 34 | index.add("keyFoo", "value2"); |
diff --git a/tests/inspectiontest.cpp b/tests/inspectiontest.cpp index 8f2c50f..3e8a103 100644 --- a/tests/inspectiontest.cpp +++ b/tests/inspectiontest.cpp | |||
@@ -19,10 +19,10 @@ class InspectionTest : public QObject | |||
19 | private slots: | 19 | private slots: |
20 | void initTestCase() | 20 | void initTestCase() |
21 | { | 21 | { |
22 | auto factory = Sink::ResourceFactory::load("org.kde.dummy"); | 22 | auto factory = Sink::ResourceFactory::load("sink.dummy"); |
23 | QVERIFY(factory); | 23 | QVERIFY(factory); |
24 | ResourceConfig::addResource("org.kde.dummy.instance1", "org.kde.dummy"); | 24 | ResourceConfig::addResource("sink.dummy.instance1", "sink.dummy"); |
25 | Sink::Store::removeDataFromDisk(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); | 25 | Sink::Store::removeDataFromDisk(QByteArray("sink.dummy.instance1")).exec().waitForFinished(); |
26 | } | 26 | } |
27 | 27 | ||
28 | void testInspection_data() | 28 | void testInspection_data() |
@@ -38,7 +38,7 @@ private slots: | |||
38 | using namespace Sink; | 38 | using namespace Sink; |
39 | using namespace Sink::ApplicationDomain; | 39 | using namespace Sink::ApplicationDomain; |
40 | 40 | ||
41 | Mail mail(QByteArray("org.kde.dummy.instance1"), QByteArray("identifier"), 0, QSharedPointer<MemoryBufferAdaptor::MemoryBufferAdaptor>::create()); | 41 | Mail mail(QByteArray("sink.dummy.instance1"), QByteArray("identifier"), 0, QSharedPointer<MemoryBufferAdaptor::MemoryBufferAdaptor>::create()); |
42 | 42 | ||
43 | // testInspection is a magic property that the dummyresource supports | 43 | // testInspection is a magic property that the dummyresource supports |
44 | auto inspectionCommand = ResourceControl::Inspection::PropertyInspection(mail, "testInspection", success); | 44 | auto inspectionCommand = ResourceControl::Inspection::PropertyInspection(mail, "testInspection", success); |
diff --git a/tests/maildirsyncbenchmark.cpp b/tests/maildirsyncbenchmark.cpp index 8b1a9d7..d84c758 100644 --- a/tests/maildirsyncbenchmark.cpp +++ b/tests/maildirsyncbenchmark.cpp | |||
@@ -61,17 +61,17 @@ private slots: | |||
61 | { | 61 | { |
62 | targetPath = tempDir.path() + "/maildir1"; | 62 | targetPath = tempDir.path() + "/maildir1"; |
63 | 63 | ||
64 | MaildirResource::removeFromDisk("org.kde.maildir.test1"); | 64 | MaildirResource::removeFromDisk("sink.maildir.test1"); |
65 | Sink::ApplicationDomain::SinkResource resource; | 65 | Sink::ApplicationDomain::SinkResource resource; |
66 | resource.setProperty("identifier", "org.kde.maildir.test1"); | 66 | resource.setProperty("identifier", "sink.maildir.test1"); |
67 | resource.setProperty("type", "org.kde.maildir"); | 67 | resource.setProperty("type", "sink.maildir"); |
68 | resource.setProperty("path", targetPath); | 68 | resource.setProperty("path", targetPath); |
69 | Sink::Store::create(resource).exec().waitForFinished(); | 69 | Sink::Store::create(resource).exec().waitForFinished(); |
70 | } | 70 | } |
71 | 71 | ||
72 | void cleanup() | 72 | void cleanup() |
73 | { | 73 | { |
74 | MaildirResource::removeFromDisk("org.kde.maildir.test1"); | 74 | MaildirResource::removeFromDisk("sink.maildir.test1"); |
75 | QDir dir(targetPath); | 75 | QDir dir(targetPath); |
76 | dir.removeRecursively(); | 76 | dir.removeRecursively(); |
77 | } | 77 | } |
@@ -83,8 +83,8 @@ private slots: | |||
83 | 83 | ||
84 | void testbench() | 84 | void testbench() |
85 | { | 85 | { |
86 | auto pipeline = QSharedPointer<Sink::Pipeline>::create("org.kde.maildir.test1"); | 86 | auto pipeline = QSharedPointer<Sink::Pipeline>::create("sink.maildir.test1"); |
87 | MaildirResource resource("org.kde.maildir.test1", pipeline); | 87 | MaildirResource resource("sink.maildir.test1", pipeline); |
88 | QTime time; | 88 | QTime time; |
89 | time.start(); | 89 | time.start(); |
90 | resource.Sink::GenericResource::synchronizeWithSource().exec().waitForFinished(); | 90 | resource.Sink::GenericResource::synchronizeWithSource().exec().waitForFinished(); |
diff --git a/tests/mailquerybenchmark.cpp b/tests/mailquerybenchmark.cpp index 4e58899..450955f 100644 --- a/tests/mailquerybenchmark.cpp +++ b/tests/mailquerybenchmark.cpp | |||
@@ -148,7 +148,7 @@ private slots: | |||
148 | 148 | ||
149 | void init() | 149 | void init() |
150 | { | 150 | { |
151 | resourceIdentifier = "org.kde.test.instance1"; | 151 | resourceIdentifier = "sink.test.instance1"; |
152 | Sink::AdaptorFactoryRegistry::instance().registerFactory<Sink::ApplicationDomain::Mail, TestMailAdaptorFactory>("test"); | 152 | Sink::AdaptorFactoryRegistry::instance().registerFactory<Sink::ApplicationDomain::Mail, TestMailAdaptorFactory>("test"); |
153 | } | 153 | } |
154 | 154 | ||
diff --git a/tests/messagequeuetest.cpp b/tests/messagequeuetest.cpp index 27dd12b..e79bba2 100644 --- a/tests/messagequeuetest.cpp +++ b/tests/messagequeuetest.cpp | |||
@@ -21,7 +21,7 @@ private slots: | |||
21 | void initTestCase() | 21 | void initTestCase() |
22 | { | 22 | { |
23 | Sink::Test::initTest(); | 23 | Sink::Test::initTest(); |
24 | Sink::Storage store(Sink::Store::storageLocation(), "org.kde.dummy.testqueue", Sink::Storage::ReadWrite); | 24 | Sink::Storage store(Sink::Store::storageLocation(), "sink.dummy.testqueue", Sink::Storage::ReadWrite); |
25 | store.removeFromDisk(); | 25 | store.removeFromDisk(); |
26 | } | 26 | } |
27 | 27 | ||
@@ -31,13 +31,13 @@ private slots: | |||
31 | 31 | ||
32 | void cleanup() | 32 | void cleanup() |
33 | { | 33 | { |
34 | Sink::Storage store(Sink::Store::storageLocation(), "org.kde.dummy.testqueue", Sink::Storage::ReadWrite); | 34 | Sink::Storage store(Sink::Store::storageLocation(), "sink.dummy.testqueue", Sink::Storage::ReadWrite); |
35 | store.removeFromDisk(); | 35 | store.removeFromDisk(); |
36 | } | 36 | } |
37 | 37 | ||
38 | void testEmpty() | 38 | void testEmpty() |
39 | { | 39 | { |
40 | MessageQueue queue(Sink::Store::storageLocation(), "org.kde.dummy.testqueue"); | 40 | MessageQueue queue(Sink::Store::storageLocation(), "sink.dummy.testqueue"); |
41 | QVERIFY(queue.isEmpty()); | 41 | QVERIFY(queue.isEmpty()); |
42 | queue.enqueue("value"); | 42 | queue.enqueue("value"); |
43 | QVERIFY(!queue.isEmpty()); | 43 | QVERIFY(!queue.isEmpty()); |
@@ -45,7 +45,7 @@ private slots: | |||
45 | 45 | ||
46 | void testDequeueEmpty() | 46 | void testDequeueEmpty() |
47 | { | 47 | { |
48 | MessageQueue queue(Sink::Store::storageLocation(), "org.kde.dummy.testqueue"); | 48 | MessageQueue queue(Sink::Store::storageLocation(), "sink.dummy.testqueue"); |
49 | bool gotValue = false; | 49 | bool gotValue = false; |
50 | bool gotError = false; | 50 | bool gotError = false; |
51 | queue.dequeue([&](void *ptr, int size, std::function<void(bool success)> callback) { gotValue = true; }, [&](const MessageQueue::Error &error) { gotError = true; }); | 51 | queue.dequeue([&](void *ptr, int size, std::function<void(bool success)> callback) { gotValue = true; }, [&](const MessageQueue::Error &error) { gotError = true; }); |
@@ -55,7 +55,7 @@ private slots: | |||
55 | 55 | ||
56 | void testEnqueue() | 56 | void testEnqueue() |
57 | { | 57 | { |
58 | MessageQueue queue(Sink::Store::storageLocation(), "org.kde.dummy.testqueue"); | 58 | MessageQueue queue(Sink::Store::storageLocation(), "sink.dummy.testqueue"); |
59 | QSignalSpy spy(&queue, SIGNAL(messageReady())); | 59 | QSignalSpy spy(&queue, SIGNAL(messageReady())); |
60 | queue.enqueue("value1"); | 60 | queue.enqueue("value1"); |
61 | QCOMPARE(spy.size(), 1); | 61 | QCOMPARE(spy.size(), 1); |
@@ -63,7 +63,7 @@ private slots: | |||
63 | 63 | ||
64 | void testDrained() | 64 | void testDrained() |
65 | { | 65 | { |
66 | MessageQueue queue(Sink::Store::storageLocation(), "org.kde.dummy.testqueue"); | 66 | MessageQueue queue(Sink::Store::storageLocation(), "sink.dummy.testqueue"); |
67 | QSignalSpy spy(&queue, SIGNAL(drained())); | 67 | QSignalSpy spy(&queue, SIGNAL(drained())); |
68 | queue.enqueue("value1"); | 68 | queue.enqueue("value1"); |
69 | 69 | ||
@@ -77,7 +77,7 @@ private slots: | |||
77 | values << "value1"; | 77 | values << "value1"; |
78 | values << "value2"; | 78 | values << "value2"; |
79 | 79 | ||
80 | MessageQueue queue(Sink::Store::storageLocation(), "org.kde.dummy.testqueue"); | 80 | MessageQueue queue(Sink::Store::storageLocation(), "sink.dummy.testqueue"); |
81 | for (const QByteArray &value : values) { | 81 | for (const QByteArray &value : values) { |
82 | queue.enqueue(value); | 82 | queue.enqueue(value); |
83 | } | 83 | } |
@@ -107,7 +107,7 @@ private slots: | |||
107 | values << "value1"; | 107 | values << "value1"; |
108 | values << "value2"; | 108 | values << "value2"; |
109 | 109 | ||
110 | MessageQueue queue(Sink::Store::storageLocation(), "org.kde.dummy.testqueue"); | 110 | MessageQueue queue(Sink::Store::storageLocation(), "sink.dummy.testqueue"); |
111 | for (const QByteArray &value : values) { | 111 | for (const QByteArray &value : values) { |
112 | queue.enqueue(value); | 112 | queue.enqueue(value); |
113 | } | 113 | } |
@@ -145,7 +145,7 @@ private slots: | |||
145 | */ | 145 | */ |
146 | void testNestedEnqueue() | 146 | void testNestedEnqueue() |
147 | { | 147 | { |
148 | MessageQueue queue(Sink::Store::storageLocation(), "org.kde.dummy.testqueue"); | 148 | MessageQueue queue(Sink::Store::storageLocation(), "sink.dummy.testqueue"); |
149 | queue.enqueue("value1"); | 149 | queue.enqueue("value1"); |
150 | 150 | ||
151 | bool gotError = false; | 151 | bool gotError = false; |
@@ -160,7 +160,7 @@ private slots: | |||
160 | 160 | ||
161 | void testBatchDequeue() | 161 | void testBatchDequeue() |
162 | { | 162 | { |
163 | MessageQueue queue(Sink::Store::storageLocation(), "org.kde.dummy.testqueue"); | 163 | MessageQueue queue(Sink::Store::storageLocation(), "sink.dummy.testqueue"); |
164 | queue.enqueue("value1"); | 164 | queue.enqueue("value1"); |
165 | queue.enqueue("value2"); | 165 | queue.enqueue("value2"); |
166 | queue.enqueue("value3"); | 166 | queue.enqueue("value3"); |
@@ -181,7 +181,7 @@ private slots: | |||
181 | 181 | ||
182 | void testBatchEnqueue() | 182 | void testBatchEnqueue() |
183 | { | 183 | { |
184 | MessageQueue queue(Sink::Store::storageLocation(), "org.kde.dummy.testqueue"); | 184 | MessageQueue queue(Sink::Store::storageLocation(), "sink.dummy.testqueue"); |
185 | QSignalSpy spy(&queue, SIGNAL(messageReady())); | 185 | QSignalSpy spy(&queue, SIGNAL(messageReady())); |
186 | queue.startTransaction(); | 186 | queue.startTransaction(); |
187 | queue.enqueue("value1"); | 187 | queue.enqueue("value1"); |
diff --git a/tests/modelinteractivitytest.cpp b/tests/modelinteractivitytest.cpp index d13cdf7..4819ccc 100644 --- a/tests/modelinteractivitytest.cpp +++ b/tests/modelinteractivitytest.cpp | |||
@@ -51,13 +51,13 @@ private slots: | |||
51 | void initTestCase() | 51 | void initTestCase() |
52 | { | 52 | { |
53 | Sink::Test::initTest(); | 53 | Sink::Test::initTest(); |
54 | ResourceConfig::addResource("org.kde.dummy.instance1", "org.kde.dummy"); | 54 | ResourceConfig::addResource("sink.dummy.instance1", "sink.dummy"); |
55 | Sink::Store::removeDataFromDisk(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); | 55 | Sink::Store::removeDataFromDisk(QByteArray("sink.dummy.instance1")).exec().waitForFinished(); |
56 | } | 56 | } |
57 | 57 | ||
58 | void cleanup() | 58 | void cleanup() |
59 | { | 59 | { |
60 | Sink::Store::removeDataFromDisk(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); | 60 | Sink::Store::removeDataFromDisk(QByteArray("sink.dummy.instance1")).exec().waitForFinished(); |
61 | } | 61 | } |
62 | 62 | ||
63 | void init() | 63 | void init() |
@@ -68,14 +68,14 @@ private slots: | |||
68 | { | 68 | { |
69 | // Setup | 69 | // Setup |
70 | { | 70 | { |
71 | Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); | 71 | Sink::ApplicationDomain::Mail mail("sink.dummy.instance1"); |
72 | for (int i = 0; i < 1000; i++) { | 72 | for (int i = 0; i < 1000; i++) { |
73 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); | 73 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); |
74 | } | 74 | } |
75 | } | 75 | } |
76 | 76 | ||
77 | Sink::Query query; | 77 | Sink::Query query; |
78 | query.resources << "org.kde.dummy.instance1"; | 78 | query.resources << "sink.dummy.instance1"; |
79 | query.liveQuery = true; | 79 | query.liveQuery = true; |
80 | 80 | ||
81 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 81 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
diff --git a/tests/pipelinebenchmark.cpp b/tests/pipelinebenchmark.cpp index 51481fd..0c0b9e6 100644 --- a/tests/pipelinebenchmark.cpp +++ b/tests/pipelinebenchmark.cpp | |||
@@ -131,7 +131,7 @@ private slots: | |||
131 | { | 131 | { |
132 | Sink::Log::setDebugOutputLevel(Sink::Log::Warning); | 132 | Sink::Log::setDebugOutputLevel(Sink::Log::Warning); |
133 | Sink::AdaptorFactoryRegistry::instance().registerFactory<Sink::ApplicationDomain::Mail, TestMailAdaptorFactory>("test"); | 133 | Sink::AdaptorFactoryRegistry::instance().registerFactory<Sink::ApplicationDomain::Mail, TestMailAdaptorFactory>("test"); |
134 | resourceIdentifier = "org.kde.test.instance1"; | 134 | resourceIdentifier = "sink.test.instance1"; |
135 | } | 135 | } |
136 | 136 | ||
137 | void testWithoutIndex() | 137 | void testWithoutIndex() |
diff --git a/tests/pipelinetest.cpp b/tests/pipelinetest.cpp index 65d4b49..7216f62 100644 --- a/tests/pipelinetest.cpp +++ b/tests/pipelinetest.cpp | |||
@@ -195,7 +195,7 @@ private slots: | |||
195 | 195 | ||
196 | void init() | 196 | void init() |
197 | { | 197 | { |
198 | removeFromDisk("org.kde.pipelinetest.instance1"); | 198 | removeFromDisk("sink.pipelinetest.instance1"); |
199 | } | 199 | } |
200 | 200 | ||
201 | void testCreate() | 201 | void testCreate() |
@@ -203,14 +203,14 @@ private slots: | |||
203 | flatbuffers::FlatBufferBuilder entityFbb; | 203 | flatbuffers::FlatBufferBuilder entityFbb; |
204 | auto command = createEntityCommand(createEvent(entityFbb)); | 204 | auto command = createEntityCommand(createEvent(entityFbb)); |
205 | 205 | ||
206 | Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); | 206 | Sink::Pipeline pipeline("sink.pipelinetest.instance1"); |
207 | pipeline.setResourceType("test"); | 207 | pipeline.setResourceType("test"); |
208 | 208 | ||
209 | pipeline.startTransaction(); | 209 | pipeline.startTransaction(); |
210 | pipeline.newEntity(command.constData(), command.size()); | 210 | pipeline.newEntity(command.constData(), command.size()); |
211 | pipeline.commit(); | 211 | pipeline.commit(); |
212 | 212 | ||
213 | auto result = getKeys("org.kde.pipelinetest.instance1", "event.main"); | 213 | auto result = getKeys("sink.pipelinetest.instance1", "event.main"); |
214 | qDebug() << result; | 214 | qDebug() << result; |
215 | QCOMPARE(result.size(), 1); | 215 | QCOMPARE(result.size(), 1); |
216 | } | 216 | } |
@@ -220,7 +220,7 @@ private slots: | |||
220 | flatbuffers::FlatBufferBuilder entityFbb; | 220 | flatbuffers::FlatBufferBuilder entityFbb; |
221 | auto command = createEntityCommand(createEvent(entityFbb, "summary", "description")); | 221 | auto command = createEntityCommand(createEvent(entityFbb, "summary", "description")); |
222 | 222 | ||
223 | Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); | 223 | Sink::Pipeline pipeline("sink.pipelinetest.instance1"); |
224 | pipeline.setResourceType("test"); | 224 | pipeline.setResourceType("test"); |
225 | 225 | ||
226 | auto adaptorFactory = QSharedPointer<TestEventAdaptorFactory>::create(); | 226 | auto adaptorFactory = QSharedPointer<TestEventAdaptorFactory>::create(); |
@@ -231,7 +231,7 @@ private slots: | |||
231 | pipeline.commit(); | 231 | pipeline.commit(); |
232 | 232 | ||
233 | // Get uid of written entity | 233 | // Get uid of written entity |
234 | auto keys = getKeys("org.kde.pipelinetest.instance1", "event.main"); | 234 | auto keys = getKeys("sink.pipelinetest.instance1", "event.main"); |
235 | QCOMPARE(keys.size(), 1); | 235 | QCOMPARE(keys.size(), 1); |
236 | const auto key = keys.first(); | 236 | const auto key = keys.first(); |
237 | const auto uid = Sink::Storage::uidFromKey(key); | 237 | const auto uid = Sink::Storage::uidFromKey(key); |
@@ -244,7 +244,7 @@ private slots: | |||
244 | pipeline.commit(); | 244 | pipeline.commit(); |
245 | 245 | ||
246 | // Ensure we've got the new revision with the modification | 246 | // Ensure we've got the new revision with the modification |
247 | auto buffer = getEntity("org.kde.pipelinetest.instance1", "event.main", Sink::Storage::assembleKey(uid, 2)); | 247 | auto buffer = getEntity("sink.pipelinetest.instance1", "event.main", Sink::Storage::assembleKey(uid, 2)); |
248 | QVERIFY(!buffer.isEmpty()); | 248 | QVERIFY(!buffer.isEmpty()); |
249 | Sink::EntityBuffer entityBuffer(buffer.data(), buffer.size()); | 249 | Sink::EntityBuffer entityBuffer(buffer.data(), buffer.size()); |
250 | auto adaptor = adaptorFactory->createAdaptor(entityBuffer.entity()); | 250 | auto adaptor = adaptorFactory->createAdaptor(entityBuffer.entity()); |
@@ -253,7 +253,7 @@ private slots: | |||
253 | QVERIFY2(adaptor->getProperty("description").toString() == QString("description"), "The modification has sideeffects."); | 253 | QVERIFY2(adaptor->getProperty("description").toString() == QString("description"), "The modification has sideeffects."); |
254 | 254 | ||
255 | // Both revisions are in the store at this point | 255 | // Both revisions are in the store at this point |
256 | QCOMPARE(getKeys("org.kde.pipelinetest.instance1", "event.main").size(), 2); | 256 | QCOMPARE(getKeys("sink.pipelinetest.instance1", "event.main").size(), 2); |
257 | 257 | ||
258 | // Cleanup old revisions | 258 | // Cleanup old revisions |
259 | pipeline.startTransaction(); | 259 | pipeline.startTransaction(); |
@@ -261,7 +261,7 @@ private slots: | |||
261 | pipeline.commit(); | 261 | pipeline.commit(); |
262 | 262 | ||
263 | // And now only the latest revision is left | 263 | // And now only the latest revision is left |
264 | QCOMPARE(getKeys("org.kde.pipelinetest.instance1", "event.main").size(), 1); | 264 | QCOMPARE(getKeys("sink.pipelinetest.instance1", "event.main").size(), 1); |
265 | } | 265 | } |
266 | 266 | ||
267 | void testModifyWithUnrelatedOperationInbetween() | 267 | void testModifyWithUnrelatedOperationInbetween() |
@@ -269,7 +269,7 @@ private slots: | |||
269 | flatbuffers::FlatBufferBuilder entityFbb; | 269 | flatbuffers::FlatBufferBuilder entityFbb; |
270 | auto command = createEntityCommand(createEvent(entityFbb)); | 270 | auto command = createEntityCommand(createEvent(entityFbb)); |
271 | 271 | ||
272 | Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); | 272 | Sink::Pipeline pipeline("sink.pipelinetest.instance1"); |
273 | pipeline.setResourceType("test"); | 273 | pipeline.setResourceType("test"); |
274 | 274 | ||
275 | auto adaptorFactory = QSharedPointer<TestEventAdaptorFactory>::create(); | 275 | auto adaptorFactory = QSharedPointer<TestEventAdaptorFactory>::create(); |
@@ -280,7 +280,7 @@ private slots: | |||
280 | pipeline.commit(); | 280 | pipeline.commit(); |
281 | 281 | ||
282 | // Get uid of written entity | 282 | // Get uid of written entity |
283 | auto keys = getKeys("org.kde.pipelinetest.instance1", "event.main"); | 283 | auto keys = getKeys("sink.pipelinetest.instance1", "event.main"); |
284 | QCOMPARE(keys.size(), 1); | 284 | QCOMPARE(keys.size(), 1); |
285 | const auto uid = Sink::Storage::uidFromKey(keys.first()); | 285 | const auto uid = Sink::Storage::uidFromKey(keys.first()); |
286 | 286 | ||
@@ -302,7 +302,7 @@ private slots: | |||
302 | pipeline.commit(); | 302 | pipeline.commit(); |
303 | 303 | ||
304 | // Ensure we've got the new revision with the modification | 304 | // Ensure we've got the new revision with the modification |
305 | auto buffer = getEntity("org.kde.pipelinetest.instance1", "event.main", Sink::Storage::assembleKey(uid, 3)); | 305 | auto buffer = getEntity("sink.pipelinetest.instance1", "event.main", Sink::Storage::assembleKey(uid, 3)); |
306 | QVERIFY(!buffer.isEmpty()); | 306 | QVERIFY(!buffer.isEmpty()); |
307 | Sink::EntityBuffer entityBuffer(buffer.data(), buffer.size()); | 307 | Sink::EntityBuffer entityBuffer(buffer.data(), buffer.size()); |
308 | auto adaptor = adaptorFactory->createAdaptor(entityBuffer.entity()); | 308 | auto adaptor = adaptorFactory->createAdaptor(entityBuffer.entity()); |
@@ -313,7 +313,7 @@ private slots: | |||
313 | { | 313 | { |
314 | flatbuffers::FlatBufferBuilder entityFbb; | 314 | flatbuffers::FlatBufferBuilder entityFbb; |
315 | auto command = createEntityCommand(createEvent(entityFbb)); | 315 | auto command = createEntityCommand(createEvent(entityFbb)); |
316 | Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); | 316 | Sink::Pipeline pipeline("sink.pipelinetest.instance1"); |
317 | pipeline.setResourceType("test"); | 317 | pipeline.setResourceType("test"); |
318 | 318 | ||
319 | // Create the initial revision | 319 | // Create the initial revision |
@@ -321,7 +321,7 @@ private slots: | |||
321 | pipeline.newEntity(command.constData(), command.size()); | 321 | pipeline.newEntity(command.constData(), command.size()); |
322 | pipeline.commit(); | 322 | pipeline.commit(); |
323 | 323 | ||
324 | auto result = getKeys("org.kde.pipelinetest.instance1", "event.main"); | 324 | auto result = getKeys("sink.pipelinetest.instance1", "event.main"); |
325 | QCOMPARE(result.size(), 1); | 325 | QCOMPARE(result.size(), 1); |
326 | 326 | ||
327 | const auto uid = Sink::Storage::uidFromKey(result.first()); | 327 | const auto uid = Sink::Storage::uidFromKey(result.first()); |
@@ -333,7 +333,7 @@ private slots: | |||
333 | pipeline.commit(); | 333 | pipeline.commit(); |
334 | 334 | ||
335 | // We have a new revision that indicates the deletion | 335 | // We have a new revision that indicates the deletion |
336 | QCOMPARE(getKeys("org.kde.pipelinetest.instance1", "event.main").size(), 2); | 336 | QCOMPARE(getKeys("sink.pipelinetest.instance1", "event.main").size(), 2); |
337 | 337 | ||
338 | // Cleanup old revisions | 338 | // Cleanup old revisions |
339 | pipeline.startTransaction(); | 339 | pipeline.startTransaction(); |
@@ -341,7 +341,7 @@ private slots: | |||
341 | pipeline.commit(); | 341 | pipeline.commit(); |
342 | 342 | ||
343 | // And all revisions are gone | 343 | // And all revisions are gone |
344 | QCOMPARE(getKeys("org.kde.pipelinetest.instance1", "event.main").size(), 0); | 344 | QCOMPARE(getKeys("sink.pipelinetest.instance1", "event.main").size(), 0); |
345 | } | 345 | } |
346 | 346 | ||
347 | void testPreprocessor() | 347 | void testPreprocessor() |
@@ -350,7 +350,7 @@ private slots: | |||
350 | 350 | ||
351 | auto testProcessor = new TestProcessor; | 351 | auto testProcessor = new TestProcessor; |
352 | 352 | ||
353 | Sink::Pipeline pipeline("org.kde.pipelinetest.instance1"); | 353 | Sink::Pipeline pipeline("sink.pipelinetest.instance1"); |
354 | pipeline.setResourceType("test"); | 354 | pipeline.setResourceType("test"); |
355 | pipeline.setPreprocessors("event", QVector<Sink::Preprocessor *>() << testProcessor); | 355 | pipeline.setPreprocessors("event", QVector<Sink::Preprocessor *>() << testProcessor); |
356 | pipeline.startTransaction(); | 356 | pipeline.startTransaction(); |
@@ -368,7 +368,7 @@ private slots: | |||
368 | pipeline.commit(); | 368 | pipeline.commit(); |
369 | entityFbb.Clear(); | 369 | entityFbb.Clear(); |
370 | pipeline.startTransaction(); | 370 | pipeline.startTransaction(); |
371 | auto keys = getKeys("org.kde.pipelinetest.instance1", "event.main"); | 371 | auto keys = getKeys("sink.pipelinetest.instance1", "event.main"); |
372 | QCOMPARE(keys.size(), 1); | 372 | QCOMPARE(keys.size(), 1); |
373 | const auto uid = Sink::Storage::uidFromKey(keys.first()); | 373 | const auto uid = Sink::Storage::uidFromKey(keys.first()); |
374 | { | 374 | { |
diff --git a/tests/querytest.cpp b/tests/querytest.cpp index 95c22b3..d3a97f6 100644 --- a/tests/querytest.cpp +++ b/tests/querytest.cpp | |||
@@ -23,15 +23,15 @@ private slots: | |||
23 | void initTestCase() | 23 | void initTestCase() |
24 | { | 24 | { |
25 | Sink::Test::initTest(); | 25 | Sink::Test::initTest(); |
26 | auto factory = Sink::ResourceFactory::load("org.kde.dummy"); | 26 | auto factory = Sink::ResourceFactory::load("sink.dummy"); |
27 | QVERIFY(factory); | 27 | QVERIFY(factory); |
28 | ResourceConfig::addResource("org.kde.dummy.instance1", "org.kde.dummy"); | 28 | ResourceConfig::addResource("sink.dummy.instance1", "sink.dummy"); |
29 | Sink::Store::removeDataFromDisk(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); | 29 | Sink::Store::removeDataFromDisk(QByteArray("sink.dummy.instance1")).exec().waitForFinished(); |
30 | } | 30 | } |
31 | 31 | ||
32 | void cleanup() | 32 | void cleanup() |
33 | { | 33 | { |
34 | Sink::Store::removeDataFromDisk(QByteArray("org.kde.dummy.instance1")).exec().waitForFinished(); | 34 | Sink::Store::removeDataFromDisk(QByteArray("sink.dummy.instance1")).exec().waitForFinished(); |
35 | } | 35 | } |
36 | 36 | ||
37 | void init() | 37 | void init() |
@@ -59,13 +59,13 @@ private slots: | |||
59 | { | 59 | { |
60 | // Setup | 60 | // Setup |
61 | { | 61 | { |
62 | Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); | 62 | Sink::ApplicationDomain::Mail mail("sink.dummy.instance1"); |
63 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); | 63 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); |
64 | } | 64 | } |
65 | 65 | ||
66 | // Test | 66 | // Test |
67 | Sink::Query query; | 67 | Sink::Query query; |
68 | query.resources << "org.kde.dummy.instance1"; | 68 | query.resources << "sink.dummy.instance1"; |
69 | query.liveQuery = true; | 69 | query.liveQuery = true; |
70 | 70 | ||
71 | // We fetch before the data is available and rely on the live query mechanism to deliver the actual data | 71 | // We fetch before the data is available and rely on the live query mechanism to deliver the actual data |
@@ -77,13 +77,13 @@ private slots: | |||
77 | { | 77 | { |
78 | // Setup | 78 | // Setup |
79 | { | 79 | { |
80 | Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); | 80 | Sink::ApplicationDomain::Mail mail("sink.dummy.instance1"); |
81 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); | 81 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); |
82 | } | 82 | } |
83 | 83 | ||
84 | // Test | 84 | // Test |
85 | Sink::Query query; | 85 | Sink::Query query; |
86 | query.resources << "org.kde.dummy.instance1"; | 86 | query.resources << "sink.dummy.instance1"; |
87 | query.liveQuery = false; | 87 | query.liveQuery = false; |
88 | 88 | ||
89 | // Ensure all local data is processed | 89 | // Ensure all local data is processed |
@@ -101,12 +101,12 @@ private slots: | |||
101 | QByteArray id; | 101 | QByteArray id; |
102 | // Setup | 102 | // Setup |
103 | { | 103 | { |
104 | Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); | 104 | Sink::ApplicationDomain::Mail mail("sink.dummy.instance1"); |
105 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); | 105 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); |
106 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); | 106 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); |
107 | 107 | ||
108 | Sink::Query query; | 108 | Sink::Query query; |
109 | query.resources << "org.kde.dummy.instance1"; | 109 | query.resources << "sink.dummy.instance1"; |
110 | 110 | ||
111 | // Ensure all local data is processed | 111 | // Ensure all local data is processed |
112 | Sink::Store::synchronize(query).exec().waitForFinished(); | 112 | Sink::Store::synchronize(query).exec().waitForFinished(); |
@@ -120,7 +120,7 @@ private slots: | |||
120 | 120 | ||
121 | // Test | 121 | // Test |
122 | Sink::Query query; | 122 | Sink::Query query; |
123 | query.resources << "org.kde.dummy.instance1"; | 123 | query.resources << "sink.dummy.instance1"; |
124 | query.ids << id; | 124 | query.ids << id; |
125 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Mail>(query); | 125 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Mail>(query); |
126 | QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); | 126 | QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); |
@@ -131,13 +131,13 @@ private slots: | |||
131 | { | 131 | { |
132 | // Setup | 132 | // Setup |
133 | { | 133 | { |
134 | Sink::ApplicationDomain::Folder folder("org.kde.dummy.instance1"); | 134 | Sink::ApplicationDomain::Folder folder("sink.dummy.instance1"); |
135 | Sink::Store::create<Sink::ApplicationDomain::Folder>(folder).exec().waitForFinished(); | 135 | Sink::Store::create<Sink::ApplicationDomain::Folder>(folder).exec().waitForFinished(); |
136 | } | 136 | } |
137 | 137 | ||
138 | // Test | 138 | // Test |
139 | Sink::Query query; | 139 | Sink::Query query; |
140 | query.resources << "org.kde.dummy.instance1"; | 140 | query.resources << "sink.dummy.instance1"; |
141 | query.liveQuery = true; | 141 | query.liveQuery = true; |
142 | 142 | ||
143 | // We fetch before the data is available and rely on the live query mechanism to deliver the actual data | 143 | // We fetch before the data is available and rely on the live query mechanism to deliver the actual data |
@@ -151,11 +151,11 @@ private slots: | |||
151 | { | 151 | { |
152 | // Setup | 152 | // Setup |
153 | { | 153 | { |
154 | Sink::ApplicationDomain::Folder folder("org.kde.dummy.instance1"); | 154 | Sink::ApplicationDomain::Folder folder("sink.dummy.instance1"); |
155 | Sink::Store::create<Sink::ApplicationDomain::Folder>(folder).exec().waitForFinished(); | 155 | Sink::Store::create<Sink::ApplicationDomain::Folder>(folder).exec().waitForFinished(); |
156 | 156 | ||
157 | Sink::Query query; | 157 | Sink::Query query; |
158 | query.resources << "org.kde.dummy.instance1"; | 158 | query.resources << "sink.dummy.instance1"; |
159 | 159 | ||
160 | // Ensure all local data is processed | 160 | // Ensure all local data is processed |
161 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 161 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
@@ -167,14 +167,14 @@ private slots: | |||
167 | auto folderEntity = model->index(0, 0).data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Folder::Ptr>(); | 167 | auto folderEntity = model->index(0, 0).data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Folder::Ptr>(); |
168 | QVERIFY(!folderEntity->identifier().isEmpty()); | 168 | QVERIFY(!folderEntity->identifier().isEmpty()); |
169 | 169 | ||
170 | Sink::ApplicationDomain::Folder subfolder("org.kde.dummy.instance1"); | 170 | Sink::ApplicationDomain::Folder subfolder("sink.dummy.instance1"); |
171 | subfolder.setProperty("parent", folderEntity->identifier()); | 171 | subfolder.setProperty("parent", folderEntity->identifier()); |
172 | Sink::Store::create<Sink::ApplicationDomain::Folder>(subfolder).exec().waitForFinished(); | 172 | Sink::Store::create<Sink::ApplicationDomain::Folder>(subfolder).exec().waitForFinished(); |
173 | } | 173 | } |
174 | 174 | ||
175 | // Test | 175 | // Test |
176 | Sink::Query query; | 176 | Sink::Query query; |
177 | query.resources << "org.kde.dummy.instance1"; | 177 | query.resources << "sink.dummy.instance1"; |
178 | query.parentProperty = "parent"; | 178 | query.parentProperty = "parent"; |
179 | 179 | ||
180 | // Ensure all local data is processed | 180 | // Ensure all local data is processed |
@@ -193,7 +193,7 @@ private slots: | |||
193 | { | 193 | { |
194 | // Setup | 194 | // Setup |
195 | { | 195 | { |
196 | Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); | 196 | Sink::ApplicationDomain::Mail mail("sink.dummy.instance1"); |
197 | mail.setProperty("uid", "test1"); | 197 | mail.setProperty("uid", "test1"); |
198 | mail.setProperty("sender", "doe@example.org"); | 198 | mail.setProperty("sender", "doe@example.org"); |
199 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); | 199 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); |
@@ -201,7 +201,7 @@ private slots: | |||
201 | 201 | ||
202 | // Test | 202 | // Test |
203 | Sink::Query query; | 203 | Sink::Query query; |
204 | query.resources << "org.kde.dummy.instance1"; | 204 | query.resources << "sink.dummy.instance1"; |
205 | query.liveQuery = false; | 205 | query.liveQuery = false; |
206 | query += Sink::Query::PropertyFilter("uid", "test1"); | 206 | query += Sink::Query::PropertyFilter("uid", "test1"); |
207 | 207 | ||
@@ -219,11 +219,11 @@ private slots: | |||
219 | // Setup | 219 | // Setup |
220 | Sink::ApplicationDomain::Folder::Ptr folderEntity; | 220 | Sink::ApplicationDomain::Folder::Ptr folderEntity; |
221 | { | 221 | { |
222 | Sink::ApplicationDomain::Folder folder("org.kde.dummy.instance1"); | 222 | Sink::ApplicationDomain::Folder folder("sink.dummy.instance1"); |
223 | Sink::Store::create<Sink::ApplicationDomain::Folder>(folder).exec().waitForFinished(); | 223 | Sink::Store::create<Sink::ApplicationDomain::Folder>(folder).exec().waitForFinished(); |
224 | 224 | ||
225 | Sink::Query query; | 225 | Sink::Query query; |
226 | query.resources << "org.kde.dummy.instance1"; | 226 | query.resources << "sink.dummy.instance1"; |
227 | 227 | ||
228 | // Ensure all local data is processed | 228 | // Ensure all local data is processed |
229 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 229 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
@@ -235,7 +235,7 @@ private slots: | |||
235 | folderEntity = model->index(0, 0).data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Folder::Ptr>(); | 235 | folderEntity = model->index(0, 0).data(Sink::Store::DomainObjectRole).value<Sink::ApplicationDomain::Folder::Ptr>(); |
236 | QVERIFY(!folderEntity->identifier().isEmpty()); | 236 | QVERIFY(!folderEntity->identifier().isEmpty()); |
237 | 237 | ||
238 | Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); | 238 | Sink::ApplicationDomain::Mail mail("sink.dummy.instance1"); |
239 | mail.setProperty("uid", "test1"); | 239 | mail.setProperty("uid", "test1"); |
240 | mail.setProperty("folder", folderEntity->identifier()); | 240 | mail.setProperty("folder", folderEntity->identifier()); |
241 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); | 241 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); |
@@ -243,7 +243,7 @@ private slots: | |||
243 | 243 | ||
244 | // Test | 244 | // Test |
245 | Sink::Query query; | 245 | Sink::Query query; |
246 | query.resources << "org.kde.dummy.instance1"; | 246 | query.resources << "sink.dummy.instance1"; |
247 | query += Sink::Query::PropertyFilter("folder", *folderEntity); | 247 | query += Sink::Query::PropertyFilter("folder", *folderEntity); |
248 | 248 | ||
249 | // Ensure all local data is processed | 249 | // Ensure all local data is processed |
@@ -260,11 +260,11 @@ private slots: | |||
260 | // Setup | 260 | // Setup |
261 | Sink::ApplicationDomain::Folder::Ptr folderEntity; | 261 | Sink::ApplicationDomain::Folder::Ptr folderEntity; |
262 | { | 262 | { |
263 | Sink::ApplicationDomain::Folder folder("org.kde.dummy.instance1"); | 263 | Sink::ApplicationDomain::Folder folder("sink.dummy.instance1"); |
264 | Sink::Store::create<Sink::ApplicationDomain::Folder>(folder).exec().waitForFinished(); | 264 | Sink::Store::create<Sink::ApplicationDomain::Folder>(folder).exec().waitForFinished(); |
265 | 265 | ||
266 | Sink::Query query; | 266 | Sink::Query query; |
267 | query.resources << "org.kde.dummy.instance1"; | 267 | query.resources << "sink.dummy.instance1"; |
268 | 268 | ||
269 | // Ensure all local data is processed | 269 | // Ensure all local data is processed |
270 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); | 270 | Sink::ResourceControl::flushMessageQueue(query.resources).exec().waitForFinished(); |
@@ -278,21 +278,21 @@ private slots: | |||
278 | 278 | ||
279 | const auto date = QDateTime(QDate(2015, 7, 7), QTime(12, 0)); | 279 | const auto date = QDateTime(QDate(2015, 7, 7), QTime(12, 0)); |
280 | { | 280 | { |
281 | Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); | 281 | Sink::ApplicationDomain::Mail mail("sink.dummy.instance1"); |
282 | mail.setProperty("uid", "testSecond"); | 282 | mail.setProperty("uid", "testSecond"); |
283 | mail.setProperty("folder", folderEntity->identifier()); | 283 | mail.setProperty("folder", folderEntity->identifier()); |
284 | mail.setProperty("date", date.addDays(-1)); | 284 | mail.setProperty("date", date.addDays(-1)); |
285 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); | 285 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); |
286 | } | 286 | } |
287 | { | 287 | { |
288 | Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); | 288 | Sink::ApplicationDomain::Mail mail("sink.dummy.instance1"); |
289 | mail.setProperty("uid", "testLatest"); | 289 | mail.setProperty("uid", "testLatest"); |
290 | mail.setProperty("folder", folderEntity->identifier()); | 290 | mail.setProperty("folder", folderEntity->identifier()); |
291 | mail.setProperty("date", date); | 291 | mail.setProperty("date", date); |
292 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); | 292 | Sink::Store::create<Sink::ApplicationDomain::Mail>(mail).exec().waitForFinished(); |
293 | } | 293 | } |
294 | { | 294 | { |
295 | Sink::ApplicationDomain::Mail mail("org.kde.dummy.instance1"); | 295 | Sink::ApplicationDomain::Mail mail("sink.dummy.instance1"); |
296 | mail.setProperty("uid", "testLast"); | 296 | mail.setProperty("uid", "testLast"); |
297 | mail.setProperty("folder", folderEntity->identifier()); | 297 | mail.setProperty("folder", folderEntity->identifier()); |
298 | mail.setProperty("date", date.addDays(-2)); | 298 | mail.setProperty("date", date.addDays(-2)); |
@@ -302,7 +302,7 @@ private slots: | |||
302 | 302 | ||
303 | // Test | 303 | // Test |
304 | Sink::Query query; | 304 | Sink::Query query; |
305 | query.resources << "org.kde.dummy.instance1"; | 305 | query.resources << "sink.dummy.instance1"; |
306 | query += Sink::Query::PropertyFilter("folder", *folderEntity); | 306 | query += Sink::Query::PropertyFilter("folder", *folderEntity); |
307 | query.sortProperty = "date"; | 307 | query.sortProperty = "date"; |
308 | query.limit = 1; | 308 | query.limit = 1; |