diff options
author | Marc Blank <mblank@google.com> | 2011-11-17 15:12:48 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-11-17 15:12:48 -0800 |
commit | 5248e794032538829c8cf82a3b811709b9a04094 (patch) | |
tree | cd4ed85746aee1cef6b2e4df761030b62de40589 /tests/src | |
parent | dc3ffcbfa5ea31aab742c6396a6ffc54ad4ba4e3 (diff) | |
parent | 2c7d44b182654120a98921cbc864be2d135c8fda (diff) | |
download | android_packages_apps_Exchange-5248e794032538829c8cf82a3b811709b9a04094.tar.gz android_packages_apps_Exchange-5248e794032538829c8cf82a3b811709b9a04094.tar.bz2 android_packages_apps_Exchange-5248e794032538829c8cf82a3b811709b9a04094.zip |
am 2c7d44b1: Attempt to better handle screwy MSFT time zone information
* commit '2c7d44b182654120a98921cbc864be2d135c8fda':
Attempt to better handle screwy MSFT time zone information
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/com/android/exchange/utility/CalendarUtilitiesTests.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/src/com/android/exchange/utility/CalendarUtilitiesTests.java b/tests/src/com/android/exchange/utility/CalendarUtilitiesTests.java index b883b5a2..0ecdb8fd 100644 --- a/tests/src/com/android/exchange/utility/CalendarUtilitiesTests.java +++ b/tests/src/com/android/exchange/utility/CalendarUtilitiesTests.java @@ -103,6 +103,13 @@ public class CalendarUtilitiesTests extends SyncAdapterTestCase<CalendarSyncAdap "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAYQB3AGEAaQBpAGEAbgAgAEQAYQB5AGwAaQBnAGgAdAAgAFQA" + "aQBtAGUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="; + // This is time zone sent by Exchange 2007, apparently; the start time of DST for the eastern + // time zone (EST) is off by two hours, which we should correct in our new "lenient" code + private static final String LENIENT_EASTERN_TIME = + "LAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + + "AAAAAAAAAAsAAAABAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAACAAAAAAAAAAAAxP///w=="; + private static final String ORGANIZER = "organizer@server.com"; private static final String ATTENDEE = "attendee@server.com"; @@ -132,6 +139,17 @@ public class CalendarUtilitiesTests extends SyncAdapterTestCase<CalendarSyncAdap assertEquals("Asia/Calcutta", tz.getID()); tz = CalendarUtilities.tziStringToTimeZone(AUSTRALIA_ACT_TIME); assertEquals("Australia/ACT", tz.getID()); + + // Test peculiar MS sent EST data with and without lenient precision; send standard + // precision + 1 (i.e. 1ms) to make sure the code doesn't automatically flip to lenient + // when the tz isn't found + tz = CalendarUtilities.tziStringToTimeZoneImpl(LENIENT_EASTERN_TIME, + CalendarUtilities.STANDARD_DST_PRECISION+1); + assertEquals("America/Atikokan", tz.getID()); + tz = CalendarUtilities.tziStringToTimeZoneImpl(LENIENT_EASTERN_TIME, + CalendarUtilities.LENIENT_DST_PRECISION); + assertEquals("America/Detroit", tz.getID()); + tz = CalendarUtilities.tziStringToTimeZone(GMT_UNKNOWN_DAYLIGHT_TIME); int bias = tz.getOffset(System.currentTimeMillis()); assertEquals(0, bias); |