Skip to content
Permalink
Browse files

[JENKINS-25897] Add tests

(cherry picked from commit b090751)
  • Loading branch information...
daniel-beck authored and olivergondza committed Dec 23, 2014
1 parent 6e67cb9 commit b7ccd6bb14becb51a5df9ebf043d28323abd538a
Showing with 21 additions and 0 deletions.
  1. +21 −0 core/src/test/java/hudson/scheduler/CronTabTest.java
@@ -280,4 +280,25 @@ public int next(int n) {
assertEquals("[35, 56]", times.toString());
}

@Test public void rangeBoundsCheckOK() throws Exception {
new CronTab("H(0-59) H(0-23) H(1-31) H(1-12) H(0-7)");
}

@Test public void rangeBoundsCheckFailHour() throws Exception {
try {
new CronTab("H H(12-24) * * *");
fail();
} catch (ANTLRException e) {
// ok
}
}

@Test public void rangeBoundsCheckFailMinute() throws Exception {
try {
new CronTab("H(33-66) * * * *");
fail();
} catch (ANTLRException e) {
// ok
}
}
}

0 comments on commit b7ccd6b

Please sign in to comment.
You can’t perform that action at this time.