summaryrefslogtreecommitdiff
path: root/test/synckolab/parser
diff options
context:
space:
mode:
authorniko <niko>2012-10-07 12:07:27 (GMT)
committerniko <niko>2012-10-07 12:07:27 (GMT)
commit131a82456a97a057dd16942e4201314f58c4dcfc (patch)
tree03698c3b68e5a64067bbc6efae1968b6048e07b7 /test/synckolab/parser
parent1b345176e3942b5909862878e772bfe83b6c9f94 (diff)
downloadsynckolab-131a82456a97a057dd16942e4201314f58c4dcfc.tar.gz
kolab3 vcard format writing
Diffstat (limited to 'test/synckolab/parser')
-rw-r--r--test/synckolab/parser/kolab2/contactTest.js2
-rw-r--r--test/synckolab/parser/kolab3/contactTest.js10
-rw-r--r--test/synckolab/parser/kolab3/json/complex.vcf.mime.json9
-rw-r--r--test/synckolab/parser/kolab3/json/simple.vcf.mime.json2
-rw-r--r--test/synckolab/parser/kolab3/raw/complex.vcf.mime1
5 files changed, 16 insertions, 8 deletions
diff --git a/test/synckolab/parser/kolab2/contactTest.js b/test/synckolab/parser/kolab2/contactTest.js
index 3efb20b..739356e 100644
--- a/test/synckolab/parser/kolab2/contactTest.js
+++ b/test/synckolab/parser/kolab2/contactTest.js
@@ -10,7 +10,7 @@ load("src/chrome/content/synckolab/addressbookTools.js");
load("test/lib/testOverride.js");
-test("synckolab.addressbookTools.parseMessageContent", function(){
+test("skolab2 ynckolab.addressbookTools.parseMessageContent", function(){
equal(null, synckolab.addressbookTools.parseMessageContent(null), "parsing a null message");
var testFiles = ["contactMinimalTest", "contactFullTest"];
diff --git a/test/synckolab/parser/kolab3/contactTest.js b/test/synckolab/parser/kolab3/contactTest.js
index 8e05dcb..e268935 100644
--- a/test/synckolab/parser/kolab3/contactTest.js
+++ b/test/synckolab/parser/kolab3/contactTest.js
@@ -10,7 +10,7 @@ load("src/chrome/content/synckolab/addressbookTools.js");
load("test/lib/testOverride.js");
-test("synckolab.addressbookTools.parseMessageContent", function(){
+test("kolab3 synckolab.addressbookTools.parseMessageContent", function(){
equal(null, synckolab.addressbookTools.parseMessageContent(null), "parsing a null message");
var testFiles = ["simple.vcf.mime","complex.vcf.mime"];
@@ -25,10 +25,13 @@ test("synckolab.addressbookTools.parseMessageContent", function(){
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 = ["complex.vcf.mime"];
+ var testFiles = ["simple.vcf.mime"];
var content, entry, jsonEntry;
@@ -42,6 +45,9 @@ test("synckolab.addressbookTools.parseMessageContent", function(){
print("==== STARTING PARSE")
entry = synckolab.addressbookTools.parseMessageContent(content);
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);
diff --git a/test/synckolab/parser/kolab3/json/complex.vcf.mime.json b/test/synckolab/parser/kolab3/json/complex.vcf.mime.json
index e9c7002..b44e602 100644
--- a/test/synckolab/parser/kolab3/json/complex.vcf.mime.json
+++ b/test/synckolab/parser/kolab3/json/complex.vcf.mime.json
@@ -3,12 +3,12 @@
"type": "contact",
"isMailList": false,
"ts": 1349565039427,
- "UUID": "urn:uuid:Huu5X7hfYy",
+ "UUID": "Huu5X7hfYy",
"DisplayName": "Displayname",
"FirstName": "Lastname",
"LastName": "Firstname",
"Notes": "Notes",
- "title": "Title",
+ "JobTitle": "Title",
"WebPage1": "www.homepage.org",
"WebPage2": "www.blog.test",
"HomeAddress": "Home Street",
@@ -26,10 +26,10 @@
"NickName": "Nickname",
"related": "Partner",
"BirthYear": 2009,
- "BirthMonth": 6,
+ "BirthMonth": 7,
"BirthDay": 27,
"AnniversaryYear": 2009,
- "AnniversaryMonth": 6,
+ "AnniversaryMonth": 7,
"AnniversaryDay": 28,
"HomePhone": "+4930-homephone",
"CellularNumber": "+4930-mobile",
@@ -38,5 +38,6 @@
"AimScreenName": "messaging",
"PrimaryEmail": "first@email.org",
"SecondEmail": "second@email.org",
+ "AllowRemoteContent": true,
"sha1": "64d8099d65db9198bcb1bca276d88b7a82ffd0eb"
} \ No newline at end of file
diff --git a/test/synckolab/parser/kolab3/json/simple.vcf.mime.json b/test/synckolab/parser/kolab3/json/simple.vcf.mime.json
index 6e779b9..0b0ba6b 100644
--- a/test/synckolab/parser/kolab3/json/simple.vcf.mime.json
+++ b/test/synckolab/parser/kolab3/json/simple.vcf.mime.json
@@ -3,7 +3,7 @@
"type": "contact",
"isMailList": false,
"ts": 1349536624864,
- "UUID": "urn:uuid:4xuyC0cyjV",
+ "UUID": "4xuyC0cyjV",
"DisplayName": "Volker Krause",
"FirstName": "Krause",
"LastName": "Volker",
diff --git a/test/synckolab/parser/kolab3/raw/complex.vcf.mime b/test/synckolab/parser/kolab3/raw/complex.vcf.mime
index 54fa347..4a3d52a 100644
--- a/test/synckolab/parser/kolab3/raw/complex.vcf.mime
+++ b/test/synckolab/parser/kolab3/raw/complex.vcf.mime
@@ -257,6 +257,7 @@ AhhBBCCPEe8D+b5dDLeP4TXAAAAABJRU5ErkJggg=3D=3D</uri>
<identifier>X-Profession</identifier>
<value>Profession</value>
</x-custom>
+ <x-custom><identifier>X-AllowRemoteContent</identifier><value>true</value></x-custom>
</vcard>
</vcards>