Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RecurrenceIteratorFactory.except doesn't honor its contract #4

Open
GoogleCodeExporter opened this issue Mar 1, 2016 · 0 comments
Open

Comments

@GoogleCodeExporter
Copy link

A simple JUnit test is needed to reproduce the bug.



public void testExcept() throws Exception 
{
  RecurrenceIterator rrule 
         = RecurrenceIteratorFactory
                  .createRecurrenceIterator(
                                  "RRULE:FREQ=WEEKLY;INTERVAL=3;COUNT=5",
                                  new DateValueImpl(2009, 02, 02), 
                                  GMT1);
  StringBuilder sb = createRecuranceDateString(rrule);

  // test succeed
  assertEquals("20090202,20090223,20090316,20090406,20090427", 
                                   sb.toString());

  RecurrenceIterator rdate 
         = RecurrenceIteratorFactory
                  .createRecurrenceIterator(
                                  "RDATE;VALUE=DATE:20090316", 
                                  new DateValueImpl(2009, 03, 16), 
                                  GMT1);

  sb = createRecuranceDateString(rdate);

  //test succeed
  assertEquals("20090316", sb.toString());

  RecurrenceIterator rdateExcept 
                = RecurrenceIteratorFactory.except(rrule, rdate);

  sb = createRecuranceDateString(rdateExcept);

  //test FAILED !! 
  assertEquals("20090202,20090223,20090406,20090427", sb.toString());
}


The last assert returns: 
   junit.framework.ComparisonFailure: 
      expected:<20090202,20090223,20090406,20090427> 
      but was:<>


Thanks for this excellent project,

Regards


Yanick.

Original issue reported on code.google.com by [email protected] on 18 Feb 2009 at 11:15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant