summaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
authorMarc Blank <mblank@google.com>2011-07-27 07:49:54 -0700
committerMarc Blank <mblank@google.com>2011-07-27 10:22:46 -0700
commit60df2ad267f1ad7aed45b583adcd1a5bb2a006b0 (patch)
tree01ebf52d7fc78dfeeba7289d3a7f91cafba08313 /tests/src
parent55df6ac772d12c574dd13b72796567687bee5a3a (diff)
downloadandroid_packages_apps_Exchange-60df2ad267f1ad7aed45b583adcd1a5bb2a006b0.tar.gz
android_packages_apps_Exchange-60df2ad267f1ad7aed45b583adcd1a5bb2a006b0.tar.bz2
android_packages_apps_Exchange-60df2ad267f1ad7aed45b583adcd1a5bb2a006b0.zip
Handle UNTIL properly in RRULE
* We weren't handling UNTIL properly in cases when the until date in GMT was on a different day than in the local time zone * Rewrite this code to take into account the local time zone Bug: 5057748 Change-Id: I3543671d434fcd672a3151a57877ba15c2195029
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/com/android/exchange/utility/CalendarUtilitiesTests.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/src/com/android/exchange/utility/CalendarUtilitiesTests.java b/tests/src/com/android/exchange/utility/CalendarUtilitiesTests.java
index 0ac8c70b..c9adf90b 100644
--- a/tests/src/com/android/exchange/utility/CalendarUtilitiesTests.java
+++ b/tests/src/com/android/exchange/utility/CalendarUtilitiesTests.java
@@ -176,12 +176,13 @@ public class CalendarUtilitiesTests extends SyncAdapterTestCase<CalendarSyncAdap
}
public void testRecurrenceUntilToEasUntil() {
- // Test full format
- assertEquals("YYYYMMDDT000000Z",
- CalendarUtilities.recurrenceUntilToEasUntil("YYYYMMDDTHHMMSSZ"));
- // Test date only format
- assertEquals("YYYYMMDDT000000Z",
- CalendarUtilities.recurrenceUntilToEasUntil("YYYYMMDD"));
+ TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles"));
+ // Case where local time crosses into next day in GMT
+ assertEquals("20110730T000000Z",
+ CalendarUtilities.recurrenceUntilToEasUntil("20110731T025959Z"));
+ // Case where local time does not cross into next day in GMT
+ assertEquals("20110730T000000Z",
+ CalendarUtilities.recurrenceUntilToEasUntil("20110730T235959Z"));
}
public void testParseEmailDateTimeToMillis(String date) {