diff options
author | Andy McFadden <fadden@android.com> | 2011-10-20 16:51:50 -0700 |
---|---|---|
committer | Andy McFadden <fadden@android.com> | 2011-10-21 12:46:01 -0700 |
commit | 9a91eb9d6c3c28b54223dae453c9d456b0c87355 (patch) | |
tree | 1bb5e6d36e9a7aff0946fd86bfd58c48864b93b8 /tests/src | |
parent | 0053119c0bc05aedaed9d55cef91806f4c95d535 (diff) | |
download | calendar-9a91eb9d6c3c28b54223dae453c9d456b0c87355.tar.gz |
Support WKST in recurrence rulesandroid-sdk-4.0.3_r1android-sdk-4.0.3-tools_r1android-cts-verifier-4.0_r1android-cts-verifier-4.0.3_r1android-cts-4.0.3_r1android-4.0.3_r1.1android-4.0.3_r1
RFC 5545 says WKST is significant in weekly rules with nonzero
intervals and BYDAY rules, and also in yearly rules with a BYWEEKNO
part. Yearly with BYWEEKNO seems to be generally broken, so this
only attempts to correct weekly recurrences.
Bug 1641249
Change-Id: Icad8762be4685036fc50bed0cc75970e774a21a8
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/com/android/calendarcommon/RecurrenceProcessorTest.java | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/tests/src/com/android/calendarcommon/RecurrenceProcessorTest.java b/tests/src/com/android/calendarcommon/RecurrenceProcessorTest.java index 21d2d52..ba5ec0c 100644 --- a/tests/src/com/android/calendarcommon/RecurrenceProcessorTest.java +++ b/tests/src/com/android/calendarcommon/RecurrenceProcessorTest.java @@ -547,18 +547,10 @@ public class RecurrenceProcessorTest extends TestCase { }); } - /** - * This test fails because of a bug in RecurrenceProcessor.expand(). We - * don't have time to fix the bug yet but we don't want to lose track of - * this test either. The "failing" prefix on the method name prevents this - * test from being run. Remove the "failing" prefix when the bug is fixed. - * - * @throws Exception - */ @SmallTest - public void failingTestWeekly9() throws Exception { + public void testWeekly9() throws Exception { verifyRecurrence("19970805T100000", - "FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=MO", + "FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU", // uses default WKST=MO null /* rdate */, null /* exrule */, null /* exdate */, "19970101T000000", "19980101T000000", new String[]{ @@ -611,6 +603,34 @@ public class RecurrenceProcessorTest extends TestCase { } } + /** + * Test repeating weekly event with dtstart and dtend (only one occurrence) + * See bug #3267616 + * @throws Exception + */ + @SmallTest + public void testWeekly13() throws Exception { + verifyRecurrence("20101117T150000", + "FREQ=WEEKLY;BYDAY=WE", + null /* rdate */, null /* exrule */, null /* exdate */, + "20101117T150000", "20101117T160000", + new String[]{ "20101117T150000" }); + } + + @SmallTest + public void testWeekly14() throws Exception { + verifyRecurrence("19970805T100000", + "FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=TH", + null /* rdate */, null /* exrule */, null /* exdate */, + "19970101T000000", "19980101T000000", + new String[]{ + "19970805T100000", + "19970817T100000", + "19970819T100000", + "19970831T100000", + }); + } + @SmallTest public void testDaily0() throws Exception { verifyRecurrence("20060215T100000", "FREQ=DAILY;COUNT=3", @@ -2397,18 +2417,6 @@ public class RecurrenceProcessorTest extends TestCase { null /* last */); } - /** - * Test repeating weekly event with dtstart and dtend (only one occurrence) - * See bug #3267616 - * @throws Exception - */ - public void testWeekly13() throws Exception { - verifyRecurrence("20101117T150000", - "FREQ=WEEKLY;BYDAY=WE", - null /* rdate */, null /* exrule */, null /* exdate */, - "20101117T150000", "20101117T160000", - new String[]{ "20101117T150000" }); - } // These recurrence rules are used in the loop that measures the performance // of recurrence expansion. |