summaryrefslogtreecommitdiff
path: root/test/synckolab/parser
diff options
context:
space:
mode:
authorniko <niko>2012-10-21 21:06:50 (GMT)
committerniko <niko>2012-10-21 21:06:50 (GMT)
commit36fa4bd13ea734583d49d38098a216dfdf943744 (patch)
treeb0477998d3b64d7f6bd4e787ab109475a7f9e408 /test/synckolab/parser
parenteaca0119bdadb63986fc3525ee2bebd6a4c140ec (diff)
downloadsynckolab-36fa4bd13ea734583d49d38098a216dfdf943744.tar.gz
rewrite of distribution list handling
Diffstat (limited to 'test/synckolab/parser')
-rw-r--r--test/synckolab/parser/kolab2/contactTest.js4
-rw-r--r--test/synckolab/parser/kolab2/json/list.test.json1
-rw-r--r--test/synckolab/parser/kolab2/json/list.test2.json52
-rw-r--r--test/synckolab/parser/kolab2/raw/list.test2.xml64
4 files changed, 119 insertions, 2 deletions
diff --git a/test/synckolab/parser/kolab2/contactTest.js b/test/synckolab/parser/kolab2/contactTest.js
index d247613..6d79eb8 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", "list.test"];
+ var testFiles = ["contactMinimalTest", "contactFullTest", "list.test", "list.test2"];
var content, entry, jsonEntry;
@@ -24,7 +24,7 @@ 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 + "\n" + JSON.stringify(entry, null, " "));
+ equal(synckolab.tools.equalsObject(entry, jsonEntry, {UUID:true}), true, src + "\n" + JSON.stringify(entry, null, " "));
// json -> kolab 2 xml
/*
diff --git a/test/synckolab/parser/kolab2/json/list.test.json b/test/synckolab/parser/kolab2/json/list.test.json
index 6288395..8e1e3b6 100644
--- a/test/synckolab/parser/kolab2/json/list.test.json
+++ b/test/synckolab/parser/kolab2/json/list.test.json
@@ -6,6 +6,7 @@
"DisplayName": "list-name",
"Notes": "list-description",
"NickName": "list-nickname",
+ "UUID": "SomeRandomUUID",
"contacts": [
{
"synckolab": "3.0.0",
diff --git a/test/synckolab/parser/kolab2/json/list.test2.json b/test/synckolab/parser/kolab2/json/list.test2.json
new file mode 100644
index 0000000..b1e48b1
--- /dev/null
+++ b/test/synckolab/parser/kolab2/json/list.test2.json
@@ -0,0 +1,52 @@
+{
+ "synckolab": "3.0.0",
+ "type": "maillist",
+ "isMailList": true,
+ "ts": 1350823376091,
+ "UUID": "dc90f284789cb642256068504d42dc7e",
+ "DisplayName": "list dc90f284789cb642256068504d42dc7e",
+ "Notes": "list-description",
+ "contacts": [
+ {
+ "synckolab": "3.0.0",
+ "listMember": true,
+ "type": "contact",
+ "isMailList": false,
+ "ts": 1350823376138,
+ "DisplayName": "user.name (Retail)",
+ "PrimaryEmail": "user.name@domain.com",
+ "UUID": "993e519e411b0c5ff6b90e2293c99bd1"
+ },
+ {
+ "synckolab": "3.0.0",
+ "listMember": true,
+ "type": "contact",
+ "isMailList": false,
+ "ts": 1350823376139,
+ "DisplayName": "user.name (Retail2)",
+ "PrimaryEmail": "a12346@domain.com",
+ "UUID": "993e519e411b0c5ff6b90e2293c99bd1"
+ },
+ {
+ "synckolab": "3.0.0",
+ "listMember": true,
+ "type": "contact",
+ "isMailList": false,
+ "ts": 1350823376140,
+ "DisplayName": "user.name (HomeServices)",
+ "PrimaryEmail": "user.name@domain.com",
+ "UUID": "e1778e4a015e7bbb068bf9375182d6ab"
+ },
+ {
+ "synckolab": "3.0.0",
+ "listMember": true,
+ "type": "contact",
+ "isMailList": false,
+ "ts": 1350823376142,
+ "DisplayName": "user.name(Retail3)",
+ "PrimaryEmail": "user.name@domain.com",
+ "UUID": "6e0366e6f12afa2e2dd8883bec36f37d"
+ }
+ ],
+ "sha1": "4717f9c787b1baa2c408ea8953a121d6181a5f04"
+} \ No newline at end of file
diff --git a/test/synckolab/parser/kolab2/raw/list.test2.xml b/test/synckolab/parser/kolab2/raw/list.test2.xml
new file mode 100644
index 0000000..dfb734d
--- /dev/null
+++ b/test/synckolab/parser/kolab2/raw/list.test2.xml
@@ -0,0 +1,64 @@
+From: someone@domain.com
+To: someone@domain.com
+Date: Thu, 18 Oct 2012 10:11:18 -0400
+X-Kolab-Type: application/x-vnd.kolab.distribution-list
+Subject: dc90f284789cb642256068504d42dc7e
+User-Agent: Horde::Kolab::Storage v0.2
+MIME-Version: 1.0
+Content-Type: multipart/mixed;
+ boundary="=_96e43p7nnc0"
+Content-Transfer-Encoding: 7bit
+
+This message is in MIME format.
+
+--=_96e43p7nnc0
+Content-Type: text/plain;
+ charset=UTF-8
+Content-Disposition: inline
+Content-Transfer-Encoding: quoted-printable
+
+This is a Kolab Groupware object. To view this object you will need an emai=
+l
+client that understands the Kolab Groupware format. For a list of such emai=
+l
+clients please visit http://www.kolab.org/kolab2-clients.html
+
+--=_96e43p7nnc0
+Content-Type: application/x-vnd.kolab.distribution-list;
+ name="kolab.xml"
+Content-Disposition: attachment;
+ filename="kolab.xml"
+Content-Transfer-Encoding: quoted-printable
+
+<?xml version=3D"1.0"?>
+<distribution-list version=3D"1.0">
+ <uid>dc90f284789cb642256068504d42dc7e</uid>
+ <body>list-description</body>
+ <categories></categories>
+ <creation-date>2012-10-18T14:11:07Z</creation-date>
+ <last-modification-date>2012-10-18T14:11:18Z</last-modification-date>
+ <sensitivity>public</sensitivity>
+ <product-id>Horde::Kolab</product-id>
+ <member>
+ <display-name>user.name (Retail)</display-name>
+ <smtp-address>user.name@domain.com</smtp-address>
+ <uid>993e519e411b0c5ff6b90e2293c99bd1</uid>
+ </member>
+ <member>
+ <display-name>user.name (Retail2)</display-name>
+ <smtp-address>a12346@domain.com</smtp-address>
+ <uid>993e519e411b0c5ff6b90e2293c99bd1</uid>
+ </member>
+ <member>
+ <display-name>user.name (HomeServices)</display-name>
+ <smtp-address>user.name@domain.com</smtp-address>
+ <uid>e1778e4a015e7bbb068bf9375182d6ab</uid>
+ </member>
+ <member>
+ <display-name>user.name(Retail3)</display-name>
+ <smtp-address>user.name@domain.com</smtp-address>
+ <uid>6e0366e6f12afa2e2dd8883bec36f37d</uid>
+ </member>
+
+</distribution-list>
+--=_96e43p7nnc0-- \ No newline at end of file