@@ -0,0 +1,1830 @@
+package com.stratelia.webactiv.almanach.control.ejb;%0A%0A/*%0A * To change this template, choose Tools %7C Templates%0A * and open the template in the editor.%0A */%0Aimport com.stratelia.webactiv.almanach.model.Periodicity;%0Aimport java.util.Calendar;%0Aimport net.fortuna.ical4j.model.Recur;%0Aimport net.fortuna.ical4j.model.property.RRule;%0Aimport org.junit.After;%0Aimport org.junit.Assert;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0A/**%0A *%0A * @author ehugonnet%0A */%0Apublic class AlmanachBmEJBTest %7B%0A%0A  public AlmanachBmEJBTest() %7B%0A  %7D%0A%0A  @Before%0A  public void setUp() %7B%0A  %7D%0A%0A  @After%0A  public void tearDown() %7B%0A  %7D%0A%0A  /**%0A   * Test of generateRecurrenceRule method, of class AlmanachBmEJB.%0A   */%0A  @Test%0A  public void testGenerateRecurrenceRule() %7B%0A    Periodicity periodicity = new Periodicity();%0A    periodicity.setFrequency(1);%0A    periodicity.setUnity(Periodicity.UNIT_DAY);%0A    Calendar calend = Calendar.getInstance();%0A    calend.set(Calendar.DAY_OF_MONTH, 30);%0A    calend.set(Calendar.MONTH, Calendar.JUNE);%0A    calend.set(Calendar.YEAR, 2010);%0A    calend.set(Calendar.HOUR_OF_DAY, 10);%0A    calend.set(Calendar.MINUTE, 30);%0A    calend.set(Calendar.SECOND, 0);%0A    calend.set(Calendar.MILLISECOND, 0);%0A    periodicity.setUntilDatePeriod(calend.getTime());%0A    AlmanachBmEJB instance = new AlmanachBmEJB();%0A    RRule result = instance.generateRecurrenceRule(periodicity);%0A    Assert.assertNotNull(result);%0A    Assert.assertFalse(result.isComponentProperty());%0A    Recur recur = result.getRecur();%0A    Assert.assertNotNull(recur);%0A    Assert.assertNotNull(recur.getUntil());%0A    calend.set(Calendar.HOUR_OF_DAY, 23);%0A    calend.set(Calendar.MINUTE, 59);%0A    calend.set(Calendar.SECOND, 59);%0A    Assert.assertEquals(calend.getTimeInMillis(), recur.getUntil().getTime());%0A    Assert.assertEquals(Recur.DAILY, recur.getFrequency());%0A  %7D%0A%7D%0A

Test for the Almanach