summaryrefslogtreecommitdiff
path: root/test/synckolab
diff options
context:
space:
mode:
authorniko <niko>2012-10-09 23:35:41 (GMT)
committerniko <niko>2012-10-09 23:35:41 (GMT)
commit793b6fb9135e641f651715bd94f45a1ba3bbf617 (patch)
tree20b35e7abbec20605e768544f00606e7ff8c598b /test/synckolab
parent9254ccd9792d7dee7638025f618db6d18e5a945b (diff)
downloadsynckolab-793b6fb9135e641f651715bd94f45a1ba3bbf617.tar.gz
version to 2.9.0 to show upgrade path to 3.0
Diffstat (limited to 'test/synckolab')
-rw-r--r--test/synckolab/parser/kolab3/contactTest.js21
-rw-r--r--test/synckolab/parser/kolab3/xml/complex.vcf.mime.xml75
-rw-r--r--test/synckolab/parser/kolab3/xml/simple.vcf.mime.xml18
-rw-r--r--test/synckolab/tools/toolsTest.js5
4 files changed, 110 insertions, 9 deletions
diff --git a/test/synckolab/parser/kolab3/contactTest.js b/test/synckolab/parser/kolab3/contactTest.js
index e268935..7eb8dc8 100644
--- a/test/synckolab/parser/kolab3/contactTest.js
+++ b/test/synckolab/parser/kolab3/contactTest.js
@@ -27,10 +27,15 @@ test("kolab3 synckolab.addressbookTools.parseMessageContent", function(){
equal(synckolab.tools.equalsObject(entry, jsonEntry), true, src);
// json -> kolab 3 xml
-
+ content = synckolab.addressbookTools.card2Kolab3(entry);
+ xmlcontent = readFile("test/synckolab/parser/kolab3/xml/"+src + ".xml");
+ if (xmlcontent.replace(/[\n\r\t ]/g, "").length != content.replace(/[\n\r\t ]/g, "").length) {
+ 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);
+ }
}
});
-
+/*
var testFiles = ["simple.vcf.mime"];
@@ -47,13 +52,13 @@ test("kolab3 synckolab.addressbookTools.parseMessageContent", function(){
print(JSON.stringify(entry, null, ' '))
// json -> kolab 3 xml
content = synckolab.addressbookTools.card2Kolab3(entry);
- print(content);
- /*
- content = readFile("test/synckolab/parser/kolab3/json/"+src+".json");
- jsonEntry = JSON.parse(content);
- equal(synckolab.tools.equalsObject(entry, jsonEntry), true, src);
- */
+ xmlcontent = readFile("test/synckolab/parser/kolab3/xml/"+src + ".xml");
+ if (xmlcontent.replace(/[\n\r\t ]/g, "").length != content.replace(/[\n\r\t ]/g, "").length) {
+ 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/kolab3/xml/complex.vcf.mime.xml b/test/synckolab/parser/kolab3/xml/complex.vcf.mime.xml
new file mode 100644
index 0000000..b6f074b
--- /dev/null
+++ b/test/synckolab/parser/kolab3/xml/complex.vcf.mime.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
+<vcard>
+ <uid><uri>urn:uuid:Huu5X7hfYy</uri></uid>
+ <prodid><text>SyncKolab 3.0.0, Kolab resource</text></prodid>
+ <rev><timestamp>19700101T000000ZZ</timestamp></rev>
+ <note>
+ <text>Notes</text>
+ </note>
+ <n>
+ <given>Lastname</given>
+ <surname>Firstname</surname>
+ </n>
+ <fn><text>Displayname</text></fn>
+ <url>
+ <uri>www.homepage.org</uri>
+ </url>
+ <url>
+ <uri>www.blog.test</uri>
+ </url>
+ <impp>
+ <uri>messaging</uri>
+ </impp>
+ <title>
+ <text>Title</text>
+ </title>
+ <nickname>
+ <text>Nickname</text>
+ </nickname>
+ <bday> <date-time>2043</date-time>
+</bday>
+ <anniversary> <date-time>2009-7-28</date-time>
+</anniversary>
+ <tel>
+ <parameters><type><text>home</text></type></parameters>
+ <text>+4930-homephone</text>
+ </tel>
+ <tel>
+ <parameters><type><text>work</text></type></parameters>
+ <text>+4930-workphone</text>
+ </tel>
+ <tel>
+ <parameters><type><text>fax</text><text>work</text></type></parameters>
+ <text>+4930-fax</text>
+ </tel>
+ <tel>
+ <parameters><type><text>cell</text></type></parameters>
+ <text>+4930-mobile</text>
+ </tel>
+ <email>
+ <parameters><pref><integer>1</integer></pref></parameters>
+ <text>first@email.org</text>
+ </email>
+ <email>
+ <text>second@email.org</text>
+ </email>
+ <adr>
+ <parameters><type><text>home</text></type></parameters>
+ <street>Home Street</street>
+ <locality>Home Locality</locality>
+ <region>Home Region</region>
+ <code>Home Postal Code</code>
+ <country>Gabon</country>
+ </adr>
+ <adr>
+ <parameters><type><text>work</text></type></parameters>
+ <street>Work Street</street>
+ <locality>Work Locality</locality>
+ <region>Work Region</region>
+ <code>Work Postal Code</code>
+ <country>Azerbaijan</country>
+ </adr>
+ <x-custom><identifier>X-AllowRemoteContent</identifier><value>true</value></x-custom>
+</vcard>
+</vcards> \ No newline at end of file
diff --git a/test/synckolab/parser/kolab3/xml/simple.vcf.mime.xml b/test/synckolab/parser/kolab3/xml/simple.vcf.mime.xml
new file mode 100644
index 0000000..90b72a4
--- /dev/null
+++ b/test/synckolab/parser/kolab3/xml/simple.vcf.mime.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+ <vcards xmlns="urn:ietf:params:xml:ns:vcard-4.0">
+ <vcard>
+ <uid><uri>urn:uuid:4xuyC0cyjV</uri></uid>
+ <prodid><text>SyncKolab 3.0.0, Kolab resource</text></prodid>
+ <rev><timestamp>19700101T000000ZZ</timestamp></rev>
+ <n>
+ <given>Krause</given>
+ <surname>Volker</surname>
+ </n>
+ <fn><text>Volker Krause</text></fn>
+ <email>
+ <parameters><pref><integer>1</integer></pref></parameters>
+ <text>vkrause@kde.org</text>
+ </email>
+ <x-custom><identifier>X-AllowRemoteContent</identifier><value>false</value></x-custom>
+ </vcard>
+ </vcards> \ No newline at end of file
diff --git a/test/synckolab/tools/toolsTest.js b/test/synckolab/tools/toolsTest.js
index fa6ff53..c534f84 100644
--- a/test/synckolab/tools/toolsTest.js
+++ b/test/synckolab/tools/toolsTest.js
@@ -9,7 +9,7 @@ load("test/lib/testOverride.js");
/**
* Test on Node
*/
-test("synckolab.tools.text.checkExist", function(){
+test("synckolab.Node", function(){
// prepare and read an xml
var content = readFile("test/synckolab/tools/data/domtest.xml");
var doc = synckolab.tools.parseXml(content);
@@ -23,4 +23,7 @@ test("synckolab.tools.text.checkExist", function(){
child = child.getNextNode();
equal(child.nodeName, "child", "dom name (child)");
equal(child.getFirstData(), "2", "child 2");
+
});
+
+