summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/synckolab/parser/kolab2/contactTest.js5
-rw-r--r--test/synckolab/parser/kolab2/json/list.test.json32
-rw-r--r--test/synckolab/parser/kolab2/raw/list.test.eml52
-rw-r--r--test/synckolab/parser/kolab2/raw/list.test.xml21
4 files changed, 108 insertions, 2 deletions
diff --git a/test/synckolab/parser/kolab2/contactTest.js b/test/synckolab/parser/kolab2/contactTest.js
index 739356e..d1fa937 100644
--- a/test/synckolab/parser/kolab2/contactTest.js
+++ b/test/synckolab/parser/kolab2/contactTest.js
@@ -12,7 +12,7 @@ load("test/lib/testOverride.js");
test("skolab2 ynckolab.addressbookTools.parseMessageContent", function(){
equal(null, synckolab.addressbookTools.parseMessageContent(null), "parsing a null message");
- var testFiles = ["contactMinimalTest", "contactFullTest"];
+ var testFiles = ["contactMinimalTest", "contactFullTest", "list.test"];
var content, entry, jsonEntry;
@@ -24,7 +24,8 @@ test("skolab2 ynckolab.addressbookTools.parseMessageContent", function(){
entry = synckolab.addressbookTools.parseMessageContent(content);
content = readFile("test/synckolab/parser/kolab2/json/"+src+".json");
jsonEntry = JSON.parse(content);
- equal(synckolab.tools.equalsObject(entry, jsonEntry), true, src);
+ equal(synckolab.tools.equalsObject(entry, jsonEntry), true, src + "\n" + JSON.stringify(entry, null, " "));
+
}
diff --git a/test/synckolab/parser/kolab2/json/list.test.json b/test/synckolab/parser/kolab2/json/list.test.json
new file mode 100644
index 0000000..a4dfdd1
--- /dev/null
+++ b/test/synckolab/parser/kolab2/json/list.test.json
@@ -0,0 +1,32 @@
+{
+ "synckolab": "3.0.0",
+ "type": "maillist",
+ "isMailList": true,
+ "ts": 1349908157804,
+ "DisplayName": "list-name",
+ "Notes": "list-description",
+ "NickName": "list-nickname",
+ "contacts": [
+ {
+ "synckolab": "3.0.0",
+ "listMember": true,
+ "type": "contact",
+ "isMailList": false,
+ "ts": 1349908157831,
+ "DisplayName": "testöä lastname",
+ "PrimaryEmail": "",
+ "UUID": "urn:uuid:pas-id-1D84CEA337CD1878"
+ },
+ {
+ "synckolab": "3.0.0",
+ "listMember": true,
+ "type": "contact",
+ "isMailList": false,
+ "ts": 1349908157832,
+ "DisplayName": "cont2#öüä&$",
+ "PrimaryEmail": "",
+ "UUID": "urn:uuid:pas-id-A4E937D838A897AD"
+ }
+ ],
+ "sha1": "8d2e5e0088530d5fbe9f6acc40a5e3eb2c094ec7"
+} \ No newline at end of file
diff --git a/test/synckolab/parser/kolab2/raw/list.test.eml b/test/synckolab/parser/kolab2/raw/list.test.eml
new file mode 100644
index 0000000..9963cd3
--- /dev/null
+++ b/test/synckolab/parser/kolab2/raw/list.test.eml
@@ -0,0 +1,52 @@
+From: niko.berger@corinis.com
+Reply-To:
+Bcc:
+To: synckolab@no.tld
+Subject: list_name
+Date: Thu, 11 Oct 2012 00:20:52 +0200
+Content-Type: Multipart/Mixed;boundary="Boundary-00=173882C61DEE82C7"
+User-Agent: SyncKolab 2.9.0
+X-Kolab-Type: application/x-vnd.kolab.contact.distlist
+
+--Boundary-00=173882C61DEE82C7
+Content-Type: Text/Plain;
+ charset="us-ascii"
+Content-Transfer-Encoding: 7bit
+
+This is a Kolab Groupware object.
+To view this object you will need an email client that can understand the Kolab Groupware format.
+For a list of such email clients please visit
+http://www.kolab.org/kolab2-clients.html
+---
+Name: list-name
+Notes: list-description
+Members:
+
+test lastname <email@mail.com>
+cont2#&$ <weird@email.com>
+---
+
+Notice:
+The information above is only valid, if no other client than synckolab updated this message. (ie. a client that updates the attachment but not the message)
+
+--Boundary-00=173882C61DEE82C7
+Content-Type: application/x-vnd.kolab.contact.distlist;
+ name="kolab.xml"
+Content-Transfer-Encoding: base64
+Content-Disposition: attachment;
+ filename="kolab.xml"
+
+PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPGRpc3RyaWJ1dGlvbi1saXN0IHZl
+cnNpb249IjEuMCIgPgogPHByb2R1Y3QtaWQ+U3luY0tvbGFiLCBLb2xhYiByZXNvdXJjZTwvcHJvZHVj
+dC1pZD4KIDx1aWQ+bGlzdF9uYW1lPC91aWQ+CiA8Y3JlYXRpb24tZGF0ZT4yMDEyMTAxMFQyMjIwNTJa
+PC9jcmVhdGlvbi1kYXRlPgogPGxhc3QtbW9kaWZpY2F0aW9uLWRhdGU+MjAxMjEwMTBUMjIyMDUyWjwv
+bGFzdC1tb2RpZmljYXRpb24tZGF0ZT4KIDxzZW5zaXRpdml0eT5wdWJsaWM8L3NlbnNpdGl2aXR5Pgog
+PG5hbWU+bGlzdC1uYW1lPC9uYW1lPgogPGJvZHk+bGlzdC1kZXNjcmlwdGlvbjwvYm9keT4KIDxuaWNr
+bmFtZT5saXN0LW5pY2tuYW1lPC9uaWNrbmFtZT4KICA8bWVtYmVyPgogICAgICA8ZGlzcGxheS1uYW1l
+PnRlc3TDtsOkIGxhc3RuYW1lPC9kaXNwbGF5LW5hbWU+CiAgICAgIDxzbXRwLWFkZHJlc3M+ZW1haWxA
+bWFpbC5jb208L3NtdHAtYWRkcmVzcz4KICAgICAgPHVpZD51cm46dXVpZDpwYXMtaWQtMUQ4NENFQTMz
+N0NEMTg3ODwvdWlkPgogIDwvbWVtYmVyPgogIDxtZW1iZXI+CiAgICAgIDxkaXNwbGF5LW5hbWU+Y29u
+dDIjw7bDvMOkJmFtcDskPC9kaXNwbGF5LW5hbWU+CiAgICAgIDxzbXRwLWFkZHJlc3M+d2VpcmRAZW1h
+aWwuY29tPC9zbXRwLWFkZHJlc3M+CiAgICAgIDx1aWQ+dXJuOnV1aWQ6cGFzLWlkLUE0RTkzN0Q4MzhB
+ODk3QUQ8L3VpZD4KICA8L21lbWJlcj4KPC9kaXN0cmlidXRpb24tbGlzdD4K
+--Boundary-00=173882C61DEE82C7--
diff --git a/test/synckolab/parser/kolab2/raw/list.test.xml b/test/synckolab/parser/kolab2/raw/list.test.xml
new file mode 100644
index 0000000..8ff9b02
--- /dev/null
+++ b/test/synckolab/parser/kolab2/raw/list.test.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<distribution-list version="1.0" >
+ <product-id>SyncKolab, Kolab resource</product-id>
+ <uid>list_name</uid>
+ <creation-date>20121010T222052Z</creation-date>
+ <last-modification-date>20121010T222052Z</last-modification-date>
+ <sensitivity>public</sensitivity>
+ <name>list-name</name>
+ <body>list-description</body>
+ <nickname>list-nickname</nickname>
+ <member>
+ <display-name>testöä lastname</display-name>
+ <smtp-address>email@mail.com</smtp-address>
+ <uid>urn:uuid:pas-id-1D84CEA337CD1878</uid>
+ </member>
+ <member>
+ <display-name>cont2#öüä&amp;$</display-name>
+ <smtp-address>weird@email.com</smtp-address>
+ <uid>urn:uuid:pas-id-A4E937D838A897AD</uid>
+ </member>
+</distribution-list>