Commit 28140042 authored by Ricki Hirner's avatar Ricki Hirner 🐑

Update to ez-vcard 0.10.1 to fix REV timestamp problems

parent 20733b17
Pipeline #5610918 passed with stage
in 10 minutes and 50 seconds
......@@ -51,10 +51,11 @@ android {
dependencies {
compile 'org.apache.commons:commons-lang3:3.4'
compile 'commons-io:commons-io:2.5'
provided 'org.projectlombok:lombok:1.16.12'
// ez-vcard to parse/generate VCards
compile('com.googlecode.ez-vcard:ez-vcard:0.10.0') {
compile('com.googlecode.ez-vcard:ez-vcard:0.10.1') {
// hCard functionality not needed
exclude group: 'org.jsoup'
exclude group: 'org.freemarker'
......
......@@ -38,6 +38,7 @@ import android.provider.ContactsContract.CommonDataKinds.Website;
import android.provider.ContactsContract.RawContacts;
import android.text.TextUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.text.WordUtils;
......@@ -68,7 +69,6 @@ import ezvcard.property.Impp;
import ezvcard.property.Related;
import ezvcard.property.Telephone;
import ezvcard.property.Url;
import ezvcard.util.IOUtils;
import lombok.Cleanup;
import lombok.Getter;
import lombok.NonNull;
......
......@@ -8,6 +8,7 @@
package at.bitfire.vcard4android;
import org.apache.commons.io.IOUtils;
import org.junit.Test;
import java.io.ByteArrayInputStream;
......@@ -34,10 +35,14 @@ import ezvcard.property.Organization;
import ezvcard.property.Related;
import ezvcard.property.Telephone;
import ezvcard.property.Url;
import ezvcard.util.IOUtils;
import lombok.Cleanup;
import static org.junit.Assert.*;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
public class ContactTest {
......@@ -359,7 +364,7 @@ public class ContactTest {
@Test
public void testStrangeREV() throws IOException {
Contact c = parseContact("strange-rev.vcf", null);
assertTrue(c.unknownProperties.contains("REV;VALUE=timestamp:2016-11-19T17:44:22.057Z"));
assertNull(c.unknownProperties);
}
}
......@@ -16,6 +16,20 @@ import ezvcard.VCard;
public class EzVCardTest {
/*
FAILS, see https://github.com/mangstadt/ez-vcard/issues/76
@Test
public void testInvalidPref() {
VCard vCard = Ezvcard.parse("BEGIN:VCARD\r\n" +
"VERSION:4.0\r\n" +
"TEL;CELL=;PREF=:+12345\r\n" +
"END:VCARD").first();
assertEquals("+12345", vCard.getTelephoneNumbers().get(0).getText());
assertNull(vCard.getTelephoneNumbers().get(0).getPref());
}*/
@Test
public void testREV_UTC() {
VCard vCard = Ezvcard.parse("BEGIN:VCARD\r\n" +
......@@ -25,8 +39,15 @@ public class EzVCardTest {
assertNotNull(vCard.getRevision());
}
/*
SHOULD NOT FAIL, BUT FAILS: https://github.com/mangstadt/ez-vcard/issues/73
@Test
public void testREV_UTC_Milliseconds() {
VCard vCard = Ezvcard.parse("BEGIN:VCARD\r\n" +
"VERSION:4.0\r\n" +
"REV:2016-11-27T15:49:53.762Z\r\n" +
"END:VCARD").first();
assertNotNull(vCard.getRevision());
}
@Test
public void testREV_WithoutTZ() {
VCard vCard = Ezvcard.parse("BEGIN:VCARD\r\n" +
......@@ -34,10 +55,8 @@ public class EzVCardTest {
"REV:20161218T201900\r\n" +
"END:VCARD").first();
assertNotNull(vCard.getRevision());
}*/
}
/*
SHOULD NOT FAIL, BUT FAILS: https://github.com/mangstadt/ez-vcard/issues/73
@Test
public void testREV_TZHourOffset() {
VCard vCard = Ezvcard.parse("BEGIN:VCARD\r\n" +
......@@ -45,7 +64,7 @@ public class EzVCardTest {
"REV:20161218T201900-05\r\n" +
"END:VCARD").first();
assertNotNull(vCard.getRevision());
}*/
}
@Test
public void testREV_TZHourAndMinOffset() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment