diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-08 11:22:40 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-07-08 11:36:32 +0200 |
commit | 81fa4c3635a029b1c8f9cc3cd670f0b04f1c3f21 (patch) | |
tree | 3acd44ee1d055e4dfe6c8c0409406235b39e0980 /tests/dummyresourcetest.cpp | |
parent | 9317fbffeab4a8c258acb1116eb12fbded7053d8 (diff) | |
download | sink-81fa4c3635a029b1c8f9cc3cd670f0b04f1c3f21.tar.gz sink-81fa4c3635a029b1c8f9cc3cd670f0b04f1c3f21.zip |
Shorten the types to be more distinctive.
The org.kde prefix is useless and possibly misleading.
Simply prefixing with sink is more unique and shorter.
Diffstat (limited to 'tests/dummyresourcetest.cpp')
-rw-r--r-- | tests/dummyresourcetest.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
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"); |