Hi,

the following test method (to be added to CronTimeTriggerTestCase) fails:

    public void testDaysEndOfYear()
    {
        final CronTimeTrigger trigger = new CronTimeTrigger( 51,
5, -1, -1, -1, true );

        final Calendar now = Calendar.getInstance();
        now.set( Calendar.SECOND, 0 );
        now.set( Calendar.MINUTE, 2 );
        now.set( Calendar.HOUR_OF_DAY, 11 );
        now.set( Calendar.DAY_OF_MONTH, 31 );
        now.set( Calendar.MONTH, Calendar.DECEMBER );

        long time = now.getTime().getTime();
        long next = trigger.getTimeAfter( time );

        assertTrue(next > time );
    }


Problem is, that on Dec 31 the getTimeAfter method returns a value in the
past
=> consequence in our scenario: trigger is executed again and again leading
to OutOfMemory-Error for the running app ;-((

Problem (in our opinion):
Use of GregorianCalender.roll which leaves the year unchanged


Best regards,
        Thomas


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to