aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar
diff options
context:
space:
mode:
Diffstat (limited to 'test/org/traccar')
-rw-r--r--test/org/traccar/calendar/CalendarTest.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/org/traccar/calendar/CalendarTest.java b/test/org/traccar/calendar/CalendarTest.java
index 44fc9539b..7f5bd7d29 100644
--- a/test/org/traccar/calendar/CalendarTest.java
+++ b/test/org/traccar/calendar/CalendarTest.java
@@ -42,13 +42,17 @@ public class CalendarTest {
"END:VEVENT\n" +
"END:VCALENDAR";
Calendar calendar = new Calendar();
- calendar.setCalendar(calendarString.getBytes());
+ calendar.setCalendarData(calendarString.getBytes());
DateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ssX");
-
- Date date = format.parse("2016-12-13 23:01:00+05");
+
+ Date date = format.parse("2016-12-13 22:59:59+05");
+ Assert.assertTrue(!calendar.checkMoment(date));
+ date = format.parse("2016-12-13 23:00:01+05");
+ Assert.assertTrue(calendar.checkMoment(date));
+
+ date = format.parse("2016-12-13 06:59:59+05");
Assert.assertTrue(calendar.checkMoment(date));
-
- date = format.parse("2016-12-13 07:01:00+05");
+ date = format.parse("2016-12-13 07:00:01+05");
Assert.assertTrue(!calendar.checkMoment(date));
}
}