diff options
author | Rémi Nicole <nicole@kolabsystems.com> | 2018-03-27 18:26:11 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-03-27 18:26:15 +0200 |
commit | 761328989492db9bd603c2d7f1134d20e485d2f6 (patch) | |
tree | 0e3b4517dd2000fb1cc2738bbb22a3e54dfffb6f /tests | |
parent | 80afd7070f2d8e57cab2fe55fef611623fdb75f0 (diff) | |
download | sink-761328989492db9bd603c2d7f1134d20e485d2f6.tar.gz sink-761328989492db9bd603c2d7f1134d20e485d2f6.zip |
Add CalDAV support
Summary:
Notes:
- Add a `webdavcommon` folder for WebDAV generic resource code
- Move `davresource` to `carddaveresource` and make it use the WebDAV code
- For now it tests the CalDAV resource directly on KolabNow (to be changed)
- Only synchronization, not adding / changing / removing WebDAV collections or items (to be implemented)
- Only events are currently supported (todo, freebusy, etc. are to be implemented but should be straightforward)
Fixes T8224
Reviewers: cmollekopf
Tags: #sink
Maniphest Tasks: T8224
Differential Revision: https://phabricator.kde.org/D11741
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/calendar.fbs | 12 | ||||
-rw-r--r-- | tests/domainadaptortest.cpp | 2 | ||||
-rw-r--r-- | tests/storagebenchmark.cpp | 11 |
4 files changed, 4 insertions, 22 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 883a38b..fe7866c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt | |||
@@ -58,7 +58,6 @@ auto_tests ( | |||
58 | entitystoretest | 58 | entitystoretest |
59 | upgradetest | 59 | upgradetest |
60 | ) | 60 | ) |
61 | generate_flatbuffers(sink_test calendar) | ||
62 | target_link_libraries(dummyresourcetest sink_resource_dummy) | 61 | target_link_libraries(dummyresourcetest sink_resource_dummy) |
63 | target_link_libraries(dummyresourcebenchmark sink_resource_dummy) | 62 | target_link_libraries(dummyresourcebenchmark sink_resource_dummy) |
64 | target_link_libraries(dummyresourcewritebenchmark sink_resource_dummy) | 63 | target_link_libraries(dummyresourcewritebenchmark sink_resource_dummy) |
diff --git a/tests/calendar.fbs b/tests/calendar.fbs deleted file mode 100644 index ef4f112..0000000 --- a/tests/calendar.fbs +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | // example IDL file | ||
2 | |||
3 | namespace Calendar; | ||
4 | |||
5 | table Event { | ||
6 | summary:string; | ||
7 | description:string; | ||
8 | attachment:[ubyte]; | ||
9 | } | ||
10 | |||
11 | root_type Event; | ||
12 | file_identifier "AKFB"; | ||
diff --git a/tests/domainadaptortest.cpp b/tests/domainadaptortest.cpp index 2aed0a9..60d5069 100644 --- a/tests/domainadaptortest.cpp +++ b/tests/domainadaptortest.cpp | |||
@@ -76,12 +76,10 @@ private slots: | |||
76 | auto summary = m_fbb.CreateString("summary1"); | 76 | auto summary = m_fbb.CreateString("summary1"); |
77 | auto description = m_fbb.CreateString("description"); | 77 | auto description = m_fbb.CreateString("description"); |
78 | static uint8_t rawData[100]; | 78 | static uint8_t rawData[100]; |
79 | auto attachment = m_fbb.CreateVector(rawData, 100); | ||
80 | 79 | ||
81 | auto builder = Sink::ApplicationDomain::Buffer::EventBuilder(m_fbb); | 80 | auto builder = Sink::ApplicationDomain::Buffer::EventBuilder(m_fbb); |
82 | builder.add_summary(summary); | 81 | builder.add_summary(summary); |
83 | builder.add_description(description); | 82 | builder.add_description(description); |
84 | builder.add_attachment(attachment); | ||
85 | auto buffer = builder.Finish(); | 83 | auto buffer = builder.Finish(); |
86 | Sink::ApplicationDomain::Buffer::FinishEventBuffer(m_fbb, buffer); | 84 | Sink::ApplicationDomain::Buffer::FinishEventBuffer(m_fbb, buffer); |
87 | 85 | ||
diff --git a/tests/storagebenchmark.cpp b/tests/storagebenchmark.cpp index ee336d2..eef360e 100644 --- a/tests/storagebenchmark.cpp +++ b/tests/storagebenchmark.cpp | |||
@@ -1,6 +1,6 @@ | |||
1 | #include <QtTest> | 1 | #include <QtTest> |
2 | 2 | ||
3 | #include "calendar_generated.h" | 3 | #include "event_generated.h" |
4 | 4 | ||
5 | #include "hawd/dataset.h" | 5 | #include "hawd/dataset.h" |
6 | #include "hawd/formatter.h" | 6 | #include "hawd/formatter.h" |
@@ -13,7 +13,7 @@ | |||
13 | #include <QString> | 13 | #include <QString> |
14 | #include <QTime> | 14 | #include <QTime> |
15 | 15 | ||
16 | using namespace Calendar; | 16 | using namespace Sink::ApplicationDomain::Buffer; |
17 | using namespace flatbuffers; | 17 | using namespace flatbuffers; |
18 | 18 | ||
19 | static QByteArray createEvent() | 19 | static QByteArray createEvent() |
@@ -25,13 +25,10 @@ static QByteArray createEvent() | |||
25 | { | 25 | { |
26 | uint8_t *rawDataPtr = Q_NULLPTR; | 26 | uint8_t *rawDataPtr = Q_NULLPTR; |
27 | auto summary = fbb.CreateString("summary"); | 27 | auto summary = fbb.CreateString("summary"); |
28 | auto data = fbb.CreateUninitializedVector<uint8_t>(attachmentSize, &rawDataPtr); | 28 | EventBuilder eventBuilder(fbb); |
29 | // auto data = fbb.CreateVector(rawData, attachmentSize); | ||
30 | Calendar::EventBuilder eventBuilder(fbb); | ||
31 | eventBuilder.add_summary(summary); | 29 | eventBuilder.add_summary(summary); |
32 | eventBuilder.add_attachment(data); | ||
33 | auto eventLocation = eventBuilder.Finish(); | 30 | auto eventLocation = eventBuilder.Finish(); |
34 | Calendar::FinishEventBuffer(fbb, eventLocation); | 31 | FinishEventBuffer(fbb, eventLocation); |
35 | memcpy((void *)rawDataPtr, rawData, attachmentSize); | 32 | memcpy((void *)rawDataPtr, rawData, attachmentSize); |
36 | } | 33 | } |
37 | 34 | ||