Skip to content
Permalink
Browse files

[JENKINS-25897] Add tests

  • Loading branch information
daniel-beck committed Dec 23, 2014
1 parent 9a8329e commit b090751c16242402ad2187292e40f0f7bd5bbe10
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 b090751

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