summaryrefslogtreecommitdiff
path: root/test/synckolab/parser
diff options
context:
space:
mode:
authorniko <niko>2012-10-08 06:38:53 (GMT)
committerniko <niko>2012-10-08 06:38:53 (GMT)
commit5240e08baeb09a127b69018e3f025518bbd934c3 (patch)
tree887a064ee496519a30e624d1844b7467efd9125a /test/synckolab/parser
parent131a82456a97a057dd16942e4201314f58c4dcfc (diff)
downloadsynckolab-5240e08baeb09a127b69018e3f025518bbd934c3.tar.gz
timezone parsing
Diffstat (limited to 'test/synckolab/parser')
-rw-r--r--test/synckolab/parser/kolab3/calendarTest.js59
1 files changed, 59 insertions, 0 deletions
diff --git a/test/synckolab/parser/kolab3/calendarTest.js b/test/synckolab/parser/kolab3/calendarTest.js
new file mode 100644
index 0000000..4522082
--- /dev/null
+++ b/test/synckolab/parser/kolab3/calendarTest.js
@@ -0,0 +1,59 @@
+// load synckolab libraries
+
+load("src/chrome/content/synckolab/tools.js");
+load("src/chrome/content/synckolab/tools/sha1.js");
+load("src/chrome/content/synckolab/tools/kolab.js");
+load("src/chrome/content/synckolab/tools/text.js");
+
+load("src/chrome/content/synckolab/calendarTools.js");
+
+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 content, entry, jsonEntry;
+
+ for(var i = 0; i < testFiles.length; i++) {
+ var src = testFiles[i];
+
+ content = readFile("test/synckolab/parser/kolab3/raw/"+src);
+ content = synckolab.tools.stripMailHeader(content);
+ entry = synckolab.addressbookTools.parseMessageContent(content);
+ content = readFile("test/synckolab/parser/kolab3/json/"+src+".json");
+ jsonEntry = JSON.parse(content);
+ equal(synckolab.tools.equalsObject(entry, jsonEntry), true, src);
+
+ // json -> kolab 3 xml
+
+ }
+});
+*/
+ var testFiles = ["simple.ics.mime"];
+
+
+ var content, entry, jsonEntry;
+
+ for(var i = 0; i < testFiles.length; i++) {
+ var src = testFiles[i];
+
+ content = readFile("test/synckolab/parser/kolab3/raw/"+src);
+ content = synckolab.tools.stripMailHeader(content);
+ print(content);
+ print("==== STARTING PARSE")
+ entry = synckolab.calendarTools.message2json(content, false);
+ 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);
+ */
+ }
+
+
+