diff options
Diffstat (limited to 'tests/genericfacadetest.cpp')
-rw-r--r-- | tests/genericfacadetest.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/genericfacadetest.cpp b/tests/genericfacadetest.cpp index 397bf6a..8336875 100644 --- a/tests/genericfacadetest.cpp +++ b/tests/genericfacadetest.cpp | |||
@@ -9,7 +9,7 @@ | |||
9 | #include <common/resultprovider.h> | 9 | #include <common/resultprovider.h> |
10 | #include <common/synclistresult.h> | 10 | #include <common/synclistresult.h> |
11 | 11 | ||
12 | //Replace with something different | 12 | // Replace with something different |
13 | #include "event_generated.h" | 13 | #include "event_generated.h" |
14 | 14 | ||
15 | 15 | ||
@@ -34,7 +34,7 @@ private slots: | |||
34 | Sink::Query query; | 34 | Sink::Query query; |
35 | query.liveQuery = false; | 35 | query.liveQuery = false; |
36 | 36 | ||
37 | auto resultSet = QSharedPointer<Sink::ResultProvider<Sink::ApplicationDomain::Event::Ptr> >::create(); | 37 | auto resultSet = QSharedPointer<Sink::ResultProvider<Sink::ApplicationDomain::Event::Ptr>>::create(); |
38 | auto resourceAccess = QSharedPointer<TestResourceAccess>::create(); | 38 | auto resourceAccess = QSharedPointer<TestResourceAccess>::create(); |
39 | // storage->mResults << Sink::ApplicationDomain::Event::Ptr::create(); | 39 | // storage->mResults << Sink::ApplicationDomain::Event::Ptr::create(); |
40 | TestResourceFacade facade("identifier", resourceAccess); | 40 | TestResourceFacade facade("identifier", resourceAccess); |
@@ -44,7 +44,7 @@ private slots: | |||
44 | facade.load(query, *resultSet).exec().waitForFinished(); | 44 | facade.load(query, *resultSet).exec().waitForFinished(); |
45 | resultSet->initialResultSetComplete(); | 45 | resultSet->initialResultSetComplete(); |
46 | 46 | ||
47 | //We have to wait for the events that deliver the results to be processed by the eventloop | 47 | // We have to wait for the events that deliver the results to be processed by the eventloop |
48 | result.exec(); | 48 | result.exec(); |
49 | 49 | ||
50 | QCOMPARE(result.size(), 1); | 50 | QCOMPARE(result.size(), 1); |
@@ -55,7 +55,7 @@ private slots: | |||
55 | Sink::Query query; | 55 | Sink::Query query; |
56 | query.liveQuery = true; | 56 | query.liveQuery = true; |
57 | 57 | ||
58 | auto resultSet = QSharedPointer<Sink::ResultProvider<Sink::ApplicationDomain::Event::Ptr> >::create(); | 58 | auto resultSet = QSharedPointer<Sink::ResultProvider<Sink::ApplicationDomain::Event::Ptr>>::create(); |
59 | auto resourceAccess = QSharedPointer<TestResourceAccess>::create(); | 59 | auto resourceAccess = QSharedPointer<TestResourceAccess>::create(); |
60 | // storage->mResults << Sink::ApplicationDomain::Event::Ptr::create(); | 60 | // storage->mResults << Sink::ApplicationDomain::Event::Ptr::create(); |
61 | TestResourceFacade facade("identifier", resourceAccess); | 61 | TestResourceFacade facade("identifier", resourceAccess); |
@@ -68,13 +68,13 @@ private slots: | |||
68 | result.exec(); | 68 | result.exec(); |
69 | QCOMPARE(result.size(), 1); | 69 | QCOMPARE(result.size(), 1); |
70 | 70 | ||
71 | //Enter a second result | 71 | // Enter a second result |
72 | // storage->mResults.clear(); | 72 | // storage->mResults.clear(); |
73 | // storage->mResults << QSharedPointer<Sink::ApplicationDomain::Event>::create("resource", "id2", 0, QSharedPointer<Sink::ApplicationDomain::BufferAdaptor>()); | 73 | // storage->mResults << QSharedPointer<Sink::ApplicationDomain::Event>::create("resource", "id2", 0, QSharedPointer<Sink::ApplicationDomain::BufferAdaptor>()); |
74 | // storage->mLatestRevision = 2; | 74 | // storage->mLatestRevision = 2; |
75 | resourceAccess->emit revisionChanged(2); | 75 | resourceAccess->emit revisionChanged(2); |
76 | 76 | ||
77 | //Hack to get event loop in synclistresult to abort again | 77 | // Hack to get event loop in synclistresult to abort again |
78 | resultSet->initialResultSetComplete(); | 78 | resultSet->initialResultSetComplete(); |
79 | result.exec(); | 79 | result.exec(); |
80 | 80 | ||
@@ -86,7 +86,7 @@ private slots: | |||
86 | Sink::Query query; | 86 | Sink::Query query; |
87 | query.liveQuery = true; | 87 | query.liveQuery = true; |
88 | 88 | ||
89 | auto resultSet = QSharedPointer<Sink::ResultProvider<Sink::ApplicationDomain::Event::Ptr> >::create(); | 89 | auto resultSet = QSharedPointer<Sink::ResultProvider<Sink::ApplicationDomain::Event::Ptr>>::create(); |
90 | auto resourceAccess = QSharedPointer<TestResourceAccess>::create(); | 90 | auto resourceAccess = QSharedPointer<TestResourceAccess>::create(); |
91 | auto entity = QSharedPointer<Sink::ApplicationDomain::Event>::create("resource", "id2", 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); | 91 | auto entity = QSharedPointer<Sink::ApplicationDomain::Event>::create("resource", "id2", 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); |
92 | entity->setProperty("test", "test1"); | 92 | entity->setProperty("test", "test1"); |
@@ -101,7 +101,7 @@ private slots: | |||
101 | result.exec(); | 101 | result.exec(); |
102 | QCOMPARE(result.size(), 1); | 102 | QCOMPARE(result.size(), 1); |
103 | 103 | ||
104 | //Modify the entity again | 104 | // Modify the entity again |
105 | // storage->mResults.clear(); | 105 | // storage->mResults.clear(); |
106 | entity = QSharedPointer<Sink::ApplicationDomain::Event>::create("resource", "id2", 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); | 106 | entity = QSharedPointer<Sink::ApplicationDomain::Event>::create("resource", "id2", 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); |
107 | entity->setProperty("test", "test2"); | 107 | entity->setProperty("test", "test2"); |
@@ -109,7 +109,7 @@ private slots: | |||
109 | // storage->mLatestRevision = 2; | 109 | // storage->mLatestRevision = 2; |
110 | resourceAccess->emit revisionChanged(2); | 110 | resourceAccess->emit revisionChanged(2); |
111 | 111 | ||
112 | //Hack to get event loop in synclistresult to abort again | 112 | // Hack to get event loop in synclistresult to abort again |
113 | resultSet->initialResultSetComplete(); | 113 | resultSet->initialResultSetComplete(); |
114 | result.exec(); | 114 | result.exec(); |
115 | 115 | ||
@@ -122,7 +122,7 @@ private slots: | |||
122 | Sink::Query query; | 122 | Sink::Query query; |
123 | query.liveQuery = true; | 123 | query.liveQuery = true; |
124 | 124 | ||
125 | auto resultSet = QSharedPointer<Sink::ResultProvider<Sink::ApplicationDomain::Event::Ptr> >::create(); | 125 | auto resultSet = QSharedPointer<Sink::ResultProvider<Sink::ApplicationDomain::Event::Ptr>>::create(); |
126 | auto resourceAccess = QSharedPointer<TestResourceAccess>::create(); | 126 | auto resourceAccess = QSharedPointer<TestResourceAccess>::create(); |
127 | auto entity = QSharedPointer<Sink::ApplicationDomain::Event>::create("resource", "id2", 0, QSharedPointer<Sink::ApplicationDomain::BufferAdaptor>()); | 127 | auto entity = QSharedPointer<Sink::ApplicationDomain::Event>::create("resource", "id2", 0, QSharedPointer<Sink::ApplicationDomain::BufferAdaptor>()); |
128 | // storage->mResults << entity; | 128 | // storage->mResults << entity; |
@@ -136,13 +136,13 @@ private slots: | |||
136 | result.exec(); | 136 | result.exec(); |
137 | QCOMPARE(result.size(), 1); | 137 | QCOMPARE(result.size(), 1); |
138 | 138 | ||
139 | //Remove the entity again | 139 | // Remove the entity again |
140 | // storage->mResults.clear(); | 140 | // storage->mResults.clear(); |
141 | // storage->mRemovals << entity; | 141 | // storage->mRemovals << entity; |
142 | // storage->mLatestRevision = 2; | 142 | // storage->mLatestRevision = 2; |
143 | resourceAccess->emit revisionChanged(2); | 143 | resourceAccess->emit revisionChanged(2); |
144 | 144 | ||
145 | //Hack to get event loop in synclistresult to abort again | 145 | // Hack to get event loop in synclistresult to abort again |
146 | resultSet->initialResultSetComplete(); | 146 | resultSet->initialResultSetComplete(); |
147 | result.exec(); | 147 | result.exec(); |
148 | 148 | ||