use of com.zimbra.common.calendar.ZCalendar.ZComponent in project zm-mailbox by Zimbra.
the class TestCalDav method testFuzzyTimeZoneMatchGMT06.
@Test
public void testFuzzyTimeZoneMatchGMT06() throws Exception {
try (ByteArrayInputStream bais = new ByteArrayInputStream(VtimeZoneGMT_0600_0500.getBytes())) {
ZVCalendar tzcal = ZCalendar.ZCalendarBuilder.build(bais, MimeConstants.P_CHARSET_UTF8);
assertNotNull("tzcal", tzcal);
ZComponent tzcomp = tzcal.getComponent(ICalTok.VTIMEZONE);
assertNotNull("tzcomp", tzcomp);
ICalTimeZone tz = ICalTimeZone.fromVTimeZone(tzcomp, false, /* skipLookup */
ICalTimeZone.TZID_NAME_ASSIGNMENT_BEHAVIOR.ALWAYS_KEEP);
ICalTimeZone matchtz = ICalTimeZone.lookupMatchingWellKnownTZ(tz);
assertEquals("ID of Timezone which fuzzy matches GMT=06.00/-05.00", "America/Chicago", matchtz.getID());
}
}
Aggregations