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

Incorrect description generation for expressions with hour range #37

Open
mkucharek opened this issue Jun 19, 2016 · 2 comments
Open

Incorrect description generation for expressions with hour range #37

mkucharek opened this issue Jun 19, 2016 · 2 comments

Comments

@mkucharek
Copy link

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"));
    }
@mkucharek
Copy link
Author

mkucharek commented Jun 20, 2016

ok, I've looked through the code and I see it's not going to be easy to change the code to get the expected results.. Maybe instead of using "between X and Y", something like "X through Y" would be better?

So the expected output would be:
At 30 minutes past the hour, 10:00 AM through 1:00 PM, only on Wednesday and Friday

@lumo1
Copy link

lumo1 commented Dec 13, 2017

Any update on this one ?

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

No branches or pull requests

2 participants