From 60c9d03e1df55bd93201901038887a221af0e717 Mon Sep 17 00:00:00 2001 From: gtully Date: Mon, 26 Jan 2015 21:20:03 +0000 Subject: [PATCH] Fixed bug in cron test. #58 - patch applied with thanks --- .../apache/activemq/broker/scheduler/CronParserTest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/activemq-client/src/test/java/org/apache/activemq/broker/scheduler/CronParserTest.java b/activemq-client/src/test/java/org/apache/activemq/broker/scheduler/CronParserTest.java index 3c7186911b..395a87d349 100644 --- a/activemq-client/src/test/java/org/apache/activemq/broker/scheduler/CronParserTest.java +++ b/activemq-client/src/test/java/org/apache/activemq/broker/scheduler/CronParserTest.java @@ -216,13 +216,19 @@ public class CronParserTest { long current = 20*60*1000; Calendar calender = Calendar.getInstance(); calender.setTimeInMillis(current); + int startHours = calender.get(Calendar.HOUR_OF_DAY); + int startMinutes = calender.get(Calendar.MINUTE); LOG.debug("start:" + calender.getTime()); long next = CronParser.getNextScheduledTime(test, current); calender.setTimeInMillis(next); LOG.debug("next:" + calender.getTime()); long result = next - current; - assertEquals(60*10*1000,result); + if (startHours == 8 && startMinutes == 50) { + assertEquals(60*40*1000,result); + } else { + assertEquals(60*10*1000,result); + } } @Test