Skip to content

Incorrect description generation for expressions with hour range #37

@mkucharek

Description

@mkucharek

I believe there is an issue with generating the textual description for CRON expressions that contains hour-range definiton - according to the tutorial and the documentation, the hour-range is inclusive, meaning that if we put an hour definition as 10-14, the cron will also run in 14 hour (or 2PM). However, the textual description generated says between 10:00 AM and 1:00 PM, which is not true and is actually confusing.

Attached please find the failing test case:

/**
     * From QUARTZ tutorial (http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/tutorial-lesson-06.html):
     * CronTrigger Example 3 - an expression to create a trigger that fires at 10:30, 11:30, 12:30, and 13:30, on every Wednesday and Friday.
     *
     * Expected output (including 1PM):
     * At 30 minutes past the hour, between 10:00 AM and 2:00 PM, only on Wednesday and Friday
     *
     * Actual output:
     * At 30 minutes past the hour, between 10:00 AM and 1:00 PM, only on Wednesday and Friday
     * @throws Exception
     */
    @Test
    public void shouldMatchQuartzCronTutorial() throws Exception {
        Assert.assertEquals("At 30 minutes past the hour, between 10:00 AM and 2:00 PM, only on Wednesday and Friday", CronExpressionDescriptor.getDescription("0 30 10-13 ? * WED,FRI"));
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions