summaryrefslogtreecommitdiff
path: root/test/synckolab/parser
diff options
context:
space:
mode:
authorniko <niko>2012-10-08 21:56:23 (GMT)
committerniko <niko>2012-10-08 21:56:23 (GMT)
commit5c5c52da4c0d64721905ce14ecf8995ca4c399e3 (patch)
tree5c7ab9fdf19efd7e932b54405a93d5f914980c38 /test/synckolab/parser
parent5240e08baeb09a127b69018e3f025518bbd934c3 (diff)
downloadsynckolab-5c5c52da4c0d64721905ce14ecf8995ca4c399e3.tar.gz
kolab3 ical reading
Diffstat (limited to 'test/synckolab/parser')
-rw-r--r--test/synckolab/parser/kolab3/calendarTest.js10
-rw-r--r--test/synckolab/parser/kolab3/json/complex.ics.mime.json61
-rw-r--r--test/synckolab/parser/kolab3/json/simple.ics.mime.json18
-rw-r--r--test/synckolab/parser/kolab3/raw/complex.ics.mime35
4 files changed, 84 insertions, 40 deletions
diff --git a/test/synckolab/parser/kolab3/calendarTest.js b/test/synckolab/parser/kolab3/calendarTest.js
index 4522082..6041a3e 100644
--- a/test/synckolab/parser/kolab3/calendarTest.js
+++ b/test/synckolab/parser/kolab3/calendarTest.js
@@ -12,7 +12,7 @@ load("test/lib/testOverride.js");
/*
test("kolab3 synckolab.addressbookTools.parseMessageContent", function(){
equal(null, synckolab.addressbookTools.parseMessageContent(null), "parsing a null message");
- var testFiles = ["simple.vcf.mime","complex.vcf.mime"];
+ var testFiles = ["simple.ics.mime","complex.ics.mime"];
var content, entry, jsonEntry;
@@ -21,7 +21,7 @@ test("kolab3 synckolab.addressbookTools.parseMessageContent", function(){
content = readFile("test/synckolab/parser/kolab3/raw/"+src);
content = synckolab.tools.stripMailHeader(content);
- entry = synckolab.addressbookTools.parseMessageContent(content);
+ entry = synckolab.calendarTools.message2json(content, false);
content = readFile("test/synckolab/parser/kolab3/json/"+src+".json");
jsonEntry = JSON.parse(content);
equal(synckolab.tools.equalsObject(entry, jsonEntry), true, src);
@@ -31,7 +31,7 @@ test("kolab3 synckolab.addressbookTools.parseMessageContent", function(){
}
});
*/
- var testFiles = ["simple.ics.mime"];
+ var testFiles = ["complex.ics.mime"];
var content, entry, jsonEntry;
@@ -46,8 +46,8 @@ test("kolab3 synckolab.addressbookTools.parseMessageContent", function(){
entry = synckolab.calendarTools.message2json(content, false);
print(JSON.stringify(entry, null, ' '))
// json -> kolab 3 xml
- //content = synckolab.addressbookTools.card2Kolab3(entry);
- //print(content);
+ content = synckolab.calendarTools.json2kolab3(entry);
+ print(content);
/*
content = readFile("test/synckolab/parser/kolab3/json/"+src+".json");
jsonEntry = JSON.parse(content);
diff --git a/test/synckolab/parser/kolab3/json/complex.ics.mime.json b/test/synckolab/parser/kolab3/json/complex.ics.mime.json
new file mode 100644
index 0000000..29f1253
--- /dev/null
+++ b/test/synckolab/parser/kolab3/json/complex.ics.mime.json
@@ -0,0 +1,61 @@
+{
+ "synckolab": "3.0.0",
+ "type": "calendar",
+ "uid": "KOrganizer-1687167952.818",
+ "createdDate": "2009-09-01T12:52:58Z",
+ "modified": "2012-05-05T05:05:05Z",
+ "sensitivity": "PRIVATE",
+ "categories": "Appointment Business ",
+ "startDate": {
+ "tz": "/kolab.org/Europe/Berlin",
+ "dateTime": "2009-09-02T10:00:00"
+ },
+ "endDate": {
+ "tz": "/kolab.org/Europe/Berlin",
+ "dateTime": "2009-09-02T11:00:00"
+ },
+ "recurrence": {
+ "cycle": "weekly",
+ "days": [
+ "WE",
+ "FR"
+ ],
+ "interval": 1,
+ "count": 10,
+ "exclusion": [
+ "2009-09-04"
+ ]
+ },
+ "title": "Complex Event",
+ "body": "Some notes on this event.",
+ "location": "Here",
+ "attendees": [
+ {
+ "mail": "mailto:<a1@example.com>",
+ "displayName": "Attendee1",
+ "status": "needs-action",
+ "rsvp": true,
+ "role": "required"
+ },
+ {
+ "mail": "mailto:<a2@example.com>",
+ "displayName": "Attendee2",
+ "status": "accepted",
+ "rsvp": true,
+ "role": "resource"
+ },
+ {
+ "mail": "mailto:<a3@example.com>",
+ "displayName": "Attendee3",
+ "status": "declined",
+ "rsvp": false,
+ "role": "required"
+ }
+ ],
+ "alarms": [
+ {
+ "action": "DISPLAY",
+ "description": null
+ }
+ ]
+} \ No newline at end of file
diff --git a/test/synckolab/parser/kolab3/json/simple.ics.mime.json b/test/synckolab/parser/kolab3/json/simple.ics.mime.json
new file mode 100644
index 0000000..5b62f20
--- /dev/null
+++ b/test/synckolab/parser/kolab3/json/simple.ics.mime.json
@@ -0,0 +1,18 @@
+{
+ "synckolab": "3.0.0",
+ "type": "calendar",
+ "uid": "KOrganizer-1353608432.168",
+ "createdDate": "2009-09-01T11:36:44Z",
+ "modified": "2012-05-05T05:05:05Z",
+ "sensitivity": "PUBLIC",
+ "startDate": {
+ "tz": "/kolab.org/Europe/Berlin",
+ "dateTime": "2009-09-02T08:00:00"
+ },
+ "endDate": {
+ "tz": "/kolab.org/Europe/Berlin",
+ "dateTime": "2009-09-02T09:00:00"
+ },
+ "title": "Simple Event",
+ "location": "Here"
+} \ No newline at end of file
diff --git a/test/synckolab/parser/kolab3/raw/complex.ics.mime b/test/synckolab/parser/kolab3/raw/complex.ics.mime
index 0176c5e..76c69c5 100644
--- a/test/synckolab/parser/kolab3/raw/complex.ics.mime
+++ b/test/synckolab/parser/kolab3/raw/complex.ics.mime
@@ -145,17 +145,6 @@ Content-Disposition: attachment; filename="kolab.xml"
</parameters>
<cal-address>mailto:%3Ca3%40example.com%3E</cal-address>
</attendee>
- <attach>
- <parameters>
- <fmttype>
- <text>image/png</text>
- </fmttype>
- <x-label>
- <text>akonadi.png</text>
- </x-label>
- </parameters>
- <uri>cid:7313173.zaagFSsPPv@kolab.resource.akonadi</uri>
- </attach>
</properties>
<components>
<valarm>
@@ -189,28 +178,4 @@ Content-Disposition: attachment; filename="kolab.xml"
</icalendar>
---nextPart1929983.SbWkbbbi0G
-Content-ID: <7313173.zaagFSsPPv@kolab.resource.akonadi>
-Content-Type: image/png; name="akonadi.png"
-Content-Transfer-Encoding: base64
-Content-Disposition: attachment; filename="akonadi.png"
-
-iVBORw0K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