summaryrefslogtreecommitdiff
path: root/test/synckolab/parser/kolab2
diff options
context:
space:
mode:
Diffstat (limited to 'test/synckolab/parser/kolab2')
-rw-r--r--test/synckolab/parser/kolab2/contactTest.js15
-rw-r--r--test/synckolab/parser/kolab2/raw/list.test.xml4
-rw-r--r--test/synckolab/parser/kolab2/xml/contactFullTest.xml71
-rw-r--r--test/synckolab/parser/kolab2/xml/contactMinimalTest.xml17
-rw-r--r--test/synckolab/parser/kolab2/xml/list.test.xml21
5 files changed, 126 insertions, 2 deletions
diff --git a/test/synckolab/parser/kolab2/contactTest.js b/test/synckolab/parser/kolab2/contactTest.js
index d1fa937..d247613 100644
--- a/test/synckolab/parser/kolab2/contactTest.js
+++ b/test/synckolab/parser/kolab2/contactTest.js
@@ -26,6 +26,21 @@ test("skolab2 ynckolab.addressbookTools.parseMessageContent", function(){
jsonEntry = JSON.parse(content);
equal(synckolab.tools.equalsObject(entry, jsonEntry), true, src + "\n" + JSON.stringify(entry, null, " "));
+ // json -> kolab 2 xml
+ /*
+ if(entry.type === "maillist") {
+ content = synckolab.addressbookTools.list2Xml(entry);
+ } else {
+ content = synckolab.addressbookTools.card2Xml(entry);
+ }
+ xmlcontent = readFile("test/synckolab/parser/kolab2/xml/"+src + ".xml");
+ if (xmlcontent.replace(/[\n\r\t ]/g, "").length !== content.replace(/[\n\r\t ]/g, "").length) {
+ equal(xmlcontent.replace(/[\n\r\t ]/g, ""), content.replace(/[\n\r\t ]/g, ""), src);
+ var diff = diffString(xmlcontent, content);
+ print("DIFF FOUND:"+ xmlcontent.replace(/[\n\r\t ]/g, "").length + " vs. "+ content.replace(/[\n\r\t ]/g, "").length +"\n" + diff);
+ }
+ */
+
}
diff --git a/test/synckolab/parser/kolab2/raw/list.test.xml b/test/synckolab/parser/kolab2/raw/list.test.xml
index 6aece4e..9f07b00 100644
--- a/test/synckolab/parser/kolab2/raw/list.test.xml
+++ b/test/synckolab/parser/kolab2/raw/list.test.xml
@@ -3,8 +3,8 @@
<product-id>SyncKolab, Kolab resource</product-id>
<uid>list_name</uid>
<creation-date>20121017T214612Z</creation-date>
- <last-modification-date>20121017T214612Z</last-modification-date>
- <sensitivity>public</sensitivity>
+ <last-modification-date>1970-01-01T00:00:00Z</last-modification-date>
+ <sensitivity>public</sensitivity>
<name>list-name</name>
<body>list-description</body>
<nickname>list-nickname</nickname>
diff --git a/test/synckolab/parser/kolab2/xml/contactFullTest.xml b/test/synckolab/parser/kolab2/xml/contactFullTest.xml
new file mode 100644
index 0000000..895dfac
--- /dev/null
+++ b/test/synckolab/parser/kolab2/xml/contactFullTest.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<contact version="1.0" >
+ <product-id>SyncKolab, Kolab resource</product-id>
+ <uid>pas-id-1D84CEA337CD1878</uid>
+ <last-modification-date>1970-01-01T00:00:00Z</last-modification-date>
+ <sensitivity>public</sensitivity>
+ <body>multiline
+note with öäü!</body>
+ <name>
+ <given-name>testöä</given-name>
+ <last-name>lastnameöäü</last-name>
+ <full-name>testöä lastname</full-name>
+ </name>
+ <organization>w-org</organization>
+ <web-page>w-web</web-page>
+ <business-web-page>p-web</business-web-page>
+ <department>w-department</department>
+ <job-title>w-title</job-title>
+ <nick-name>nick</nick-name>
+ <birthday>1980-1-22</birthday>
+ <phone>
+ <type>home1</type>
+ <number>01-home</number>
+ </phone>
+ <phone>
+ <type>business1</type>
+ <number>01-work</number>
+ </phone>
+ <phone>
+ <type>fax</type>
+ <number>01-fax</number>
+ </phone>
+ <phone>
+ <type>mobile</type>
+ <number>01-mobile</number>
+ </phone>
+ <phone>
+ <type>page</type>
+ <number>01-page</number>
+ </phone>
+ <email type="primary">
+ <display-name>testöä lastname</display-name>
+ <smtp-address>email@mail.com</smtp-address>
+ </email>
+ <email>
+ <display-name>testöä lastname</display-name>
+ <smtp-address>additional@mail.com</smtp-address>
+ </email>
+ <address>
+ <type>home</type>
+ <street>priv-addr1</street>
+ <street2>priv-addr2</street2>
+ <locality>priv-city</locality>
+ <region>priv-state</region>
+ <postal-code>p123</postal-code>
+ <country>p-country</country>
+ </address>
+ <address>
+ <type>business</type>
+ <street>w-addr1</street>
+ <street2>w-addr2</street2>
+ <locality>w-city</locality>
+ <region>w-state</region>
+ <postal-code>w123</postal-code>
+ <country>w-country</country>
+ </address>
+ <custom1>cust1</custom1>
+ <custom2>cust2</custom2>
+ <custom3>cust3</custom3>
+ <allow-remote-content>true</allow-remote-content>
+</contact>
diff --git a/test/synckolab/parser/kolab2/xml/contactMinimalTest.xml b/test/synckolab/parser/kolab2/xml/contactMinimalTest.xml
new file mode 100644
index 0000000..29cc0ed
--- /dev/null
+++ b/test/synckolab/parser/kolab2/xml/contactMinimalTest.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<contact version="1.0" >
+ <product-id>SyncKolab, Kolab resource</product-id>
+ <uid>sk-vc-C18A6B3AE0CD9EDC</uid>
+ <last-modification-date>1970-01-01T00:00:00Z</last-modification-date>
+ <sensitivity>public</sensitivity>
+ <name>
+ <given-name>Test</given-name>
+ <last-name>LastName</last-name>
+ <full-name>Test Lastname</full-name>
+ </name>
+ <email type="primary">
+ <display-name>Test Lastname</display-name>
+ <smtp-address>email@test.com</smtp-address>
+ </email>
+ <allow-remote-content>true</allow-remote-content>
+</contact>
diff --git a/test/synckolab/parser/kolab2/xml/list.test.xml b/test/synckolab/parser/kolab2/xml/list.test.xml
new file mode 100644
index 0000000..d9575ac
--- /dev/null
+++ b/test/synckolab/parser/kolab2/xml/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>20121017T231244Z</creation-date>
+ <last-modification-date>1970-01-01T00:00:00Z</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>weird@email.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>