From 837cba33c59ea4bb622878f77fc262436e01ce2b Mon Sep 17 00:00:00 2001 From: Daisuke Miyakawa Date: Tue, 27 Oct 2009 11:22:34 +0900 Subject: Add partial support of Android-specific properties. In the near future, all the values which cannot be converted to vCard property is expressed as "X-ANDROID-CUSTOM" property + MIME_TYPE. Example (Nick name): X-ANDROID-CUSTOM:vnd.android.cursor.item/nickname;Nicky;;;;;;;;;;;;; All the data are stored ordered by its column name ("data1" - "data15"). Currently the code assumes the max num is 15. Internal Issue number: 2079082 --- .../unit_tests/vcard/VCardExporterTests.java | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/AndroidTests/src/com/android/unit_tests/vcard/VCardExporterTests.java b/tests/AndroidTests/src/com/android/unit_tests/vcard/VCardExporterTests.java index d0097c4..f1a46d6 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/vcard/VCardExporterTests.java +++ b/tests/AndroidTests/src/com/android/unit_tests/vcard/VCardExporterTests.java @@ -643,9 +643,6 @@ public class VCardExporterTests extends AndroidTestCase { testStructuredNameUseSuperPrimaryCommon(V30); } - /** - * There's no property for nickname in vCard 2.1, so we don't have any requirement on it. - */ public void testNickNameV30() { ExportTestResolver resolver = new ExportTestResolver(); ContentValues contentValues = resolver.buildData(Nickname.CONTENT_ITEM_TYPE); @@ -1269,4 +1266,23 @@ public class VCardExporterTests extends AndroidTestCase { verifyOneComposition(resolver, handler, version); } + + /** + * There's no "NICKNAME" property in vCard 2.1, while there is in vCard 3.0. + * We use Android-specific "X-ANDROID-CUSTOM" property. + * This test verifies the functionality. + */ + public void testNickNameV21() { + ExportTestResolver resolver = new ExportTestResolver(); + ContentValues contentValues = resolver.buildData(Nickname.CONTENT_ITEM_TYPE); + contentValues.put(Nickname.NAME, "Nicky"); + + VCardVerificationHandler handler = new VCardVerificationHandler(this, V21); + handler.addNewVerifierWithEmptyName() + .addNodeWithOrder("X-ANDROID-CUSTOM", Nickname.CONTENT_ITEM_TYPE + ";Nicky"); + + // TODO: also test import part. + + verifyOneComposition(resolver, handler, V21); + } } -- cgit v1.1