VCardImporterTests.java revision 06ae82316d0b5f7222a7a1d15b7d03df88fdea15
1/*
2 * Copyright (C) 2009 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package com.android.vcard.tests;
17
18import android.content.ContentValues;
19import android.provider.ContactsContract.CommonDataKinds.Email;
20import android.provider.ContactsContract.CommonDataKinds.Event;
21import android.provider.ContactsContract.CommonDataKinds.Im;
22import android.provider.ContactsContract.CommonDataKinds.Nickname;
23import android.provider.ContactsContract.CommonDataKinds.Note;
24import android.provider.ContactsContract.CommonDataKinds.Organization;
25import android.provider.ContactsContract.CommonDataKinds.Phone;
26import android.provider.ContactsContract.CommonDataKinds.Photo;
27import android.provider.ContactsContract.CommonDataKinds.StructuredName;
28import android.provider.ContactsContract.CommonDataKinds.StructuredPostal;
29import android.provider.ContactsContract.CommonDataKinds.Website;
30import android.provider.ContactsContract.Data;
31
32import com.android.vcard.VCardConfig;
33import com.android.vcard.tests.test_utils.ContentValuesVerifier;
34import com.android.vcard.tests.test_utils.ContentValuesVerifierElem;
35import com.android.vcard.tests.test_utils.PropertyNodesVerifierElem.TypeSet;
36import com.android.vcard.tests.test_utils.VCardTestsBase;
37
38import java.util.Arrays;
39
40public class VCardImporterTests extends VCardTestsBase {
41    // Push data into int array at first since values like 0x80 are
42    // interpreted as int by the compiler and casting all of them is
43    // cumbersome...
44    private static final int[] sPhotoIntArrayForComplicatedCase = {
45        0xff, 0xd8, 0xff, 0xe1, 0x0a, 0x0f, 0x45, 0x78, 0x69, 0x66, 0x00,
46        0x00, 0x4d, 0x4d, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0d,
47        0x01, 0x0e, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
48        0xaa, 0x01, 0x0f, 0x00, 0x02, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00,
49        0x00, 0xba, 0x01, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00,
50        0x00, 0x00, 0xc2, 0x01, 0x12, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01,
51        0x00, 0x01, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x05, 0x00, 0x00, 0x00,
52        0x01, 0x00, 0x00, 0x00, 0xc8, 0x01, 0x1b, 0x00, 0x05, 0x00, 0x00,
53        0x00, 0x01, 0x00, 0x00, 0x00, 0xd0, 0x01, 0x28, 0x00, 0x03, 0x00,
54        0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x01, 0x31, 0x00, 0x02,
55        0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xd8, 0x01, 0x32, 0x00,
56        0x02, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0xe6, 0x02, 0x13,
57        0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x82,
58        0x98, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xfa,
59        0x87, 0x69, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01,
60        0x84, 0xc4, 0xa5, 0x00, 0x07, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00,
61        0x01, 0x08, 0x00, 0x00, 0x04, 0x1e, 0x32, 0x30, 0x30, 0x38, 0x31,
62        0x30, 0x32, 0x39, 0x31, 0x33, 0x35, 0x35, 0x33, 0x31, 0x00, 0x00,
63        0x44, 0x6f, 0x43, 0x6f, 0x4d, 0x6f, 0x00, 0x00, 0x44, 0x39, 0x30,
64        0x35, 0x69, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01,
65        0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x44, 0x39, 0x30,
66        0x35, 0x69, 0x20, 0x56, 0x65, 0x72, 0x31, 0x2e, 0x30, 0x30, 0x00,
67        0x32, 0x30, 0x30, 0x38, 0x3a, 0x31, 0x30, 0x3a, 0x32, 0x39, 0x20,
68        0x31, 0x33, 0x3a, 0x35, 0x35, 0x3a, 0x34, 0x37, 0x00, 0x20, 0x20,
69        0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
70        0x00, 0x50, 0x72, 0x69, 0x6e, 0x74, 0x49, 0x4d, 0x00, 0x30, 0x33,
71        0x30, 0x30, 0x00, 0x00, 0x00, 0x06, 0x00, 0x01, 0x00, 0x14, 0x00,
72        0x14, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
73        0x00, 0x34, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01,
74        0x00, 0x00, 0x00, 0x01, 0x10, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
75        0x11, 0x09, 0x00, 0x00, 0x27, 0x10, 0x00, 0x00, 0x0f, 0x0b, 0x00,
76        0x00, 0x27, 0x10, 0x00, 0x00, 0x05, 0x97, 0x00, 0x00, 0x27, 0x10,
77        0x00, 0x00, 0x08, 0xb0, 0x00, 0x00, 0x27, 0x10, 0x00, 0x00, 0x1c,
78        0x01, 0x00, 0x00, 0x27, 0x10, 0x00, 0x00, 0x02, 0x5e, 0x00, 0x00,
79        0x27, 0x10, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x27, 0x10, 0x00,
80        0x00, 0x03, 0xcb, 0x00, 0x00, 0x27, 0x10, 0x00, 0x00, 0x1b, 0xe5,
81        0x00, 0x00, 0x27, 0x10, 0x00, 0x28, 0x82, 0x9a, 0x00, 0x05, 0x00,
82        0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0x6a, 0x82, 0x9d, 0x00, 0x05,
83        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0x72, 0x88, 0x22, 0x00,
84        0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x90, 0x00,
85        0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x30, 0x32, 0x32, 0x30, 0x90,
86        0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x03, 0x7a,
87        0x90, 0x04, 0x00, 0x02, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x03,
88        0x8e, 0x91, 0x01, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x01, 0x02,
89        0x03, 0x00, 0x91, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00,
90        0x00, 0x03, 0xa2, 0x92, 0x01, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x01,
91        0x00, 0x00, 0x03, 0xaa, 0x92, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00,
92        0x01, 0x00, 0x00, 0x03, 0xb2, 0x92, 0x04, 0x00, 0x0a, 0x00, 0x00,
93        0x00, 0x01, 0x00, 0x00, 0x03, 0xba, 0x92, 0x05, 0x00, 0x05, 0x00,
94        0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0xc2, 0x92, 0x07, 0x00, 0x03,
95        0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x92, 0x08, 0x00,
96        0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x92, 0x09,
97        0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x92,
98        0x0a, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0xca,
99        0x92, 0x7c, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
100        0x00, 0x92, 0x86, 0x00, 0x07, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00,
101        0x03, 0xd2, 0xa0, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x30,
102        0x31, 0x30, 0x30, 0xa0, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01,
103        0x00, 0x01, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x03, 0x00, 0x00, 0x00,
104        0x01, 0x00, 0x60, 0x00, 0x00, 0xa0, 0x03, 0x00, 0x03, 0x00, 0x00,
105        0x00, 0x01, 0x00, 0x48, 0x00, 0x00, 0xa0, 0x05, 0x00, 0x04, 0x00,
106        0x00, 0x00, 0x01, 0x00, 0x00, 0x04, 0x00, 0xa2, 0x0e, 0x00, 0x05,
107        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0xe8, 0xa2, 0x0f, 0x00,
108        0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0xf0, 0xa2, 0x10,
109        0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0xa2,
110        0x17, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00,
111        0xa3, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00,
112        0x00, 0xa3, 0x01, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
113        0x00, 0x00, 0xa4, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00,
114        0x00, 0x00, 0x00, 0xa4, 0x02, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01,
115        0x00, 0x00, 0x00, 0x00, 0xa4, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00,
116        0x01, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x04, 0x00, 0x05, 0x00, 0x00,
117        0x00, 0x01, 0x00, 0x00, 0x03, 0xf8, 0xa4, 0x05, 0x00, 0x03, 0x00,
118        0x00, 0x00, 0x01, 0x00, 0x1d, 0x00, 0x00, 0xa4, 0x06, 0x00, 0x03,
119        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x07, 0x00,
120        0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x08,
121        0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa4,
122        0x09, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
123        0xa4, 0x0a, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
124        0x00, 0xa4, 0x0c, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02,
125        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x53, 0x00,
126        0x00, 0x27, 0x10, 0x00, 0x00, 0x01, 0x5e, 0x00, 0x00, 0x00, 0x64,
127        0x32, 0x30, 0x30, 0x38, 0x3a, 0x31, 0x30, 0x3a, 0x32, 0x39, 0x20,
128        0x31, 0x33, 0x3a, 0x35, 0x35, 0x3a, 0x33, 0x31, 0x00, 0x32, 0x30,
129        0x30, 0x38, 0x3a, 0x31, 0x30, 0x3a, 0x32, 0x39, 0x20, 0x31, 0x33,
130        0x3a, 0x35, 0x35, 0x3a, 0x34, 0x37, 0x00, 0x00, 0x00, 0x29, 0x88,
131        0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x02, 0xb2, 0x00, 0x00, 0x00,
132        0x64, 0x00, 0x00, 0x01, 0x5e, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00,
133        0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x25, 0x00,
134        0x00, 0x00, 0x0a, 0x00, 0x00, 0x0e, 0x92, 0x00, 0x00, 0x03, 0xe8,
135        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x30, 0x30,
136        0x38, 0x31, 0x30, 0x32, 0x39, 0x31, 0x33, 0x35, 0x35, 0x33, 0x31,
137        0x00, 0x00, 0x20, 0x2a, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x2a,
138        0xe2, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
139        0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00,
140        0x04, 0x52, 0x39, 0x38, 0x00, 0x00, 0x02, 0x00, 0x07, 0x00, 0x00,
141        0x00, 0x04, 0x30, 0x31, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00,
142        0x06, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x06,
143        0x00, 0x00, 0x01, 0x1a, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00,
144        0x00, 0x04, 0x6c, 0x01, 0x1b, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01,
145        0x00, 0x00, 0x04, 0x74, 0x01, 0x28, 0x00, 0x03, 0x00, 0x00, 0x00,
146        0x01, 0x00, 0x02, 0x00, 0x00, 0x02, 0x01, 0x00, 0x04, 0x00, 0x00,
147        0x00, 0x01, 0x00, 0x00, 0x04, 0x7c, 0x02, 0x02, 0x00, 0x04, 0x00,
148        0x00, 0x00, 0x01, 0x00, 0x00, 0x05, 0x8b, 0x00, 0x00, 0x00, 0x00,
149        0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
150        0x48, 0x00, 0x00, 0x00, 0x01, 0xff, 0xd8, 0xff, 0xdb, 0x00, 0x84,
151        0x00, 0x20, 0x16, 0x18, 0x1c, 0x18, 0x14, 0x20, 0x1c, 0x1a, 0x1c,
152        0x24, 0x22, 0x20, 0x26, 0x30, 0x50, 0x34, 0x30, 0x2c, 0x2c, 0x30,
153        0x62, 0x46, 0x4a, 0x3a, 0x50, 0x74, 0x66, 0x7a, 0x78, 0x72, 0x66,
154        0x70, 0x6e, 0x80, 0x90, 0xb8, 0x9c, 0x80, 0x88, 0xae, 0x8a, 0x6e,
155        0x70, 0xa0, 0xda, 0xa2, 0xae, 0xbe, 0xc4, 0xce, 0xd0, 0xce, 0x7c,
156        0x9a, 0xe2, 0xf2, 0xe0, 0xc8, 0xf0, 0xb8, 0xca, 0xce, 0xc6, 0x01,
157        0x22, 0x24, 0x24, 0x30, 0x2a, 0x30, 0x5e, 0x34, 0x34, 0x5e, 0xc6,
158        0x84, 0x70, 0x84, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
159        0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
160        0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
161        0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
162        0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xff, 0xc0,
163        0x00, 0x11, 0x08, 0x00, 0x78, 0x00, 0xa0, 0x03, 0x01, 0x21, 0x00,
164        0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xff, 0xc4, 0x01, 0xa2, 0x00,
165        0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00,
166        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
167        0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x10, 0x00, 0x02, 0x01, 0x03,
168        0x03, 0x02, 0x04, 0x03, 0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01,
169        0x7d, 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, 0x31,
170        0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81,
171        0x91, 0xa1, 0x08, 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
172        0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16, 0x17, 0x18, 0x19,
173        0x1a, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37,
174        0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a,
175        0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65,
176        0x66, 0x67, 0x68, 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
177        0x79, 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92,
178        0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4,
179        0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
180        0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8,
181        0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
182        0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf1,
183        0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0x01, 0x00,
184        0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00,
185        0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
186        0x07, 0x08, 0x09, 0x0a, 0x0b, 0x11, 0x00, 0x02, 0x01, 0x02, 0x04,
187        0x04, 0x03, 0x04, 0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77,
188        0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06, 0x12,
189        0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22, 0x32, 0x81, 0x08, 0x14,
190        0x42, 0x91, 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, 0x15,
191        0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34, 0xe1, 0x25, 0xf1, 0x17,
192        0x18, 0x19, 0x1a, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37,
193        0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a,
194        0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65,
195        0x66, 0x67, 0x68, 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
196        0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a,
197        0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3,
198        0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5,
199        0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
200        0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9,
201        0xda, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf2,
202        0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xff, 0xda, 0x00,
203        0x0c, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3f, 0x00,
204        0x14, 0x54, 0xaa, 0x2a, 0x46, 0x48, 0xa2, 0xa4, 0x55, 0xa6, 0x04,
205        0x8a, 0x29, 0xe0, 0x53, 0x10, 0xe0, 0x29, 0xc0, 0x50, 0x03, 0xb1,
206        0x46, 0x29, 0x80, 0x84, 0x52, 0x11, 0x40, 0x0d, 0x22, 0x9a, 0x45,
207        0x20, 0x23, 0x61, 0x51, 0x30, 0xa0, 0x08, 0xc8, 0xa8, 0xd8, 0x52,
208        0x02, 0x26, 0x15, 0x0b, 0x0a, 0x00, 0xb4, 0xa2, 0xa5, 0x5a, 0x00,
209        0x91, 0x45, 0x4a, 0xa2, 0x81, 0x92, 0x01, 0x4e, 0x02, 0x98, 0x87,
210        0x0a, 0x70, 0xa0, 0x07, 0x62, 0x8c, 0x50, 0x21, 0x0d, 0x25, 0x00,
211        0x34, 0x8a, 0x61, 0x14, 0x0c, 0x63, 0x0a, 0x89, 0x85, 0x00, 0x46,
212        0xd5, 0x1b, 0x52, 0x02, 0x16, 0xa8, 0x98, 0x50, 0x05, 0x94, 0xa9,
213        0x16, 0x80, 0x25, 0x5a, 0x95, 0x68, 0x18, 0xf1, 0x4f, 0x14, 0xc4,
214        0x3b, 0xb5, 0x22, 0xb6, 0x38, 0x34, 0x00, 0xe3, 0x22, 0x8e, 0xf4,
215        0x79, 0x8a, 0x7b, 0xd1, 0x71, 0x03, 0x30, 0xc7, 0x14, 0x83, 0xa5,
216        0x00, 0x06, 0x98, 0x68, 0x01, 0x8d, 0x51, 0x35, 0x03, 0x22, 0x6a,
217        0x8d, 0xa9, 0x01, 0x13, 0x54, 0x4d, 0x40, 0x13, 0xa5, 0x4a, 0x28,
218        0x02, 0x45, 0x35, 0x2a, 0x9a, 0x00, 0x78, 0x34, 0xf0, 0x69, 0x80,
219        0x34, 0x81, 0x45, 0x40, 0xce, 0x58, 0xe6, 0xa2, 0x4c, 0x06, 0xe4,
220        0xfa, 0xd1, 0x93, 0x50, 0x21, 0xca, 0xe4, 0x55, 0x84, 0x90, 0x30,
221        0xab, 0x8b, 0x18, 0xa6, 0x9a, 0x6a, 0xc4, 0x31, 0xaa, 0x26, 0xa0,
222        0x64, 0x4d, 0x51, 0xb5, 0x20, 0x23, 0x6a, 0x89, 0xa8, 0x02, 0x44,
223        0x35, 0x2a, 0x9a, 0x00, 0x95, 0x4d, 0x48, 0xa6, 0x80, 0x24, 0x53,
224        0x4e, 0xce, 0x05, 0x30, 0x2b, 0x3b, 0xee, 0x6a, 0x91, 0x5d, 0x76,
225        0x63, 0xbd, 0x65, 0x7d, 0x40, 0x66, 0x68, 0xa9, 0x02, 0x45, 0x2b,
226        0xb3, 0x9e, 0xb4, 0xc5, 0x6d, 0xad, 0x9a, 0xa0, 0x2c, 0x06, 0xc8,
227        0xcd, 0x04, 0xd6, 0xa2, 0x23, 0x63, 0x51, 0xb1, 0xa0, 0x64, 0x4d,
228        0x51, 0x93, 0x48, 0x08, 0xda, 0xa2, 0x6a, 0x00, 0x72, 0x1a, 0x99,
229        0x4d, 0x00, 0x48, 0xa6, 0xa4, 0x53, 0x4c, 0x07, 0x86, 0x03, 0xbd,
230        0x2b, 0x9c, 0xa7, 0x14, 0x98, 0x10, 0x85, 0x34, 0xe0, 0xa6, 0xb3,
231        0xb0, 0x0b, 0xb5, 0xa8, 0x0a, 0xd4, 0x58, 0x42, 0xed, 0x3e, 0x94,
232        0xd2, 0xa6, 0x8b, 0x01, 0x34, 0x44, 0xed, 0xe6, 0x9c, 0x4d, 0x6a,
233        0x80, 0x8d, 0x8d, 0x46, 0xc6, 0x80, 0x23, 0x63, 0x51, 0x9a, 0x06,
234        0x46, 0xd5, 0x13, 0x52, 0x01, 0x54, 0xd4, 0xaa, 0x68, 0x02, 0x40,
235        0x6a, 0x40, 0x78, 0xa0, 0x08, 0x59, 0xce, 0xee, 0xb5, 0x2a, 0x39,
236        0xd9, 0x59, 0xa7, 0xa8, 0x00, 0x73, 0xeb, 0x4e, 0x0e, 0x7d, 0x69,
237        0x5c, 0x05, 0xf3, 0x0f, 0xad, 0x1e, 0x61, 0xf5, 0xa7, 0x71, 0x0b,
238        0xe6, 0x35, 0x21, 0x90, 0xd3, 0xb8, 0x0e, 0x32, 0x10, 0x95, 0x10,
239        0x91, 0xb3, 0xd6, 0x9b, 0x60, 0x4b, 0x9c, 0x8a, 0x63, 0x1a, 0xb0,
240        0x18, 0x4d, 0x46, 0xc6, 0x80, 0x22, 0x6a, 0x61, 0xa4, 0x31, 0xaa,
241        0x6a, 0x55, 0x34, 0x01, 0x2a, 0x9a, 0x7e, 0x78, 0xa0, 0x08, 0x09,
242        0xf9, 0xaa, 0x58, 0xcf, 0xca, 0x6b, 0x3e, 0xa0, 0x00, 0xd3, 0x81,
243        0xa9, 0x01, 0x73, 0x46, 0x69, 0x80, 0xb9, 0xa4, 0xcd, 0x00, 0x2b,
244        0x1f, 0x92, 0xa3, 0x07, 0x9a, 0x6f, 0x70, 0x26, 0xcf, 0x14, 0xd2,
245        0x6b, 0x51, 0x0c, 0x63, 0x51, 0xb1, 0xa0, 0x08, 0xda, 0x98, 0x69,
246        0x0c, 0x8d, 0x4d, 0x4a, 0xa6, 0x80, 0x24, 0x53, 0x52, 0x03, 0xc5,
247        0x02, 0x21, 0x27, 0xe6, 0xa9, 0x23, 0x3f, 0x29, 0xac, 0xfa, 0x8c,
248        0x01, 0xe6, 0x9c, 0x0d, 0x48, 0x0a, 0x0d, 0x2e, 0x68, 0x01, 0x73,
249        0x49, 0x9a, 0x60, 0x2b, 0x1f, 0x92, 0x98, 0x3a, 0xd3, 0x7b, 0x81,
250        0x36, 0x78, 0xa6, 0x93, 0x5a, 0x88, 0x8c, 0x9a, 0x63, 0x1a, 0x00,
251        0x8c, 0xd3, 0x0d, 0x21, 0x91, 0x29, 0xa9, 0x14, 0xd0, 0x04, 0x8a,
252        0x69, 0xe0, 0xd3, 0x11, 0x1b, 0x1e, 0x6a, 0x48, 0xcf, 0xca, 0x6b,
253        0x3e, 0xa3, 0x10, 0x1a, 0x70, 0x35, 0x20, 0x38, 0x1a, 0x5c, 0xd2,
254        0x01, 0x73, 0x49, 0x9a, 0x60, 0x39, 0x8f, 0xca, 0x29, 0x8b, 0xf7,
255        0xaa, 0xba, 0x88, 0x96, 0x9a, 0x6b, 0x40, 0x18, 0xc6, 0xa3, 0x26,
256        0x80, 0x18, 0x69, 0xa6, 0x90, 0xc8, 0x14, 0xd4, 0x8a, 0x69, 0x80,
257        0xf0, 0x6a, 0x40, 0x68, 0x10, 0xbb, 0x41, 0xa7, 0xe3, 0x0b, 0xc5,
258        0x2b, 0x01, 0x10, 0xa7, 0x03, 0x59, 0x0c, 0x76, 0x69, 0x73, 0x40,
259        0x0b, 0x9a, 0x28, 0x11, 0x28, 0x19, 0x5e, 0x69, 0x02, 0x81, 0x5a,
260        0xd8, 0x00, 0xd3, 0x4d, 0x50, 0x0c, 0x6a, 0x8c, 0xd2, 0x01, 0xa6,
261        0x98, 0x69, 0x0c, 0xae, 0xa6, 0xa4, 0x06, 0x80, 0x1e, 0xa6, 0x9e,
262        0x0d, 0x31, 0x12, 0x03, 0x4f, 0x06, 0x80, 0x13, 0x60, 0x34, 0xd3,
263        0xc1, 0xa8, 0x92, 0x01, 0xf1, 0x8d, 0xdd, 0x69, 0xcc, 0xa1, 0x69,
264        0x5b, 0x4b, 0x80, 0x83, 0x93, 0x52, 0x04, 0x14, 0xe2, 0xae, 0x03,
265        0xa9, 0x0d, 0x68, 0x03, 0x4d, 0x34, 0xd0, 0x03, 0x0d, 0x30, 0xd2,
266        0x01, 0x86, 0x9a, 0x68, 0x19, 0x58, 0x1a, 0x78, 0xa4, 0x04, 0x8a,
267        0x69, 0xe0, 0xd3, 0x10, 0xe0, 0x69, 0xe0, 0xd0, 0x03, 0xc1, 0xa8,
268        0xdb, 0xad, 0x4c, 0x81, 0x12, 0x45, 0xd6, 0x9d, 0x25, 0x1d, 0x00,
269        0x6a, 0xf5, 0xa9, 0xe8, 0x80, 0x31, 0x29, 0x0d, 0x58, 0x08, 0x69,
270        0x86, 0x80, 0x1a, 0x69, 0x86, 0x90, 0x0c, 0x34, 0xd3, 0x48, 0x65,
271        0x51, 0x4f, 0x06, 0x98, 0x0f, 0x14, 0xf0, 0x68, 0x10, 0xf0, 0x69,
272        0xe0, 0xd0, 0x03, 0x81, 0xa5, 0x2b, 0x9a, 0x1a, 0xb8, 0x87, 0xa8,
273        0xdb, 0x4a, 0x46, 0x68, 0xb6, 0x80, 0x2a, 0xa8, 0x14, 0xea, 0x12,
274        0xb0, 0x05, 0x21, 0xa6, 0x02, 0x1a, 0x61, 0xa0, 0x06, 0x9a, 0x61,
275        0xa4, 0x31, 0x86, 0x9a, 0x69, 0x0c, 0xa8, 0x0d, 0x3c, 0x53, 0x01,
276        0xe2, 0x9e, 0x28, 0x10, 0xf1, 0x4e, 0x06, 0x98, 0x0f, 0x06, 0x9e,
277        0x0d, 0x02, 0x1c, 0x29, 0xc2, 0x80, 0x16, 0x96, 0x80, 0x0a, 0x4a,
278        0x00, 0x43, 0x4d, 0x34, 0x0c, 0x61, 0xa6, 0x1a, 0x40, 0x34, 0xd3,
279        0x4d, 0x21, 0x80, 0xff, 0xd9, 0xff, 0xdb, 0x00, 0x84, 0x00, 0x0a,
280        0x07, 0x07, 0x08, 0x07, 0x06, 0x0a, 0x08, 0x08, 0x08, 0x0b, 0x0a,
281        0x0a, 0x0b, 0x0e, 0x18, 0x10, 0x0e, 0x0d, 0x0d, 0x0e, 0x1d, 0x15,
282        0x16, 0x11, 0x18, 0x23, 0x1f, 0x25, 0x24, 0x22, 0x1f, 0x22, 0x21,
283        0x26, 0x2b, 0x37, 0x2f, 0x26, 0x29, 0x34, 0x29, 0x21, 0x22, 0x30,
284        0x41, 0x31, 0x34, 0x39, 0x3b, 0x3e, 0x3e, 0x3e, 0x25, 0x2e, 0x44,
285        0x49, 0x43, 0x3c, 0x48, 0x37, 0x3d, 0x3e, 0x3b, 0x01, 0x0a, 0x0b,
286        0x0b, 0x0e, 0x0d, 0x0e, 0x1c, 0x10, 0x10, 0x1c, 0x3b, 0x28, 0x22,
287        0x28, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
288        0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
289        0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
290        0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
291        0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0xff, 0xc0, 0x00, 0x11,
292        0x08, 0x00, 0x48, 0x00, 0x60, 0x03, 0x01, 0x21, 0x00, 0x02, 0x11,
293        0x01, 0x03, 0x11, 0x01, 0xff, 0xc4, 0x01, 0xa2, 0x00, 0x00, 0x01,
294        0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
295        0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
296        0x08, 0x09, 0x0a, 0x0b, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02,
297        0x04, 0x03, 0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7d, 0x01,
298        0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, 0x31, 0x41, 0x06,
299        0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1,
300        0x08, 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0, 0x24, 0x33,
301        0x62, 0x72, 0x82, 0x09, 0x0a, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x25,
302        0x26, 0x27, 0x28, 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
303        0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54,
304        0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67,
305        0x68, 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a,
306        0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94,
307        0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6,
308        0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8,
309        0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca,
310        0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
311        0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf1, 0xf2, 0xf3,
312        0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0x01, 0x00, 0x03, 0x01,
313        0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00,
314        0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
315        0x09, 0x0a, 0x0b, 0x11, 0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03,
316        0x04, 0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77, 0x00, 0x01,
317        0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51,
318        0x07, 0x61, 0x71, 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
319        0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, 0x15, 0x62, 0x72,
320        0xd1, 0x0a, 0x16, 0x24, 0x34, 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19,
321        0x1a, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38, 0x39,
322        0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54,
323        0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67,
324        0x68, 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a,
325        0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93,
326        0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
327        0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
328        0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9,
329        0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe2,
330        0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf2, 0xf3, 0xf4,
331        0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xff, 0xda, 0x00, 0x0c, 0x03,
332        0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3f, 0x00, 0x9e, 0xd2,
333        0x2e, 0x07, 0x15, 0xaf, 0x6d, 0x08, 0xe2, 0xb3, 0x45, 0x1a, 0xf6,
334        0xd0, 0x00, 0x01, 0xc5, 0x68, 0x45, 0x17, 0x4a, 0xb4, 0x22, 0xe4,
335        0x70, 0x8c, 0x74, 0xa9, 0x3c, 0xa1, 0x8e, 0x95, 0x48, 0x96, 0x31,
336        0xe2, 0x18, 0xe9, 0x55, 0xa5, 0x8c, 0x7a, 0x50, 0x05, 0x0b, 0x88,
337        0x86, 0x0f, 0x15, 0x8f, 0x75, 0x1f, 0x26, 0x93, 0x19, 0x91, 0x77,
338        0x18, 0xc1, 0xac, 0x4b, 0xc8, 0xfa, 0xd6, 0x63, 0x37, 0x6d, 0x31,
339        0xb4, 0x73, 0x5b, 0x36, 0xa0, 0x1c, 0x50, 0x80, 0xd7, 0x83, 0xa0,
340        0xab, 0xd1, 0x62, 0xad, 0x09, 0x8f, 0x17, 0x29, 0x03, 0xb2, 0xcc,
341        0xe0, 0x77, 0x14, 0xa3, 0x56, 0xb3, 0x27, 0x1e, 0x67, 0xe9, 0x52,
342        0xea, 0xc6, 0x3a, 0x36, 0x48, 0xef, 0x3d, 0x27, 0x70, 0x22, 0x60,
343        0x47, 0x52, 0x69, 0xb2, 0xe2, 0xad, 0x3b, 0xea, 0x80, 0xa3, 0x38,
344        0xe0, 0xd6, 0x3d, 0xd8, 0x1c, 0xd0, 0xca, 0x46, 0x3d, 0xd0, 0x18,
345        0x35, 0x89, 0x78, 0xa3, 0x9a, 0xcd, 0x8c, 0xd2, 0xb3, 0x93, 0x2a,
346        0x2b, 0x66, 0xd5, 0xf1, 0x8a, 0x10, 0x1a, 0xd6, 0xf2, 0x03, 0x8a,
347        0x9e, 0xe6, 0xf4, 0x5a, 0xdb, 0xef, 0xfe, 0x23, 0xc0, 0xa7, 0x27,
348        0xcb, 0x16, 0xc4, 0xcc, 0xdd, 0xe2, 0x78, 0x9a, 0x69, 0x66, 0xcc,
349        0x99, 0xe1, 0x4d, 0x47, 0xba, 0xbc, 0xd9, 0x6a, 0xee, 0x26, 0x59,
350        0x59, 0x4d, 0xac, 0x69, 0x34, 0x52, 0xe5, 0x8f, 0x55, 0xad, 0x58,
351        0xae, 0x85, 0xc4, 0x22, 0x41, 0xdf, 0xad, 0x76, 0x61, 0xe5, 0x6f,
352        0x74, 0x45, 0x69, 0xdc, 0x00, 0x79, 0xac, 0x8b, 0xa6, 0xc9, 0x35,
353        0xd4, 0x34, 0x64, 0xdc, 0x37, 0x06, 0xb1, 0xae, 0x88, 0xc1, 0xac,
354        0xd8, 0xc9, 0x2c, 0xa6, 0xe0, 0x73, 0x5b, 0x36, 0xf3, 0x74, 0xe6,
355        0x84, 0x05, 0xe3, 0xa9, 0x47, 0x6a, 0x14, 0xb6, 0x49, 0x3d, 0x85,
356        0x3a, 0xee, 0xee, 0x2b, 0xa8, 0xe2, 0x6f, 0x30, 0x81, 0xe9, 0x8a,
357        0xca, 0xa4, 0xe2, 0xd3, 0x8b, 0x01, 0xb1, 0xf9, 0x04, 0x7f, 0xaf,
358        0x23, 0xf0, 0xa9, 0x54, 0x41, 0x9c, 0xfd, 0xa3, 0xf4, 0xae, 0x65,
359        0x18, 0xf7, 0x25, 0x8a, 0xe2, 0x02, 0x38, 0xb8, 0xfd, 0x2a, 0x7b,
360        0x5b, 0xa8, 0x6d, 0x6d, 0x5d, 0x9a, 0x5d, 0xcb, 0xbb, 0xd2, 0xb6,
361        0xa6, 0xa3, 0x19, 0x5e, 0xe2, 0x03, 0x7b, 0x1d, 0xc2, 0x17, 0x8d,
362        0xb8, 0xac, 0xfb, 0x89, 0x39, 0x35, 0xd6, 0x9a, 0x6a, 0xe8, 0x66,
363        0x55, 0xcb, 0xf5, 0xac, 0x7b, 0x96, 0xeb, 0x50, 0xc6, 0x88, 0x6d,
364        0x66, 0xe9, 0xcd, 0x6c, 0xdb, 0x4f, 0xd3, 0x9a, 0x00, 0x2f, 0xe6,
365        0xf9, 0xa3, 0xe7, 0xb5, 0x4a, 0x93, 0x7f, 0xa2, 0xc6, 0x73, 0xdc,
366        0xd7, 0x15, 0x55, 0xef, 0x48, 0x7d, 0x09, 0x52, 0x6e, 0x3a, 0xd4,
367        0xab, 0x2f, 0xbd, 0x61, 0x16, 0x0c, 0x73, 0x49, 0xc5, 0x24, 0x92,
368        0x7f, 0xa2, 0x63, 0xfd, 0xaa, 0xd6, 0x2f, 0x71, 0x0e, 0xb1, 0x93,
369        0xf7, 0x2d, 0xf5, 0xa4, 0x9e, 0x4e, 0xb5, 0xdd, 0x4b, 0xf8, 0x68,
370        0x4c, 0xcb, 0xb9, 0x93, 0xad, 0x65, 0xce, 0xd9, 0x26, 0xa9, 0x8d,
371        0x19, 0xf6, 0xf2, 0xf4, 0xe6, 0xb5, 0xad, 0xe7, 0xc6, 0x39, 0xa0,
372        0x18, 0xeb, 0xc9, 0x77, 0x6c, 0x35, 0x2a, 0x4b, 0xfe, 0x8a, 0x9c,
373        0xff, 0x00, 0x11, 0xae, 0x3a, 0x8b, 0xde, 0x61, 0xd0, 0x9e, 0x39,
374        0xb8, 0xeb, 0x53, 0xac, 0xb9, 0xae, 0x5b, 0x00, 0xf3, 0x27, 0x14,
375        0x92, 0xc9, 0xfe, 0x8a, 0x3f, 0xde, 0x35, 0xac, 0x3a, 0x88, 0x92,
376        0xcd, 0xb1, 0x6e, 0x7d, 0xcd, 0x32, 0x67, 0xeb, 0xcd, 0x7a, 0x14,
377        0xfe, 0x04, 0x26, 0x66, 0xce, 0xf9, 0x26, 0xb3, 0xe6, 0x6e, 0xb4,
378        0xd9, 0x48, 0xc8, 0x82, 0x4e, 0x07, 0x35, 0xa7, 0x6f, 0x2f, 0x02,
379        0x9a, 0x06, 0x5f, 0x8c, 0xa4, 0x83, 0x0e, 0x32, 0x2a, 0x69, 0xe3,
380        0xdd, 0x12, 0x08, 0x97, 0x85, 0xec, 0x2a, 0x2a, 0x42, 0xf1, 0x76,
381        0x26, 0xe4, 0x6a, 0x59, 0x0e, 0x18, 0x10, 0x6a, 0xd2, 0x89, 0x02,
382        0x6e, 0x2a, 0x71, 0xeb, 0x5c, 0x1c, 0x8c, 0xa6, 0x48, 0xbb, 0xdc,
383        0x61, 0x41, 0x35, 0x72, 0x28, 0x87, 0xd9, 0xf6, 0x4a, 0xb9, 0xe7,
384        0x38, 0xae, 0x8c, 0x3d, 0x36, 0xdd, 0xde, 0xc4, 0xb0, 0x21, 0x51,
385        0x76, 0xa8, 0xc0, 0xaa, 0x93, 0x31, 0xe6, 0xbb, 0x2d, 0x65, 0x61,
386        0x19, 0xd3, 0x1e, 0xb5, 0x46, 0x5a, 0x96, 0x5a, 0x30, 0xa0, 0x7e,
387        0x05, 0x69, 0x5b, 0xc9, 0xc6, 0x28, 0x40, 0xcd, 0x08, 0x64, 0x3c,
388        0x73, 0x57, 0xe1, 0x94, 0xf1, 0xcd, 0x5a, 0x21, 0x8c, 0xb9, 0x63,
389        0xe7, 0x67, 0x1d, 0xab, 0x40, 0xb1, 0xfb, 0x00, 0x1d, 0xf0, 0x2b,
390        0x99, 0x2d, 0x66, 0x3e, 0x88, 0x75, 0x81, 0x3f, 0x31, 0xf6, 0xab,
391        0x64, 0xd6, 0xb4, 0x17, 0xee, 0xd0, 0x9e, 0xe4, 0x32, 0x1a, 0xa7,
392        0x31, 0xad, 0x18, 0x14, 0x26, 0xef, 0x54, 0xa5, 0xa8, 0x65, 0xa3,
393        0x9c, 0x81, 0xfa, 0x56, 0x8c, 0x2d, 0xce, 0x68, 0x40, 0xcb, 0xf1,
394        0x37, 0xbd, 0x5e, 0x85, 0xea, 0xd1, 0x0c, 0xbb, 0x19, 0x56, 0x23,
395        0x20, 0x1f, 0xad, 0x5c, 0x42, 0x08, 0x03, 0xb5, 0x55, 0x91, 0x04,
396        0xc9, 0x80, 0x38, 0x00, 0x0a, 0x71, 0x34, 0x6c, 0x32, 0x27, 0xe9,
397        0x55, 0x25, 0x15, 0x2c, 0x68, 0xa3, 0x30, 0xeb, 0x54, 0xa5, 0x15,
398        0x0c, 0xd1, 0x00, 0xff, 0xd9};
399
400    /* package */ static final byte[] sPhotoByteArrayForComplicatedCase;
401
402    static {
403        final int length = sPhotoIntArrayForComplicatedCase.length;
404        sPhotoByteArrayForComplicatedCase = new byte[length];
405        for (int i = 0; i < length; i++) {
406            sPhotoByteArrayForComplicatedCase[i] = (byte)sPhotoIntArrayForComplicatedCase[i];
407        }
408    }
409
410    public void testV21SimpleCase1_Parsing() {
411        mVerifier.initForImportTest(V21, R.raw.v21_simple_1);
412        mVerifier.addPropertyNodesVerifierElemWithoutVersion()  // no "VERSION:2.1" line.
413                .addExpectedNodeWithOrder("N", "Ando;Roid;", Arrays.asList("Ando", "Roid", ""));
414    }
415
416    public void testV21SimpleCase1_Type_Generic() {
417        mVerifier.initForImportTest(VCardConfig.VCARD_TYPE_V21_GENERIC, R.raw.v21_simple_1);
418        mVerifier.addContentValuesVerifierElem()
419                .addExpected(StructuredName.CONTENT_ITEM_TYPE)
420                        .put(StructuredName.FAMILY_NAME, "Ando")
421                        .put(StructuredName.GIVEN_NAME, "Roid")
422                        .put(StructuredName.DISPLAY_NAME, "Roid Ando");
423    }
424
425    public void testV21SimpleCase1_Type_Japanese() {
426        mVerifier.initForImportTest(VCardConfig.VCARD_TYPE_V21_JAPANESE, R.raw.v21_simple_1);
427        mVerifier.addContentValuesVerifierElem()
428                .addExpected(StructuredName.CONTENT_ITEM_TYPE)
429                        .put(StructuredName.FAMILY_NAME, "Ando")
430                        .put(StructuredName.GIVEN_NAME, "Roid")
431                        // If name-related strings only contains printable Ascii,
432                        // the order is remained to be US's:
433                        // "Prefix Given Middle Family Suffix"
434                        .put(StructuredName.DISPLAY_NAME, "Roid Ando");
435    }
436
437    public void testV21SimpleCase2() {
438        mVerifier.initForImportTest(VCardConfig.VCARD_TYPE_V21_JAPANESE, R.raw.v21_simple_2);
439        mVerifier.addContentValuesVerifierElem()
440                .addExpected(StructuredName.CONTENT_ITEM_TYPE)
441                        .put(StructuredName.DISPLAY_NAME, "Ando Roid");
442    }
443
444    public void testV21SimpleCase3() {
445        mVerifier.initForImportTest(V21, R.raw.v21_simple_3);
446        mVerifier.addContentValuesVerifierElem()
447                .addExpected(StructuredName.CONTENT_ITEM_TYPE)
448                        .put(StructuredName.FAMILY_NAME, "Ando")
449                        .put(StructuredName.GIVEN_NAME, "Roid")
450                        // "FN" field should be prefered since it should contain the original
451                        // order intended by the author of the file.
452                        .put(StructuredName.DISPLAY_NAME, "Ando Roid");
453    }
454
455    /**
456     * Tests ';' is properly handled by VCardParser implementation.
457     */
458    public void testV21BackslashCase_Parsing() {
459        mVerifier.initForImportTest(V21, R.raw.v21_backslash);
460        mVerifier.addPropertyNodesVerifierElem()
461                .addExpectedNodeWithOrder("N", ";A;B\\;C\\;;D;:E;\\\\;",
462                        Arrays.asList("", "A;B\\", "C\\;", "D", ":E", "\\\\", ""))
463                .addExpectedNodeWithOrder("FN", "A;B\\C\\;D:E\\\\");
464
465    }
466
467    /**
468     * Tests ContactStruct correctly ignores redundant fields in "N" property values and
469     * inserts name related data.
470     */
471    public void testV21BackslashCase() {
472        mVerifier.initForImportTest(V21, R.raw.v21_backslash);
473        mVerifier.addContentValuesVerifierElem()
474                .addExpected(StructuredName.CONTENT_ITEM_TYPE)
475                        // FAMILY_NAME is empty and removed in this test...
476                        .put(StructuredName.GIVEN_NAME, "A;B\\")
477                        .put(StructuredName.MIDDLE_NAME, "C\\;")
478                        .put(StructuredName.PREFIX, "D")
479                        .put(StructuredName.SUFFIX, ":E")
480                        .put(StructuredName.DISPLAY_NAME, "A;B\\C\\;D:E\\\\");
481    }
482
483    public void testOrgBeforTitle() {
484        mVerifier.initForImportTest(V21, R.raw.v21_org_before_title);
485        ContentValuesVerifierElem elem = mVerifier.addContentValuesVerifierElem();
486        elem.addExpected(StructuredName.CONTENT_ITEM_TYPE)
487                .put(StructuredName.DISPLAY_NAME, "Normal Guy");
488        elem.addExpected(Organization.CONTENT_ITEM_TYPE)
489                .put(Organization.COMPANY, "Company")
490                .put(Organization.DEPARTMENT, "Organization Devision Room Sheet No.")
491                .put(Organization.TITLE, "Excellent Janitor")
492                .put(Organization.TYPE, Organization.TYPE_WORK);
493    }
494
495    public void testTitleBeforOrg() {
496        mVerifier.initForImportTest(V21, R.raw.v21_title_before_org);
497        ContentValuesVerifierElem elem = mVerifier.addContentValuesVerifierElem();
498        elem.addExpected(StructuredName.CONTENT_ITEM_TYPE)
499                .put(StructuredName.DISPLAY_NAME, "Nice Guy");
500        elem.addExpected(Organization.CONTENT_ITEM_TYPE)
501                .put(Organization.COMPANY, "Marverous")
502                .put(Organization.DEPARTMENT, "Perfect Great Good Bad Poor")
503                .put(Organization.TITLE, "Cool Title")
504                .put(Organization.TYPE, Organization.TYPE_WORK);
505    }
506
507    /**
508     * Verifies that vCard importer correctly interpret "PREF" attribute to IS_PRIMARY.
509     * The data contain three cases: one "PREF", no "PREF" and multiple "PREF", in each type.
510     */
511    public void testV21PrefToIsPrimary() {
512        mVerifier.initForImportTest(V21, R.raw.v21_pref_handling);
513        ContentValuesVerifierElem elem = mVerifier.addContentValuesVerifierElem();
514        elem.addExpected(StructuredName.CONTENT_ITEM_TYPE)
515                .put(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE)
516                .put(StructuredName.DISPLAY_NAME, "Smith");
517        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
518                .put(Phone.NUMBER, "1")
519                .put(Phone.TYPE, Phone.TYPE_HOME);
520        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
521                .put(Phone.NUMBER, "2")
522                .put(Phone.TYPE, Phone.TYPE_WORK)
523                .put(Phone.IS_PRIMARY, 1);
524        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
525                .put(Phone.NUMBER, "3")
526                .put(Phone.TYPE, Phone.TYPE_ISDN);
527        elem.addExpected(Email.CONTENT_ITEM_TYPE)
528                .put(Email.DATA, "test@example.com")
529                .put(Email.TYPE, Email.TYPE_HOME)
530                .put(Email.IS_PRIMARY, 1);
531        elem.addExpected(Email.CONTENT_ITEM_TYPE)
532                .put(Email.DATA, "test2@examination.com")
533                .put(Email.TYPE, Email.TYPE_MOBILE)
534                .put(Email.IS_PRIMARY, 1);
535        elem.addExpected(Organization.CONTENT_ITEM_TYPE)
536                .put(Organization.COMPANY, "Company")
537                .put(Organization.TITLE, "Engineer")
538                .put(Organization.TYPE, Organization.TYPE_WORK);
539        elem.addExpected(Organization.CONTENT_ITEM_TYPE)
540                .put(Organization.COMPANY, "Mystery")
541                .put(Organization.TITLE, "Blogger")
542                .put(Organization.TYPE, Organization.TYPE_WORK);
543        elem.addExpected(Organization.CONTENT_ITEM_TYPE)
544                .put(Organization.COMPANY, "Poetry")
545                .put(Organization.TITLE, "Poet")
546                .put(Organization.TYPE, Organization.TYPE_WORK);
547    }
548
549    /**
550     * Tests all the properties in a complicated vCard are correctly parsed by the VCardParser.
551     */
552    public void testV21ComplicatedCase_Parsing() {
553        mVerifier.initForImportTest(V21, R.raw.v21_complicated);
554        mVerifier.addPropertyNodesVerifierElem()
555                .addExpectedNodeWithOrder("N", "Gump;Forrest;Hoge;Pos;Tao",
556                        Arrays.asList("Gump", "Forrest", "Hoge", "Pos", "Tao"))
557                .addExpectedNodeWithOrder("FN", "Joe Due")
558                .addExpectedNodeWithOrder("ORG",
559                        "Gump Shrimp Co.;Sales Dept.;Manager;Fish keeper",
560                        Arrays.asList("Gump Shrimp Co.", "Sales Dept.;Manager", "Fish keeper"))
561                .addExpectedNodeWithOrder("ROLE", "Fish Cake Keeper!")
562                .addExpectedNodeWithOrder("TITLE", "Shrimp Man")
563                .addExpectedNodeWithOrder("X-CLASS", "PUBLIC")
564                .addExpectedNodeWithOrder("TEL", "(111) 555-1212", new TypeSet("WORK", "VOICE"))
565                .addExpectedNodeWithOrder("TEL", "(404) 555-1212", new TypeSet("HOME", "VOICE"))
566                .addExpectedNodeWithOrder("TEL", "0311111111", new TypeSet("CELL"))
567                .addExpectedNodeWithOrder("TEL", "0322222222", new TypeSet("VIDEO"))
568                .addExpectedNodeWithOrder("TEL", "0333333333", new TypeSet("VOICE"))
569                .addExpectedNodeWithOrder("ADR",
570                        ";;100 Waters Edge;Baytown;LA;30314;United States of America",
571                        Arrays.asList("", "", "100 Waters Edge", "Baytown",
572                                "LA", "30314", "United States of America"),
573                                null, null, new TypeSet("WORK"), null)
574                .addExpectedNodeWithOrder("LABEL",
575                        "100 Waters Edge\r\nBaytown, LA 30314\r\nUnited  States of America",
576                        null, null, mContentValuesForQP, new TypeSet("WORK"), null)
577                .addExpectedNodeWithOrder("ADR",
578                        ";;42 Plantation St.;Baytown;LA;30314;United States of America",
579                        Arrays.asList("", "", "42 Plantation St.", "Baytown",
580                                "LA", "30314", "United States of America"), null, null,
581                                new TypeSet("HOME"), null)
582                .addExpectedNodeWithOrder("LABEL",
583                        "42 Plantation St.\r\nBaytown, LA 30314\r\nUnited  States of America",
584                        null, null, mContentValuesForQP,
585                        new TypeSet("HOME"), null)
586                .addExpectedNodeWithOrder("EMAIL", "forrestgump@walladalla.com",
587                        new TypeSet("PREF", "INTERNET"))
588                .addExpectedNodeWithOrder("EMAIL", "cell@example.com", new TypeSet("CELL"))
589                .addExpectedNodeWithOrder("NOTE",
590                        "The following note is the example from RFC 2045.")
591                .addExpectedNodeWithOrder("NOTE",
592                        "Now's the time for all folk to come to the aid of their country.",
593                        null, null, mContentValuesForQP, null, null)
594                .addExpectedNodeWithOrder("PHOTO", null,
595                        null, sPhotoByteArrayForComplicatedCase, mContentValuesForBase64V21,
596                        new TypeSet("JPEG"), null)
597                .addExpectedNodeWithOrder("X-ATTRIBUTE", "Some String")
598                .addExpectedNodeWithOrder("BDAY", "19800101")
599                .addExpectedNodeWithOrder("GEO", "35.6563854,139.6994233")
600                .addExpectedNodeWithOrder("URL", "http://www.example.com/")
601                .addExpectedNodeWithOrder("REV", "20080424T195243Z");
602    }
603
604    /**
605     * Checks ContactStruct correctly inserts values in a complicated vCard
606     * into ContentResolver.
607     */
608    public void testV21ComplicatedCase() {
609        mVerifier.initForImportTest(V21, R.raw.v21_complicated);
610        ContentValuesVerifierElem elem = mVerifier.addContentValuesVerifierElem();
611        elem.addExpected(StructuredName.CONTENT_ITEM_TYPE)
612                .put(StructuredName.FAMILY_NAME, "Gump")
613                .put(StructuredName.GIVEN_NAME, "Forrest")
614                .put(StructuredName.MIDDLE_NAME, "Hoge")
615                .put(StructuredName.PREFIX, "Pos")
616                .put(StructuredName.SUFFIX, "Tao")
617                .put(StructuredName.DISPLAY_NAME, "Joe Due");
618        elem.addExpected(Organization.CONTENT_ITEM_TYPE)
619                .put(Organization.TYPE, Organization.TYPE_WORK)
620                .put(Organization.COMPANY, "Gump Shrimp Co.")
621                .put(Organization.DEPARTMENT, "Sales Dept.;Manager Fish keeper")
622                .put(Organization.TITLE, "Shrimp Man");
623        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
624                .put(Phone.TYPE, Phone.TYPE_WORK)
625                // Phone number is expected to be formated with NAMP format in default.
626                .put(Phone.NUMBER, "111-555-1212");
627        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
628                .put(Phone.TYPE, Phone.TYPE_HOME)
629                .put(Phone.NUMBER, "404-555-1212");
630        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
631                .put(Phone.TYPE, Phone.TYPE_MOBILE)
632                .put(Phone.NUMBER, "031-111-1111");
633        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
634                .put(Phone.TYPE, Phone.TYPE_CUSTOM)
635                .put(Phone.LABEL, "VIDEO")
636                .put(Phone.NUMBER, "032-222-2222");
637        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
638                .put(Phone.TYPE, Phone.TYPE_CUSTOM)
639                .put(Phone.LABEL, "VOICE")
640                .put(Phone.NUMBER, "033-333-3333");
641        elem.addExpected(StructuredPostal.CONTENT_ITEM_TYPE)
642                .put(StructuredPostal.TYPE, StructuredPostal.TYPE_WORK)
643                .put(StructuredPostal.COUNTRY, "United States of America")
644                .put(StructuredPostal.POSTCODE, "30314")
645                .put(StructuredPostal.REGION, "LA")
646                .put(StructuredPostal.CITY, "Baytown")
647                .put(StructuredPostal.STREET, "100 Waters Edge")
648                .put(StructuredPostal.FORMATTED_ADDRESS,
649                        "100 Waters Edge Baytown LA 30314 United States of America");
650        elem.addExpected(StructuredPostal.CONTENT_ITEM_TYPE)
651                .put(StructuredPostal.TYPE, StructuredPostal.TYPE_HOME)
652                .put(StructuredPostal.COUNTRY, "United States of America")
653                .put(StructuredPostal.POSTCODE, "30314")
654                .put(StructuredPostal.REGION, "LA")
655                .put(StructuredPostal.CITY, "Baytown")
656                .put(StructuredPostal.STREET, "42 Plantation St.")
657                .put(StructuredPostal.FORMATTED_ADDRESS,
658                        "42 Plantation St. Baytown LA 30314 United States of America");
659        elem.addExpected(Email.CONTENT_ITEM_TYPE)
660                // "TYPE=INTERNET" -> TYPE_CUSTOM + the label "INTERNET"
661                .put(Email.TYPE, Email.TYPE_CUSTOM)
662                .put(Email.LABEL, "INTERNET")
663                .put(Email.DATA, "forrestgump@walladalla.com")
664                .put(Email.IS_PRIMARY, 1);
665        elem.addExpected(Email.CONTENT_ITEM_TYPE)
666                .put(Email.TYPE, Email.TYPE_MOBILE)
667                .put(Email.DATA, "cell@example.com");
668        elem.addExpected(Note.CONTENT_ITEM_TYPE)
669                .put(Note.NOTE, "The following note is the example from RFC 2045.");
670        elem.addExpected(Note.CONTENT_ITEM_TYPE)
671                .put(Note.NOTE,
672                        "Now's the time for all folk to come to the aid of their country.");
673        elem.addExpected(Photo.CONTENT_ITEM_TYPE)
674                // No information about its image format can be inserted.
675                .put(Photo.PHOTO, sPhotoByteArrayForComplicatedCase);
676        elem.addExpected(Event.CONTENT_ITEM_TYPE)
677                .put(Event.START_DATE, "19800101")
678                .put(Event.TYPE, Event.TYPE_BIRTHDAY);
679        elem.addExpected(Website.CONTENT_ITEM_TYPE)
680                .put(Website.URL, "http://www.example.com/")
681                .put(Website.TYPE, Website.TYPE_HOMEPAGE);
682    }
683
684    public void testInvalidMultipleLineV21() {
685        mVerifier.initForImportTest(V21, R.raw.v21_invalid_multiple_line);
686        ContentValuesVerifierElem elem = mVerifier.addContentValuesVerifierElem();
687        elem.addExpected(StructuredName.CONTENT_ITEM_TYPE)
688                .put(StructuredName.GIVEN_NAME, "Omega")
689                .put(StructuredName.DISPLAY_NAME, "Omega");
690        elem.addExpected(Email.CONTENT_ITEM_TYPE)
691                .put(Email.TYPE, Email.TYPE_CUSTOM)
692                .put(Email.LABEL, "INTERNET")
693                .put(Email.ADDRESS, "\"Omega\" <omega@example.com>");
694    }
695
696    public void testV30Simple_Parsing() {
697        mVerifier.initForImportTest(V30, R.raw.v30_simple);
698        mVerifier.addPropertyNodesVerifierElem()
699                .addExpectedNodeWithOrder("FN", "And Roid")
700                .addExpectedNodeWithOrder("N", "And;Roid;;;",
701                        Arrays.asList("And", "Roid", "", "", ""))
702                .addExpectedNodeWithOrder("ORG", "Open;Handset; Alliance",
703                        Arrays.asList("Open", "Handset", " Alliance"))
704                .addExpectedNodeWithOrder("SORT-STRING", "android")
705                .addExpectedNodeWithOrder("TEL", "0300000000", new TypeSet("PREF", "VOICE"))
706                .addExpectedNodeWithOrder("CLASS", "PUBLIC")
707                .addExpectedNodeWithOrder("X-GNO", "0")
708                .addExpectedNodeWithOrder("X-GN", "group0")
709                .addExpectedNodeWithOrder("X-REDUCTION", "0")
710                .addExpectedNodeWithOrder("REV", "20081031T065854Z");
711    }
712
713    public void testV30Simple() {
714        mVerifier.initForImportTest(V30, R.raw.v30_simple);
715        ContentValuesVerifierElem elem = mVerifier.addContentValuesVerifierElem();
716        elem.addExpected(StructuredName.CONTENT_ITEM_TYPE)
717                .put(StructuredName.FAMILY_NAME, "And")
718                .put(StructuredName.GIVEN_NAME, "Roid")
719                .put(StructuredName.DISPLAY_NAME, "And Roid")
720                .put(StructuredName.PHONETIC_GIVEN_NAME, "android");
721        elem.addExpected(Organization.CONTENT_ITEM_TYPE)
722                .put(Organization.COMPANY, "Open")
723                .put(Organization.DEPARTMENT, "Handset  Alliance")
724                .put(Organization.TYPE, Organization.TYPE_WORK);
725        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
726                .put(Phone.TYPE, Phone.TYPE_CUSTOM)
727                .put(Phone.LABEL, "VOICE")
728                .put(Phone.NUMBER, "030-000-0000")
729                .put(Phone.IS_PRIMARY, 1);
730    }
731
732    public void testV21Japanese1_Parsing() {
733        // Though Japanese careers append ";;;;" at the end of the value of "SOUND",
734        // vCard 2.1/3.0 specification does not allow multiple values.
735        // Do not need to handle it as multiple values.
736        mVerifier.initForImportTest(VCardConfig.VCARD_TYPE_V21_JAPANESE, R.raw.v21_japanese_1);
737        mVerifier.addPropertyNodesVerifierElem()
738                .addExpectedNodeWithOrder("N", "\u5B89\u85E4\u30ED\u30A4\u30C9;;;;",
739                        Arrays.asList("\u5B89\u85E4\u30ED\u30A4\u30C9", "", "", "", ""),
740                        null, mContentValuesForSJis, null, null)
741                .addExpectedNodeWithOrder("SOUND",
742                        "\uFF71\uFF9D\uFF84\uFF9E\uFF73\uFF9B\uFF72\uFF84\uFF9E;;;;",
743                        null, null, mContentValuesForSJis,
744                        new TypeSet("X-IRMC-N"), null)
745                .addExpectedNodeWithOrder("TEL", "0300000000", null, null, null,
746                        new TypeSet("VOICE", "PREF"), null);
747    }
748
749    private void testV21Japanese1Common(int resId, int vcardType, boolean japanese) {
750        mVerifier.initForImportTest(vcardType, resId);
751        ContentValuesVerifierElem elem = mVerifier.addContentValuesVerifierElem();
752        elem.addExpected(StructuredName.CONTENT_ITEM_TYPE)
753                .put(StructuredName.FAMILY_NAME, "\u5B89\u85E4\u30ED\u30A4\u30C9")
754                .put(StructuredName.DISPLAY_NAME, "\u5B89\u85E4\u30ED\u30A4\u30C9")
755                // While vCard parser does not split "SOUND" property values,
756                // ContactStruct care it.
757                .put(StructuredName.PHONETIC_GIVEN_NAME,
758                        "\uFF71\uFF9D\uFF84\uFF9E\uFF73\uFF9B\uFF72\uFF84\uFF9E");
759        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
760                // Phone number formatting is different.
761                .put(Phone.NUMBER, (japanese ? "03-0000-0000" : "030-000-0000"))
762                .put(Phone.TYPE, Phone.TYPE_CUSTOM)
763                .put(Phone.LABEL, "VOICE")
764                .put(Phone.IS_PRIMARY, 1);
765    }
766
767    /**
768     * Verifies vCard with Japanese can be parsed correctly with
769     * {@link com.android.vcard.VCardConfig#VCARD_TYPE_V21_GENERIC}.
770     */
771    public void testV21Japanese1_Type_Generic_Utf8() {
772        testV21Japanese1Common(
773                R.raw.v21_japanese_1, VCardConfig.VCARD_TYPE_V21_GENERIC, false);
774    }
775
776    /**
777     * Verifies vCard with Japanese can be parsed correctly with
778     * {@link com.android.vcard.VCardConfig#VCARD_TYPE_V21_JAPANESE}.
779     */
780    public void testV21Japanese1_Type_Japanese_Sjis() {
781        testV21Japanese1Common(
782                R.raw.v21_japanese_1, VCardConfig.VCARD_TYPE_V21_JAPANESE, true);
783    }
784
785    /**
786     * Verifies vCard with Japanese can be parsed correctly with
787     * {@link com.android.vcard.VCardConfig#VCARD_TYPE_V21_JAPANESE}.
788     * since vCard 2.1 specifies the charset of each line if it contains non-Ascii.
789     */
790    public void testV21Japanese1_Type_Japanese_Utf8() {
791        testV21Japanese1Common(
792                R.raw.v21_japanese_1, VCardConfig.VCARD_TYPE_V21_JAPANESE, true);
793    }
794
795    public void testV21Japanese2_Parsing() {
796        mVerifier.initForImportTest(VCardConfig.VCARD_TYPE_V21_JAPANESE, R.raw.v21_japanese_2);
797        mVerifier.addPropertyNodesVerifierElem()
798                .addExpectedNodeWithOrder("N", "\u5B89\u85E4;\u30ED\u30A4\u30C9\u0031;;;",
799                        Arrays.asList("\u5B89\u85E4", "\u30ED\u30A4\u30C9\u0031",
800                                "", "", ""),
801                        null, mContentValuesForSJis, null, null)
802                .addExpectedNodeWithOrder("FN", "\u5B89\u85E4\u0020\u30ED\u30A4\u30C9\u0020\u0031",
803                        null, null, mContentValuesForSJis, null, null)
804                .addExpectedNodeWithOrder("SOUND",
805                        "\uFF71\uFF9D\uFF84\uFF9E\uFF73;\uFF9B\uFF72\uFF84\uFF9E\u0031;;;",
806                        null, null, mContentValuesForSJis,
807                        new TypeSet("X-IRMC-N"), null)
808                .addExpectedNodeWithOrder("ADR",
809                        ";\u6771\u4EAC\u90FD\u6E0B\u8C37\u533A\u685C" +
810                        "\u4E18\u753A\u0032\u0036\u002D\u0031\u30BB" +
811                        "\u30EB\u30EA\u30A2\u30F3\u30BF\u30EF\u30FC\u0036" +
812                        "\u968E;;;;150-8512;",
813                        Arrays.asList("",
814                                "\u6771\u4EAC\u90FD\u6E0B\u8C37\u533A\u685C" +
815                                "\u4E18\u753A\u0032\u0036\u002D\u0031\u30BB" +
816                                "\u30EB\u30EA\u30A2\u30F3\u30BF\u30EF\u30FC" +
817                                "\u0036\u968E", "", "", "", "150-8512", ""),
818                        null, mContentValuesForQPAndSJis, new TypeSet("HOME"), null)
819                .addExpectedNodeWithOrder("NOTE", "\u30E1\u30E2", null, null,
820                        mContentValuesForQPAndSJis, null, null);
821    }
822
823    public void testV21Japanese2_Type_Generic_Utf8() {
824        mVerifier.initForImportTest(V21, R.raw.v21_japanese_2);
825        ContentValuesVerifierElem elem = mVerifier.addContentValuesVerifierElem();
826        elem.addExpected(StructuredName.CONTENT_ITEM_TYPE)
827                .put(StructuredName.FAMILY_NAME, "\u5B89\u85E4")
828                .put(StructuredName.GIVEN_NAME, "\u30ED\u30A4\u30C9\u0031")
829                .put(StructuredName.DISPLAY_NAME,
830                        "\u5B89\u85E4\u0020\u30ED\u30A4\u30C9\u0020\u0031")
831                // ContactStruct should correctly split "SOUND" property into several elements,
832                // even though VCardParser side does not care it.
833                .put(StructuredName.PHONETIC_FAMILY_NAME, "\uFF71\uFF9D\uFF84\uFF9E\uFF73")
834                .put(StructuredName.PHONETIC_GIVEN_NAME, "\uFF9B\uFF72\uFF84\uFF9E\u0031");
835        elem.addExpected(StructuredPostal.CONTENT_ITEM_TYPE)
836                .put(StructuredPostal.POSTCODE, "150-8512")
837                .put(StructuredPostal.STREET,
838                        "\u6771\u4EAC\u90FD\u6E0B\u8C37\u533A\u685C" +
839                        "\u4E18\u753A\u0032\u0036\u002D\u0031\u30BB" +
840                        "\u30EB\u30EA\u30A2\u30F3\u30BF\u30EF\u30FC" +
841                        "\u0036\u968E")
842                .put(StructuredPostal.FORMATTED_ADDRESS,
843                        "\u6771\u4EAC\u90FD\u6E0B\u8C37\u533A\u685C" +
844                        "\u4E18\u753A\u0032\u0036\u002D\u0031\u30BB" +
845                        "\u30EB\u30EA\u30A2\u30F3\u30BF\u30EF\u30FC" +
846                        "\u0036\u968E 150-8512")
847                .put(StructuredPostal.TYPE, StructuredPostal.TYPE_HOME);
848        elem.addExpected(Note.CONTENT_ITEM_TYPE)
849                .put(Note.NOTE, "\u30E1\u30E2");
850    }
851
852    public void testV21MultipleEntryCase_Parse() {
853        mVerifier.initForImportTest(VCardConfig.VCARD_TYPE_V21_JAPANESE, R.raw.v21_multiple_entry);
854        mVerifier.addPropertyNodesVerifierElem()
855                .addExpectedNodeWithOrder("N", "\u5B89\u85E4\u30ED\u30A4\u30C9\u0033;;;;",
856                        Arrays.asList("\u5B89\u85E4\u30ED\u30A4\u30C9\u0033", "", "", "", ""),
857                        null, mContentValuesForSJis, null, null)
858                .addExpectedNodeWithOrder("SOUND",
859                        "\uFF71\uFF9D\uFF84\uFF9E\uFF73\uFF9B\uFF72\uFF84\uFF9E\u0033;;;;",
860                        null, null, mContentValuesForSJis,
861                        new TypeSet("X-IRMC-N"), null)
862                .addExpectedNodeWithOrder("TEL", "9", new TypeSet("X-NEC-SECRET"))
863                .addExpectedNodeWithOrder("TEL", "10", new TypeSet("X-NEC-HOTEL"))
864                .addExpectedNodeWithOrder("TEL", "11", new TypeSet("X-NEC-SCHOOL"))
865                .addExpectedNodeWithOrder("TEL", "12", new TypeSet("FAX", "HOME"));
866        mVerifier.addPropertyNodesVerifierElem()
867                .addExpectedNodeWithOrder("N", "\u5B89\u85E4\u30ED\u30A4\u30C9\u0034;;;;",
868                        Arrays.asList("\u5B89\u85E4\u30ED\u30A4\u30C9\u0034", "", "", "", ""),
869                        null, mContentValuesForSJis, null, null)
870                .addExpectedNodeWithOrder("SOUND",
871                        "\uFF71\uFF9D\uFF84\uFF9E\uFF73\uFF9B\uFF72\uFF84\uFF9E\u0034;;;;",
872                        null, null, mContentValuesForSJis,
873                        new TypeSet("X-IRMC-N"), null)
874                .addExpectedNodeWithOrder("TEL", "13", new TypeSet("MODEM"))
875                .addExpectedNodeWithOrder("TEL", "14", new TypeSet("PAGER"))
876                .addExpectedNodeWithOrder("TEL", "15", new TypeSet("X-NEC-FAMILY"))
877                .addExpectedNodeWithOrder("TEL", "16", new TypeSet("X-NEC-GIRL"));
878        mVerifier.addPropertyNodesVerifierElem()
879                .addExpectedNodeWithOrder("N", "\u5B89\u85E4\u30ED\u30A4\u30C9\u0035;;;;",
880                        Arrays.asList("\u5B89\u85E4\u30ED\u30A4\u30C9\u0035", "", "", "", ""),
881                        null, mContentValuesForSJis, null, null)
882                .addExpectedNodeWithOrder("SOUND",
883                        "\uFF71\uFF9D\uFF84\uFF9E\uFF73\uFF9B\uFF72\uFF84\uFF9E\u0035;;;;",
884                        null, null, mContentValuesForSJis,
885                        new TypeSet("X-IRMC-N"), null)
886                .addExpectedNodeWithOrder("TEL", "17", new TypeSet("X-NEC-BOY"))
887                .addExpectedNodeWithOrder("TEL", "18", new TypeSet("X-NEC-FRIEND"))
888                .addExpectedNodeWithOrder("TEL", "19", new TypeSet("X-NEC-PHS"))
889                .addExpectedNodeWithOrder("TEL", "20", new TypeSet("X-NEC-RESTAURANT"));
890    }
891
892    public void testV21MultipleEntryCase() {
893        mVerifier.initForImportTest(VCardConfig.VCARD_TYPE_V21_JAPANESE, R.raw.v21_multiple_entry);
894        ContentValuesVerifierElem elem = mVerifier.addContentValuesVerifierElem();
895        elem.addExpected(StructuredName.CONTENT_ITEM_TYPE)
896                .put(StructuredName.FAMILY_NAME, "\u5B89\u85E4\u30ED\u30A4\u30C9\u0033")
897                .put(StructuredName.DISPLAY_NAME, "\u5B89\u85E4\u30ED\u30A4\u30C9\u0033")
898                .put(StructuredName.PHONETIC_GIVEN_NAME,
899                        "\uFF71\uFF9D\uFF84\uFF9E\uFF73\uFF9B\uFF72\uFF84\uFF9E\u0033");
900        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
901                .put(Phone.TYPE, Phone.TYPE_CUSTOM)
902                .put(Phone.LABEL, "NEC-SECRET")
903                .put(Phone.NUMBER, "9");
904        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
905                .put(Phone.TYPE, Phone.TYPE_CUSTOM)
906                .put(Phone.LABEL, "NEC-HOTEL")
907                .put(Phone.NUMBER, "10");
908        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
909                .put(Phone.TYPE, Phone.TYPE_CUSTOM)
910                .put(Phone.LABEL, "NEC-SCHOOL")
911                .put(Phone.NUMBER, "11");
912        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
913                .put(Phone.TYPE, Phone.TYPE_FAX_HOME)
914                .put(Phone.NUMBER, "12");
915
916        elem = mVerifier.addContentValuesVerifierElem();
917        elem.addExpected(StructuredName.CONTENT_ITEM_TYPE)
918                .put(StructuredName.FAMILY_NAME, "\u5B89\u85E4\u30ED\u30A4\u30C9\u0034")
919                .put(StructuredName.DISPLAY_NAME, "\u5B89\u85E4\u30ED\u30A4\u30C9\u0034")
920                .put(StructuredName.PHONETIC_GIVEN_NAME,
921                        "\uFF71\uFF9D\uFF84\uFF9E\uFF73\uFF9B\uFF72\uFF84\uFF9E\u0034");
922        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
923                .put(Phone.TYPE, Phone.TYPE_CUSTOM)
924                .put(Phone.LABEL, "MODEM")
925                .put(Phone.NUMBER, "13");
926        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
927                .put(Phone.TYPE, Phone.TYPE_PAGER)
928                .put(Phone.NUMBER, "14");
929        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
930                .put(Phone.TYPE, Phone.TYPE_CUSTOM)
931                .put(Phone.LABEL, "NEC-FAMILY")
932                .put(Phone.NUMBER, "15");
933        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
934                .put(Phone.TYPE, Phone.TYPE_CUSTOM)
935                .put(Phone.LABEL, "NEC-GIRL")
936                .put(Phone.NUMBER, "16");
937
938        elem = mVerifier.addContentValuesVerifierElem();
939        elem.addExpected(StructuredName.CONTENT_ITEM_TYPE)
940                .put(StructuredName.FAMILY_NAME, "\u5B89\u85E4\u30ED\u30A4\u30C9\u0035")
941                .put(StructuredName.DISPLAY_NAME, "\u5B89\u85E4\u30ED\u30A4\u30C9\u0035")
942                .put(StructuredName.PHONETIC_GIVEN_NAME,
943                        "\uFF71\uFF9D\uFF84\uFF9E\uFF73\uFF9B\uFF72\uFF84\uFF9E\u0035");
944        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
945                .put(Phone.TYPE, Phone.TYPE_CUSTOM)
946                .put(Phone.LABEL, "NEC-BOY")
947                .put(Phone.NUMBER, "17");
948        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
949                .put(Phone.TYPE, Phone.TYPE_CUSTOM)
950                .put(Phone.LABEL, "NEC-FRIEND")
951                .put(Phone.NUMBER, "18");
952        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
953                .put(Phone.TYPE, Phone.TYPE_CUSTOM)
954                .put(Phone.LABEL, "NEC-PHS")
955                .put(Phone.NUMBER, "19");
956        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
957                .put(Phone.TYPE, Phone.TYPE_CUSTOM)
958                .put(Phone.LABEL, "NEC-RESTAURANT")
959                .put(Phone.NUMBER, "20");
960    }
961
962    public void testIgnoreAgentV21_Parse() {
963        mVerifier.initForImportTest(V21, R.raw.v21_winmo_65);
964        ContentValues contentValuesForValue = new ContentValues();
965        contentValuesForValue.put("VALUE", "DATE");
966        mVerifier.addPropertyNodesVerifierElem()
967                .addExpectedNodeWithOrder("N", Arrays.asList("Example", "", "", "", ""))
968                .addExpectedNodeWithOrder("FN", "Example")
969                .addExpectedNodeWithOrder("ANNIVERSARY", "20091010", contentValuesForValue)
970                .addExpectedNodeWithOrder("AGENT", "")
971                .addExpectedNodeWithOrder("X-CLASS", "PUBLIC")
972                .addExpectedNodeWithOrder("X-REDUCTION", "")
973                .addExpectedNodeWithOrder("X-NO", "");
974    }
975
976    public void testIgnoreAgentV21() {
977        mVerifier.initForImportTest(V21, R.raw.v21_winmo_65);
978        ContentValuesVerifier verifier = new ContentValuesVerifier();
979        ContentValuesVerifierElem elem = mVerifier.addContentValuesVerifierElem();
980        elem.addExpected(StructuredName.CONTENT_ITEM_TYPE)
981                .put(StructuredName.FAMILY_NAME, "Example")
982                .put(StructuredName.DISPLAY_NAME, "Example");
983        elem.addExpected(Event.CONTENT_ITEM_TYPE)
984                .put(Event.TYPE, Event.TYPE_ANNIVERSARY)
985                .put(Event.START_DATE, "20091010");
986    }
987
988    public void testTolerateInvalidCommentLikeLineV21() {
989        mVerifier.initForImportTest(V21, R.raw.v21_invalid_comment_line);
990        ContentValuesVerifierElem elem = mVerifier.addContentValuesVerifierElem();
991        elem.addExpected(StructuredName.CONTENT_ITEM_TYPE)
992                .put(StructuredName.GIVEN_NAME, "Conference Call")
993                .put(StructuredName.DISPLAY_NAME, "Conference Call");
994        elem.addExpected(Note.CONTENT_ITEM_TYPE)
995                .put(Note.NOTE, "This is an (sharp ->#<- sharp) example. "
996                        + "This message must NOT be ignored.");
997    }
998
999    public void testPagerV30_Parse() {
1000        mVerifier.initForImportTest(V30, R.raw.v30_pager);
1001        mVerifier.addPropertyNodesVerifierElem()
1002                .addExpectedNodeWithOrder("N", Arrays.asList("F", "G", "M", "", ""))
1003                .addExpectedNodeWithOrder("TEL", "6101231234@pagersample.com",
1004                        new TypeSet("WORK", "MSG", "PAGER"));
1005    }
1006
1007    public void testPagerV30() {
1008        mVerifier.initForImportTest(V30, R.raw.v30_pager);
1009        ContentValuesVerifierElem elem = mVerifier.addContentValuesVerifierElem();
1010        elem.addExpected(StructuredName.CONTENT_ITEM_TYPE)
1011                .put(StructuredName.FAMILY_NAME, "F")
1012                .put(StructuredName.MIDDLE_NAME, "M")
1013                .put(StructuredName.GIVEN_NAME, "G")
1014                .put(StructuredName.DISPLAY_NAME, "G M F");
1015        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
1016                .put(Phone.TYPE, Phone.TYPE_PAGER)
1017                .put(Phone.NUMBER, "6101231234@pagersample.com");
1018    }
1019
1020    public void testMultiBytePropV30_Parse() {
1021        mVerifier.initForImportTest(V30, R.raw.v30_multibyte_param);
1022        mVerifier.addPropertyNodesVerifierElem()
1023                .addExpectedNodeWithOrder("N", Arrays.asList("F", "G", "M", "", ""))
1024                .addExpectedNodeWithOrder("TEL", "1", new TypeSet("\u8D39"));
1025    }
1026
1027    public void testMultiBytePropV30() {
1028        mVerifier.initForImportTest(V30, R.raw.v30_multibyte_param);
1029        final ContentValuesVerifierElem elem = mVerifier.addContentValuesVerifierElem();
1030        elem.addExpected(StructuredName.CONTENT_ITEM_TYPE)
1031                .put(StructuredName.FAMILY_NAME, "F")
1032                .put(StructuredName.MIDDLE_NAME, "M")
1033                .put(StructuredName.GIVEN_NAME, "G")
1034                .put(StructuredName.DISPLAY_NAME, "G M F");
1035        elem.addExpected(Phone.CONTENT_ITEM_TYPE)
1036                .put(Phone.TYPE, Phone.TYPE_CUSTOM)
1037                .put(Phone.LABEL, "\u8D39")
1038                .put(Phone.NUMBER, "1");
1039    }
1040
1041    public void testCommaSeparatedParamsV30_Parse() {
1042        mVerifier.initForImportTest(V30, R.raw.v30_comma_separated);
1043        mVerifier.addPropertyNodesVerifierElem()
1044                .addExpectedNodeWithOrder("N", Arrays.asList("F", "G", "M", "", ""),
1045                        new TypeSet("PREF", "HOME"))
1046                .addExpectedNodeWithOrder("TEL", "1",
1047                        new TypeSet("COMMA,SEPARATED:INSIDE.DQUOTE", "PREF"));
1048    }
1049
1050    public void testSortAsV40_Parse() {
1051        mVerifier.initForImportTest(V40, R.raw.v40_sort_as);
1052
1053        final ContentValues contentValuesForSortAsN = new ContentValues();
1054        contentValuesForSortAsN.put("SORT-AS",
1055                "\u3042\u3093\u3069\u3046;\u308D\u3044\u3069");
1056        final ContentValues contentValuesForSortAsOrg = new ContentValues();
1057        contentValuesForSortAsOrg.put("SORT-AS",
1058                "\u3050\u30FC\u3050\u308B;\u3051\u3093\u3055\u304F\u3076\u3082\u3093");
1059
1060        mVerifier.addPropertyNodesVerifierElem()
1061                .addExpectedNodeWithOrder("FN", "\u5B89\u85E4\u0020\u30ED\u30A4\u30C9")
1062                .addExpectedNodeWithOrder("N",
1063                        Arrays.asList("\u5B89\u85E4", "\u30ED\u30A4\u30C9", "", "", ""),
1064                        contentValuesForSortAsN)
1065                .addExpectedNodeWithOrder("ORG",
1066                        Arrays.asList("\u30B0\u30FC\u30B0\u30EB", "\u691C\u7D22\u90E8\u9580"),
1067                        contentValuesForSortAsOrg, new TypeSet("WORK"));
1068    }
1069
1070    public void testSortAsV40() {
1071        mVerifier.initForImportTest(V40, R.raw.v40_sort_as);
1072        final ContentValuesVerifierElem elem = mVerifier.addContentValuesVerifierElem();
1073        elem.addExpected(StructuredName.CONTENT_ITEM_TYPE)
1074                .put(StructuredName.FAMILY_NAME, "\u5B89\u85E4")
1075                .put(StructuredName.GIVEN_NAME, "\u30ED\u30A4\u30C9")
1076                .put(StructuredName.DISPLAY_NAME, "\u5B89\u85E4\u0020\u30ED\u30A4\u30C9")
1077                .put(StructuredName.PHONETIC_FAMILY_NAME, "\u3042\u3093\u3069\u3046")
1078                .put(StructuredName.PHONETIC_GIVEN_NAME,
1079                        "\u308D\u3044\u3069");
1080        elem.addExpected(Organization.CONTENT_ITEM_TYPE)
1081                .put(Organization.TYPE, Organization.TYPE_WORK)
1082                .put(Organization.COMPANY, "\u30B0\u30FC\u30B0\u30EB")
1083                .put(Organization.DEPARTMENT, "\u691C\u7D22\u90E8\u9580")
1084                .put(Organization.PHONETIC_NAME,
1085                        "\u3050\u30FC\u3050\u308B\u3051\u3093\u3055\u304F\u3076\u3082\u3093");
1086    }
1087
1088    public void testIMV21_Parse() {
1089        mVerifier.initForImportTest(V21, R.raw.v21_im);
1090        mVerifier.addPropertyNodesVerifierElem()
1091                .addExpectedNodeWithOrder("X-ANDROID-CUSTOM",
1092                        Arrays.asList("vnd.android.cursor.item/nickname", "Nick", "1",
1093                                "", "", "", "", "", "", "", "", "", "", "", "", ""))  // 13
1094                .addExpectedNodeWithOrder("X-GOOGLE-TALK", "hhh@gmail.com");
1095    }
1096
1097    public void testIMV21() {
1098        mVerifier.initForImportTest(V21, R.raw.v21_im);
1099        final ContentValuesVerifierElem elem = mVerifier.addContentValuesVerifierElem();
1100        elem.addExpected(Nickname.CONTENT_ITEM_TYPE)
1101                .put(Nickname.NAME, "Nick")
1102                .put(Nickname.TYPE, "1");
1103        elem.addExpected(Im.CONTENT_ITEM_TYPE)
1104                .put(Im.PROTOCOL, Im.PROTOCOL_GOOGLE_TALK)
1105                .put(Im.TYPE, Im.TYPE_HOME)
1106                .put(Im.DATA, "hhh@gmail.com");
1107    }
1108}
1109